diff --git a/content/wiki/knowledge_base.html b/content/wiki/knowledge_base.html index 53fa865..dc8c3b5 100644 --- a/content/wiki/knowledge_base.html +++ b/content/wiki/knowledge_base.html @@ -1792,6 +1792,14 @@ TODO
Type the text for 'No.de'
! generate a new certificate +for example for unrealircd: +{{{ +openssl req -new -x509 -keyout temp.key -out server.cert.pem -days 9001 +openssl rsa -in temp.key > server.key.pem +}}}+
! Find Oracle Home should be, in most cases, right below {{{bin/sqlplus}}} @@ -3070,6 +3078,17 @@ iptables -A POSTROUTING -t nat -o $device -j MASQUERADE #iptables -A FORWARD -m state --state NEW,INVALID -i $device -j DROP }}}
! Disable one interface + +{{{ +lsusb +lsusb -t +# syntax of the id: +# <bus>-<port>.<port>.<port>... +cd /sys/bus/usb/drivers/usb/1-1.6 ; echo 1 > remove +}}}+
- to use with [[Duply]] {{{ @@ -3203,19 +3222,20 @@ T0$ ifconfig at0 192.168.0.1 up && dnsmasq -d deb http://ftp.de.debian.org/debian squeeze main non-free contrib }}}
! basic install {{{ -# we are using gpt, not mbr -gdisk /dev/sda -# create a 2MB grub (EF02) partition and the rest as linux partition(8200) +# 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 && cd __active -for i in home var usr ; do btrfs subvolume create $i; done -mount /dev/sda2 default,noatime,subvol=__active /mnt/active +btrfs subvolume create var +mount /dev/sda2 -o default,noatime,subvol=__active /mnt/active # install that shit pacstrap /mnt/active base 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 @@en Copyright 2014 makefu -Tue, 14 Jan 2014 01:38:28 GMT -Tue, 14 Jan 2014 01:38:28 GMT +Mon, 31 Mar 2014 07:06:35 GMT +Mon, 31 Mar 2014 07:06:35 GMT http://blogs.law.harvard.edu/tech/rss TiddlyWiki 2.8.1 - +
+OpenSSL +<h1> generate a new certificate</h1>for example for unrealircd:<br><pre>openssl req -new -x509 -keyout temp.key -out server.cert.pem -days 9001 +openssl rsa -in temp.key > server.key.pem +</pre> +null#OpenSSL +Mon, 31 Mar 2014 07:06:34 GMT + +- +
+USB +<h1> Disable one interface</h1><br><pre>lsusb +lsusb -t +# syntax of the id: +# <bus>-<port>.<port>.<port>... +cd /sys/bus/usb/drivers/usb/1-1.6 ; echo 1 > remove +</pre> +usb +null#USB +Fri, 07 Mar 2014 14:36:00 GMT + +- +
+archlinux +<h1> basic install</h1><pre># 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 && 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 > /mnt/active/etc/fstab +cat >> /mnt/active/etc/fstab<<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 "LANG=en_US.UTF-8" >> /etc/locale.conf +echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen +locale-gen +echo "my-host" > /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 +</pre> +null#archlinux +Wed, 26 Feb 2014 09:55:00 GMT + +curl <h1> spoof host_name</h1><pre>curl --resolve host:80:ip host </pre> null#curl -Tue, 14 Jan 2014 01:38:27 GMT +Tue, 14 Jan 2014 01:38:00 GMT - @@ -318,7 +386,7 @@ swapon /swapon
- -
MainMenu -<a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="GettingStarted" refresh="link" target="_blank" title="External link to null#GettingStarted" href="null#GettingStarted" class="externalLink null">GettingStarted</a><br><a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="Security" refresh="link" target="_blank" title="External link to null#Security" href="null#Security" class="externalLink null">Security</a><br><a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="Hardware" refresh="link" target="_blank" title="External link to null#Hardware" href="null#Hardware" class="externalLink null">Hardware</a><br><a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="Programming" refresh="link" target="_blank" title="External link to null#Programming" href="null#Programming" class="externalLink null">Programming</a><br><a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="Hacking" refresh="link" target="_blank" title="External link to null#Hacking" href="null#Hacking" class="externalLink null">Hacking</a><br><h1> Misc</h1><a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="TODO" refresh="link" target="_blank" title="External link to null#TODO" href="null#TODO" class="externalLink null">TODO</a><br><a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="Fun" refresh="link" target="_blank" title="External link to null#Fun" href="null#Fun" class="externalLink null">Fun</a><br><a target="_blank" title="External link to http://euer.krebsco.de/atom.xml" href="http://euer.krebsco.de/atom.xml" class="externalLink">RSS of this Blog</a><br> +<a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="GettingStarted" refresh="link" target="_blank" title="External link to null#GettingStarted" href="null#GettingStarted" class="externalLink null">GettingStarted</a><br><a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="Security" refresh="link" target="_blank" title="External link to null#Security" href="null#Security" class="externalLink null">Security</a><br><a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="Hardware" refresh="link" target="_blank" title="External link to null#Hardware" href="null#Hardware" class="externalLink null">Hardware</a><br><a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="Programming" refresh="link" target="_blank" title="External link to null#Programming" href="null#Programming" class="externalLink null">Programming</a><br><a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="Hacking" refresh="link" target="_blank" title="External link to null#Hacking" href="null#Hacking" class="externalLink null">Hacking</a><br><h1> Misc</h1><a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="TODO" refresh="link" target="_blank" title="External link to null#TODO" href="null#TODO" class="externalLink null">TODO</a><br><a tiddlyfields="server.type:"file" server.host:"file:///home/makefu/Downloads/knowledge_base.html"" tiddlylink="Fun" refresh="link" target="_blank" title="External link to null#Fun" href="null#Fun" class="externalLink null">Fun</a><br><a target="_blank" title="External link to /wiki/knowledge_base.xml" href="/wiki/knowledge_base.xml" class="externalLink">RSS of this Blog</a><br> null#MainMenuThu, 07 Nov 2013 14:12:00 GMT @@ -389,120 +457,6 @@ kill dat-shit null#%5B%5BFile%20Systems%5D%5DTue, 22 Oct 2013 17:37:00 GMT -- -
-/etc/network/interfaces -<h1>static network</h1><pre>auto eth1 # come up automatically -iface et1 inet static - address 192.168.0.24 - netmask 255.255.255.0 -# gateway 192.168.0.23 -</pre><h1> for wpa_supplicant</h1><pre>auto wlan0 -allow-hotplug wlan0 -iface wlan0 inet dhcp - wpa-ssid meinessid - wpa-psk meinpasswort -</pre> -network -null#%2Fetc%2Fnetwork%2Finterfaces -Wed, 16 Oct 2013 23:54:00 GMT - -- -
-solaris -<h1> gnu alternatives</h1><h2> readlink -f</h2><pre>canonicalpath() { - if [ -d $1 ]; then - pushd $1 > /dev/null 2>&1 - echo $PWD - elif [ -f $1 ]; then - pushd $(dirname $1) > /dev/null 2>&1 - echo $PWD/$(basename $1) - else - echo "Invalid path $1" - fi - popd > /dev/null 2>&1 -} -</pre><pre>canonicalize(){ - cd -P -- "$(dirname -- "$1")" && - printf '%s\n' "$(pwd -P)/$(basename -- "$1")" -} -</pre><h2> mount -o bind</h2><pre>mount -F lofs DIR1 DIR2 -</pre> -null#solaris -Wed, 16 Oct 2013 10:59:00 GMT - -- -
\ No newline at end of filePython Advanced -<h1> Python for the user</h1>in ~/.profile <br><pre>export PYTHONPATH=~/.local/lib/python2.7/site-packages -export PATH=$PATH:~/.local/lbin -</pre>then do<br><pre>pip install --user <stuff> -</pre><h1> Interactive Shell</h1><h2> Activate Tab Completion</h2><pre>import rlcompleter,readline;readline.parse_and_bind("tab: complete") -</pre><h1> Single file Python</h1><h2> py2zip</h2>from <a target="_blank" title="External link to http://people.canonical.com/~roman.yepishev/us/src/" href="http://people.canonical.com/~roman.yepishev/us/src/" class="externalLink">http://people.canonical.com/~roman.yepishev/us/src/</a><br><pre>#!/bin/bash - -ORIG_PWD=$PWD - -set -ex - -TARGET="$1" -TARGET_BASENAME=`basename "$TARGET"` -shift - -MAIN=$1 -shift - -FILES="$*" -TEMPDIR=`mktemp -d /tmp/XXXXXXXX` - -cp "$MAIN" "$TEMPDIR/__main__.py" -cp --parents -r $FILES "$TEMPDIR/" - -cd "$TEMPDIR" -zip -q -r build.zip * -cd "$ORIG_PWD" -echo "#!/usr/bin/python" > "$TEMPDIR/build.header" -cat "$TEMPDIR/build.header" "$TEMPDIR/build.zip" > "$TEMPDIR/$TARGET_BASENAME" -chmod +x "$TEMPDIR/$TARGET_BASENAME" -mv "$TEMPDIR/$TARGET_BASENAME" $TARGET -</pre><br><h1>Conditionals</h1><pre>>>> x = 5 ->>> 1 < x < 10 -True ->>> 10 < x < 20 -False ->>> x < 10 < x*10 < 100 -True ->>> 10 > x <= 9 -True ->>> 5 == x > 4 -True -</pre><h1>Random</h1><pre>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 -</pre><h1>Decorators</h1><pre> -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 - ->>> write('foo') -Arguments: ('foo',){} -foo -</pre><h1>Advanced Regexes</h1><pre>re.compile("^\[font(?:=(?P<size>[-+][0-9]{1,2}))?\](.*?)[/font]", - re.DEBUG) -</pre> -null#%5B%5BPython%20Advanced%5D%5D -Fri, 11 Oct 2013 10:00:00 GMT -