Linux For Cynics One user's experiences with Linux

17Apr/130

Change the Hostname (Computer name) in Ubuntu

Changing your computer's name (also called the system's "hostname") in Ubuntu is simple. You just have to change two files and restart the computer. These instructions also work for Debian and Ubuntu-based distros (like Linux Mint). The files in question are /etc/hosts and /etc/hostname

1. Open /etc/hosts with sudo (or gksu if you're going to use something like gedit)

$ gksu gedit /etc/hosts

The file will look something like this:

127.0.0.1       localhost
127.0.1.1       current_hostname

Instead of current_hostname you'll see the hostname / computer name. Change it to whatever you want the new name to be. Save and close the file.

2. Open /etc/hosts with sudo (or gksu if you're going to use something like gedit)

$ gksu gedit /etc/hostname

This file just contains the hostname / computer name. Change it to whatever you want the new computer name to be. Make sure it matches the name you put in /etc/hosts. Save and close the file.

3. Restart your computer.

Tagged as: , No Comments
27Mar/1317

Improve Font Rendering in Debian

After installing Debian Testing (Wheezy), and started using Firefox (aka Iceweazel), one of the first things I noticed is that the default font rendering in Debian is not pretty.

Luckily, fixing this is very straight foward. Create a file called .fonts.conf in your home directory, and put the following contents in it:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
  <match target="font">
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
  </match>
</fontconfig>

This will enable subpixel-hinting and font-smoothing. Now just restart X.org (log out, then back in again). Read more here: http://wiki.debian.org/Fonts

Here's the before and after (before is on the left):
fontrendering_beforeandafter

25Mar/130

Set Keyboard Repeat Delay and Rate

In order to change the key press repeat delay and rate we use a command called

xset

which is a user preference utility for X.

This command:

xset r rate DELAY RATE

where DELAY and RATE are replaced with actual values, in milliseconds. for example:

xset r rate 200 20

First, use

xset q

to see what the current values are. As shown above, I have mine set to 200 delay and 20 repeat rate.

To make this permanent, add that line to your ~/.xinitrc

xset can be used for a lot more than this. As always, use

man xset

to find out more about this command.

11Mar/130

Git in Color

To enable color in git, simply use this command:

git config --global --add color.ui true

That adds the following lines to your .gitconfig:

[color]
        ui = true

There, now you'll see git's greens and reds, which make it much easier to see what's changed.

Don't worry, the color codes will only be used in interactive mode and not when piping output from git to other programs.

Tagged as: No Comments
4Mar/130

How to Add Wallpapers from Old Ubuntu Versions

My favorite background from Karmic

My favorite background from Karmic

The wallpapers included in Ubuntu are stored in

/usr/local/backgrounds/

. If you want to easily add wallpapers from older versions, like, 9.10 for example, all you need to do is run this command:

sudo apt-get install ubuntu-wallpapers-karmic

For other old Ubuntu versions, replace "karmic" with

  • precise for 12.04
  • oneiric for 11,10,
  • natty for 11.04,
  • maverick for 10.10,
  • lucid for 10.04,
9Oct/120

Unity Panel in Gnome-Shell

One of my favorite things about Unity is the global menu. By "global menu" I mean the feature that combines the title bar and menu of the currently maximized application into the left side of the top panel. It saves screen space and very clean-looking.

I also like how the notification area is in the top right in Unity, instead of having its own ugly bottom panel that autohides like in Gnome-shell.

Well, it's possible to use Unity's top panel in Gnome-shell! Just run:

unity-2d-panel

You'll also want to move gnome-shell's top panel to the bottom with an extension. Panel Settings will do the trick.

Clearly we're not done. Now the normal gnome-shell panel is on the bottom but it still does much of what our Unity-2d-panel does. You'll have to either hide it, or give it different functionality using gnome-shell extensions. I leave that up to you.

Be warned that Unity2D will be deprecated in Ubuntu 12.10.

9Sep/120

How to Add Shutdown Shortcut in Ubuntu Unity

I hate that there's no keyboard shortcut for system shutdown in Unity. Here's how to add one:

1. System Settings
2. Keyboard
3. Shortcuts tab
4. Custom Shortcuts
5. Then the little + icon.

You can give it the name "Shutdown", and the command:

gnome-session-quit --power-off --force

, then apply whatever keyboard shortcut you want to it.

9Jul/120

Change Boot Screen in Ubuntu/Mint

plymouth screenshot

Plymouth is the application which provides the graphical "splash" screen when booting and shutting down an Ubuntu or Ubuntu-based system. I never really gave it much thought until I installed xbuntu-desktop and noticed that my boot screen had changed to the xubuntu logo.

If you find yourself in the same situation or just want to customize your installation, first find a new plymouth theme, which can be accomplished by searching for "plymouth-theme" in the package manager (or don't, if you are just reverting to your original theme if you installed a different desktop environment). Then, in terminal:

sudo update-alternatives --config default.plymouth

Select the theme you want, and then:

sudo update-initramfs -u

That's it!

Now, if you go searching for a way to switch themes using a GUI, you may come across Mario Guerriero's plymouth-manager. However, if you add the ppa and try to install plymouth-manager, you might find there is no version for Ubuntu 12.04.

18Apr/120

How to install Cinnamon in Ubuntu 12.04

I've finally updated to the Ubuntu 12.04 LTS from the 10.04 LTS. On my more recent machines, it really is an improvement. I prefer gnome-shell to Unity, but both run well. On my older machines, I am using crunchbang, Xubuntu or Cinnamon, which is based on gnome3.

Give Cinnamon a try:

sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update
sudo apt-get install cinnamon
4Jan/120

Changing Desktop Environment in Ubuntu

I mostly write about Ubuntu because it is my distribution of choice, and one of the most popular. However, I think the default desktop environment (before it was GNOME, now it's Unity) is far from ideal on many machines, including netbooks and older laptops. So I set out to try another DE, and thankfully it is very easy to install them. There are also other distributions based on Ubuntu except they come with other default DEs. In order to try them out, I recommend to only install the DE, and not a whole distribution or worse, one of the "*buntu-desktop " packages (this is what psychocats.net recommends. Don't do that.).

Fair warning: installing multiple DEs means you'll have multiple applications that do the same thing, and many of them will be available from either DE, meaning cluttered menus full of redundant applications. Keep in mind that you are just experimenting. Do this in a VM or non-critical system.

The process is the same for each DE: Install the DE, log out, choose the new DE, log in.

KDE:

sudo apt-get install kde-standard

XFCE:

sudo apt-get install xfce4

LXDE:

sudo apt-get install lxde