I have run into a couple of shell scripts that print terminal colours as blocks of colour or text but none have been formatted in a way that showed a terminal colour scheme that well. Recently I have taken up adopting the solarized colour scheme but I’ve been trying to modify it slightly to suit my tastes and have had trouble discerning what colours were what, as some colours are replaced with different shades of grey.

Reading the debian planet I came across Antonio Terceiro’s post on a neat simple shell script to print out all the ANSI colour codes and I really like the formatting, so I want to save it here so I don’t forget.

#!/bin/sh -e
 
for attr in $(seq 0 1); do
  for fg in $(seq 30 37); do
    for bg in $(seq 40 47); do
      echo -n "\033[$attr;${bg};${fg}m$attr;$fg;$bg\033[m " 
    done
    echo
  done
done
 

Occasionally I need to extract a source tarball to a subdirectory without its leading path directory and every time I need it I forget the necessary GNU tar switches, so here is todays lesson in the two tar switches required.

tar --strip-components 1 -xvf package_1.1.tar.bz2 -C package

“–strip-components 1″ will strip off the first (1) folder of the archives path. Replacing 1 with 2 will do the obvious and strip off 2 folders/preceding path components.

“-C package” is nice and simple, it will extract the archive into the folder package. You could be fancy and do “-C ~/source/package” and extract the archive anywhere you fancy.

 

A really simple guide to ripping the audio out of a DVD using transcode to wav or mp3.

http://www.ubuntugeek.com/how-to-rip-dvd-audio-to-mp3-or-ogg.html

 

If you have to install CentOS, or you just want to have a nosey, the best way to install it is using the Netinstall CD.

I followed this little guide: http://www.chrisgountanis.com/technical/45-centos-netinstall.html, and it worked out great.

I chose the raw base system install in the graphical installer. It downloaded about 400-500mb of data, installed the packages and after a quick reboot left me with a console screen in vmware, exactly what I wanted.

The only trick was to make sure I was pointing to the right folder in the mirror’s ftp/http directory.

 


When a member of an irc channel I lurk in talked about signing up to the Palm Developer forum this sparked my curiosity about the Palm Pre Developers Kit. So I had a little nosey around the Palm website to see if they had a Linux version of the SDK, which they do. Palm use virtualbox as the virtual machine which is easy to install as well as providing an Ubuntu package for the Pre image. While packaged for Ubuntu also installs with no trouble on Debian squeeze.

The last required package is novacom, the debug/control server required to control the Pre virtual image and let you install any applications you write for the Pre onto the virtual image. This package unfortunately takes advantage of Ubuntu using the Upstart init system instead of init.d as in Debian so does not install cleanly. One option you could take is to uncompress the package and manually install/run the novacom binaries. I chose however to write a simple replacement startup script for init.d, which hopefully is fully functional, and repackage it following this blog post:

http://binaryunit.blogspot.com/2008/01/dist-upgrade-goes-segmentation-fault.html

The Debian package starts novacomd with the init script exactly as the Palm package does using Upstart but also cleanly stops novacomd and should purge the init.d script when purging the config during package removal.

Grab the package here: palm-novacom_0.3-svn177284-hud9_debian_i386

Edit: This package badly fails Lintain and the packaging guidelines, I will try and clean that up and post a more clean package soon fingers crossed.

Edit: Fixed! Mostly ;)

 

Rxvt is a great terminal. When I needed a light weight terminal that supported unicode on my ye olde laptop, rxvt was the answer.

When combined with the font Terminus it quickly became my terminal of choice on the PC as well, but back to the topic at hand. Using a large monitor resolution leaves alot of unused screen real estate and one of the common action I would do with my terminal windows was to tile them, lining each terminal window up against the edge of the screen, and then dragging them half way.

This quickly becomes rediculous manually adjusting windows each time you boot. I searched for ways of tiling windows in XFCE a number of times but either came across posts about using applications to do the tiling or going the the whole way and using a tiling window manager like awsome.

Fortunately last week while exploring the vast rxvt-unicode documentation, trying to solve another issue I came across the geometry command line option.

My terminal tiling is simply two terminals taking up half the desktop each and I use a seperate shortcut for the tiled windows and a generic window, with XFCE’s window management nicely placing the two terminals side by side.

Here is my tiled rxvt command line options from my terminal shortcut:

rxvt-unicode -bg black -fg white -vb -sl 10000 -fn "xft:Terminus" -geometry 102x62

 

While Linux is not known for its instability, every so often something can go wrong and leave you with a frozen system.

Usually, at least for me, a frozen system occurs when modifying core parts of the operating system, such as the kernel, X window system or when performing a complete upgrade such as debian’s dist-upgrade, which includes plenty of changes to core components.

The first thing to try when presented with a frozen screen is to see if just X has crashed and whether you can access a console via ctrl-alt-F1, if you’re presented with the console screen, you can login and relatively cleanly reboot by issuing, sudo reboot -f. If you swap to a console screen from a working X and wish to get back, on most distro’s this is ctrl-alt-F7, if not try the combo with other function keys.

Still stuck staring at a locked screen? Then it is time to try the magic sysreq key. The sysreq key is a kernel function, which must be compiled into the kernel, that allows low level commands to be run. This means you can clean up a system, and force it to reboot/shutdown with out corrupting the filesystem. To issue a magic sysreq key you hold down alt, Sysreq (also the PrintScreen key on most modern keyboards), then the selected key for which command you want issued.

The best series of sysreq keys to issue has luckily been solved by an acronym, created by some one far more creative than me and found on the wikipedia link below.

Raising Elephants Is So Utterly Boring, or BUSIER in reverse.

The series above will do the following:

  1. R: Switch the keyboard from RAW mode to XLATE mode (ASCII Mode, sort of.)
  2. E: Terminate all processes, applications should gracefully close
  3. I: Kill all processes, forcefully terminate all processses
  4. S: Sync/flush data to the disk
  5. U: Unmount all filesystems and remount as read only
  6. B: Reboot the system

A few second pause should be used between each sysreq command issued so they can take full effect.

You will also need to be aware if you’re using a different keyboard layout the keys are based on the QWERTY layout, the matching keys are in the wikipedia link below, which you can also take a look at if you’re interested in the fullset of available sysreq commands.

If nothing happens, unfortunately you’ll have to powercycle and hope for the best, fingers crossed you won’t need the magic sysreq key very often!

http://en.wikipedia.org/wiki/Magic_SysRq_key

 

While the auto-opening of rhythmbox every time you plug in your MP3 player is probably great for alot of people, especially if you have a large harddrive player and use it to carry most of your music collection, it’s a pain in the ass when you have a small capacity player and its use is mainly for listening to podcasts.

The pre-hardy heron way was to go to System -> Removable Drives and Media -> Click through the tabs till you see Media player or the like, then change the on-load action to load folder. This made alot of sense, its definately a user preference and most users would think of changing this some where global.

Now in the new, flashy, hardy ways, it has moved to being a nautilus preference, while still leaving many of the other hotplug loading actions in the Removable Drives and Media menu. Why they couldn’t move them all to the same place beats me, but if you’re sick of rhythmbox autoloading you need to load nautilus and go to:

Edit -> Preferences -> Media

Solution from:
http://ubuntuforums.org/showthread.php?t=381041

© 2012 Linux Sand Garden Suffusion theme by Sayontan Sinha