summaryrefslogtreecommitdiffstats
path: root/content/wiki/knowledge_base.xml
diff options
context:
space:
mode:
Diffstat (limited to 'content/wiki/knowledge_base.xml')
-rwxr-xr-xcontent/wiki/knowledge_base.xml190
1 files changed, 72 insertions, 118 deletions
diff --git a/content/wiki/knowledge_base.xml b/content/wiki/knowledge_base.xml
index 269fdfa..2bdd43a 100755
--- a/content/wiki/knowledge_base.xml
+++ b/content/wiki/knowledge_base.xml
@@ -5,16 +5,84 @@
<description></description>
<language>en</language>
<copyright>Copyright 2014 makefu</copyright>
-<pubDate>Tue, 14 Jan 2014 01:38:28 GMT</pubDate>
-<lastBuildDate>Tue, 14 Jan 2014 01:38:28 GMT</lastBuildDate>
+<pubDate>Mon, 31 Mar 2014 07:06:35 GMT</pubDate>
+<lastBuildDate>Mon, 31 Mar 2014 07:06:35 GMT</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>TiddlyWiki 2.8.1</generator>
<item>
+<title>OpenSSL</title>
+<description>&lt;h1&gt; generate a new certificate&lt;/h1&gt;for example for unrealircd:&lt;br&gt;&lt;pre&gt;openssl req -new -x509 -keyout temp.key -out server.cert.pem -days 9001
+openssl rsa -in temp.key &amp;gt; server.key.pem
+&lt;/pre&gt;</description>
+<link>null#OpenSSL</link>
+<pubDate>Mon, 31 Mar 2014 07:06:34 GMT</pubDate>
+
+</item>
+<item>
+<title>USB</title>
+<description>&lt;h1&gt; Disable one interface&lt;/h1&gt;&lt;br&gt;&lt;pre&gt;lsusb
+lsusb -t
+# syntax of the id:
+# &amp;lt;bus&amp;gt;-&amp;lt;port&amp;gt;.&amp;lt;port&amp;gt;.&amp;lt;port&amp;gt;...
+cd /sys/bus/usb/drivers/usb/1-1.6 ; echo 1 &amp;gt; remove
+&lt;/pre&gt;</description>
+<category>usb</category>
+<link>null#USB</link>
+<pubDate>Fri, 07 Mar 2014 14:36:00 GMT</pubDate>
+
+</item>
+<item>
+<title>archlinux</title>
+<description>&lt;h1&gt; basic install&lt;/h1&gt;&lt;pre&gt;# we are using mbr again, guid somehow does not do the right thing
+fdisk /dev/sda
+# create linux partition(8300)
+n;enter;enter;enter
+# ... and btrfs because all the cool kids do so
+mkfs.btrfs /dev/sda2
+mkdir /mnt/btrfs-root /mnt/active
+mount /dev/sda2 /mnt/btrfs-root
+btrfs subvolume create __active &amp;amp;&amp;amp; cd __active
+btrfs subvolume create var
+mount /dev/sda2 -o default,noatime,subvol=__active /mnt/active
+
+# install that shit
+pacstrap /mnt/active base
+genfstab -p /mnt/active &amp;gt; /mnt/active/etc/fstab
+cat &amp;gt;&amp;gt; /mnt/active/etc/fstab&amp;lt;&amp;lt;EOF
+tmpfs /tmp tmpfs defaults 0 0
+## to never write persistent, uncomment:
+#tmpfs /var/log tmpfs defaults 0 0
+EOF
+arch-chroot /mnt/active
+ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
+echo &quot;LANG=en_US.UTF-8&quot; &amp;gt;&amp;gt; /etc/locale.conf
+echo &quot;en_US.UTF-8 UTF-8&quot; &amp;gt;&amp;gt; /etc/locale.gen
+locale-gen
+echo &quot;my-host&quot; &amp;gt; /etc/hostname
+mkinitcpio -p linux
+pacman -S openssh grub-bios
+grub-mkconfig -o /boot/grub/grub.cfg
+passwd
+# useradd -d /home/bob -m bob
+cd /etc/netctl
+cp examples/ethernet-static lan
+# edit lan , try network: enp0s25 or something
+netctl enable lan
+systemctl enable sshd.service
+grub-install /dev/sda
+exit
+reboot
+&lt;/pre&gt;</description>
+<link>null#archlinux</link>
+<pubDate>Wed, 26 Feb 2014 09:55:00 GMT</pubDate>
+
+</item>
+<item>
<title>curl</title>
<description>&lt;h1&gt; spoof host_name&lt;/h1&gt;&lt;pre&gt;curl --resolve host:80:ip host
&lt;/pre&gt;</description>
<link>null#curl</link>
-<pubDate>Tue, 14 Jan 2014 01:38:27 GMT</pubDate>
+<pubDate>Tue, 14 Jan 2014 01:38:00 GMT</pubDate>
</item>
<item>
@@ -318,7 +386,7 @@ swapon /swapon
</item>
<item>
<title>MainMenu</title>
-<description>&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;GettingStarted&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#GettingStarted&quot; href=&quot;null#GettingStarted&quot; class=&quot;externalLink null&quot;&gt;GettingStarted&lt;/a&gt;&lt;br&gt;&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;Security&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#Security&quot; href=&quot;null#Security&quot; class=&quot;externalLink null&quot;&gt;Security&lt;/a&gt;&lt;br&gt;&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;Hardware&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#Hardware&quot; href=&quot;null#Hardware&quot; class=&quot;externalLink null&quot;&gt;Hardware&lt;/a&gt;&lt;br&gt;&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;Programming&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#Programming&quot; href=&quot;null#Programming&quot; class=&quot;externalLink null&quot;&gt;Programming&lt;/a&gt;&lt;br&gt;&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;Hacking&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#Hacking&quot; href=&quot;null#Hacking&quot; class=&quot;externalLink null&quot;&gt;Hacking&lt;/a&gt;&lt;br&gt;&lt;h1&gt; Misc&lt;/h1&gt;&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;TODO&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#TODO&quot; href=&quot;null#TODO&quot; class=&quot;externalLink null&quot;&gt;TODO&lt;/a&gt;&lt;br&gt;&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;Fun&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#Fun&quot; href=&quot;null#Fun&quot; class=&quot;externalLink null&quot;&gt;Fun&lt;/a&gt;&lt;br&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to http://euer.krebsco.de/atom.xml&quot; href=&quot;http://euer.krebsco.de/atom.xml&quot; class=&quot;externalLink&quot;&gt;RSS of this Blog&lt;/a&gt;&lt;br&gt;</description>
+<description>&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;GettingStarted&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#GettingStarted&quot; href=&quot;null#GettingStarted&quot; class=&quot;externalLink null&quot;&gt;GettingStarted&lt;/a&gt;&lt;br&gt;&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;Security&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#Security&quot; href=&quot;null#Security&quot; class=&quot;externalLink null&quot;&gt;Security&lt;/a&gt;&lt;br&gt;&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;Hardware&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#Hardware&quot; href=&quot;null#Hardware&quot; class=&quot;externalLink null&quot;&gt;Hardware&lt;/a&gt;&lt;br&gt;&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;Programming&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#Programming&quot; href=&quot;null#Programming&quot; class=&quot;externalLink null&quot;&gt;Programming&lt;/a&gt;&lt;br&gt;&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;Hacking&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#Hacking&quot; href=&quot;null#Hacking&quot; class=&quot;externalLink null&quot;&gt;Hacking&lt;/a&gt;&lt;br&gt;&lt;h1&gt; Misc&lt;/h1&gt;&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;TODO&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#TODO&quot; href=&quot;null#TODO&quot; class=&quot;externalLink null&quot;&gt;TODO&lt;/a&gt;&lt;br&gt;&lt;a tiddlyfields=&quot;server.type:&amp;quot;file&amp;quot; server.host:&amp;quot;file:///home/makefu/Downloads/knowledge_base.html&amp;quot;&quot; tiddlylink=&quot;Fun&quot; refresh=&quot;link&quot; target=&quot;_blank&quot; title=&quot;External link to null#Fun&quot; href=&quot;null#Fun&quot; class=&quot;externalLink null&quot;&gt;Fun&lt;/a&gt;&lt;br&gt;&lt;a target=&quot;_blank&quot; title=&quot;External link to /wiki/knowledge_base.xml&quot; href=&quot;/wiki/knowledge_base.xml&quot; class=&quot;externalLink&quot;&gt;RSS of this Blog&lt;/a&gt;&lt;br&gt;</description>
<link>null#MainMenu</link>
<pubDate>Thu, 07 Nov 2013 14:12:00 GMT</pubDate>
@@ -390,119 +458,5 @@ kill dat-shit
<pubDate>Tue, 22 Oct 2013 17:37:00 GMT</pubDate>
</item>
-<item>
-<title>/etc/network/interfaces</title>
-<description>&lt;h1&gt;static network&lt;/h1&gt;&lt;pre&gt;auto eth1 # come up automatically
-iface et1 inet static
- address 192.168.0.24
- netmask 255.255.255.0
-# gateway 192.168.0.23
-&lt;/pre&gt;&lt;h1&gt; for wpa_supplicant&lt;/h1&gt;&lt;pre&gt;auto wlan0
-allow-hotplug wlan0
-iface wlan0 inet dhcp
- wpa-ssid meinessid
- wpa-psk meinpasswort
-&lt;/pre&gt;</description>
-<category>network</category>
-<link>null#%2Fetc%2Fnetwork%2Finterfaces</link>
-<pubDate>Wed, 16 Oct 2013 23:54:00 GMT</pubDate>
-
-</item>
-<item>
-<title>solaris</title>
-<description>&lt;h1&gt; gnu alternatives&lt;/h1&gt;&lt;h2&gt; readlink -f&lt;/h2&gt;&lt;pre&gt;canonicalpath() {
- if [ -d $1 ]; then
- pushd $1 &amp;gt; /dev/null 2&amp;gt;&amp;amp;1
- echo $PWD
- elif [ -f $1 ]; then
- pushd $(dirname $1) &amp;gt; /dev/null 2&amp;gt;&amp;amp;1
- echo $PWD/$(basename $1)
- else
- echo &quot;Invalid path $1&quot;
- fi
- popd &amp;gt; /dev/null 2&amp;gt;&amp;amp;1
-}
-&lt;/pre&gt;&lt;pre&gt;canonicalize(){
- cd -P -- &quot;$(dirname -- &quot;$1&quot;)&quot; &amp;amp;&amp;amp;
- printf '%s\n' &quot;$(pwd -P)/$(basename -- &quot;$1&quot;)&quot;
-}
-&lt;/pre&gt;&lt;h2&gt; mount -o bind&lt;/h2&gt;&lt;pre&gt;mount -F lofs DIR1 DIR2
-&lt;/pre&gt;</description>
-<link>null#solaris</link>
-<pubDate>Wed, 16 Oct 2013 10:59:00 GMT</pubDate>
-
-</item>
-<item>
-<title>Python Advanced</title>
-<description>&lt;h1&gt; Python for the user&lt;/h1&gt;in ~/.profile &lt;br&gt;&lt;pre&gt;export PYTHONPATH=~/.local/lib/python2.7/site-packages
-export PATH=$PATH:~/.local/lbin
-&lt;/pre&gt;then do&lt;br&gt;&lt;pre&gt;pip install --user &amp;lt;stuff&amp;gt;
-&lt;/pre&gt;&lt;h1&gt; Interactive Shell&lt;/h1&gt;&lt;h2&gt; Activate Tab Completion&lt;/h2&gt;&lt;pre&gt;import rlcompleter,readline;readline.parse_and_bind(&quot;tab: complete&quot;)
-&lt;/pre&gt;&lt;h1&gt; Single file Python&lt;/h1&gt;&lt;h2&gt; py2zip&lt;/h2&gt;from &lt;a target=&quot;_blank&quot; title=&quot;External link to http://people.canonical.com/~roman.yepishev/us/src/&quot; href=&quot;http://people.canonical.com/~roman.yepishev/us/src/&quot; class=&quot;externalLink&quot;&gt;http://people.canonical.com/~roman.yepishev/us/src/&lt;/a&gt;&lt;br&gt;&lt;pre&gt;#!/bin/bash
-
-ORIG_PWD=$PWD
-
-set -ex
-
-TARGET=&quot;$1&quot;
-TARGET_BASENAME=`basename &quot;$TARGET&quot;`
-shift
-
-MAIN=$1
-shift
-
-FILES=&quot;$*&quot;
-TEMPDIR=`mktemp -d /tmp/XXXXXXXX`
-
-cp &quot;$MAIN&quot; &quot;$TEMPDIR/__main__.py&quot;
-cp --parents -r $FILES &quot;$TEMPDIR/&quot;
-
-cd &quot;$TEMPDIR&quot;
-zip -q -r build.zip *
-cd &quot;$ORIG_PWD&quot;
-echo &quot;#!/usr/bin/python&quot; &amp;gt; &quot;$TEMPDIR/build.header&quot;
-cat &quot;$TEMPDIR/build.header&quot; &quot;$TEMPDIR/build.zip&quot; &amp;gt; &quot;$TEMPDIR/$TARGET_BASENAME&quot;
-chmod +x &quot;$TEMPDIR/$TARGET_BASENAME&quot;
-mv &quot;$TEMPDIR/$TARGET_BASENAME&quot; $TARGET
-&lt;/pre&gt;&lt;br&gt;&lt;h1&gt;Conditionals&lt;/h1&gt;&lt;pre&gt;&amp;gt;&amp;gt;&amp;gt; x = 5
-&amp;gt;&amp;gt;&amp;gt; 1 &amp;lt; x &amp;lt; 10
-True
-&amp;gt;&amp;gt;&amp;gt; 10 &amp;lt; x &amp;lt; 20
-False
-&amp;gt;&amp;gt;&amp;gt; x &amp;lt; 10 &amp;lt; x*10 &amp;lt; 100
-True
-&amp;gt;&amp;gt;&amp;gt; 10 &amp;gt; x &amp;lt;= 9
-True
-&amp;gt;&amp;gt;&amp;gt; 5 == x &amp;gt; 4
-True
-&lt;/pre&gt;&lt;h1&gt;Random&lt;/h1&gt;&lt;pre&gt;from random import random
-seed() # which seed to use
-randint(a,b) # int between a and b
-randrange(start,stop,step) # like choice(range(start,stop,step))
-hoice(seq) # random choice from sequence
-shuffle(x) # shuffles sequence
-sample(seq,num) # choose num samples
-uniform() # float between a and b
-&lt;/pre&gt;&lt;h1&gt;Decorators&lt;/h1&gt;&lt;pre&gt;
-def print_args(function):
- def wrapper(*args, **kwargs):
- print 'Arguments:', args, kwargs
- return function(*args, **kwargs)
- return wrapper
-
-@print_args
-def write(text):
- print text
-
-&amp;gt;&amp;gt;&amp;gt; write('foo')
-Arguments: ('foo',){}
-foo
-&lt;/pre&gt;&lt;h1&gt;Advanced Regexes&lt;/h1&gt;&lt;pre&gt;re.compile(&quot;^\[font(?:=(?P&amp;lt;size&amp;gt;[-+][0-9]{1,2}))?\](.*?)[/font]&quot;,
- re.DEBUG)
-&lt;/pre&gt;</description>
-<link>null#%5B%5BPython%20Advanced%5D%5D</link>
-<pubDate>Fri, 11 Oct 2013 10:00:00 GMT</pubDate>
-
-</item>
</channel>
</rss> \ No newline at end of file