From 8c54b83913c7307a1f0c948ca5fba0f0d5ae1903 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Fri, 20 Mar 2015 01:12:12 +0100 Subject: [PATCH] Various new posts. --- .htaccess | 9 + assets/colorboot.png | Bin 0 -> 1343 bytes .../software/linux/_posts/2008-10-10-btg.md | 154 ++++++++++++++++++ .../_posts/2009-01-11-compiling-php-gtk.md | 72 ++++++++ .../software/linux/_posts/2009-02-08-bash.md | 75 +++++++++ .../linux/_posts/2009-03-31-boot-colours.md | 63 +++++++ .../linux/_posts/2009-03-31-boot-partition.md | 54 ++++++ .../_posts/2009-07-17-colourful-manpages.md | 23 +++ .../_posts/2010-02-26-compiling-kismet.md | 38 +++++ .../_posts/2010-03-04-citrix-icaclient.md | 47 ++++++ 10 files changed, 535 insertions(+) create mode 100644 assets/colorboot.png create mode 100644 know-how/software/linux/_posts/2008-10-10-btg.md create mode 100644 know-how/software/linux/_posts/2009-01-11-compiling-php-gtk.md create mode 100644 know-how/software/linux/_posts/2009-02-08-bash.md create mode 100644 know-how/software/linux/_posts/2009-03-31-boot-colours.md create mode 100644 know-how/software/linux/_posts/2009-03-31-boot-partition.md create mode 100644 know-how/software/linux/_posts/2009-07-17-colourful-manpages.md create mode 100644 know-how/software/linux/_posts/2010-02-26-compiling-kismet.md create mode 100644 know-how/software/linux/_posts/2010-03-04-citrix-icaclient.md diff --git a/.htaccess b/.htaccess index b52ee7b..bd769d6 100644 --- a/.htaccess +++ b/.htaccess @@ -172,6 +172,15 @@ RewriteRule ^know-how/misc/audio-bitrates http://wiki.mbirth.de/know-how/misc/au RewriteRule ^know-how/misc/nasa-roger-beep http://wiki.mbirth.de/know-how/misc/nasa-roger-beep.html [L,R=301] RewriteRule ^know-how/misc/nypd-siren-sounds http://wiki.mbirth.de/know-how/misc/nypd-siren-sounds.html [L,R=301] RewriteRule ^know-how/misc/rsa-safeword-tokens http://wiki.mbirth.de/know-how/misc/rsa-safeword-tokens.html [L,R=301] +RewriteRule ^know-how/software/android/duplicate-asec-files http://wiki.mbirth.de/know-how/software/android/duplicate-asec-files.html [L,R=301] +RewriteRule ^know-how/software/android/root http://wiki.mbirth.de/know-how/software/android/root.html [L,R=301] +RewriteRule ^know-how/software/android/tango-messenger-phone-numbers http://wiki.mbirth.de/know-how/software/android/tango-messenger-phone-numbers.html [L,R=301] +RewriteRule ^know-how/software/eclipse/ezpublish http://wiki.mbirth.de/know-how/software/eclipse/ezpublish-templates-in-eclipse.html [L,R=301] +RewriteRule ^know-how/software/eclipse/whitespaces http://wiki.mbirth.de/know-how/software/eclipse/lighter-whitespaces.html [L,R=301] +RewriteRule ^know-how/software/freesshd/keyauth http://wiki.mbirth.de/know-how/software/freesshd/key-authentication.html [L,R=301] +RewriteRule ^know-how/software/games/spaz http://wiki.mbirth.de/know-how/software/games/spaz.html [L,R=301] +RewriteRule ^know-how/software/java/lookandfeel-in-all-apps http://wiki.mbirth.de/know-how/software/java/lookandfeel-in-all-apps.html [L,R=301] +RewriteRule ^know-how/software/java/swing-garbledbackground http://wiki.mbirth.de/know-how/software/java/swing-garbled-background.html [L,R=301] # ... RewriteRule ^know-how/software/titanium http://wiki.mbirth.de/know-how/software/appcelerator-titanium.html [L,R=301] # ... diff --git a/assets/colorboot.png b/assets/colorboot.png new file mode 100644 index 0000000000000000000000000000000000000000..dd7e7aa52c7dce1e54799bd42fb45f9409e66ff6 GIT binary patch literal 1343 zcmV-F1;F}=P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXH3 z2?ha}vv$D%00h5DL_t(|+U?!Fa^oNnz;PwxB9G@Hg&)yH3O}BU6jx}%aEOmxv>=fF zzscMvJ{e*APU}U8{a8-z`Fy(V$K$a80000000000U~v8gp7ERQ(D-!S05F~V_j~<0 z<>4+AkhU#9JxzNUJv9Hd08~T>>7KuL_v1ep>|=P)8z0Y}_~g&r3w~`HjR2r+-1@!0 zZm-m@nFsgy6!y$8vDp5)%`l>wN2Z-rBhkOg_eU6hOk&ucr#v1H0u_KkB9@7p>Uico z@XxkxTbp?VjTGCrQqh`KGy;H=MWaH7^t!!*p+oZ?sLr;2PLRnPcE*glu-YPW5RCv_ zCmJoqAv+h7_Vhp!NK{SLHR7IP*dNydkplqQ1|%1Uf@}$Wk{JI27*~t{jG$dOP+UV= zJJBdp(*}SMhO=7tp<)Uj0CbB<=HZ}l4XOBu{M;HHYSZ4n6CHM|Xs}}FPdlrv;^w64 zcSF*S_Hh8{oG0Cc2X2=HxU*p@*c4+%&`8hIYjCV$SN&^O3k#3~m?YjrqreEmW|zj& zK>()4(m?l@LNY&A$_>@#sqaKp6c6T^YR|&v$zJ6ZO2PLEoJS2g*9fB3Skjn)$)0RoV+W;yTgdywvQ&3+^SX)&#bWOBN9gHH1Cv046E5HJyx(hjjjEL|r8SQ#e~aBw?0tY|=(u zB>;0}OMMP>hI&ZCQ-9Eo>T*zmLynGR|&we{5y(*yNld*F!?+6I7Y|PK>!Xx zJtP1C000000002sAcJ3`Z?{-DA3Xq}kta16m!HT?v$nb=^N?FRO{Sp(zzAMHU!qvz zt)`t?)U>!-!g{O&X4z?1*B&Gx&@R7S-2pNr03&2b+Gw;SYCg#8KUii+`|Bb38^XFr z+Z$%{cY{V7FV;!gneOE4Ek*B{mDg>O95=J_g}g4*wx6ocg$xq7VqojMlAN|4QvR!Y zv3Pc|zESZg+dYeQk|gPcu-N&w{a~Z6Zd3laew!6_q*DDb&YmmOqk4>zd0mh0D4+TSK!t+{wF12LTXgjo(-#_)bD*9in|0HQAwZCM05e%ud-XFkp@g^Dt zMkpgbJ*FuGxU7+v4*DP_@r@n;000000000W@DFI|3-I|c+{XX_002ovPDHLkV1h + + +Incoming directory +================== + +To have a directory scanned for `.torrent` files and let them be added to BTG, there is this nice bash script from +the [BTG HowTo](http://btg.berlios.de/howto.html#using-an-incoming-directory): + +{% highlight bash %} +#!/bin/sh + +CLIENT=btgcli +# The directory containing the torrent files. +INCOMING_DIR=~/btg/incomming +# The directory to which .torrent files are moved +# to after loading them into BTG. +DONE_DIR=~/btg/incomming/done + +GOT_SESSION=0 +$CLIENT -A -n -c "detach" &> /dev/null && GOT_SESSION=1 + +if [ $GOT_SESSION -eq 0 ] +then + $CLIENT -n -c "detach" &> /dev/null && GOT_SESSION=1 +fi + +if [ $GOT_SESSION -eq 0 ] +then + echo "Unable to attach or create a BTG session." + exit -1 +fi + +TORRENT_ADDED=0 + +cd $INCOMING_DIR && \ +for f in `ls -1 *.torrent 2> /dev/null` ; do + echo "Loading file: $f" && \ + $CLIENT -A -n -c "detach" -o $f &> /dev/null && \ + TORRENT_ADDED=`expr $TORRENT_ADDED + 1` && \ + mv $f $DONE_DIR +done + +if [ $TORRENT_ADDED -gt 0 ] +then + echo "Added $TORRENT_ADDED torrents to BTG." +fi +{% endhighlight %} + + +Set Speedlimits based on time of day +==================================== + +This script also comes from the [BTG HowTo](http://btg.berlios.de/howto.html#setting-global-limits-based-on-the-time-of-the-day): + +{% highlight bash %} +#!/bin/sh + +# The location of the BTG client application. +CLIENT=btgcli + +H=`date +%H` +O="none" + +if [ "$H" -gt "0" ] || [ "$H" -lt "6" ] +then + O="night" +fi + +if [ "$H" -gt "6" ] || [ "$H" -lt "12" ] +then + O="morning" +fi + +if [ "$H" -gt "12" ] || [ "$H" -lt "16" ] +then + O="midday" +fi + +if [ "$H" -gt "16" ] || [ "$H" -lt "23" ] +then + O="evening" +fi + +# Max upload limit. +UL_MAX=75 + +# Global limits in KiB/sec. +UL=-1 +DL=-1 +SET_LIMIT=0 + +case "$O" in + night) + UL=$UL_MAX + SET_LIMIT=1 + echo "Limit:$O:$UL:$DL" + ;; + morning) + UL=`expr $UL_MAX - 20` + SET_LIMIT=1 + echo "Limit:$O:$UL:$DL" + ;; + midday) + UL=`expr $UL_MAX - 40` + SET_LIMIT=1 + echo "Limit:$O:$UL:$DL" + ;; + evening) + UL=`expr $UL_MAX - 70` + SET_LIMIT=1 + echo "Limit:$O:$UL:$DL" + ;; + *) + echo "Not setting limit." + ;; +esac + +if [ "$SET_LIMIT" -eq "0" ] +then + exit 0 +fi + +GOT_SESSION=0 +$CLIENT -A -n -c "detach" &> /dev/null && GOT_SESSION=1 + +if [ $GOT_SESSION -eq 0 ] +then + $CLIENT -n -c "detach" &> /dev/null && GOT_SESSION=1 +fi + +if [ $GOT_SESSION -eq 0 ] +then + echo "Unable to attach or create a BTG session." + exit -1 +fi + +$CLIENT -A -n -c "glimit $UL $DL -1 -1;detach" &> /dev/null && \ +echo "Limit set." +{% endhighlight %} diff --git a/know-how/software/linux/_posts/2009-01-11-compiling-php-gtk.md b/know-how/software/linux/_posts/2009-01-11-compiling-php-gtk.md new file mode 100644 index 0000000..c371bb2 --- /dev/null +++ b/know-how/software/linux/_posts/2009-01-11-compiling-php-gtk.md @@ -0,0 +1,72 @@ +--- +title: Compiling PHP-GTK +layout: default +created: 2009-01-11 13:48:56 +0100 +updated: 2009-01-11 13:57:32 +0100 +toc: false +tags: + - know-how + - software + - linux + - software + - php + - gtk +--- +To compile [php-gtk](http://gtk.php.net/), you need the following packages: + + sudo aptitude install php5-dev php5-gd libgtk2.0-dev libglade2-dev build-essentials + + +When trying to use the `buildconf.sh`, you might encounter the following error: + +~~~ +~/php-gtk-2.0.1$ ./buildconf +Configuring for: +PHP Api Version: 20041225 +Zend Module Api No: 20060613 +Zend Extension Api No: 220060519 +rebuilding aclocal.m4 +rebuilding configure +configure.in:77: warning: LTOPTIONS_VERSION is m4_require'd but not m4_defun'd +aclocal.m4:2912: LT_INIT is expanded from... +aclocal.m4:2947: AC_PROG_LIBTOOL is expanded from... +configure.in:77: the top level +configure.in:77: warning: LTSUGAR_VERSION is m4_require'd but not m4_defun'd +configure.in:77: warning: LTVERSION_VERSION is m4_require'd but not m4_defun'd +configure.in:77: warning: LTOBSOLETE_VERSION is m4_require'd but not m4_defun'd +configure:12242: error: possibly undefined macro: m4_ifval + If this token and others are legitimate, please use m4_pattern_allow. + See the Autoconf documentation. +configure:15849: error: possibly undefined macro: _LT_SET_OPTIONS +configure:15849: error: possibly undefined macro: LT_INIT +make[1]: *** [configure] Error 1 +make: *** [all] Error 2 +~~~ + +which leaves the `configure`-script in a broken state. The problem is that the newer `libtool.m4` has been split into +different files. To make it work, you have to concatenate the different files back into the libtool. + +~~~ +$ cd /usr/share/aclocal +$ sudo cp libtool.m4 libtool.m4~backup +$ sudo chmod 777 libtool.m4 +$ sudo cat lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 >>libtool.m4 +$ sudo chmod 644 libtool.m4 +~~~ + +After that, unpack a **clean** `php-gtk` source and try again. + +~~~ +~/php-gtk-2.0.1$ ./buildconf +~/php-gtk-2.0.1$ ./configure +~/php-gtk-2.0.1$ make +~/php-gtk-2.0.1$ sudo make install +~~~ + +After enabling the new extension in the `php.ini`, you should be able to use the [Gtk2-Frontend for PEAR](http://pear.php.net/PEAR_Frontend_Gtk2). + + sudo pear install --alldeps pear/PEAR#gtk2installer + +You can now run the graphical installer using the following command: + + sudo pear -G diff --git a/know-how/software/linux/_posts/2009-02-08-bash.md b/know-how/software/linux/_posts/2009-02-08-bash.md new file mode 100644 index 0000000..3c00ec5 --- /dev/null +++ b/know-how/software/linux/_posts/2009-02-08-bash.md @@ -0,0 +1,75 @@ +--- +title: bash Tips & Tricks +layout: default +created: 2008-08-01 22:41:34 +0200 +updated: 2009-02-08 14:32:54 +0100 +toc: false +tags: + - know-how + - software + - linux + - software + - bash +--- +Bourne Again Shell. + + +bash magic +========== + +Some handy `bash` magic. + + +sudo last command +----------------- + + sudo !! + +If you forgot `sudo` after executing your 3-lines-command, sudo *bang! bang!* will repeat the last entered command with `sudo` prefixed. + + +More parameter magic +-------------------- + +| *bang* | Expands to | +|:----------:|:-----------| +| `!$` | last argument of previous command | +| `!$:p` | just show last argument of previous command, don't add to commandline | +| `!*` | **all** arguments of previous command | +| `!!:1` | first argument of previous command | +| `!vi` | last command that started with "*vi*" | +| `!vi:p` | just show last "*vi*"-call, don't run it again | +| `^err^corr` | replace all occurrences of `err` by `corr` in the last command | + + +Shortcuts +--------- + +| *keypress* | Description | +|:------------:|:---------------| +| Ctrl+w | Erase word | +| Ctrl+u | Erase from cursor to beginning of line | +| Ctrl+a | Move cursor to beginning of line | +| Ctrl+e | Move cursor to end of line | +| Ctrl+r | Search command history (type letters after this) | + + +chdir to last one +----------------- + + cd - + +Changes to previous directory. + + +Use output of previous command +------------------------------ + +Sometimes it's handy to use the output of a previous command, e.g. a `which`. To do that, simply use the *bang-bang* with the backtick operator: + + $ which php + /usr/bin/php + $ ls -l `!!` + ls -l `which php` + lrwxrwxrwx 1 root root 21 2008-06-12 02:47 /usr/bin/php -> /etc/alternatives/php + $ _ diff --git a/know-how/software/linux/_posts/2009-03-31-boot-colours.md b/know-how/software/linux/_posts/2009-03-31-boot-colours.md new file mode 100644 index 0000000..694b216 --- /dev/null +++ b/know-how/software/linux/_posts/2009-03-31-boot-colours.md @@ -0,0 +1,63 @@ +--- +title: Colourful boot messages +layout: default +created: 2008-08-06 00:18:47 +0200 +updated: 2009-03-31 11:16:03 +0200 +toc: false +tags: + - know-how + - software + - linux + - software + - bootup + - colours +--- +The functions used for the status messages upon boot are defined in `/lib/lsb/init-functions` and may be overwritten +in `/etc/lsb-base-logging.sh`. + +To add colours, in that `init-functions` file find the function *log_use_fancy_output()* and below the `fi` add the lines + +{% highlight bash %} +... +else + FANCYTTY=0 +fi +# BEGIN --- colour definition +if [ -n "$TERM" ]; then + NORMAL=`$TPUT sgr0` + BOLD=`$TPUT bold` + BLINK=`$TPUT blink` + BLACK=`$TPUT setaf 0` + RED=`$TPUT setaf 1` + GREEN=`$TPUT setaf 2` + YELLOW=`$TPUT setaf 3` + BLUE=`$TPUT setaf 4` + MAGENTA=`$TPUT setaf 5` + CYAN=`$TPUT setaf 6` + WHITE=`$TPUT setaf 7` +fi +# END --- colour definition +case "$FANCYTTY" in + 1|Y|yes|true) true;; + ... +{% endhighlight %} + +After that, edit the `lsb-base-logging.sh` and change e.g. the output of *log_end_msg()*: + +{% highlight bash %} + ... + if [ "$COL" ] && [ -x "$TPUT" ]; then + printf "\r" + $TPUT hpa $COL + if [ "$1" -eq 0 ]; then + echo "${BOLD}${BLUE}[${GREEN} OK ${BLUE}]${NORMAL}" + else + echo "${BOLD}${BLUE}[${RED}fail${BLUE}]${NORMAL}" + fi + else + ... +{% endhighlight %} + +Your next boot will look like this: + +![]({{ site.url }}/assets/colorboot.png) diff --git a/know-how/software/linux/_posts/2009-03-31-boot-partition.md b/know-how/software/linux/_posts/2009-03-31-boot-partition.md new file mode 100644 index 0000000..dfc30e7 --- /dev/null +++ b/know-how/software/linux/_posts/2009-03-31-boot-partition.md @@ -0,0 +1,54 @@ +--- +title: /boot to own partition +layout: default +created: 2008-09-12 21:53:07 +0200 +updated: 2009-03-31 11:48:44 +0200 +toc: false +tags: + - know-how + - software + - linux + - software + - bootup +--- +Using an emulated SCSI-adapter in VMware with a very large root disk may give you either + + Error 18: Selected Cylinder exceeds maximum supported by BIOS + +or + + Error 16: Inconsistent Filesystem Structure + +This is because the *initrd* image is created (maybe only partially) outside the 1024-cylinder boundary accessible by +the VMware BIOS. The only stress-free solution is to move `/boot` to its own partition directly at the beginning of the +virtual disk. There is a nice how-to from [Tek Guru](http://tekguru.wordpress.com/2007/09/04/howto-moving-boot-to-its-own-partition/). + +So use your favourite partitioner (I prefer GPartEd from the [SysRescCD](http://www.sysresccd.org/).) and move the +beginning of the first partition about 100 MiB to the right to add a new *ext3* partition in front of it. 100 MiB +should be enough for most people. You may need to use `fdisk`'s expert menu to fix the partition ordering if you can't +live with a `/dev/sda3` at the beginning of the disk. + +Afterwards mount both partitions, the future `/boot` and the system partition and copy the contents of `/boot` to the +new and empty partition. Rename the old boot-folder and create a new empty one. Edit the `fstab` and add following line: + + /dev/sda3 /boot ext3 rw 0 1 + +(Tek Guru used `ro` here to mount the partition read-only. As Ubuntu often updates the initrd, `rw` is the better way.) + +Now open the `grub/menu.lst` and remove the `/boot` in front of the entries. Since grub sees the plain partition, +everything is in the root directory at this point. Maybe you also have to change the `root hd(0,X)` if your `X` is +not `0` (= the first partition). + +Using the rescuecd, you can now boot your system using the `rescuecd boothd=/dev/sda2` (`root=/dev/sda2` in recent +versions) parameter. If the system is up, run + + grub-install /dev/sda + +to finally install grub correctly. You should now be able to boot. + + +

