<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-593663383710482559</id><updated>2019-01-29T00:20:43.299-08:00</updated><category term="windows"/><category term="console"/><category term="backup"/><category term="upgrade"/><category term="debian"/><category term="multimedia"/><category term="disk"/><category term="boot"/><category term="gnome"/><category term="programming"/><category term="remote access"/><category term="usb"/><category term="email"/><category term="x"/><category term="live-hdd"/><category term="network"/><category term="one-liner"/><category term="undbx"/><category term="firewall"/><category term="printer"/><category term="security"/><category term="hardware"/><category term="virtualbox"/><category term="vnc"/><category term="awesome"/><category term="browser"/><category term="dvd"/><category term="window manager"/><category term="emacs"/><category term="kernel"/><category term="sshd"/><category term="udev"/><category term="webserver"/><category term="wine"/><category term="baculafs"/><category term="floppy"/><category term="gallery2"/><category term="locale"/><category term="office"/><category term="photos"/><category term="samba"/><category term="source"/><category term="syntax-highlight"/><category term="autoconf"/><category term="blog"/><category term="bluetooth"/><category term="cloud"/><category term="cygwin"/><category term="fax"/><category term="fonts"/><category term="fun"/><category term="git"/><category term="hebrew"/><category term="time"/><category term="ubuntu"/><category term="work"/><category term="c/c++"/><category term="gdm"/><category term="gimp"/><category term="grml"/><category term="hal"/><category term="keyboard"/><category term="mysql"/><category term="nautilus"/><category term="pdf"/><category term="power"/><category term="powerpc"/><category term="qemu"/><category term="scanner"/><category term="screen"/><category term="vim"/><category term="cron"/><category term="daemon"/><category term="dbus"/><category term="digicam"/><category term="drivers"/><category term="games"/><category term="google desktop search"/><category term="gpm"/><category term="java"/><category term="memory"/><category term="perl"/><category term="php"/><category term="podcasts"/><category term="screensaver"/><category term="tcsh"/><category term="webdav"/><category term="wordpress"/><title type='text'>Machine Cycle</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>199</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-7258660160132025255</id><published>2012-12-07T04:59:00.000-08:00</published><updated>2012-12-07T04:59:00.456-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="multimedia"/><category scheme="http://www.blogger.com/atom/ns#" term="nautilus"/><category scheme="http://www.blogger.com/atom/ns#" term="samba"/><title type='text'>Launch Playback of Multimedia Files on a SAMBA Share from Nautilus</title><content type='html'>I hit this problem on a new Debian installation: if I use Nautilus to navigate to a SAMBA share (on a Windows or Linux box) I can launch playback of multimedia files by double clicking them. So far so good. This brings up Totem (the default Gnome multimedia player), which is fine, but I&#39;d rather use &lt;a href=&quot;http://deb-multimedia.org/dists/unstable/main/binary-amd64/package/vlc&quot;&gt;VLC&lt;/a&gt; (from the &lt;a href=&quot;http://deb-multimedia.org&quot;&gt;Debian Multimedia&lt;/a&gt; repository). &lt;br /&gt;&lt;br /&gt;It&#39;s easy enough to convince Nautilus to launch VLC, but VLC fails to find the multimedia files. This only happens if the SAMBA share is mounted by Nautilus. If I mount the SAMBA share manually from the command line, VLC finds the files just fine.&lt;br /&gt;&lt;br /&gt;The problem is that Nautilus points VLC to a non-existent path that lives on the Gnome virtual file system (&lt;a href=&quot;http://en.wikipedia.org/wiki/GVFS&quot;&gt;GVFS&lt;/a&gt;). &lt;br /&gt;&lt;br /&gt;The fix is to install the &lt;a href=&quot;http://packages.debian.org/search?keywords=gvfs-fuse&quot;&gt;GVFS FUSE daemon&lt;/a&gt;, which, for some reason, is not installed by default:&lt;pre&gt;aptitude install gvfs-fuse&lt;/pre&gt;add your user account to the &lt;code&gt;fuse&lt;/code&gt; group, and re-login.</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/7258660160132025255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/12/launch-playback-of-multimedia-files-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/7258660160132025255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/7258660160132025255'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/12/launch-playback-of-multimedia-files-on.html' title='Launch Playback of Multimedia Files on a SAMBA Share from Nautilus'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-5640367126013532532</id><published>2012-04-28T04:46:00.001-07:00</published><updated>2012-04-28T04:46:23.511-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c/c++"/><category scheme="http://www.blogger.com/atom/ns#" term="hardware"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="undbx"/><title type='text'>Illegal Instruction in Code Compiled with Clang</title><content type='html'>I was inspired by the &lt;a href=&quot;http://sylvestre.ledru.info/blog/sylvestre/2012/02/29/rebuild_of_the_debian_archive_with_clang&quot;&gt;effort to rebuild the Debian archive with clang&lt;/a&gt;, to try compiling &lt;a href=&quot;http://code.google.com/p/undbx/&quot;&gt;UnDBX&lt;/a&gt; with &lt;a href=&quot;http://packages.qa.debian.org/c/clang.html&quot;&gt;&lt;code&gt;clang&lt;/code&gt;&lt;/a&gt;:&lt;pre&gt;CC=clang ./configure&lt;br /&gt;make&lt;/pre&gt;I was a bit surprised when &lt;code&gt;clang&lt;/code&gt; complained about an (legitimate) operator precedence issue, which &lt;a href=&quot;http://gcc.gnu.org/&quot;&gt;&lt;code&gt;gcc&lt;/code&gt;&lt;/a&gt; never pointed out to me. I fixed this by judicious use of parenthesis, and recompiled.&lt;br /&gt;&lt;br /&gt;But the generated binary failed to run - I got an &quot;Illegal instruction&quot; error. This error persisted with optimizations turned off (i.e. &lt;code&gt;-O0&lt;/code&gt;). I tried running the binary under &lt;a href=&quot;http://valgrind.org/&quot;&gt;&lt;code&gt;valgrind&lt;/code&gt;&lt;/a&gt; and got the following:&lt;pre&gt;vex x86-&gt;IR: unhandled instruction bytes: 0x66 0xF 0xEF 0xC0&lt;br /&gt;==28891== valgrind: Unrecognised instruction at address 0x8048fc3.&lt;/pre&gt;followed by a verbose error message explaining that this may be caused either by trying to execute code in a non-code area of memory, or by a bug in &lt;code&gt;valgrind&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;I used &lt;a href=&quot;http://manpages.debian.net/cgi-bin/man.cgi?query=objdump&quot;&gt;&lt;code&gt;objdump&lt;/code&gt;&lt;/a&gt; to find the offending instruction/address:&lt;pre&gt;$ objdump -d -S undbx | grep -i 8048fc3&lt;br /&gt; 8048fc3:       66 0f ef c0             pxor   %xmm0,%xmm0&lt;/pre&gt;&lt;br /&gt;I don&#39;t grok x86 assembly much, so it took me some googling to find that the combination of &lt;code&gt;pxor&lt;/code&gt; and &lt;code&gt;xmm&lt;/code&gt; type registers is in fact an SSE instruction. The CPU on this box is an aging 32-bit Mobile AMD Athlon XP, and the CPU flags in &lt;code&gt;/proc/cpuinfo&lt;/code&gt; include SSE, so I&#39;m not sure what to make of this.&lt;br /&gt;&lt;br /&gt;The same code compiles and runs nicely on my newly upgraded laptop which sports a slightly less lame 64-bit Mobile AMD Sempron processor, running a 64-bit kernel.&lt;br /&gt;&lt;br /&gt;In any case, I tried compiling like this:&lt;pre&gt;CC=&#39;clang &lt;font color=&quot;red&quot;&gt;-mno-sse&lt;/font&gt;&#39; ./configure&lt;br /&gt;make&lt;/pre&gt;and I got a working executable.&lt;br /&gt;&lt;br /&gt;My guess is that this is a bug in &lt;code&gt;clang&lt;/code&gt; (maybe Debian bug &lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=632472&quot;&gt;#632472&lt;/a&gt;?), but as I said, I&#39;m not sure. &lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/5640367126013532532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/04/illegal-instruction-in-code-compiled.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/5640367126013532532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/5640367126013532532'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/04/illegal-instruction-in-code-compiled.html' title='Illegal Instruction in Code Compiled with Clang'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-8615131156910147151</id><published>2012-04-21T13:18:00.000-07:00</published><updated>2012-04-21T13:18:20.898-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gdm"/><category scheme="http://www.blogger.com/atom/ns#" term="remote access"/><category scheme="http://www.blogger.com/atom/ns#" term="vnc"/><category scheme="http://www.blogger.com/atom/ns#" term="x"/><title type='text'>Remote GDM3 Login with VNC</title><content type='html'>I usually leave my computer at home turned on, logged in to the graphical desktop, with a VNC server running, to allow remote access to the desktop with a VNC viewer.&lt;br /&gt;&lt;br /&gt;A few days ago, while waiting for code to compile, I logged in to my computer from work, and performed a long overdue package upgrade, which required a reboot to complete. This left me logged out of the desktop, with the GDM3 greeter waiting for someone to log in, but no VNC server to allow remote access to it.&lt;br /&gt;&lt;br /&gt;Here&#39;s how to run a VNC server and start the desktop, in this situation:&lt;ol&gt;&lt;li&gt;connect to the remote machine with &lt;code&gt;ssh&lt;/code&gt;, forwarding the default VNC port (this is the usual way I access my home PC): &lt;br /&gt;&lt;pre&gt;# ssh -L 5901:localhost:5900 &lt;font color=&quot;red&quot;&gt;example.home-computer.com&lt;/font&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;run the following command as &lt;code&gt;root&lt;/code&gt; to detect the path to the X authority file:&lt;pre wrap&gt;$ ps ax | grep auth&lt;br /&gt; 1398 tty7     Ss+    4:30 /usr/bin/Xorg :0 -br -verbose -novtswitch -auth &lt;font color=&quot;red&quot;&gt;/var/run/gdm3/auth-for-Debian-gdm-e7ERxa/database&lt;/font&gt; -nolisten tcp vt7&lt;br /&gt; 5053 pts/5    S+     0:00 grep --color=auto auth&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;launch a VNC server (as &lt;code&gt;root&lt;/code&gt;) that allows access to your real X11 display, using the path to the X authority file (I use &lt;a href=&quot;http://www.karlrunge.com/x11vnc/&quot;&gt;&lt;code&gt;x11vnc&lt;/code&gt;&lt;/a&gt;):&lt;br /&gt;&lt;pre wrap&gt;$ x11vnc -xkb -ncache 0 --forever -localhost -display :0 -auth &lt;font color=&quot;red&quot;&gt;/var/run/gdm3/auth-for-Debian-gdm-e7ERxa/database&lt;/font&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;back on the local machine - connect to the remote machine with a VNC viewer (I use &lt;code&gt;realvnc&lt;/code&gt; here):&lt;pre warp&gt;# vncviewer -FullScreen -LowColourLevel 2 -PreferredEncoding ZRLE localhost:1&lt;/pre&gt;you should now see the remote GDM greeter and be able to login to your desktop.&lt;/li&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/8615131156910147151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/04/remote-gdm3-login-with-vnc.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/8615131156910147151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/8615131156910147151'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/04/remote-gdm3-login-with-vnc.html' title='Remote GDM3 Login with VNC'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-4392288313639328504</id><published>2012-04-13T06:20:00.000-07:00</published><updated>2012-04-14T00:18:52.885-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="debian"/><category scheme="http://www.blogger.com/atom/ns#" term="security"/><category scheme="http://www.blogger.com/atom/ns#" term="upgrade"/><title type='text'>Update rkhunter Database After Installing/Upgrading Packages</title><content type='html'>Once upon a time I &lt;a href=&quot;http://machine-cycle.blogspot.com/2008/03/running-script-automatically-after.html&quot;&gt;described&lt;/a&gt; how to automatically update the &lt;a href=&quot;http://www.rootkit.nl/projects/rootkit_hunter.html&quot;&gt;&lt;code&gt;rkhunter&lt;/code&gt;&lt;/a&gt; database after installing/upgrading packages. There&#39;s an easier way of achieving this which either did not exist at the time, or I somehow missed. Just add the following line to &lt;code&gt;/etc/default/rkhunter&lt;/code&gt;:&lt;pre&gt;APT_AUTOGEN=&quot;yes&quot;&lt;/pre&gt;My original method is still useful for running any custom script after installing/upgrading packages.</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/4392288313639328504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/04/update-rkhunter-database-after.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/4392288313639328504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/4392288313639328504'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/04/update-rkhunter-database-after.html' title='Update rkhunter Database After Installing/Upgrading Packages'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-1990928247347081766</id><published>2012-04-06T10:27:00.000-07:00</published><updated>2012-04-06T10:27:00.989-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="backup"/><category scheme="http://www.blogger.com/atom/ns#" term="dvd"/><category scheme="http://www.blogger.com/atom/ns#" term="multimedia"/><title type='text'>DVD Backup</title><content type='html'>Here&#39;s how I currently backup my kids&#39; DVDs to single CD-sized AVI files (mostly tested with PAL animation DVDs):&lt;br /&gt;&lt;ol&gt;&lt;li&gt;find the main title (usually the longest):&lt;pre&gt;$ lsdvd&lt;br /&gt;...&lt;br /&gt;Title: 21, Length: 01:31:58.200 Chapters: 42, Cells: 43, Audio streams: 05, Subpictures: 15&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;(&lt;code&gt;lsdvd&lt;/code&gt; is also kind enough to report the number of the longest title)&lt;br&gt;Alternatively, you can use &lt;code&gt;mplayer&lt;/code&gt; to do this too:&lt;pre&gt;mplayer -msglevel identify=6 -frames 0 dvd://&lt;/pre&gt;(it also lists the language audio tracks on the disc)&lt;/li&gt;&lt;li&gt;extract the MPEG2 stream with &lt;code&gt;mplayer&lt;/code&gt;&lt;pre&gt;mplayer -dumpstream -dumpfile temp/title.mpg dvd://21&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;calculate encoded video bit-rate with the script that&#39;s listed below:&lt;pre&gt;$ calc_video_bitrate.py 1:31:58 128 700&lt;br /&gt;bitrate: 929.650763&lt;br /&gt;&lt;/pre&gt;(the command line arguments are, in order: duration of video, audio target bitrate in kbit/sec and encoded file size in MB)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;rip the MPEG2 stream into an AVI file, in two passes, using &lt;code&gt;ffmpeg&lt;/code&gt; - note that I use the &lt;code&gt;-map&lt;/code&gt; command line option to keep only a single audio track (my kids don&#39;t speak English, yet):&lt;pre wrap&gt;ffmpeg -i temp/title.mpg -pass 1 -ac 2 -ab 128k -ar 44100 -acodec libmp3lame -b 929.65k -s 640x360 -map 0:0 -map 0:3  temp/title.pass1.avi&lt;br /&gt;ffmpeg -i temp/title.mpg -pass 2 -ac 2 -ab 128k -ar 44100 -acodec libmp3lame -b 929.65k -s 640x360 -map 0:0 -map 0:3  temp/title.avi&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;The code for calculating video bit-rate is based on JavaScript code found at &lt;a href=&quot;http://quadpoint.org/projects/simplerip&quot;&gt;http://quadpoint.org/projects/simplerip&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;!-- Generator: GNU source-highlight 3.1.6 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --&gt;&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;&lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;#! /usr/bin/env python&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#000080&quot;&gt;import&lt;/font&gt;&lt;/b&gt; sys&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;def&lt;/font&gt;&lt;/b&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;bitrate2bytes&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;bitrate&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; length&lt;font color=&quot;#990000&quot;&gt;):&lt;/font&gt;&lt;br /&gt;    &lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;# bitrate in kbit/s&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;    &lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;# length in seconds&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;    &lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;# returns number of bytes&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;    &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;return&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;bitrate &lt;font color=&quot;#990000&quot;&gt;*&lt;/font&gt; length &lt;font color=&quot;#990000&quot;&gt;*&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;1000&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;/&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;8.0&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;def&lt;/font&gt;&lt;/b&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;bytes2bitrate&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;size&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; length&lt;font color=&quot;#990000&quot;&gt;):&lt;/font&gt;&lt;br /&gt;    &lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;# size in bytes&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;    &lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;# length in seconds&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;    &lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;# returns bitrate in kbit/s&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;    &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;return&lt;/font&gt;&lt;/b&gt; size &lt;font color=&quot;#990000&quot;&gt;*&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;8.0&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;/&lt;/font&gt; length &lt;font color=&quot;#990000&quot;&gt;/&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;1000&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;def&lt;/font&gt;&lt;/b&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;calcbr&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;targetsize&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; audiosize&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; length&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; coverhead&lt;font color=&quot;#990000&quot;&gt;):&lt;/font&gt;&lt;br /&gt;    &lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;# targetsize in bytes&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;    &lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;# audiosize in bytes&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;    &lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;# length in seconds&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;    &lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;# coverhead in percent (container overhead)&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;    &lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;# returns bitrate in kbit/s&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;    overhead &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;1.0&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;+&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;coverhead &lt;font color=&quot;#990000&quot;&gt;/&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;100.0&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;    size &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;targetsize &lt;font color=&quot;#990000&quot;&gt;-&lt;/font&gt; audiosize&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;/&lt;/font&gt; overhead&lt;br /&gt;    &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;return&lt;/font&gt;&lt;/b&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;bytes2bitrate&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;size&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; length&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;def&lt;/font&gt;&lt;/b&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;main&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;():&lt;/font&gt;&lt;br /&gt;    &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;if&lt;/font&gt;&lt;/b&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;len&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;sys&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;argv&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;!=&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;4&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;:&lt;/font&gt;&lt;br /&gt;        &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;print&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#990000&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;sys&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;stderr&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; &lt;font color=&quot;#FF0000&quot;&gt;&#39;Usage: %s hh:mm[:ss] &amp;lt;audio-bitrate-kb-per-sec&amp;gt; &amp;lt;target-size-mb&amp;gt;\n&#39;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;%&lt;/font&gt; sys&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;argv&lt;font color=&quot;#990000&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;0&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;]&lt;/font&gt;&lt;br /&gt;        &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;return&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#990000&quot;&gt;-&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;1&lt;/font&gt;&lt;br /&gt;    &lt;br /&gt;    tokens &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; sys&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;argv&lt;font color=&quot;#990000&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;1&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;].&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;split&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;&#39;:&#39;&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;    length &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;float&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;tokens&lt;font color=&quot;#990000&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;0&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;])&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;*&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;3600&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;+&lt;/font&gt; &lt;br /&gt;              &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;float&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;tokens&lt;font color=&quot;#990000&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;1&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;])&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;*&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;60&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;+&lt;/font&gt;&lt;br /&gt;              &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;float&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;tokens&lt;font color=&quot;#990000&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;2&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;])&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;if&lt;/font&gt;&lt;/b&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;len&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;tokens&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;&amp;gt;&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;2&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;else&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#993399&quot;&gt;0&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;))&lt;/font&gt;&lt;br /&gt;    audiobr &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;float&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;sys&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;argv&lt;font color=&quot;#990000&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;2&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;])&lt;/font&gt;&lt;br /&gt;    audiosize &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;bitrate2bytes&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;audiobr&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; length&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;    targetsize &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;float&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;sys&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;argv&lt;font color=&quot;#990000&quot;&gt;[&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;3&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;])&lt;/font&gt;&lt;br /&gt;    tsize &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; targetsize &lt;font color=&quot;#990000&quot;&gt;*&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;1024&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;*&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;1024&lt;/font&gt;&lt;br /&gt;    overhead &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;0.7&lt;/font&gt;&lt;br /&gt;    bitrate &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;calcbr&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;tsize&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; audiosize&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; length&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; overhead&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;    &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;print&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#FF0000&quot;&gt;&#39;bitrate: %f\n&#39;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;%&lt;/font&gt; bitrate&lt;br /&gt;    &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;return&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#993399&quot;&gt;0&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;if&lt;/font&gt;&lt;/b&gt; __name__ &lt;font color=&quot;#990000&quot;&gt;==&lt;/font&gt; &lt;font color=&quot;#FF0000&quot;&gt;&#39;__main__&#39;&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;:&lt;/font&gt;&lt;br /&gt;    sys&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;exit&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;main&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;())&lt;/font&gt;&lt;br /&gt;&lt;/tt&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/1990928247347081766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/04/dvd-backup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/1990928247347081766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/1990928247347081766'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/04/dvd-backup.html' title='DVD Backup'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-2500118845932275571</id><published>2012-03-30T05:17:00.000-07:00</published><updated>2012-03-30T05:17:00.452-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dvd"/><category scheme="http://www.blogger.com/atom/ns#" term="multimedia"/><title type='text'>DVD Playback: The Missing Package</title><content type='html'>This took a while to figure out: I had all sorts of weird errors while trying to play a DVD on my laptop, until I did this:&lt;pre&gt;aptitude install libdvdcss2&lt;/pre&gt;(requires the &lt;a href=&quot;http://www.debian-multimedia.org/&quot;&gt;Debian Multimedia&lt;/a&gt; package repository).</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/2500118845932275571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/03/dvd-playback-missing-package.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/2500118845932275571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/2500118845932275571'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/03/dvd-playback-missing-package.html' title='DVD Playback: The Missing Package'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-556880013178735804</id><published>2012-03-23T04:00:00.000-07:00</published><updated>2012-03-23T04:00:11.698-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="firewall"/><category scheme="http://www.blogger.com/atom/ns#" term="remote access"/><category scheme="http://www.blogger.com/atom/ns#" term="sshd"/><title type='text'>Digging Tunnels: socat</title><content type='html'>When &lt;a href=&quot;http://machine-cycle.blogspot.com/2011/01/digging-tunnels-part-1.html&quot;&gt;digging tunnels&lt;/a&gt;, an alternative for &lt;code&gt;stunnel&lt;/code&gt; on the client side is &lt;a href=&quot;http://packages.debian.org/search?keywords=socat&quot;&gt;&lt;code&gt;socat&lt;/code&gt;&lt;/a&gt;. Here&#39;s how to use it in &lt;code&gt;~/.ssh/config&lt;/code&gt;:&lt;pre&gt;Host tunnel.example.com&lt;br /&gt;  Port 443&lt;br /&gt;  ProxyCommand socat - OPENSSL:%h:%p,verify=0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/556880013178735804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/03/digging-tunnels-socat.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/556880013178735804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/556880013178735804'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/03/digging-tunnels-socat.html' title='Digging Tunnels: socat'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-8141270464193958935</id><published>2012-03-16T14:59:00.000-07:00</published><updated>2012-09-02T04:25:17.057-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="one-liner"/><title type='text'>One Liner: Increase the Size of /tmp</title><content type='html'>The temporary space on &lt;code&gt;/tmp&lt;/code&gt; may not be enough for some programs. The following command will re-size it to 2GB, without destroying any existing files:&lt;pre&gt;mount -t tmpfs tmpfs /tmp -o size=2000M,mode=1777,remount&lt;/pre&gt;(source: &lt;a href=&quot;http://wiki.linuxquestions.org/wiki/Tmpfs&quot;&gt;http://wiki.linuxquestions.org/wiki/Tmpfs&lt;/a&gt;). &lt;br /&gt;&lt;br /&gt;If you find yourself doing this often then you have at least two options:&lt;ol&gt;&lt;li&gt;either add a suitable line for &lt;code&gt;/tmp&lt;/code&gt; in &lt;code&gt;/etc/fstab&lt;/code&gt;:&lt;pre&gt;none /tmp tmpfs size=2000M,mode=1777 0 0&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;or avoid using &lt;a href=&quot;http://en.wikipedia.org/wiki/Tmpfs&quot;&gt;&lt;code&gt;tmpfs&lt;/code&gt;&lt;/a&gt; entirely, by modifying &lt;code&gt;/etc/default/rcS&lt;/code&gt; like this:&lt;pre&gt;RAMTMP=no&lt;/pre&gt;(not recommended: may impact both security and performance)&lt;/li&gt;&lt;/ol&gt;the changes will take effect after you reboot.&lt;br /&gt;&lt;br /&gt;[02 Sep 2012] &lt;b&gt;UPDATE:&lt;/b&gt; just noticed that &lt;code&gt;RAMTMP=no&lt;/code&gt; is now the default setting, again, and that it is set in &lt;code&gt;/etc/deafult/tmpfs&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/8141270464193958935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/03/one-liner-increase-size-of-tmp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/8141270464193958935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/8141270464193958935'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/03/one-liner-increase-size-of-tmp.html' title='One Liner: Increase the Size of /tmp'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-2469474684572304947</id><published>2012-03-09T03:10:00.000-08:00</published><updated>2012-04-01T03:04:42.751-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="debian"/><category scheme="http://www.blogger.com/atom/ns#" term="games"/><title type='text'>Install Quake and Quake3 on Debian Linux</title><content type='html'>A long time ago, in a galaxy far away, I was an avid &lt;a href=&quot;http://www.idsoftware.com/games/quake/quake&quot;&gt;Quake&lt;/a&gt;, and later on &lt;a href=&quot;http://www.idsoftware.com/games/quake/quake2&quot;&gt;Quake2&lt;/a&gt; and &lt;a href=&quot;http://www.idsoftware.com/games/quake/quake3-arena&quot;&gt;Quake3&lt;/a&gt; player and &lt;a href=&quot;http://www.atomicgamer.com/zungbang/&quot;&gt;modder&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;I seem to be getting old: I find myself reminiscing about all sorts of stuff, and Quake is one of my favorite subjects. In one of these nostalgia attacks I decided to relive the fun and install the games on my Linux laptop. I still have all the relevant CD-ROMs, so all that&#39;s needed is a suitable game engine. &lt;a href=&quot;http://packages.debian.org/search?keywords=quake&quot;&gt;Quake and Quake3&lt;/a&gt; are packaged in Debian, but &lt;a href=&quot;http://wiki.debian.org/Games/Quake2&quot;&gt;Quake2 is not packaged&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here&#39;s how to install Quake, with both &lt;a href=&quot;http://www.idsoftware.com/games/quake/quake-mp1&quot;&gt;mission&lt;/a&gt; &lt;a href=&quot;http://www.idsoftware.com/games/quake/quake-mp2&quot;&gt;packs&lt;/a&gt;:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;install the game engine:&lt;pre&gt;aptitude install quake&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;mount the game CD-ROM (e.g. on &lt;code&gt;/media/cdrom0&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;change directory to a temporary directory&lt;/li&gt;&lt;li&gt;package the game data:&lt;pre&gt;game-data-packager quake -m /media/cdrom0&lt;/pre&gt;&lt;li&gt;repeat the process for both mission packs, i.e. mount the relevant CD-ROM and then issue these commands:&lt;pre&gt;game-data-packager quake -mp1 /media/cdrom0&lt;/pre&gt;for the SOA mission pack, and&lt;pre&gt;game-data-packager quake -mp2 /media/cdrom0&lt;/pre&gt;for the DOE mission pack&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;install the generated packages (as &lt;code&gt;root&lt;/code&gt;):&lt;pre&gt;dpkg -i quake-registered_29_all.deb&lt;br /&gt;dpkg -i quake-armagon_29_all.deb&lt;br /&gt;dpkg -i quake-dissolution_29_all.deb&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/ol&gt;And here&#39;s how to install Quake3:&lt;ol&gt;&lt;li&gt;install the game engine:&lt;pre&gt;aptitude install quake3&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;download the latest point release:&lt;pre&gt;cd ~/Downloads&lt;br /&gt;wget -c ftp://ftp.idsoftware.com/idstuff/quake3/linux/linuxq3apoint-1.32b-3.x86.run&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;mount the game CD-ROM (e.g. on &lt;code&gt;/media/cdrom0&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;change directory to a temporary directory&lt;/li&gt;&lt;li&gt;package the game data:&lt;pre&gt;game-data-packager quake3 /media/cdrom0 ~/Downloads/linuxq3apoint-1.32b-3.x86.run&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;install the generated package (as &lt;code&gt;root&lt;/code&gt;):&lt;pre&gt;dpkg -i quake3-data_29_all.deb&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Happy fragging!&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/2469474684572304947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/03/install-quake-and-quake3-on-debian.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/2469474684572304947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/2469474684572304947'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/03/install-quake-and-quake3-on-debian.html' title='Install Quake and Quake3 on Debian Linux'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-8617573855241495381</id><published>2012-03-02T04:50:00.000-08:00</published><updated>2012-03-02T04:50:00.715-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="boot"/><category scheme="http://www.blogger.com/atom/ns#" term="disk"/><category scheme="http://www.blogger.com/atom/ns#" term="hardware"/><category scheme="http://www.blogger.com/atom/ns#" term="upgrade"/><category scheme="http://www.blogger.com/atom/ns#" term="usb"/><title type='text'>Scripting a Simple Boot Time State Machine in GRUB2</title><content type='html'>There&#39;s a hardware compatibility issue between my laptop&#39;s on-board nVidia nForce4 antiquated and buggy SATA interface and the modern Western Digital hard disk that I&#39;ve installed in it.&lt;br /&gt;&lt;br /&gt;The hard disk seems to disappear in mid-boot - this can happen anytime it is being re-detected: when BIOS transfers control to the boot loader (either GRUB2 or the Windows Boot Loader), and when the initial kernel image (loaded by the boot loader) re-initializes the SATA controller. If the system comes up, then any power management event may cause the disk to disappear. Sometimes, the disk just disappears for no obvious reason. The kernel&#39;s &lt;code&gt;libata&lt;/code&gt; error handling routines may manage to reestablish connection to the disk, but sometimes it does not come up and I have to power cycle the laptop.&lt;br /&gt;&lt;br /&gt;None of the solutions/workarounds I tried did the trick: apart for the stuff I already mentioned, I added &lt;code&gt;rootdelay=10&lt;/code&gt; to the kernel command line, hoping that the extra delay would give &lt;code&gt;libata&lt;/code&gt; a better chance of re-detecting the disk; I even installed the &lt;a href=&quot;http://packages.debian.org/search?keywords=watchdog&quot;&gt;&lt;code&gt;watchdog&lt;/code&gt;&lt;/a&gt; daemon, to get my laptop to reboot when it freezes, but either it doesn&#39;t really work, or (most likely) I don&#39;t understand how to configure it.&lt;br /&gt;&lt;br /&gt;The last ditch workaround I came up with, was to boot the laptop into GRUB2 from a USB disk-on-key, thus avoiding the internal hard disk altogether, and have GRUB2 perform the following steps:&lt;ol&gt;&lt;li&gt;check if boot related files on the internal hard disk are accessible&lt;/li&gt;&lt;li&gt;if any file is not accessible then reboot&lt;/li&gt;&lt;li&gt;if all files are accessible, then if this is the first success then reboot&lt;/li&gt;&lt;li&gt;if this is the second success then boot GRUB2 on the internal hard disk&lt;/li&gt;&lt;/ol&gt;This procedure captures the sequence of steps that seems to get my box to boot - it&#39;s Voodoo, I know, but it does work (most of the time).&lt;br /&gt;&lt;br /&gt;The script (&lt;code&gt;boot/grub/grub.cfg&lt;/code&gt;) below implements this procedure. It uses &lt;code&gt;get_env&lt;/code&gt; and &lt;code&gt;save_env&lt;/code&gt; to keep a persistent state (the variable &lt;code&gt;need_reboot&lt;/code&gt;) between reboots. The first few lines make sure that the state is properly initialized, even if the environment variables were not saved yet (i.e. if this is the first ever boot from this device).&lt;br /&gt;&lt;br /&gt;The fact that one can control the boot process this way is pretty neat, in my opinion. The only trouble is that even with this, my system still fails to boot - albeit less frequently than before.&lt;br /&gt;&lt;br /&gt;I must admit defeat. The laptop is usable now, but, in my eyes, just barely. The whole experience made me itch for a new PC, but with my luck being what it is, I fear that it won&#39;t be a much easier ride. So, for now, I&#39;ve resigned myself to my fate, until I gather up the courage (and cash) to tackle a new box.&lt;br /&gt;&lt;br /&gt;&lt;!-- Generator: GNU source-highlight 3.1.6 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --&gt;&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;set&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;need_reboot&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;&quot;yes&quot;&lt;/font&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;if&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#990000&quot;&gt;[&lt;/font&gt; -s &lt;font color=&quot;#009900&quot;&gt;$prefix&lt;/font&gt;/grubenv &lt;font color=&quot;#990000&quot;&gt;];&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;then&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;  load_env&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;fi&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;insmod part_msdos&lt;br /&gt;insmod ext2&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;set&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;root&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;&#39;(hd0,msdos1)&#39;&lt;/font&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;set&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;reboot_delay&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;5&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;insmod ntfs&lt;br /&gt;insmod vbe&lt;br /&gt;insmod vga&lt;br /&gt;insmod video_bochs&lt;br /&gt;insmod video_cirrus&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;function wait_and_reboot &lt;/font&gt;&lt;/b&gt;{&lt;br /&gt;  echo &lt;font color=&quot;#FF0000&quot;&gt;&quot;Reboot in ${reboot_delay} seconds ...&quot;&lt;/font&gt;&lt;br /&gt;  &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;if&lt;/font&gt;&lt;/b&gt; sleep --interruptible &lt;font color=&quot;#009900&quot;&gt;${reboot_delay}&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;then&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;    reboot&lt;br /&gt;  &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;fi&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;function find_or_die &lt;/font&gt;&lt;/b&gt;{&lt;br /&gt;  &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;if&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#990000&quot;&gt;[&lt;/font&gt; -e &lt;font color=&quot;#009900&quot;&gt;$1&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;];&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;then&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;    echo &lt;font color=&quot;#FF0000&quot;&gt;&quot;$1 found&quot;&lt;/font&gt;&lt;br /&gt;  &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;else&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;    echo &lt;font color=&quot;#FF0000&quot;&gt;&quot;$1 NOT found!&quot;&lt;/font&gt;&lt;br /&gt;    wait_and_reboot&lt;br /&gt;  &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;fi&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;set&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;menu_color_normal&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;cyan/blue&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;set&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;menu_color_highlight&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;white/blue&lt;br /&gt;&lt;br /&gt;find_or_die &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;hd1&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt;msdos1&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;/Boot/BCD&lt;br /&gt;find_or_die &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;hd1&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt;msdos2&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;/config&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;sys&lt;br /&gt;find_or_die &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;hd1&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt;msdos5&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;/boot/grub/grub&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;cfg&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;if&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#990000&quot;&gt;[&lt;/font&gt; -z &lt;font color=&quot;#FF0000&quot;&gt;&quot;${need_reboot}&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;];&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;then&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;     &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;set&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;need_reboot&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;&quot;yes&quot;&lt;/font&gt;&lt;br /&gt;     save_env need_reboot&lt;br /&gt;  &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;else&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;     &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;set&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;need_reboot&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;br /&gt;     save_env need_reboot&lt;br /&gt;     wait_and_reboot&lt;br /&gt;  &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;fi&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;fi&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;set&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;timeout&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;30&lt;/font&gt;&lt;br /&gt;menuentry &lt;font color=&quot;#FF0000&quot;&gt;&quot;GRUB on internal hard disk&quot;&lt;/font&gt; {&lt;br /&gt;        &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;set&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;root&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;&#39;(hd1)&#39;&lt;/font&gt;&lt;br /&gt;        drivemap -s &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;hd0&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;hd1&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;        chainloader &lt;font color=&quot;#990000&quot;&gt;+&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;1&lt;/font&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/tt&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/8617573855241495381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/03/scripting-simple-boot-time-state.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/8617573855241495381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/8617573855241495381'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/03/scripting-simple-boot-time-state.html' title='Scripting a Simple Boot Time State Machine in GRUB2'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-3956266070612308171</id><published>2012-02-24T07:19:00.000-08:00</published><updated>2012-02-24T07:19:00.064-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="boot"/><category scheme="http://www.blogger.com/atom/ns#" term="disk"/><category scheme="http://www.blogger.com/atom/ns#" term="hardware"/><category scheme="http://www.blogger.com/atom/ns#" term="kernel"/><category scheme="http://www.blogger.com/atom/ns#" term="upgrade"/><title type='text'>Forcing SATA Speed Limit to 1.5Gbps</title><content type='html'>Recap: I&#39;ve upgraded the hard disk on my laptop, &lt;a href=&quot;http://machine-cycle.blogspot.com/2012/02/clean-install-of-windows-7-with-upgrade.html&quot;&gt;installed Win7 Ultimate&lt;/a&gt; on it from upgrade media, &lt;a href=&quot;http://machine-cycle.blogspot.com/2012/02/dual-boot-windows-7-and-debian-gnulinux.html&quot;&gt;installed Debian GNU/Linux&lt;/a&gt; to a another partition on the same disk, and configured the Windows Boot Loader for dual boot. I was very pleased. It all seemed to work well, except for a small &lt;a href=&quot;http://machine-cycle.blogspot.com/2012/02/hard-disk-problems-disabling-spindown.html&quot;&gt;power management issue&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;I got busy installing all the stuff I needed on both operating systems, setting up printers and other hardware, configuring mount points, network shares, backup, ssh, etc. All in all, this took a few days, during which the new disk withstood a lot of read/write operations (gigabytes at a time). Most of this work was rather boring.&lt;br /&gt;&lt;br /&gt;And then, following one of many reboots, the Windows Boot Loader failed to start:&lt;br /&gt;&lt;pre&gt;Windows failed to start. A recent hardware or software change might be the cause. To fix the problem:&lt;br /&gt;&lt;br /&gt;    1. Insert your Windows installation disc and restart your computer.&lt;br /&gt;    2. Choose your language settings, then click &quot;Next.&quot;&lt;br /&gt;    3. Click &quot;Repair your computer.&quot;&lt;br /&gt;&lt;br /&gt;If you do not have this disc, contact your system administrator or computer manufacturer for assistance.&lt;br /&gt;&lt;br /&gt;    File: \Boot\BCD&lt;br /&gt;    Status: 0xc000000e&lt;br /&gt;    Info: An error occurred while attempting to read the boot configuration data.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ENTER=Continue&lt;/pre&gt;My first reaction was panic. My next reaction was to power cycle the laptop. It came up just fine: Windows seemed to work OK, and another reboot confirmed that the Linux partition was alive too.&lt;br /&gt;&lt;br /&gt;I wasn&#39;t pleased anymore.&lt;br /&gt;&lt;br /&gt;I searched for that error code, and found a lot of complaints, and a lot of &quot;solutions&quot; - but in most cases the error was permanent, and a reboot did not make it go away. This was a bad sign, but I had very little to work on, so I let it go.&lt;br /&gt;&lt;br /&gt;Two days later Debian suddenly hard-locked on me. After power-cycling the box I was not able to find any error message in any of the log files.&lt;br /&gt;&lt;br /&gt;And a few days after that, Debian failed to boot, dropping me into a limited shell, claiming that the boot device was missing.&lt;br /&gt;&lt;br /&gt;After yet another Windows Boot Loader failure, I used &lt;code&gt;grub-install&lt;/code&gt; to replace it with GRUB2, in the slim hope that it would fix the problem. Even if this wouldn&#39;t fix the problem, at least I&#39;d be able to inspect the system when it fails, from within the GRUB2 shell.&lt;br /&gt;&lt;br /&gt;GRUB2 did not fix anything: the laptop would still occasionally fail to boot - either GRUB2 would fail to find its own files, or the kernel would start but later on fail to find the root device.&lt;br /&gt;&lt;br /&gt;During all that time, when my laptop was up and running, it would occasionally freeze for brief, but noticeable, periods of time. It took me a while to realize that this was not a case of a slow-to-load website, or icedove just taking its sweet time starting up - these hiccups were correlated with messages like the following being logged to &lt;code&gt;/var/log/kern.log&lt;/code&gt;:&lt;br /&gt;&lt;pre&gt;ata3: ATA_REG 0x40 ERR_REG 0x0&lt;br /&gt;ata3: tag : dhfis dmafis sdbfis sactive &lt;br /&gt;ata3: tag 0x0: 1 1 0 1  &lt;br /&gt;ata3.00: exception Emask 0x0 SAct 0x1ff SErr 0x0 action 0x6 frozen&lt;br /&gt;ata3.00: failed command: WRITE FPDMA QUEUED&lt;br /&gt;ata3.00: cmd 61/08:00:00:f8:4d/00:00:0c:00:00/40 tag 0 ncq 4096 out&lt;br /&gt;         res 40/00:00:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)&lt;br /&gt;ata3.00: status: { DRDY }&lt;br /&gt;ata3.00: failed command: WRITE FPDMA QUEUED&lt;br /&gt;ata3.00: cmd 61/08:08:18:f8:4d/00:00:0c:00:00/40 tag 1 ncq 4096 out&lt;br /&gt;         res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;ata3.00: status: { DRDY }&lt;br /&gt;ata3: hard resetting link&lt;br /&gt;ata3: nv: skipping hardreset on occupied port&lt;br /&gt;ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)&lt;br /&gt;ata3.00: configured for UDMA/133&lt;br /&gt;ata3.00: device reported invalid CHS sector 0&lt;br /&gt;ata3.00: device reported invalid CHS sector 0&lt;br /&gt;ata3.00: device reported invalid CHS sector 0&lt;br /&gt;ata3.00: device reported invalid CHS sector 0 &lt;br /&gt;ata3.00: device reported invalid CHS sector 0 &lt;br /&gt;ata3.00: device reported invalid CHS sector 0&lt;br /&gt;ata3.00: device reported invalid CHS sector 0&lt;br /&gt;ata3.00: device reported invalid CHS sector 0&lt;br /&gt;ata3.00: device reported invalid CHS sector 0&lt;br /&gt;ata3: EH complete&lt;br /&gt;&lt;/pre&gt;At first glance it seemed to me that the hard disk was failing. I subjected it to a slew of tests (&lt;a href=&quot;http://manpages.debian.net/cgi-bin/man.cgi?query=fsck&quot;&gt;&lt;code&gt;fsck&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;http://packages.debian.org/search?keywords=smartmontools&quot;&gt;smartmontools&lt;/a&gt;, &lt;a href=&quot;http://hddguru.com/software/2005.10.02-MHDD/&quot;&gt;MHDD&lt;/a&gt;), and in all of them the disk was found to be in excellent shape. &lt;br /&gt;&lt;br /&gt;The next suspect in line was the on-board SATA controller. The laptop&#39;s mobo is based on the nVidia&#39;s nForce4 430 (MCP51) chipset. &lt;a href=&quot;http://en.wikipedia.org/wiki/NForce4&quot;&gt;Wikipedia&lt;/a&gt; has this to say about it:&lt;blockquote&gt;There have also been data corruption issues associated with certain SATA 3 Gbit/s hard drives.&lt;/blockquote&gt;The suggestion provided by many online, is to somehow force SATA speed to 1.5Gbps. However, as far as I can tell, there&#39;s no BIOS settings on this laptop to do that, and the disk itself cannot be forced either (no jumpers).&lt;br /&gt;&lt;br /&gt;After some more research I found that the SATA speed can be forced on the kernel command-line:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;modify &lt;code&gt;/etc/default/grub&lt;/code&gt;:&lt;pre&gt;GRUB_CMDLINE_LINUX=&quot;libata.force=1.5Gbps&quot;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;run &lt;code&gt;update-grub&lt;/code&gt; as &lt;code&gt;root&lt;/code&gt;&lt;/li&gt;&lt;li&gt;reboot&lt;/li&gt;&lt;/ol&gt;This cannot solve early boot problems, but I was hoping that it would at least prevent the lockups and hiccups.&lt;br /&gt;&lt;br /&gt;Unfortunately, this did not work as expected - here&#39;s what I get in the logs:&lt;br /&gt;&lt;pre&gt;ata3: FORCE: PHY spd limit set to 1.5Gbps&lt;br /&gt;ata3: SATA max UDMA/133 cmd 0x30c0 ctl 0x30b4 bmdma 0x3090 irq 23&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)&lt;br /&gt;&lt;/pre&gt;The kernel reports its intention to force the SATA controller to 1.5Gbps, but the link comes up at 3.0Gbps regardless. Sh*t.&lt;br /&gt;&lt;br /&gt;I still had another trick up my sleeve, but I&#39;ve run out of steam here, so you&#39;ll have to wait for my next post.&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/3956266070612308171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/02/forcing-sata-speed-limit-to-15gbps.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/3956266070612308171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/3956266070612308171'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/02/forcing-sata-speed-limit-to-15gbps.html' title='Forcing SATA Speed Limit to 1.5Gbps'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-6186819319470172485</id><published>2012-02-17T02:00:00.000-08:00</published><updated>2012-02-17T05:06:59.235-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="debian"/><category scheme="http://www.blogger.com/atom/ns#" term="hardware"/><category scheme="http://www.blogger.com/atom/ns#" term="upgrade"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Hard Disk Problems: Disabling Spindown</title><content type='html'>So I managed to upgrade my laptop&#39;s hard disk, and setup a dual-boot system with &lt;a href=&quot;http://machine-cycle.blogspot.com/2012/02/clean-install-of-windows-7-with-upgrade.html&quot;&gt;Windows 7 Ultimate&lt;/a&gt; and &lt;a href=&quot;http://machine-cycle.blogspot.com/2012/02/dual-boot-windows-7-and-debian-gnulinux.html&quot;&gt;Debian/testing&lt;/a&gt;. It all seemed to be working just fine. I was pleased, and mildly surprised. It didn&#39;t last long, though.&lt;br /&gt;&lt;br /&gt;The first sign of trouble was that my laptop would not come out of sleep mode (&quot;suspend&quot;) - and this happened on both Windows and Linux. My theory, at the time, was that the antiquated SATA interface on my machine, and the new hard-disk&#39;s aggressive power management features, do not play well together. The common wisdom on the Net is that one has to prevent the OS from spinning down the hard disk when it goes to sleep.&lt;br /&gt;&lt;br /&gt;Doing that on Windows 7 is left as an exercise to the reader. Linux, on the other hand, earns its reputation fair and square as a time-waster. You should add the following incantation to &lt;code&gt;/etc/hdparm.conf&lt;/code&gt;:&lt;pre&gt;&lt;font color=&quot;red&quot;&gt;/dev/sda&lt;/font&gt; {&lt;br /&gt;        apm = 254&lt;br /&gt;        spindown_time = 0&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;(where &lt;code&gt;/dev/sda&lt;/code&gt; is the block device pointing to the hard-disk in question), and then restart &lt;code&gt;hdparm&lt;/code&gt; (as &lt;code&gt;root&lt;/code&gt;):&lt;pre&gt;invoke-rc.d hdparm restart&lt;/pre&gt;The only trouble with this, is that it only works for the first time the system goes to sleep, and on the second time the system hangs again. This is caused by a long standing wishlist-bug in &lt;code&gt;hdparm&lt;/code&gt; (see &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/hdparm/+bug/199094&quot;&gt;Ubuntu bug #199094&lt;/a&gt; and &lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=510676&quot;&gt;Debian bug #510676&lt;/a&gt;), with a published fix, that has not been applied for some reason. Basically, most &lt;code&gt;hdparm&lt;/code&gt; settings are lost upon resuming from suspend.&lt;br /&gt;&lt;br /&gt;The fix is to create the a script &lt;code&gt;/etc/pm/sleep.d/20hdparm&lt;/code&gt;, with the following contents:&lt;pre&gt;#!/bin/sh&lt;br /&gt;# This script reinitializes the hard disk settings on resume.                                                                              &lt;br /&gt;&lt;br /&gt;case $1 in&lt;br /&gt;  resume|thaw)&lt;br /&gt;    /usr/sbin/invoke-rc.d hdparm start &gt;/dev/null&lt;br /&gt;    ;;&lt;br /&gt;  suspend|hibernate)&lt;br /&gt;    # Not needed                                                                                                                           &lt;br /&gt;    ;;&lt;br /&gt;esac&lt;br /&gt;&lt;/pre&gt;But even with this, I ended up completely disabling sleep/hibernation because I couldn&#39;t get the box to come out of hibernation, and I had some more hard disk trouble.&lt;br /&gt;&lt;br /&gt;Stay tuned...&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/6186819319470172485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/02/hard-disk-problems-disabling-spindown.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/6186819319470172485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/6186819319470172485'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/02/hard-disk-problems-disabling-spindown.html' title='Hard Disk Problems: Disabling Spindown'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-8769124315958918879</id><published>2012-02-10T14:09:00.000-08:00</published><updated>2012-02-10T14:09:01.263-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="boot"/><category scheme="http://www.blogger.com/atom/ns#" term="debian"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Dual Boot Windows 7 and Debian GNU/Linux</title><content type='html'>&lt;a href=&quot;http://machine-cycle.blogspot.com/2012/02/clean-install-of-windows-7-with-upgrade.html&quot;&gt;Previously on Machine-Cycle&lt;/a&gt;: your thrill-seeking host has decided to upgrade his laptop and setup a dual boot system, and has managed to install a vanilla Windows 7 Ultimate on a new clean hard disk, from upgrade media.&lt;br /&gt;&lt;br /&gt;Onward and forward: time to install Debian and make this box useful.&lt;br /&gt;&lt;br /&gt;I researched this step a bit and decided to use Windows&#39; own boot manager to manage the selection of operating systems at boot time, so as to minimize the risk of somehow trashing the Windows 7 installation. I did, eventually, replace Windows boot manager with GRUB2, and it worked out just fine. I switched to GRUB2 because it allowed me to debug some hardware issues that cropped up later, but I&#39;ll leave that for a future post. &lt;br /&gt;&lt;ol&gt;&lt;li&gt;download the Debian/testing &lt;a href=&quot;http://www.debian.org/devel/debian-installer/&quot;&gt;netinst ISO image&lt;/a&gt; and burn it to a CD&lt;/li&gt;&lt;li&gt;boot Debian Installer from CD&lt;/li&gt;&lt;li&gt;select graphical install&lt;/li&gt;&lt;li&gt;select manual partitioning: you should now see the list of existing disk partitions - the first, smaller, NTFS partition belongs to the Windows 7 boot manager, and should not be touched; the second, large, NTFS partition is the one we need to shrink, in order to fit in Debian&lt;/li&gt;&lt;li&gt;resize the second NTFS partition listed to, say, 33 percent of the hard-drive&#39;s total size (this will take a while)&lt;/li&gt;&lt;li&gt;select the remaining empty partition and install Debian into it (this will take a while)&lt;/li&gt;&lt;li&gt;when prompted to install GRUB: you can let the Debian Installer perform its magic for you, and it should just work; &lt;b&gt;otherwise&lt;/b&gt;, in order to keep the Windows boot manager: DO NOT install GRUB on the first partition (named, most likely, &lt;code&gt;/dev/sda1&lt;/code&gt;), install grub on the new partition (&lt;code&gt;/dev/sda3&lt;/code&gt;)&lt;/li&gt;&lt;li&gt;complete the installation - note that you will not be able to boot into Debian just yet&lt;/li&gt;&lt;li&gt;Windows will run a disk check upon reboot, and it should then start normally&lt;/li&gt;&lt;li&gt;boot the system into a live CD/USB (&lt;a href=&quot;http://grml.org/&quot;&gt;Grml&lt;/a&gt; is a good choice) and copy the contents of the &lt;code&gt;/dev/sda3&lt;/code&gt; boot sector to a file on the second partition (mounted, for example, on &lt;code&gt;/mnt/sda2&lt;/code&gt;):&lt;pre&gt;dd if=/dev/sda3 of=/mnt/sda2/debian.bin bs=512 count=1&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;reboot into Windows&lt;/li&gt;&lt;li&gt;open Command Prompt as administrator&lt;/li&gt;&lt;li&gt;add a new entry to the boot manager&#39;s menu:&lt;pre&gt;bcdedit /create /d &quot;Debian GNU/Linux&quot; /application BOOTSECTOR&lt;/pre&gt;this command returns the numeric ID of the new menu entry, which is used in the following steps&lt;/li&gt;&lt;li&gt;configure the new menu entry to boot &lt;code&gt;C:\debian.bin&lt;/code&gt;, make it the last entry in the menu, and configure the menu to timeout after 30 seconds:&lt;pre&gt;bcdedit /set {ID} device partition=C:&lt;br /&gt;bcdedit /set {ID}  path \debian.bin&lt;br /&gt;bcdedit /displayorder {ID} /addlast&lt;br /&gt;bcdedit /timeout 30&lt;/pre&gt;&lt;/li&gt;(read more about &lt;code&gt;bcdedit&lt;/code&gt; on &lt;a href=&quot;http://technet.microsoft.com/en-us/library/cc709667%28WS.10%29.aspx&quot;&gt;this&lt;/a&gt; Microsoft TechNet article)&lt;/li&gt;&lt;li&gt;you should now be able to select, upon reboot, to boot into either Windows 7 or Debian GNU/Linux&lt;/li&gt;&lt;/ol&gt;Going both ways ain&#39;t that simple.&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/8769124315958918879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/02/dual-boot-windows-7-and-debian-gnulinux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/8769124315958918879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/8769124315958918879'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/02/dual-boot-windows-7-and-debian-gnulinux.html' title='Dual Boot Windows 7 and Debian GNU/Linux'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-2514373110008020896</id><published>2012-02-03T08:56:00.000-08:00</published><updated>2012-02-03T08:56:00.728-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="upgrade"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Clean Install of Windows 7 with Upgrade Media</title><content type='html'>A few weeks ago I made a decision. I decided to upgrade my crappy HP Pavilion dv6000 laptop. Yup, you&#39;re quite right - that was a mistake.&lt;br /&gt;&lt;br /&gt;My plan was to replace the laptop&#39;s internal 60GB hard-drive with a shiny new &lt;a href=&quot;http://wdc.com/en/products/products.aspx?id=140&quot;&gt;320GB Western Digital 3.5&#39;&#39; hard-drive&lt;/a&gt;, and then setup a dual boot system with Windows 7 and Debian GNU/Linux. &lt;br /&gt;&lt;br /&gt;After some research, I concluded that the safest way to setup a dual boot system would be to first install a vanilla Windows 7 system, check that it works right, and only then complicate matters by installing Debian.&lt;br /&gt;&lt;br /&gt;Now, about a year and half ago, my wife purchased MS Office 2010 through her workplace, at a considerable discount. It came bundled with a Windows 7 Ultimate upgrade installation media, which remained lying in some drawer ever since, gathering dust. I was really itching to use it.&lt;br /&gt;&lt;br /&gt;But scratching that itch required me to solve two problems: a legal one (am I allowed to do this?) and a technical one: according to the installation instructions, and unlike previous versions, the Windows 7 upgrade installer seems to require a working OS to already be installed on the target system. The prospect of first installing Windows XP and then upgrading to Windows 7, did not appeal to me one bit. A quick search provided me with a &lt;a href=&quot;http://www.winsupersite.com/article/windows-7/clean-install-windows-7-with-upgrade-media-128512&quot;&gt;way out&lt;/a&gt; of this - I&#39;d still need to perform a &quot;double-install&quot;, but of Windows 7 only:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;when prompted by the Windows 7 installer, select a &quot;custom&quot; install - do &lt;b&gt;not&lt;/b&gt;, at any time, enter any code, activate, or update the OS&lt;/li&gt;&lt;li&gt;reboot when instructed to do so&lt;/li&gt;&lt;li&gt;re-install from the same installation media, but this time &quot;upgrade&quot; the existing installation, and again, do &lt;b&gt;not&lt;/b&gt; enter any code, activate, or update the OS&lt;/li&gt;&lt;li&gt;reboot when instructed to do so&lt;/li&gt;&lt;li&gt;activate the OS using the activation key provided with the installation media&lt;/li&gt;&lt;li&gt;update the OS&lt;/li&gt;&lt;/ol&gt;and it seems that it&#39;s perfectly legal, as long as you do own a full version of an older Microsoft OS.&lt;br /&gt;&lt;br /&gt;To be continued...&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/2514373110008020896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/02/clean-install-of-windows-7-with-upgrade.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/2514373110008020896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/2514373110008020896'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/02/clean-install-of-windows-7-with-upgrade.html' title='Clean Install of Windows 7 with Upgrade Media'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-2584403080053587727</id><published>2012-01-27T03:57:00.000-08:00</published><updated>2012-01-27T03:57:00.044-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="debian"/><category scheme="http://www.blogger.com/atom/ns#" term="firewall"/><category scheme="http://www.blogger.com/atom/ns#" term="remote access"/><category scheme="http://www.blogger.com/atom/ns#" term="sshd"/><title type='text'>Digging Tunnels: Connection Problem on Debian</title><content type='html'>If you follow the instructions on my first &lt;a href=&quot;http://machine-cycle.blogspot.com/2011/01/digging-tunnels-part-1.html&quot;&gt;&quot;Digging Tunnels&quot;&lt;/a&gt; post, to setup &lt;code&gt;ssh&lt;/code&gt; tunneling over SSL with &lt;code&gt;stunnel&lt;/code&gt;, then you may find that you can&#39;t access your Debian box from another Debian box. I got the following error:&lt;pre&gt;SSL_accept: 1408F10B: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number&lt;/pre&gt;&lt;br /&gt;The fix (found on &lt;a href=&quot;http://serverfault.com/questions/303090/stunnel-wont-work-with-sslv3-from-some-hosts&quot;&gt;&lt;code&gt;serverfault.com&lt;/code&gt;&lt;/a&gt;) is to make sure you have the following in lines in &lt;code&gt;/etc/stunnel/stunnel.conf&lt;/code&gt;:&lt;pre&gt;sslVersion = all&lt;br /&gt;options = NO_SSLv2&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/2584403080053587727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/01/digging-tunnels-connection-problem-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/2584403080053587727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/2584403080053587727'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/01/digging-tunnels-connection-problem-on.html' title='Digging Tunnels: Connection Problem on Debian'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-7093362360951637491</id><published>2012-01-20T07:09:00.000-08:00</published><updated>2012-01-20T07:09:00.558-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="boot"/><category scheme="http://www.blogger.com/atom/ns#" term="floppy"/><category scheme="http://www.blogger.com/atom/ns#" term="grml"/><category scheme="http://www.blogger.com/atom/ns#" term="live-hdd"/><title type='text'>Boot Floppy and ISO Images with GRUB2 on Debian</title><content type='html'>I&#39;ve once described my &lt;a href=&quot;http://machine-cycle.blogspot.com/2009/09/boot-pc-from-floppy-image-w-grub2-and.html&quot;&gt;setup&lt;/a&gt; for booting floppy disk images. That setup works rather nicely, but there&#39;s a better &lt;a href=&quot;http://michael-prokop.at/blog/2011/01/07/booting-iso-images-from-within-grub2/&quot;&gt;way&lt;/a&gt; of doing this on &lt;a href=&quot;http://packages.debian.org/search?keywords=grub-imageboot&quot;&gt;Debian&lt;/a&gt;:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;install &lt;code&gt;grub-imageboot&lt;/code&gt;:&lt;pre&gt;aptitude install grub-imageboot&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;put all image files you want to be able to boot in &lt;code&gt;/boot/images&lt;/code&gt;&lt;/li&gt;&lt;li&gt;run (as &lt;code&gt;root&lt;/code&gt;): &lt;pre&gt;update-grub&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;and that&#39;s it!&lt;br /&gt;&lt;br /&gt;&lt;code&gt;grub-imageboot&lt;/code&gt; performs the same task as my original setup, in much the same way, but it also &lt;b&gt;supports ISO images&lt;/b&gt;, is easier to install and &lt;i&gt;much&lt;/i&gt; easier to uninstall.&lt;br /&gt;&lt;br /&gt;A related tool, from the same authors (the fine &lt;a href=&quot;http://grml.org/&quot;&gt;Grml&lt;/a&gt; team) is &lt;a href=&quot;http://packages.debian.org/search?keywords=grml-rescueboot&quot;&gt;&lt;code&gt;grml-rescueboot&lt;/code&gt;&lt;/a&gt;, which lets you boot into a Grml rescue system from Grml ISO images placed in &lt;code&gt;/boot/grml&lt;/code&gt;.</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/7093362360951637491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/01/boot-floppy-and-iso-images-with-grub2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/7093362360951637491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/7093362360951637491'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/01/boot-floppy-and-iso-images-with-grub2.html' title='Boot Floppy and ISO Images with GRUB2 on Debian'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-2926027008522386787</id><published>2012-01-12T09:01:00.000-08:00</published><updated>2012-01-12T09:01:00.322-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="multimedia"/><category scheme="http://www.blogger.com/atom/ns#" term="udev"/><category scheme="http://www.blogger.com/atom/ns#" term="usb"/><title type='text'>Stuttering Video Playback Due To USB Device Reset</title><content type='html'>My kids don&#39;t usually complain when they&#39;re watching a movie on my PC, if video playback stutters. It seems that as long as playback resumes in a second or less, they don&#39;t mind the interruptions. I guess they&#39;ve learned that if they do complain, chances are that they&#39;ll have to wait several long minutes, until their OCD inflicted dad &quot;fixes&quot; the problem.&lt;br /&gt;&lt;br /&gt;I hate it when video playback stutters. So much so that I usually first download whatever video I want to watch and then watch it offline. Which is why I am a &lt;a href=&quot;http://code.google.com/p/get-flash-videos/&quot;&gt;get-flash-videos&lt;/a&gt; fanboy.&lt;br /&gt;&lt;br /&gt;But last time we were hit with such a problem, our lame ISP was not the culprit. This time, the video source was a backup ISO image of some DVD, stored on an external hard disk, connected to a Debian box (my old, headless laptop) over USB, accessed via SAMBA over a wireless connection, and played back on my WinXP laptop. The hiccups were rather noticeable, even by my lag-tolerant kids, to the point that they complained about it. &lt;br /&gt;&lt;br /&gt;At first, it seemed that debugging this would be a daunting task - there are just so many factors involved. But I got lucky - I tried playing that same DVD image on my wife&#39;s laptop, over a wired network connection, and was hit  by the same playback hiccups. This ruled out most of the suspects except for my old Debian laptop.&lt;br /&gt;&lt;br /&gt;And yet, I had no idea what to look for now, especially because I can&#39;t just playback video on my old laptop - it&#39;s screen is busted... So I just browsed for any suspicious message in the output of &lt;code&gt;dmesg&lt;/code&gt; - and found the following message, repeated several times:&lt;br /&gt;&lt;pre&gt;&quot;reset high speed USB device using ehci_hcd and address 3&quot;&lt;/pre&gt;&lt;br /&gt;These messages seemed very relevant, and a quick search brought me to several &lt;a href=&quot;http://gordonazmo.wordpress.com/2010/08/26/reset-high-speed-usb-device-using-ehci_hcd-and-address-3-your-syslog-and-what-fixed-it-for-me/&quot;&gt;blog posts&lt;/a&gt;, &lt;a href=&quot;http://www.linuxquestions.org/questions/slackware-14/usb-external-hd-issue-reset-high-speed-usb-device-using-ehci_hcd-545519/&quot;&gt;forum&lt;/a&gt; &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=1338541&quot;&gt;threads&lt;/a&gt; and &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/88746&quot;&gt;bug reports&lt;/a&gt;.&lt;br /&gt;I tried one the solutions/workarounds suggested on those links:&lt;br /&gt;&lt;pre&gt;echo 128 &amp;gt; /sys/block/sdc/device/max_sectors&lt;/pre&gt;and it actually did the trick and made the hiccups go away.&lt;br /&gt;&lt;br /&gt;The next challenge was to make this happen on system start-up. The Right Thing™ to do would have been to modify &lt;code&gt;/etc/sysctl.conf&lt;/code&gt;, but there&#39;s always the chance that the relevant block device would be renamed, e.g. when another external disk drive is attached. So I ended up adding the following line line to &lt;code&gt;/etc/init.d/bootmisc.sh&lt;/code&gt;:&lt;br /&gt;&lt;pre&gt;echo 128 &amp;gt; /sys/block/$(readlink -f &lt;span style=&quot;color: red;&quot;&gt;/dev/data&lt;/span&gt; | sed -e &#39;s/1//g&#39; -e &#39;s/\/dev\///g&#39;)/device/max_sectors&lt;/pre&gt;where &lt;code&gt;&lt;span style=&quot;color: red;&quot;&gt;/dev/data&lt;/span&gt;&lt;/code&gt; is a symbolic link that points to this block device, which is generated with an appropriate &lt;a href=&quot;http://machine-cycle.blogspot.com/search/label/udev&quot;&gt;UDEV&lt;/a&gt; rule.</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/2926027008522386787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2012/01/stuttering-video-playback-due-to-usb.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/2926027008522386787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/2926027008522386787'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2012/01/stuttering-video-playback-due-to-usb.html' title='Stuttering Video Playback Due To USB Device Reset'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-4460043001969127091</id><published>2011-10-18T13:44:00.000-07:00</published><updated>2011-10-18T13:44:39.239-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="debian"/><category scheme="http://www.blogger.com/atom/ns#" term="undbx"/><title type='text'>UnDBX in Debian!</title><content type='html'>&lt;a href=&quot;http://code.google.com/p/undbx/&quot;&gt;UnDBX&lt;/a&gt; is now officially &lt;a href=&quot;http://packages.qa.debian.org/u/undbx.html&quot;&gt;packaged&lt;/a&gt; in &lt;a href=&quot;http://www.debian.org&quot;&gt;Debian&lt;/a&gt;!</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/4460043001969127091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2011/10/undbx-in-debian.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/4460043001969127091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/4460043001969127091'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2011/10/undbx-in-debian.html' title='UnDBX in Debian!'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-3329060195630242088</id><published>2011-07-29T13:28:00.000-07:00</published><updated>2011-07-29T13:28:00.700-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="podcasts"/><title type='text'>Configuring hpodder To Handle Compressed Podcast Feeds</title><content type='html'>My &lt;a href=&quot;http://europe.nokia.com/find-products/devices/nokia-2730-classic&quot;&gt;Nokia 2730 classic&lt;/a&gt; &lt;a href=&quot;http://www.urbandictionary.com/define.php?term=dumbphone&quot;&gt;dumbphone&lt;/a&gt; is surprisingly smart. Unbeknownst to me at the time of purchase, was the fact that it has a 2GB MicroSD card, and can play MP3 files. But eventually I did stumble upon this feature and it wasn&#39;t too long before I started tuning in on &lt;a href=&quot;http://en.wikipedia.org/wiki/Podcast&quot;&gt;podcasts&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I use &lt;a href=&quot;https://github.com/jgoerzen/hpodder/wiki&quot;&gt;&lt;code&gt;hpodder&lt;/code&gt;&lt;/a&gt; (launched from a &lt;a href=&quot;http://en.wikipedia.org/wiki/Cron&quot;&gt;cron&lt;/a&gt; job) to follow podcast feeds and download episodes to my computer, and a semi-scripted procedure to move these files to my phone&#39;s memory card over a USB connection.&lt;br /&gt;&lt;br /&gt;Lately, &lt;code&gt;hpodder&lt;/code&gt; started complaining:&lt;pre wrap&gt;*** 12: Failure parsing feed: Lexical error in  file http://escapepod.org/feed/  at line 1 col 1:&lt;br /&gt;  unrecognised token: ^_\213^H^@&lt;/pre&gt;So I tried to download the feed manually:&lt;pre wrap&gt;$ curl http://escapepod.org/feed/&lt;/pre&gt;and the terminal filled up with gibberish to the point that I had to blindly type &lt;code&gt;reset&lt;/code&gt; in order to fix it.&lt;br /&gt;&lt;br /&gt;That was weird: after all, the feed is nothing more than an XML file - a text file, which should be perfectly readable with the naked eye.&lt;br /&gt;&lt;br /&gt;I saved the feed with&lt;pre wrap&gt;$ curl -o feed.bin http://escapepod.org/feed/&lt;/pre&gt;and then determined its type:&lt;pre wrap&gt;$ file -b -i feed.bin&lt;br /&gt;application/x-gzip; charset=binary&lt;br /&gt;$ zcat feed.bin | file -b -i - &lt;br /&gt;application/xml; charset=utf-8&lt;/pre&gt;I.e. a GZIP compressed XML file.&lt;br /&gt;&lt;br /&gt;So &lt;code&gt;hpodder&lt;/code&gt; choked on a compressed feed. &lt;br /&gt;&lt;br /&gt;I consulted the &lt;a href=&quot;http://jgoerzen.github.com/hpodder/hpodder.pdf&quot;&gt;manual&lt;/a&gt; and found out that &lt;code&gt;hpodder&lt;/code&gt; delegates downloads to &lt;a href=&quot;http://curl.haxx.se/&quot;&gt;cURL&lt;/a&gt;. I skimmed through the cURL &lt;a href=&quot;http://manpages.debian.net/cgi-bin/man.cgi?query=curl&quot;&gt;manpage&lt;/a&gt;, found about the &lt;code&gt;--compressed&lt;/code&gt; command line option, tried the download again - and got the uncompressed XML contents. Hoozah!&lt;br /&gt;&lt;br /&gt;Apparently, the server, that&#39;s serving that particular feed, is mis-configured to always compress its replies, even if not specifically asked to do it. The &lt;code&gt;--compressed&lt;/code&gt; command line options tells cURL to request the server to compress its replies, and cURL decompresses them.&lt;br /&gt;&lt;br /&gt;I tried downloading other feeds with the &lt;code&gt;--compressed&lt;/code&gt; added, and it worked fine. So either this option is supported by all the other servers on my list of feeds, or that cURL does nothing when the reply is not compressed. I dunno.&lt;br /&gt;&lt;br /&gt;All that I needed now was a way to convince &lt;code&gt;hpodder&lt;/code&gt; to launch cURL the same way.&lt;br /&gt;&lt;br /&gt;Turns out that &lt;code&gt;hpodder&lt;/code&gt; is a rather nice piece of software (and rather well documented too). The &lt;code&gt;hpodder&lt;/code&gt; manual pointed me to &lt;code&gt;~/.hpodder/curlrc&lt;/code&gt;:&lt;pre wrap&gt;$ echo compressed &gt;&gt; ~/.hpodder/curlrc&lt;br /&gt;&lt;/pre&gt;and now &lt;code&gt;hpodder&lt;/code&gt; works like a charm again (and probably faster than before, because it always asks for compressed replies).</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/3329060195630242088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2011/07/configuring-hpodder-to-handle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/3329060195630242088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/3329060195630242088'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2011/07/configuring-hpodder-to-handle.html' title='Configuring hpodder To Handle Compressed Podcast Feeds'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-1294185261893033294</id><published>2011-07-22T09:20:00.000-07:00</published><updated>2011-07-22T09:20:01.047-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="work"/><title type='text'>Cloning a GitHub GIT Repository on Ubuntu 8.04 LTS</title><content type='html'>At work, we&#39;re still running &lt;a href=&quot;http://releases.ubuntu.com/8.04/&quot;&gt;Ubuntu 8.04 LTS&lt;/a&gt; on most PCs with Linux. Most of the time the age of the operating system isn&#39;t a problem - but sometimes it can be a pain. Case in point: cloning a &lt;a href=&quot;http://git-scm.com/&quot;&gt;GIT&lt;/a&gt; repository hosted on &lt;a href=&quot;https://github.com/&quot;&gt;GitHub&lt;/a&gt;. This used to work just fine, until they switched to HTTPS:&lt;pre&gt;$ git clone https://github.com/user/repo.git&lt;br /&gt;Initialized empty Git repository in /current/directory/repo/.git/&lt;br /&gt;Cannot get remote repository information.&lt;br /&gt;Perhaps git-update-server-info needs to be run there?&lt;br /&gt;&lt;/pre&gt;When this first happened, I shrugged it off as a problem with the remote end, and just downloaded a source tarball from &lt;code&gt;https://github.com/user/repo/tarball/master&lt;/code&gt;. But a few weeks later I got this error again with a different repository, and got annoyed. I tried the same command at home (Debian/testing, GIT version 1.7.5.4):&lt;pre&gt;$ git clone https://github.com/user/repo.git&lt;br /&gt;Cloning into repo...&lt;br /&gt;remote: Counting objects: 81, done.&lt;br /&gt;remote: Compressing objects: 100% (72/72), done.&lt;br /&gt;remote: Total 81 (delta 34), reused 55 (delta 8)&lt;br /&gt;Unpacking objects: 100% (81/81), done.&lt;br /&gt;&lt;/pre&gt;So, this is a problem with either GIT at work, or the Net connection. I downloaded the GIT source tarball and installed it locally in my account (at &lt;code&gt;~/local&lt;/code&gt;):&lt;pre&gt;wget -c http://kernel.org/pub/software/scm/git/git-1.7.6.tar.bz2&lt;br /&gt;tar xvjf git-1.7.6.tar.bz2&lt;br /&gt;cd git-1.7.6&lt;br /&gt;ls&lt;br /&gt;./configure --prefix=$HOME/local&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;/pre&gt;and since we&#39;re using &lt;a href=&quot;http://www.tcsh.org&quot;&gt;&lt;code&gt;tcsh&lt;/code&gt;&lt;/a&gt; at work (don&#39;t ask), I also had to type &lt;code&gt;rehash&lt;/code&gt; in order to convince the shell to use the newly installed GIT.&lt;br /&gt;&lt;br /&gt;Here&#39;s what I got this time:&lt;pre WRAP&gt;$ git clone https://github.com/user/repo.git&lt;br /&gt;Cloning into repo...&lt;br /&gt;error: SSL certificate problem, verify that the CA cert is OK. Details:&lt;br /&gt;error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/user/repo.git/info/refs&lt;br /&gt;&lt;br /&gt;fatal: HTTP request failed&lt;br /&gt;&lt;/pre&gt;... which is useful: Google directed me to a &lt;a href=&quot;http://stackoverflow.com/questions/3777075/https-github-access&quot;&gt;question&lt;/a&gt; on Stack-Overflow. Most of the answers there deal with installing &lt;a href=&quot;http://en.wikipedia.org/wiki/Certificate_authority&quot;&gt;CA certificates&lt;/a&gt;, but the following trick works nicely with git version 1.5.4.3 on Ubuntu 8.04.4 LTS:&lt;pre WRAP&gt;$ env &lt;font color=&quot;red&quot;&gt;GIT_SSL_NO_VERIFY=true&lt;/font&gt; git clone https://github.com/user/repo.git&lt;br /&gt;Cloning into repo...&lt;br /&gt;remote: Counting objects: 81, done.&lt;br /&gt;remote: Compressing objects: 100% (72/72), done.&lt;br /&gt;remote: Total 81 (delta 34), reused 55 (delta 8)&lt;br /&gt;Unpacking objects: 100% (81/81), done.&lt;br /&gt;&lt;/pre&gt;(no need for &lt;code&gt;env&lt;/code&gt; in &lt;a href=&quot;http://www.gnu.org/s/bash/&quot;&gt;&lt;code&gt;bash&lt;/code&gt;&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;And while we&#39;re at it, here&#39;s another trick that might be handy in the future:&lt;pre wrap&gt;$ env &lt;font color=&quot;red&quot;&gt;GIT_CURL_VERBOSE=1&lt;/font&gt; git clone https://github.com/user/repo.git&lt;br /&gt;Cloning into repo...&lt;br /&gt;* Couldn&#39;t find host github.com in the .netrc file, using defaults&lt;br /&gt;* About to connect() to github.com port 443 (#0)&lt;br /&gt;*   Trying 207.97.227.239... * Connected to github.com (207.97.227.239) port 443 (#0)&lt;br /&gt;* successfully set certificate verify locations:&lt;br /&gt;*   CAfile: /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;  CApath: none&lt;br /&gt;* SSL certificate problem, verify that the CA cert is OK. Details:&lt;br /&gt;error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed&lt;br /&gt;* Expire cleared&lt;br /&gt;* Connection #0 to host github.com left intact&lt;br /&gt;* Couldn&#39;t find host github.com in the .netrc file, using defaults&lt;br /&gt;* Connection #0 seems to be dead!&lt;br /&gt;* Closing connection #0&lt;br /&gt;* About to connect() to github.com port 443 (#0)&lt;br /&gt;*   Trying 207.97.227.239... * Connected to github.com (207.97.227.239) port 443 (#0)&lt;br /&gt;* successfully set certificate verify locations:&lt;br /&gt;*   CAfile: /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;  CApath: none&lt;br /&gt;* SSL certificate problem, verify that the CA cert is OK. Details:&lt;br /&gt;error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed&lt;br /&gt;* Expire cleared&lt;br /&gt;* Connection #0 to host github.com left intact&lt;br /&gt;error: SSL certificate problem, verify that the CA cert is OK. Details:&lt;br /&gt;error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/user/repo.git/info/refs&lt;br /&gt;&lt;br /&gt;fatal: HTTP request failed&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/1294185261893033294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2011/07/cloning-github-git-repository-on-ubuntu.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/1294185261893033294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/1294185261893033294'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2011/07/cloning-github-git-repository-on-ubuntu.html' title='Cloning a GitHub GIT Repository on Ubuntu 8.04 LTS'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-1791989252544109488</id><published>2011-04-29T09:36:00.000-07:00</published><updated>2011-04-29T09:36:00.190-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="backup"/><category scheme="http://www.blogger.com/atom/ns#" term="blog"/><title type='text'>Backup a Blogger Blog - Revisited</title><content type='html'>I recently found out that the method I used to &lt;a href=&quot;http://machine-cycle.blogspot.com/2009/01/backup-blogger-blog.html&quot;&gt;backup this blog&lt;/a&gt; automatically, has stopped working. It all hinged on the observation that one can retrieve a single web page with the full text of all the posts of a given Blogger blog, by retrieving the link &lt;pre&gt;http://&lt;font color=&quot;red&quot;&gt;blogname&lt;/font&gt;.blogspot.com/search?max-results=&lt;font color=&quot;red&quot;&gt;N&lt;/font&gt;&lt;/pre&gt;with a large enough &lt;code&gt;N&lt;/code&gt;, e.g. 10000. This is not true anymore - at the moment I can only retrieve the latest 42 posts on this blog, from a total of 178. &lt;br /&gt;&lt;br /&gt;I&#39;m not sure when this method stopped working, or, for that matter, if it ever really worked. The fact remains, however, that I have a blog that I want to backup, so I spent the better part of an evening figuring out how to properly do this.&lt;br /&gt;&lt;br /&gt;My new Blogger blog backup script, shown below, makes use of the Google Data services API to export and download the blog archive in XML format, and then extracts from it the links of all the posts, and mirrors these pages locally, with &lt;a href=&quot;http://www.httrack.com/&quot;&gt;HTTrack&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;!-- Generator: GNU source-highlight 3.1.4 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --&gt;&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;&lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;#! /bin/bash&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color=&quot;#009900&quot;&gt;BLOGGER_EMAIL&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;user@gmail&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;com&lt;br /&gt;&lt;font color=&quot;#009900&quot;&gt;BLOGGER_PASSWD&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;password&lt;br /&gt;&lt;font color=&quot;#009900&quot;&gt;BLOGGER_BLOGID&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;000000000000000000&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#009900&quot;&gt;BLOGGER_BLOG&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;blogname&lt;br /&gt;&lt;br /&gt;&lt;font color=&quot;#009900&quot;&gt;DEST_DIR&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;/path/to/backup/directory&lt;font color=&quot;#990000&quot;&gt;/&lt;/font&gt;&lt;br /&gt;mkdir -p &lt;font color=&quot;#009900&quot;&gt;${DEST_DIR}&lt;/font&gt;&lt;br /&gt;cd &lt;font color=&quot;#009900&quot;&gt;${DEST_DIR}&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;eval&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;$(&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    curl -s &lt;font color=&quot;#FF0000&quot;&gt;&quot;https://www.google.com/accounts/ClientLogin&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    --data-urlencode &lt;font color=&quot;#009900&quot;&gt;Email&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;$BLOGGER_EMAIL&lt;/font&gt; --data-urlencode &lt;font color=&quot;#009900&quot;&gt;Passwd&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;$BLOGGER_PASSWD&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -d &lt;font color=&quot;#009900&quot;&gt;accountType&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;GOOGLE &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -d &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;source&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;MachineCycle-cURL-BlogBackup &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -d &lt;font color=&quot;#009900&quot;&gt;service&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;blogger &lt;font color=&quot;#990000&quot;&gt;|&lt;/font&gt; grep &lt;font color=&quot;#FF0000&quot;&gt;&#39;Auth=&#39;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;curl -s &lt;font color=&quot;#FF0000&quot;&gt;&quot;http://www.blogger.com/feeds/$BLOGGER_BLOGID/archive&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    --header &lt;font color=&quot;#FF0000&quot;&gt;&quot;Authorization: GoogleLogin auth=$Auth&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    --header &lt;font color=&quot;#FF0000&quot;&gt;&quot;GData-Version: 2&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    &lt;font color=&quot;#990000&quot;&gt;|&lt;/font&gt; xml_pp &lt;font color=&quot;#990000&quot;&gt;&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;${BLOGGER_BLOG}&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;blogspot&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;com&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;archive&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;xml&lt;br /&gt;&lt;br /&gt;grep -o -e &lt;font color=&quot;#FF0000&quot;&gt;&#39;&amp;lt;link href=&quot;http://&#39;&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;$BLOGGER_BLOG&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;&#39;.blogspot.com/..../[^&lt;/font&gt;&lt;font color=&quot;#CC33CC&quot;&gt;\.&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;]*.html&quot; rel=&quot;alternate&quot; title=&#39;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    &lt;font color=&quot;#009900&quot;&gt;${BLOGGER_BLOG}&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;blogspot&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;com&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;archive&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;xml &lt;font color=&quot;#990000&quot;&gt;|&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    sed -e &lt;font color=&quot;#FF0000&quot;&gt;&#39;s@.link href=&quot;@@g&#39;&lt;/font&gt; -e &lt;font color=&quot;#FF0000&quot;&gt;&#39;s@&quot; rel=&quot;alternate&quot; title=@@g&#39;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;|&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    sort -ur &lt;font color=&quot;#990000&quot;&gt;&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;${BLOGGER_BLOG}&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;links&lt;br /&gt;&lt;br /&gt;mkdir -p &lt;font color=&quot;#009900&quot;&gt;${BLOGGER_BLOG}&lt;/font&gt;&lt;br /&gt;cd &lt;font color=&quot;#009900&quot;&gt;${BLOGGER_BLOG}&lt;/font&gt;&lt;br /&gt;httrack &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -&lt;font color=&quot;#990000&quot;&gt;%&lt;/font&gt;v0 &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -&lt;font color=&quot;#990000&quot;&gt;%&lt;/font&gt;e0 &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -X&lt;font color=&quot;#993399&quot;&gt;0&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    --verbose &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    --update &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -&lt;font color=&quot;#990000&quot;&gt;%&lt;/font&gt;L &lt;font color=&quot;#990000&quot;&gt;../&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;${BLOGGER_BLOG}&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;links &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -&lt;font color=&quot;#FF0000&quot;&gt;&quot;http://${BLOGGER_BLOG}.blogspot.com/&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -&lt;font color=&quot;#FF0000&quot;&gt;&quot;${BLOGGER_BLOG}.blogspot.com/*widgetType=BlogArchive*&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -&lt;font color=&quot;#FF0000&quot;&gt;&quot;${BLOGGER_BLOG}.blogspot.com/search*&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -&lt;font color=&quot;#FF0000&quot;&gt;&quot;${BLOGGER_BLOG}.blogspot.com/*_archive.html*&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -&lt;font color=&quot;#FF0000&quot;&gt;&quot;${BLOGGER_BLOG}.blogspot.com/feeds/*&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    -&lt;font color=&quot;#FF0000&quot;&gt;&quot;${BLOGGER_BLOG}.blogspot.com/*.html?showComment=*&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    &lt;font color=&quot;#990000&quot;&gt;+&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;&quot;*.gif&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    &lt;font color=&quot;#990000&quot;&gt;+&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;&quot;*.jpg&quot;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;\&lt;/font&gt;&lt;br /&gt;    &lt;font color=&quot;#990000&quot;&gt;+&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;&quot;*.png&quot;&lt;/font&gt;&lt;br /&gt;&lt;/tt&gt;&lt;/pre&gt;A few comments are in order:&lt;ol&gt;&lt;li&gt;the script contains the Blogger username and password - keep it safe!&lt;/li&gt;&lt;li&gt;the blog id is the number that appears in the URL of most links accessible from the Blogger dashboard, after the &lt;code&gt;blogID=&lt;/code&gt; part&lt;/li&gt;&lt;li&gt;the XML blog archive may later be used to restore/migrate the blog&lt;/li&gt;&lt;li&gt;local mirroring isn&#39;t really necessary - I just like it that I can view the blog contents offline&lt;/li&gt;&lt;li&gt;another unnecessary step: I use &lt;a href=&quot;http://packages.debian.org/search?keywords=xml-twig-tools&quot;&gt;&lt;code&gt;xml_pp&lt;/code&gt;&lt;/a&gt; to beautify the exported XML file&lt;/li&gt;&lt;li&gt;currently, the script performs no error checking - I may add some checks if and when I observe failures&lt;/li&gt;&lt;li&gt;sources: &lt;a href=&quot;http://code.google.com/intl/iw/apis/gdata/articles/using_cURL.html&quot;&gt;Using cURL to interact with Google Data services&lt;/a&gt;, &lt;a href=&quot;http://code.google.com/intl/iw/apis/blogger/docs/2.0/developers_guide_protocol.html#ExportFormat&quot;&gt;Blogger export format&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/1791989252544109488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2011/04/backup-blogger-blog-revisited.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/1791989252544109488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/1791989252544109488'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2011/04/backup-blogger-blog-revisited.html' title='Backup a Blogger Blog - Revisited'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-6961768272011614613</id><published>2011-04-15T02:34:00.000-07:00</published><updated>2011-11-05T23:51:41.054-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="multimedia"/><title type='text'>Fixing Normalize Audio Feature in K3b</title><content type='html'>I usually burn and copy optical media with &lt;a href=&quot;http://k3b.plainblack.com/&quot;&gt;K3b&lt;/a&gt;. I don&#39;t do this often, but when I do, it usually just works. Except when it doesn&#39;t.&lt;br /&gt;&lt;br /&gt;My wife asked me to create an audio CD for her, from an assortment of audio tracks she collected from various sources. It was easy enough to accomplish this with K3b. But the resulting audio CD was annoying to listen to, because I had to change the volume setting for each track.&lt;br /&gt;&lt;br /&gt;It&#39;s a classic noob&#39;s mistake: I should&#39;ve enabled &lt;a href=&quot;http://en.wikipedia.org/wiki/Audio_normalization&quot;&gt;audio normalization&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So I tried it again, but found that I couldn&#39;t enable audio normalization in K3b. Turns out that K3b uses an external application (called - surprise! - &lt;tt&gt;normalize-audio&lt;/tt&gt;) to perform this task, and K3b just couldn&#39;t find it - a fact that was clearly (?) stated in the programs section of the K3b settings dialog.&lt;br /&gt;&lt;br /&gt;I tried launching &lt;tt&gt;normalize-audio&lt;/tt&gt; at the command line, and it seemed to be installed alright. A quick Net search brought me to Debian bug &lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597155&quot;&gt;#597155&lt;/a&gt; and Ubuntu bug &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/k3b/+bug/45026&quot;&gt;#45026&lt;/a&gt;. The root cause of the problem is that &lt;tt&gt;normalize-audio&lt;/tt&gt; reports its version number as &lt;pre&gt;normalize 0.7.7&lt;/pre&gt;while K3b expects &lt;pre&gt;normalize-audio 0.7.7&lt;/pre&gt;&lt;br /&gt;This can be fixed either in K3b or in &lt;tt&gt;normalize-audio&lt;/tt&gt;, and patches for both sides have already been posted. But neither has been incorporated yet. In the meantime, I&#39;ve implemented a workaround, based on suggestions in those bug reports:&lt;ol&gt;&lt;li&gt;create (as root) an executable script named &lt;tt&gt;normalize-audio&lt;/tt&gt; under &lt;tt&gt;/usr/local/bin/&lt;/tt&gt; with the following contents:&lt;!-- Generator: GNU source-highlight 3.1.4 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --&gt;&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;&lt;i&gt;&lt;font color=&quot;#9A1900&quot;&gt;#!/bin/bash&lt;/font&gt;&lt;/i&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;case&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#FF0000&quot;&gt;&quot;$1&quot;&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;in&lt;/font&gt;&lt;/b&gt;    &lt;br /&gt;    --version&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;        /usr/bin/normalize-audio --version &lt;font color=&quot;#990000&quot;&gt;|&lt;/font&gt; sed -e &lt;font color=&quot;#FF0000&quot;&gt;&#39;s/normalize/normalize-audio/g&#39;&lt;/font&gt;&lt;br /&gt;        &lt;font color=&quot;#990000&quot;&gt;;;&lt;/font&gt;&lt;br /&gt;    &lt;font color=&quot;#990000&quot;&gt;*)&lt;/font&gt;&lt;br /&gt;        /usr/bin/normalize-audio &lt;font color=&quot;#009900&quot;&gt;&quot;$@&quot;&lt;/font&gt;&lt;br /&gt;        &lt;font color=&quot;#990000&quot;&gt;;;&lt;/font&gt;&lt;br /&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;esac&lt;/font&gt;&lt;/b&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;make this script executable:&lt;pre&gt;chmod a+x /usr/local/bin/normalize-audio&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;this script is supposed to be used as a wrapper for &lt;tt&gt;normalize-audio&lt;/tt&gt;, so make sure that &lt;tt&gt;/usr/local/bin/&lt;/tt&gt; appears in the &lt;tt&gt;PATH&lt;/tt&gt; environment variable, and that it comes before &lt;tt&gt;/usr/bin&lt;/tt&gt;&lt;/li&gt;&lt;li&gt;launch K3b from a new command shell - it should now detect &lt;tt&gt;normalize-audio&lt;/tt&gt; and allow you to use it&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Time to &lt;a href=&quot;http://vimeo.com/3685071&quot;&gt;Burn&lt;/a&gt;! &lt;br /&gt;[05 Nov 2011] &lt;b&gt;UPDATE:&lt;/b&gt; fixed script to work with file names/paths that contain spaces (Thanks anonymous commenter!)</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/6961768272011614613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2011/04/fixing-normalize-audio-feature-in-k3b.html#comment-form' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/6961768272011614613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/6961768272011614613'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2011/04/fixing-normalize-audio-feature-in-k3b.html' title='Fixing Normalize Audio Feature in K3b'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-114606936034056679</id><published>2011-03-18T07:48:00.000-07:00</published><updated>2011-03-18T07:48:00.083-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hardware"/><category scheme="http://www.blogger.com/atom/ns#" term="screen"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Setting Default Laptop Screen Brightness when Running on Battery Power</title><content type='html'>A few weeks ago the screen of my &quot;new&quot; laptop (read: my wife&#39;s old WinXP laptop) started flickering.&lt;br /&gt;&lt;br /&gt;It was almost imperceptible at first, but it got worse over time, to the point that the screen would, at random intervals, suddenly dim gradually and then brighten back, for a second or so. &lt;br /&gt;&lt;br /&gt;I suspected that the laptop screen was failing. The prospect of having another &lt;a href=&quot;http://machine-cycle.blogspot.com/2010/04/busted-laptop.html&quot;&gt;headless laptop&lt;/a&gt; made me anxious. But after a while I noticed that whenever the screen brightness flickered, a battery icon would show up momentarily in the system tray.&lt;br /&gt;&lt;br /&gt;So I came up with a theory: it may be some kind of a power supply problem that causes the laptop, for very brief periods of time, to think that it is disconnected from the mains power, causing it to switch to battery power, which, in turn, causes the OS to lower the screen brightness in order to reduce power consumption.&lt;br /&gt;&lt;br /&gt;This theory seemed plausible, but with the warranty long-since expired, and without spare parts (power cord, power supply, battery, motherboard, etc.), my only option was to let it go. After all, other than this issue, the laptop seemed to be as functional as it can be.&lt;br /&gt;&lt;br /&gt;The flickering, however, made me crazy, so I searched for a way to prevent Windows from automatically darkening the screen when the laptop is switched to battery power.&lt;br /&gt;&lt;br /&gt;Well, it&#39;s easy, but it ain&#39;t obvious:&lt;ol&gt;&lt;li&gt;disconnect the laptop from the mains power - the screen dims&lt;/li&gt;&lt;li&gt;use the screen brightness controls to brighten the display back to the same brightness level when the mains power is connected&lt;/li&gt;&lt;li&gt;reconnect the mains power&lt;/li&gt;&lt;/ol&gt;That&#39;s it - I kid you not.&lt;br /&gt;&lt;br /&gt;A few days ago the laptop switched to battery power and stayed there. I took a little chance and purchased a replacement AC adapter over at eBay. Surprisingly enough, that was it. Happy Happy Joy Joy.</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/114606936034056679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2011/03/setting-default-laptop-screen.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/114606936034056679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/114606936034056679'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2011/03/setting-default-laptop-screen.html' title='Setting Default Laptop Screen Brightness when Running on Battery Power'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-9145956405004494896</id><published>2011-03-04T00:52:00.000-08:00</published><updated>2011-03-04T00:52:00.193-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="security"/><title type='text'>Getting Rid of rkhunter&#39;s False Warning about Xzibit Rootkit</title><content type='html'>I&#39;ve installed &lt;a href=&quot;http://packages.debian.org/search?keywords=rkhunter&amp;searchon=names&amp;suite=all&amp;section=all&quot;&gt;&lt;tt&gt;rkhunter&lt;/tt&gt;&lt;/a&gt; &lt;a href=&quot;http://machine-cycle.blogspot.com/2008/03/running-script-automatically-after.html&quot;&gt;a long while ago&lt;/a&gt;, mostly because it seemed irresponsible not to install some sort of &quot;protection&quot;. But, as is the case with any such tool, I started getting warnings, which, after I got over the induced anxiety attacks, were invariably confirmed as false positives.&lt;br /&gt;&lt;br /&gt;It was usually rather simple to silence these warnings from the &lt;tt&gt;rkhunter&lt;/tt&gt; configuration file &lt;tt&gt;/etc/rkhunter.conf&lt;/tt&gt; - most of the time it was just a matter of un-commenting one or more lines, and occasionally updating &lt;tt&gt;rkhunter&lt;/tt&gt;:&lt;pre&gt;rkhunter --propupd&lt;/pre&gt;(say, for instance, after upgrading packages).&lt;br /&gt;&lt;br /&gt;One false positive that was somewhat more complicated to disable was a warning about the Xzibit Rootkit. This warning is triggered by files containing the string &lt;tt&gt;hdparm&lt;/tt&gt; - it&#39;s a known bug (see Debian bug &lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576680&quot;&gt;#576680&lt;/a&gt;), and the workaround is to &quot;use the &lt;tt&gt;RTKT_FILE_WHITELIST&lt;/tt&gt; option to whitelist initscripts stating this string&quot; - e.g. &lt;tt&gt;/etc/init.d/hdparm&lt;/tt&gt; ...&lt;br /&gt;&lt;br /&gt;The comments in the configuration file, suggest that the proper method of whitelisting a file is to also add it to &lt;tt&gt;USER_FILEPROP_FILES_DIRS&lt;/tt&gt; and then update &lt;tt&gt;rkhunter&lt;/tt&gt;. But this makes &lt;tt&gt;rkhunter&lt;/tt&gt; complain that &lt;tt&gt;/etc/init.d/hdparm&lt;/tt&gt; is an executable script, so I had to also add it to &lt;tt&gt;SCRIPTWHITELIST&lt;/tt&gt;.&lt;br /&gt;&lt;br /&gt;Bottom line - add the following lines to &lt;tt&gt;/etc/rkhunter.conf&lt;/tt&gt;:&lt;pre&gt;USER_FILEPROP_FILES_DIRS=&quot;/etc/init.d/hdparm /etc/init.d/.depend.boot&quot;&lt;br /&gt;SCRIPTWHITELIST=/etc/init.d/hdparm&lt;br /&gt;RTKT_FILE_WHITELIST=&quot;/etc/init.d/hdparm /etc/init.d/.depend.boot&quot;&lt;br /&gt;&lt;/pre&gt;and the run&lt;pre&gt;rkhunter --propupd&lt;/pre&gt;Verify by running:&lt;pre&gt;rkhunter --check&lt;/pre&gt;I can only hope that I won&#39;t hit any false negatives...</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/9145956405004494896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2011/03/getting-rid-of-rkhunters-false-warning.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/9145956405004494896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/9145956405004494896'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2011/03/getting-rid-of-rkhunters-false-warning.html' title='Getting Rid of rkhunter&#39;s False Warning about Xzibit Rootkit'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-593663383710482559.post-6434596246991585919</id><published>2011-02-25T12:18:00.000-08:00</published><updated>2011-02-25T12:18:00.510-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="console"/><category scheme="http://www.blogger.com/atom/ns#" term="one-liner"/><category scheme="http://www.blogger.com/atom/ns#" term="syntax-highlight"/><title type='text'>One Liner: Pretty Print, Syntax Highlight and Page Online XML Data</title><content type='html'>Useful when leaching a bunch of video clips from YouTube:&lt;br /&gt;&lt;pre wrap=&quot;&quot;&gt;curl -s &lt;span style=&quot;color: red;&quot;&gt;&quot;http://gdata.youtube.com/feeds/api/playlists/916175AB005C0FB6&quot;&lt;/span&gt; | xml_pp | pygmentize -l xml | less -R&lt;/pre&gt;(required packages: &lt;a href=&quot;http://packages.debian.org/search?keywords=curl&quot;&gt;curl&lt;/a&gt;, &lt;a href=&quot;http://packages.debian.org/search?keywords=xml-twig-tools&quot;&gt;xml-twig-tools&lt;/a&gt;, &lt;a href=&quot;http://packages.debian.org/search?keywords=python-pygments&quot;&gt;python-pygments&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Actually, &lt;tt&gt;xml-pp&lt;/tt&gt; isn&#39;t really needed with YouTube - it can do the &lt;a href=&quot;http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html#prettyprintsp&quot;&gt;pretty-printing&lt;/a&gt; for you:&lt;pre wrap=&quot;&quot;&gt;curl -s &quot;http://gdata.youtube.com/feeds/api/playlists/916175AB005C0FB6&lt;span style=&quot;color: blue;&quot;&gt;?prettyprint=true&lt;/span&gt;&quot; | pygmentize -l xml | less -R&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://machine-cycle.blogspot.com/feeds/6434596246991585919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://machine-cycle.blogspot.com/2011/02/one-liner-pretty-print-syntax-highlight.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/6434596246991585919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/593663383710482559/posts/default/6434596246991585919'/><link rel='alternate' type='text/html' href='http://machine-cycle.blogspot.com/2011/02/one-liner-pretty-print-syntax-highlight.html' title='One Liner: Pretty Print, Syntax Highlight and Page Online XML Data'/><author><name>Zung!</name><uri>http://www.blogger.com/profile/07718442985309348694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://lh5.google.com/image/zungbang/RbfSJp67VwI/AAAAAAAAAAg/fOkC3QmzRcE/s288/cogs.jpg'/></author><thr:total>0</thr:total></entry></feed>