jump to navigation

Booting in to the command prompt January 22, 2006

Posted by Carthik in commands, snippets, ubuntu.
10 comments

Recently, I switched to using multiple monitors at work. At home, however, I have only the laptop screen. I did not want the GUI login (GDM/KDM) to come up on boot. I wanted to be able to change the xorg.conf file before starting X, depending on whether I was at home or at work.

I found a reversible way to disable booting into the graphical display.

To disable graphical login (to log into the command prompt) do:

$echo "false" | sudo tee /etc/X11/default-display-manager

The next time you reboot, you will find yourself staring at the command prompt.

To enable it again, do:

$echo "/usr/bin/gdm" | sudo tee /etc/X11/default-display-manager
Note: replace gdm in the above with kdm if you use kde’s display manager, or xdm, if, for some reason you use that.

Hat tip to Peter Garrett on the ubuntu-users list.

Ubuntu to Kubuntu + Keeping the Menus Clean January 13, 2006

Posted by Carthik in guides, snippets, ubuntu.
40 comments

So you have Ubuntu installed and want to try out Kubuntu instead?

Easily Done!

Install the “kubuntu-desktop” meta-package, and you will have the option to log in to a KDE session the next time you boot up (Choose KDE from among the session options, before you enter the username and password in the graphical login screen)

You can install kubuntu-desktop by seraching for it in Synaptic, or simpler still, using the command:
$sudo apt-get install kubuntu-desktop

kubuntu-desktop is an architected collection of carefully selected KDE applications that creates a unique “desktop” experience, much like Ubuntu – it has one software utility for each function, again, like Ubuntu. So installing kubuntu-desktop will not give you all the KDE utilities, just like installing Ubuntu did not give you all the Gnome applications. There is another meta-package called “KDE” which, when installed will give you a different set of software. So if, after installing kubuntu-desktop, you find some of your favorite KDE apps missing, install the entire KDE suite, by installing the kde metapackage. I find this unneccassary, as kubuntu-desktop provides me with the minimal set of tools to get my work done. If I need something extra, like, kile, that very useful LaTeX editor, then I just install kile. Less baggage, better trip!

If you already knew all that was written above, and are beginning to think that it was a waste of time reading so far, fear not! I have a tip (not my original idea) that will make it worth your time.

The biggest annoyance for me, with having both gnome and KDE installed is that some KDE apps show up in the Gnome menus and some Gnome apps show up in the KDE menus. While this is not a “bad” thing, I would rather do without this.

To prevent KDE apps from showing up in Gnome menus and vice-versa, do the following before you install kubuntu-desktop :

(you can also create a small cleaner.sh script witht he following and run it as root)
$ sudo -s -H
#cd /usr/share/applications
#for i in *.desktop; do \
# if ! grep -q ^OnlyShowIn= $i; then \
# echo ‘OnlyShowIn=GNOME;’ >> $i \
# fi
#done

Now, after installing kubuntu-desktop do:

$cd /usr/share/applications/kde
$sudo -s -H
#for i in *.desktop; do
# if ! grep -q ^OnlyShowIn= $i; then
# echo ‘OnlyShowIn=KDE;’ >> $i
# fi
#done

What we did above was to tell the Gnome apps to only show in the gnome menus, and later, the KDE apps to only show in KDE menus.

Script to Rename a Folder of Pictures December 16, 2005

Posted by Carthik in snippets, ubuntu.
8 comments

Todd Slater posted a link to his script to rename pictures in a folder using the exif data stored in the photo. This will work for photos taken with a a digital camera, and you can rename all photos in a folder using a name, like “xmas”, the date, and then sequential numbers.

Try the script — the comments on top of the script should tell you how to use it.

IRC chat from behind a firewall December 2, 2005

Posted by Carthik in guides, snippets, ubuntu.
22 comments

Stuck at school/work behind a firewall which does not allow you to chat on IRC (Internet Relay Chat)? That happens to me all the time. But now, I still can chat at #ubuntu or wherever else I want on IRC networks, by using ssh port forwarding.

Essentials for doing this are:
1. A login at some ssh server — You can set up an ssh server at home, or use one provided by your hosting provider, or a geeky friend.

Now, to forward port 6667, which is the port used for connecting to IRC chat networks, you should execute the following command:

ssh -L 6667:irc.freenode.net:6667 example.com -p 8888 -l username

That commands reads in English as follows:
Open an ssh connection to example.com (replace with your ssh server URL), on port 8888 (replace with whatever port your ssh server uses, if it is the default port then leave out the “-p 8888″ part), as the user “username” (the -l is a “minus ell”), forward the local port 6667 to the port 6667 on irc.freenode.net.