+You can use the same technique to get around the 137 GB / 128 GiB limit of some +older mainboards. Just create a `/boot` partition at the beginning and after the kernel has loaded the controller +module, the (BIOS-)limit is gone. +

diff --git a/know-how/software/linux/_posts/2009-07-17-colourful-manpages.md b/know-how/software/linux/_posts/2009-07-17-colourful-manpages.md new file mode 100644 index 0000000..a3d9909 --- /dev/null +++ b/know-how/software/linux/_posts/2009-07-17-colourful-manpages.md @@ -0,0 +1,23 @@ +--- +title: Colourful manpages +layout: default +created: 2009-02-02 16:39:21 +0100 +updated: 2009-07-17 23:01:40 +0200 +toc: false +tags: + - know-how + - software + - linux + - software + - manpages + - colours +--- +1. Install the `most` pageviewer: (or click here: [most](apt://most)) + + sudo aptitude install most + +1. Reconfigure the system to use `most` instead of `less` for paging: + + sudo update-alternatives --config pager + +After that, manpages will appear more colourful. diff --git a/know-how/software/linux/_posts/2010-02-26-compiling-kismet.md b/know-how/software/linux/_posts/2010-02-26-compiling-kismet.md new file mode 100644 index 0000000..28b1f99 --- /dev/null +++ b/know-how/software/linux/_posts/2010-02-26-compiling-kismet.md @@ -0,0 +1,38 @@ +--- +title: Compiling Kismet +layout: default +created: 2010-02-25 22:44:16 +0100 +updated: 2010-02-26 00:15:54 +0100 +toc: false +tags: + - know-how + - software + - linux + - software + - kismet +--- +You need the following libraries to successfully compile [Kismet](http://www.kismetwireless.net/download.shtml): + +* [libncurses5-dev](apt://libncurses5-dev) +* [libncursesw5-dev](apt://libncursesw5-dev) +* [libpcap0.8-dev](apt://libpcap0.8-dev) +* [libpcre3-dev](apt://libpcre3-dev) +* [libnl-dev](apt://libnl-dev) +* [libcap-dev](apt://libcap-dev) + +~~~ +./configure --enable-airpcap +~~~ + + +Install from PPA +================ + +You can also install the latest version using `aptitude` from [Festor's HackTools PPA](https://launchpad.net/~festor-deactivatedaccount/+archive/hack-tools). + +

+The shown URL to the PPA is wrong as Festor's account got deactivated. The correct URLs are: + + deb http://ppa.launchpad.net/festor/hack-tools/ubuntu jaunty main + deb-src http://ppa.launchpad.net/festor/hack-tools/ubuntu jaunty main +

diff --git a/know-how/software/linux/_posts/2010-03-04-citrix-icaclient.md b/know-how/software/linux/_posts/2010-03-04-citrix-icaclient.md new file mode 100644 index 0000000..6e028bf --- /dev/null +++ b/know-how/software/linux/_posts/2010-03-04-citrix-icaclient.md @@ -0,0 +1,47 @@ +--- +title: Citrix ICAClient +layout: default +created: 2010-03-04 13:41:08 +0100 +updated: 2010-03-04 14:22:24 +0100 +toc: false +tags: + - know-how + - software + - linux + - software + - citrix + - icaclient +--- +* **Download:** [citrix.com](http://www.citrix.com/English/ss/downloads/details.asp?downloadId=3323&productId=186) (preferably `.deb` format) + +This plugin will work with browsers which support Netscape compatible plugins, e.g. *Firefox* or *Opera*. + + +SSL error 61 +============ + +This error means your certificate chain is broken or not "trusted". + + +Get certificates +---------------- + +While the Windows clients download the certificates automatically, the Linux client doesn't. You will need access to a +Windows running *Firefox* or talk to someone to get the required certificates. + +* Open Firefox (make sure you had at least one successful connection using the ICAClient) +* go to menu *Tools* → *Options…* → *Advanced* → *Encryption* and click the button *View certificates* +* click the *Servers* tab +* find the certificate matching your desired Citrix server and select it (click once) +* now click the *Export…* button, choose **X.509 certificate (DER)** as format and save it +* click the *View…* button and notice the name under "Issued By" → "Common Name (CN)" then close the dialog +* select the *Authorities* tab +* search the list for the name you just saw, most times the group will have a similar name +* export this certificate the same way as above (DER format) +* view that certificate and check whether the "Issued By" → "Common Name (CN)" is different from the certificates + name - if so: repeat the steps to also export this one +* if all certificates are exported, copy them to these locations: + * the Root CA certificate (that one you exported last) goes to `/usr/lib/ICAClient/keystore/cacerts/` to make it a + *trusted* certificate + * all other go to `~/.ICAClient/keystore/cacerts/` +* All done.