<?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: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-8435631682970808710</id><updated>2012-02-12T09:14:54.207-08:00</updated><category term='linux'/><category term='crash'/><category term='router'/><category term='hawks'/><category term='wgr614v9'/><category term='acpi'/><category term='s2ram'/><category term='birds'/><category term='uboot'/><category term='linkstation'/><category term='lspro'/><category term='bash'/><category term='gnome'/><category term='asterisk'/><category term='data loss'/><category term='hello world'/><category term='posix'/><category term='first post'/><category term='debian'/><category term='power'/><category term='ext4'/><category term='bashism'/><category term='jaunty'/><category term='squeeze'/><category term='ubuntu'/><category term='suspend'/><category term='firewall'/><category term='beginning'/><category term='desk icons'/><title type='text'>regelatwork</title><subtitle type='html'>Musing on being a Linux user and other assorted things.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://regelatwork.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://regelatwork.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rodrigo Chandia</name><uri>https://profiles.google.com/115325258544904758334</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-FlHnpBfFsnc/AAAAAAAAAAI/AAAAAAAADMk/pZAlEJ67cfY/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8435631682970808710.post-1716144006711144276</id><published>2012-02-12T09:14:00.000-08:00</published><updated>2012-02-12T09:14:54.221-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='squeeze'/><category scheme='http://www.blogger.com/atom/ns#' term='uboot'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='debian'/><category scheme='http://www.blogger.com/atom/ns#' term='lspro'/><category scheme='http://www.blogger.com/atom/ns#' term='linkstation'/><title type='text'>Recreating LSPRO fw_env.config</title><content type='html'>In the process of upgrading my LSPRO to Debian Squeeze I found that I had no &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;fw_env.config&lt;/span&gt;. That is, when I attempted to get the boot parameters I only got an error and bogus values:&lt;br /&gt;&lt;blockquote&gt;&lt;div style="font-family: 'Courier New', Courier, monospace;"&gt;# fw_printenv&lt;br /&gt;Cannot parse config file: No such file or directory&lt;/div&gt;&lt;/blockquote&gt;Bummer...&lt;br /&gt;&lt;br /&gt;As it happens, that file only contains the device, offset and length of the parameters in the flash memory. Also, there is a nice example already present in&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;quote&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/usr/share/doc/uboot-envtools/examples/&lt;/span&gt;&lt;/quote&gt;&lt;/blockquote&gt;but I found that one after I made my own &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;fw_env.config&lt;/span&gt; by hand.&lt;br /&gt;&lt;br /&gt;So, the easy way to fix it:&lt;br /&gt;&lt;blockquote&gt;&lt;div style="font-family: 'Courier New', Courier, monospace;"&gt;# cp /usr/share/doc/uboot-envtools/examples/linkstation_pro_live.config /etc/fw_env.config&lt;/div&gt;&lt;/blockquote&gt;Here is the hard-ish way I actually used.&amp;nbsp;Find the flash device info according to the kernel:&lt;br /&gt;&lt;blockquote&gt;&lt;div style="font-family: 'Courier New', Courier, monospace;"&gt;# cat /proc/mtd&lt;br /&gt;dev:    size   erasesize  name&lt;br /&gt;mtd0: 00040000 00001000 "phys_mapped_flash"&lt;/div&gt;&lt;/blockquote&gt;With that, we know the device is "/etc/mtd0" and the erase size is 0x1000.&lt;br /&gt;&lt;br /&gt;Then we can examine the flash device to figure out where is the actual data. It is probably aligned to the erase size and it is all text (except for a small header) so it should be easy to spot by simple visual inspection:&lt;br /&gt;&lt;blockquote&gt;&lt;div style="font-family: 'Courier New', Courier, monospace;"&gt;# hexdump -C /dev/mtd0 | less&lt;/div&gt;&lt;/blockquote&gt;Lo and behold, it is there near the end.&lt;br /&gt;&lt;blockquote&gt;&lt;div style="font-family: 'Courier New', Courier, monospace;"&gt;00038f70  90 6a f4 00 00 00 00 00  00 00 00 00 ff ff ff ff  |.j..............|&lt;br /&gt;00038f80  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|&lt;br /&gt;*&lt;br /&gt;0003f000  48 aa b0 1a 62 6f 6f 74  61 72 67 73 3d 24 28 62  |H...bootargs=$(b|&lt;br /&gt;0003f010  6f 6f 74 61 72 67 73 5f  62 61 73 65 29 20 24 28  |ootargs_base) $(|&lt;br /&gt;0003f020  62 6f 6f 74 61 72 67 73  5f 72 6f 6f 74 29 00 62  |bootargs_root).b|&lt;br /&gt;0003f030  61 75 64 72 61 74 65 3d  31 31 35 32 30 30 00 6c  |audrate=115200.l|&lt;br /&gt;... sipped for brevity ...0003f3e0  6f 64 65 3d 68 6f 73 74  00 00 75 73 62 31 4d 6f  |ode=host..usb1Mo|&lt;br /&gt;0003f3f0  64 65 3d 68 6f 73 74 00  00 00 00 00 00 00 00 00  |de=host.........|&lt;br /&gt;0003f400  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|&lt;br /&gt;*&lt;br /&gt;00040000&lt;/div&gt;&lt;/blockquote&gt;It begins at 0x3f000. Given that the erase size is 0x1000, it ends at 0x3ffff. And with that we can reconstruct the file:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;/etc/fw_env.conf&lt;/b&gt;&lt;br /&gt;&lt;div style="font-family: 'Courier New', Courier, monospace;"&gt;#device &amp;nbsp; start &amp;nbsp; size &amp;nbsp; flash block size&lt;br /&gt;/dev/mtd0 0x3f000 0x1000 0x1000&lt;/div&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8435631682970808710-1716144006711144276?l=regelatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://regelatwork.blogspot.com/feeds/1716144006711144276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8435631682970808710&amp;postID=1716144006711144276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/1716144006711144276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/1716144006711144276'/><link rel='alternate' type='text/html' href='http://regelatwork.blogspot.com/2012/02/recreating-lspro-fwenvconfig.html' title='Recreating LSPRO fw_env.config'/><author><name>Rodrigo Chandia</name><uri>https://profiles.google.com/115325258544904758334</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-FlHnpBfFsnc/AAAAAAAAAAI/AAAAAAAADMk/pZAlEJ67cfY/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8435631682970808710.post-4880313441827797872</id><published>2010-02-13T09:33:00.000-08:00</published><updated>2010-02-13T09:36:24.810-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='birds'/><category scheme='http://www.blogger.com/atom/ns#' term='hawks'/><title type='text'>Little Birds on our Backyard</title><content type='html'>It seems we got a couple of Tweeties nesting in our backyard. I hope they do not peck on peaople's heads!&lt;br /&gt;&lt;br /&gt;&lt;embed type="application/x-shockwave-flash" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" width="288" height="192" flashvars="host=picasaweb.google.com&amp;hl=en_US&amp;feat=flashalbum&amp;RGB=0x000000&amp;feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Frodrigo.chandia%2Falbumid%2F5437782377897885489%3Falt%3Drss%26kind%3Dphoto%26hl%3Den_US" pluginspage="http://www.macromedia.com/go/getflashplayer"&gt;&lt;/embed&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8435631682970808710-4880313441827797872?l=regelatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://regelatwork.blogspot.com/feeds/4880313441827797872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8435631682970808710&amp;postID=4880313441827797872' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/4880313441827797872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/4880313441827797872'/><link rel='alternate' type='text/html' href='http://regelatwork.blogspot.com/2010/02/little-birds-on-our-backyard.html' title='Little Birds on our Backyard'/><author><name>Rodrigo Chandia</name><uri>https://profiles.google.com/115325258544904758334</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-FlHnpBfFsnc/AAAAAAAAAAI/AAAAAAAADMk/pZAlEJ67cfY/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8435631682970808710.post-9025329694391414078</id><published>2009-06-30T16:37:00.000-07:00</published><updated>2009-06-30T16:52:57.251-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='jaunty'/><category scheme='http://www.blogger.com/atom/ns#' term='data loss'/><category scheme='http://www.blogger.com/atom/ns#' term='ext4'/><category scheme='http://www.blogger.com/atom/ns#' term='crash'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>My first ext4 dataloss!</title><content type='html'>I guess it was to be expected. Let's see:&lt;br /&gt;&lt;br /&gt;1. Ubuntu Jaunty, kernel 2.6.29. Check.&lt;br /&gt;&lt;br /&gt;2. An &lt;span style="font-weight:bold;"&gt;ext4&lt;/span&gt; single partition (or at least a /home in a ext4 partition). Check.&lt;br /&gt;&lt;br /&gt;3. Intel driver, using UXA. Check.&lt;br /&gt;&lt;br /&gt;Bonus:&lt;br /&gt;&lt;br /&gt;4. In a laptop after several sleep/power-up cycles. Check&lt;br /&gt;&lt;br /&gt;5. Trying to save power by powering wireless up/down as needed. Check!!&lt;br /&gt;&lt;br /&gt;Result: the laptop froze just as I had checked my last 5 minutes of work into Mercurial and was pushing it to my home server. Hard lockup. No emergency SysReq + Sync possible!! Upon reboot it was as if I had never saved the last 5 minutes of work.&lt;br /&gt;&lt;br /&gt;Very interesting. Not much was lost and I could not detect any corruption. So I am kind of optimistic. I'll keep using ext4 for the time being.&lt;br /&gt;&lt;br /&gt;I am considering making a &lt;span style="font-weight:bold;"&gt;fsync&lt;/span&gt; button, though!! ^_^&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8435631682970808710-9025329694391414078?l=regelatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://regelatwork.blogspot.com/feeds/9025329694391414078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8435631682970808710&amp;postID=9025329694391414078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/9025329694391414078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/9025329694391414078'/><link rel='alternate' type='text/html' href='http://regelatwork.blogspot.com/2009/06/my-first-ext4-dataloss.html' title='My first ext4 dataloss!'/><author><name>Rodrigo Chandia</name><uri>https://profiles.google.com/115325258544904758334</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-FlHnpBfFsnc/AAAAAAAAAAI/AAAAAAAADMk/pZAlEJ67cfY/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8435631682970808710.post-4877232874775375892</id><published>2009-01-01T10:45:00.000-08:00</published><updated>2009-01-01T11:13:53.004-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firewall'/><category scheme='http://www.blogger.com/atom/ns#' term='wgr614v9'/><category scheme='http://www.blogger.com/atom/ns#' term='router'/><category scheme='http://www.blogger.com/atom/ns#' term='asterisk'/><title type='text'>Asterisk and a WGR614v9</title><content type='html'>I have a nice asterisk setup in a Buffalo Linkstation to get cheap international calls. It's worked nicely for several months.&lt;br /&gt;&lt;br /&gt;On the other hand, the wireless router I used to have (a hand me down) had issues. A LAN port burned out, it provides 800.11b and the new laptop I have communicates poorly with it.&lt;br /&gt;&lt;br /&gt;So with the new year I decided to get a new shiny WGR614 wireless router. Setting it up from my Linux network went fine. You are instructed to use http://www.routerconfig.net/ to get to the web setup provided by the router. So far so good.&lt;br /&gt;&lt;br /&gt;But then Asterisk stopped working... strange. My VoIP provider (Sipphone) started giving 401 and 404 errors. As if my user and/or password were wrong. After many tries and false attempts to 'fix' asterisk and the router setup I stumbled on the answer.&lt;br /&gt;&lt;br /&gt;Upgrade the firmware. That gives a nice new setting: &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;WAN Setup &gt;&gt; Disable SIP ALG&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Voila!&lt;br /&gt;&lt;br /&gt;Now I wonder. What was the router doing to mangle SIP packets such that other programs (Ekiga, for example) would work but not Asterisk?&lt;br /&gt;&lt;br /&gt;But now it works, so I am happy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8435631682970808710-4877232874775375892?l=regelatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://regelatwork.blogspot.com/feeds/4877232874775375892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8435631682970808710&amp;postID=4877232874775375892' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/4877232874775375892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/4877232874775375892'/><link rel='alternate' type='text/html' href='http://regelatwork.blogspot.com/2009/01/asterisk-and-wgr614v9.html' title='Asterisk and a WGR614v9'/><author><name>Rodrigo Chandia</name><uri>https://profiles.google.com/115325258544904758334</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-FlHnpBfFsnc/AAAAAAAAAAI/AAAAAAAADMk/pZAlEJ67cfY/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8435631682970808710.post-2865444538314340473</id><published>2008-11-13T10:52:00.000-08:00</published><updated>2008-11-13T11:43:57.344-08:00</updated><title type='text'>Backing up a new laptop</title><content type='html'>So I got a laptop, a Lenovo T500. But what to do with its funky Vista OS?&lt;br /&gt;&lt;br /&gt;Well, wipe it out, of course! With Ubuntu perhaps. But nevertheless I'd like to keep a backup of what came in the hard drive. So, here is what I did.&lt;br /&gt;&lt;br /&gt;1. Boot with Ubuntu Ibex. For that I had to get to the BIOS and force the Laptop to prefer to use the Intel card. Otherwise Ubuntu gets &lt;a href="http://ubuntuforums.org/showthread.php?p=6167024"&gt;real confused about having two cards&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Once it booted I opened a terminal and got root.This assumess that networking works fine, the HDD works reliably, etc.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;sudo -s&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;2. Mount a CIFS share to my desktop.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;mount -t cifs -o user=my_username_there //mycomputer/my_username_there /mnt&lt;br /&gt;&lt;br /&gt;cd /mnt&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;3. Backup the partition table&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;sfdisk -d /dev/sda &gt; the-windows-partititon.dump&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;4. Backup the MBR&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;dd if=/dev/sda bs=512 count=1 of=the-windows-mbr&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;5. Now it is time to get to the main issue:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;ntfsclone -s -o - /dev/sda1 | gzip | split -b 1000m - the-windows-sda1.img.gz_&lt;br /&gt;ntfsclone -s -o - /dev/sda2 | gzip | split -b 1000m - the-windows-sda2.img.gz_&lt;br /&gt;ntfsclone -s -o - /dev/sda3 | gzip | split -b 1000m - the-windows-sda3.img.gz_&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;To restore:&lt;br /&gt;&lt;br /&gt;1. Boot with Ubuntu, open a terminal, get root&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;sudo -s&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;2. Mount a CIFS share to my desktop.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;mount -t cifs -o user=my_username_there //mycomputer/my_username_there /mnt&lt;br /&gt;&lt;br /&gt;cd /mnt&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;3. Restore the partition table&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;sfdisk /dev/sda &lt; the-windows-partititon.dump&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;4. Restore the MBR&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;dd of=the-windows-mbr of=/dev/sda bs=512 count=1&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;5. Now Restore the partitions:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;cat the-windows-sda1.img.gz_* | gunzip -c | ntfsclone --restore-image --overwrite /dev/sda1 -&lt;br /&gt;cat the-windows-sda2.img.gz_* | gunzip -c | ntfsclone --restore-image --overwrite /dev/sda2 -&lt;br /&gt;cat the-windows-sda3.img.gz_* | gunzip -c | ntfsclone --restore-image --overwrite /dev/sda3 -&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8435631682970808710-2865444538314340473?l=regelatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://regelatwork.blogspot.com/feeds/2865444538314340473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8435631682970808710&amp;postID=2865444538314340473' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/2865444538314340473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/2865444538314340473'/><link rel='alternate' type='text/html' href='http://regelatwork.blogspot.com/2008/11/backung-up-net-laptop.html' title='Backing up a new laptop'/><author><name>Rodrigo Chandia</name><uri>https://profiles.google.com/115325258544904758334</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-FlHnpBfFsnc/AAAAAAAAAAI/AAAAAAAADMk/pZAlEJ67cfY/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8435631682970808710.post-7455252239427343910</id><published>2008-10-19T20:42:00.000-07:00</published><updated>2008-10-19T21:55:46.502-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='acpi'/><category scheme='http://www.blogger.com/atom/ns#' term='power'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='s2ram'/><category scheme='http://www.blogger.com/atom/ns#' term='suspend'/><title type='text'>Towards easier suspend for my PC</title><content type='html'>I have several PCs at home (Debin Sid). It uses a lot of power. I fear the elctric bill, but I like my PCs to boot fast...&lt;br /&gt;&lt;br /&gt;Suspend (suspend to ram) to the rescue!!! ^_^&lt;br /&gt;&lt;br /&gt;That is, when it works. But fixing things is already discussed elsewhere. In my case it meant not using the forcedeth Ethernet card on the mother board, but a an oldish PCI 3com instead (although I'd still like to be able to WoL so I might change the 3com for another one).&lt;br /&gt;&lt;br /&gt;But I digress. What I've done so far has been to:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Convince pm-tools that yes, it is OK to force s2ram.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Coax GDM to use &lt;i&gt;s2ram -f&lt;/i&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Get into every account I have at home and set power management preferences to suspend after 1 hour of inactivity and to suspend on the power button.&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Modify the ACPI power button script to suspend instead of powering down. ACPI calls this script to make KDE and/or GNOME aware of the power button action or to shutdown by default otherwise&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;In short, I wanted to make it really easy to suspend instead of powering down.&lt;br /&gt;&lt;br /&gt;For 1) I edited some file in /etc... Unfortunately I had to try so many things I do not remember what I did to successfully make suspend to work, even tough s2ram complains the machines are unknown.&lt;br /&gt;&lt;br /&gt;For 2) one I edited &lt;i&gt;/etc/gdm/gdm.conf&lt;/i&gt; and added under &lt;i&gt;[daemon]&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;SuspendCommand=/usr/sbin/s2ram -f&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;For 3) I just logged into every account (I am root afer all) and changed the power settings for KDE and gnome. I am sure there is a way to change the default. I just got lazy. After fixing everything else.&lt;br /&gt;&lt;br /&gt;For 4) I edited &lt;i&gt;/etc/acpi/powerbtn.sh&lt;/i&gt; to to s2ram -f instead of the usual shutdown:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;# If all else failed, just initiate a plain shutdown.&lt;br /&gt;#/sbin/shutdown -h now "Power button pressed"&lt;br /&gt;&lt;br /&gt;# regelatwork: canged to sleep instead of shutdown&lt;br /&gt;/usr/sbin/s2ram -f&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;This is still not good enough, though. It is still too easy to shutdown from inside a session. It'd be nice to have a simple way to do a logout+suspend instead. Better still for that to be the default logout option and for shutdown to ask something like "are you sure you do not want to logout and suspend instead?"&lt;br /&gt;&lt;br /&gt;Also, it is too easy to Shutdown from GDM (it is the default Action). I'd like a similar warning message along with suspend as the default.&lt;br /&gt;&lt;br /&gt;Pehaps I'll have to bite the bullet, get my hands dirty and code some scripts and modify some Gnome/KDM code to have things my way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8435631682970808710-7455252239427343910?l=regelatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://regelatwork.blogspot.com/feeds/7455252239427343910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8435631682970808710&amp;postID=7455252239427343910' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/7455252239427343910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/7455252239427343910'/><link rel='alternate' type='text/html' href='http://regelatwork.blogspot.com/2008/10/towards-easier-suspend-for-my-pc.html' title='Towards easier suspend for my PC'/><author><name>Rodrigo Chandia</name><uri>https://profiles.google.com/115325258544904758334</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-FlHnpBfFsnc/AAAAAAAAAAI/AAAAAAAADMk/pZAlEJ67cfY/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8435631682970808710.post-4667743675629941495</id><published>2008-09-16T20:03:00.000-07:00</published><updated>2009-02-09T10:05:15.875-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='posix'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='debian'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='bashism'/><title type='text'>Unlearning bash</title><content type='html'>At debian's IRC someone asked how to replace ***.png to ***.jpg. To which I replied a "bashism." &lt;br /&gt;Fortunately someone else corrected my bash-istic ways on time.&lt;br /&gt;&lt;br /&gt;So how to unlearn those pesky bash-ways? It seems the IEEE comes to our rescue with the &lt;a href="http://www.opengroup.org/onlinepubs/009695399/"&gt;Open Group Specification&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Other tools seem to be debian's checkbashism command and the ol' technique of using dash instead (with some dose of cursing in between ^_^).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Update:&lt;/b&gt; It is a bashism to use the nifty regexp substitution &lt;br /&gt;&lt;br /&gt;${var/\.oldext/.newext}&lt;br /&gt;&lt;br /&gt;One should instead use the standard way of cutting trailing substrings from a var:&lt;br /&gt;&lt;br /&gt;${var%.oldext}.newext&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8435631682970808710-4667743675629941495?l=regelatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://regelatwork.blogspot.com/feeds/4667743675629941495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8435631682970808710&amp;postID=4667743675629941495' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/4667743675629941495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/4667743675629941495'/><link rel='alternate' type='text/html' href='http://regelatwork.blogspot.com/2008/09/unlearning-bash.html' title='Unlearning bash'/><author><name>Rodrigo Chandia</name><uri>https://profiles.google.com/115325258544904758334</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-FlHnpBfFsnc/AAAAAAAAAAI/AAAAAAAADMk/pZAlEJ67cfY/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8435631682970808710.post-7943525030816577359</id><published>2008-09-11T11:19:00.000-07:00</published><updated>2008-09-11T11:29:04.737-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='desk icons'/><category scheme='http://www.blogger.com/atom/ns#' term='gnome'/><title type='text'>Lost Trashcan</title><content type='html'>It seems I am like other people with respect to icons on the Desktop. One day I love them, the next they are a nuisance on my beautiful wallpaper.&lt;br /&gt;&lt;br /&gt;I use Gnome and today I wanted my icons back. Do not panic, says the ol'book. Someone else already &lt;a href="http://linuxgamingtoday.wordpress.com/2008/01/24/display-home-computer-trash-icons-on-desktop-in-gnome/"&gt;figured it out&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Neat, ain't it?&lt;br /&gt;&lt;br /&gt;Now, if KDE and Gnome could just agree on how to represent these pesky icons so I did not have to delete/add/recycle them every time I decide &lt;del&gt;KDE&lt;/del&gt; Gnome is the best thing in the world.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8435631682970808710-7943525030816577359?l=regelatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://regelatwork.blogspot.com/feeds/7943525030816577359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8435631682970808710&amp;postID=7943525030816577359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/7943525030816577359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/7943525030816577359'/><link rel='alternate' type='text/html' href='http://regelatwork.blogspot.com/2008/09/lost-trashcan.html' title='Lost Trashcan'/><author><name>Rodrigo Chandia</name><uri>https://profiles.google.com/115325258544904758334</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-FlHnpBfFsnc/AAAAAAAAAAI/AAAAAAAADMk/pZAlEJ67cfY/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8435631682970808710.post-4424833849119445638</id><published>2008-08-07T15:03:00.000-07:00</published><updated>2008-08-07T15:06:26.065-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='first post'/><category scheme='http://www.blogger.com/atom/ns#' term='hello world'/><category scheme='http://www.blogger.com/atom/ns#' term='beginning'/><title type='text'>Hello World!</title><content type='html'>Can my first blog post be lamer?&lt;br /&gt;&lt;br /&gt;As I'm trying to write a dissertation proposal I guess it will have to do for now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8435631682970808710-4424833849119445638?l=regelatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://regelatwork.blogspot.com/feeds/4424833849119445638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8435631682970808710&amp;postID=4424833849119445638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/4424833849119445638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8435631682970808710/posts/default/4424833849119445638'/><link rel='alternate' type='text/html' href='http://regelatwork.blogspot.com/2008/08/hello-world.html' title='Hello World!'/><author><name>Rodrigo Chandia</name><uri>https://profiles.google.com/115325258544904758334</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-FlHnpBfFsnc/AAAAAAAAAAI/AAAAAAAADMk/pZAlEJ67cfY/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