Now, fire up Xchat to connect to the IRC network, and then type “/server localhost” as it tries to connect. Cool, now you can connect to the IRC network even though youa re behind a firewall.

Digg this articleDigg This!

Easiest Upgrade Path Ever December 1, 2005

Posted by Carthik in snippets, ubuntu.
18 comments

Have you used software, or OSes that make you go, “Dumb developers, what were they thinking?”

Well, turns out that one of the reasons I love Ubuntu is that every once in a while I encounter some tidbit in the mailing lists that makes me go, “Wow! These guys have common sense, and make things so much more intuitive and simple.”

For example, consider upgrading from Hoary to Breezy. You have a Breezy CD with you. Traditionally one would think that there would be some editing of the sources.list to use the cd-rom as a repository, followed by the upgrading itself, but here’s the surprise, with Ubuntu, you don’t have to run in circles: All you have to do is to just pop in the Breezy cd when your Hoary computer is running. The Update Manager will detect that the cd you popped in corresponds to a newer version of Ubuntu and then ask you if you want to upgrade to Breezy!!

Some of the things with Ubuntu are so simple that you don’t think of them straight up – Being a linux OS you don’t expect things to be so simple, yet they are. I have to constantly remind myself that the Ubuntu developers are folks with loads of common sense, and they want to build a system that’s as simple as possible (and no simpler).

System Sounds and Application Sounds October 26, 2005

Posted by Carthik in snippets, ubuntu.
5 comments

Some of the applications that are installed on your system do not use the esd (e-sound daemon, where e = enlightened) driver for outputting audio. The result — while you can hear the system beeps, hoots and whistles, you can’t hear the sound from the application you are running. If this is the case, then fear not, esddsp will rescue you!

Install esound-clients the usual way:
$sudo apt-get install esound-clients

and then add a “esddsp” to the command you use to start your application for which you cannot hear sounds yet:
$esddsp tuxracer

The above will re-route the sounds emanating from tuxracer, which is a neat little game, through esd, so you can hear the game sounds and the system sounds.

Thanks for Charles Mauch on the ubuntu-users mailing list for the tip.

Fix Sound in Firefox for Flash October 20, 2005

Posted by Carthik in snippets, ubuntu.
6 comments

Follow Roel’s instructions here.

‘Nuff Said…

List only the directories October 19, 2005

Posted by Carthik in commands, snippets, ubuntu.
81 comments

I had a trivial problem today where I had a huge list of files in a directory, and other directories within the directory. I was looking for a specific directory and wanted to get the files out of the way. I wanted a listing of the directories within the current directory and nothing more. Luckily, with a little experimentation I was able to figure out how to do this :

$ ls -l | grep “^d”

Neat.

Watch outputs as they change October 10, 2005

Posted by Carthik in commands, snippets, ubuntu.
6 comments

This is another “trick” that might seem trivial to the gurus out there, but is something I discovered recently.

Use the command watch to regularly update and refresh the output of some command. If you want to see the “running output” then watch is the program for you.

Using it is simple, by default it updates the output once every two seconds. So
$watch “your-command”

will update the output of “your-command” every two seconds.

To make it refresh more frequently, try
$watch -n1 “your-command”

and to make it highlight differences as and when they occur, try the -d option.

As an example, the command
$watch -d -n1 “netstat -t tcp”
will show you a list of the IP connections heading out from your computer, and update the output every second. It will also highlight new items/changes as they happen.

Another little gem from teh ubuntu-users mailing list archives!

WMA to OGG file conversion September 29, 2005

Posted by Carthik in snippets, ubuntu.
18 comments

Karl Hegbloom was kind enough to post to the ubuntu-users mailing list wanting to share his script to convert .wma files to .ogg files. The conversions needs the mplayer and the oggenc packages to be installed on your system. The script is pasted below:

#!/bin/sh

# Convert a .wma to an .ogg using ‘mplayer’ and ‘oggenc’.

#

# Public Domain

set -e

IN=$1

shift

if [ -z "${IN}" ]; then

IN=-

WAV=audio.wav

else

WAV=$(basename ${IN} .wma).wav

fi

mplayer -vc dummy -vo null -ao pcm:waveheader:file=${WAV} ${IN}

FILEDAT=$(file ${WAV})

BITS=$(echo ${FILEDAT} | sed -e ‘s/.*\(8\|16\|32\) bit.*/\1/’)

if echo ${FILEDAT} | grep -q mono; then

CHANS=1

else

CHANS=2

fi

oggenc -R 44100 -B ${BITS} -C ${CHANS} ${WAV} >/dev/null

rm -f ${WAV}

Follow

Get every new post delivered to your Inbox.

Join 237 other followers