Archive for May, 2011

Time Synchronization: NTP

Today I noticed that my computer clock was running fast, meaning that Debian doesn’t come with some kind of time synchronization enabled by default. Ubuntu doesn’t exactly either, but setting your location seems to take care of it in Ubuntu.

There’s really nothing much to tell here. Debian Wiki has all the instructions lined up already.

  • Type date to see current date and time
    date
  • Install NTP
    aptitude install ntp
  • Done.
  • Type ntpq -p to see servers you are syncing with.
  • Type date again to see if the time changed. You time should be synced in a next minute.
  • Done.

There’s nothing more to do, though I often like to take a peek at the configuration files and the man pages — the latter is typically a bit too dense unless you already know what you’re looking for. In this case, that would mean man ntpd, man ntp.conf, and, most important, nano /etc/ntp.conf (or whatever your favorite text editor is). It doesn’t look like there’s anything of particular interest, but you might want to replace some of those default Debian server pools with ones geographically closer to you. The easiest way is to check on www.pool.ntp.org, but if e.g. your ISP offers such a service it might be a good idea to use it.

In my case, Belgium didn’t have too many servers, so I made up my own mix of Belgium, the Netherlands, and Europe.

#server 0.debian.pool.ntp.org iburst
#server 1.debian.pool.ntp.org iburst
#server 2.debian.pool.ntp.org iburst
#server 3.debian.pool.ntp.org iburst

server 0.be.pool.ntp.org
server 1.nl.pool.ntp.org
server 2.nl.pool.ntp.org
server 3.europe.pool.ntp.org

Also see how to disable the daemon on battery power. I don’t know how much of a difference that would actually make, but as the Dutch idiom goes, all small bits help.

Comments

Unmount Flash Drives & Memory Cards

It seems that Gnome’s safely remove drive feature works just like the equivalent in Windows: not at all. It even displays the exact same useless error message, almost word for word: this device cannot be stopped. Not the slightest hint about why this might be the case.

Following this scenario, on Windows you’d pretty much be stuck shutting down your computer to be sure that no data loss will occur (although workarounds like Unlocker exist, or you can use Process Explorer to figure out the culprit manually). Luckily, on Linux the workaround is a lot easier. Use mount to display information about all currently mounted file systems and umount to, you guessed it, unmount the file system of your choice.

$ mount
[…]
/dev/sde1 on /media/888E-E0E0 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush)
$ umount /dev/sde1

PS I just found out that I’m mistaken, but I already wrote the post and besides, the point that you’re able to do things like this if you want, whereas you’d be stuck in Windows, still stands. It seems that the way Gnome devs envisioned unmounting is not while you’re viewing it in Nautilus by right-clicking, but by right-clicking on the icon on the desktop.

Comments

Remote Desktop: Remmina

A quick tip for Ubuntu users: install Remmina instead of (or alongside) the default Vinagre with sudo apt-get install remmina. It’s much better. Not only does it perform better (that is, it doesn’t hog CPU), but it has all the options Vinagre lacks.

Comments

Using Wine to Ease Migration from Windows

According to its about page, “Wine lets you run Windows software on other operating systems. With Wine, you can install and run these applications just like you would in Windows.” That sounds like a good enough description to me.

I have some applications that depend on a specific drive letter configuration, so to be truly able to share applications between Wine and Windows I’ll have to set up my drives in Wine just the way they are on Windows. I may write a post later about how to auto-mount Windows partitions.

Setting up drives is incredibly simple: you start the Wine configuration program and go to the drives tab. There you can set up certain directories or mount points to correspond to certain drives for Windows programs, but you don’t even have to use the GUI. The reason this is useful is because you can run your programs like you were on Windows and they wouldn’t know the difference. As far as the programs are concerned they’re reading data from the same location as always. This greatly simplifies my process of switching to Linux. Rather than having to set up replacement programs and configurations I can simply let Wine pretend to my programs that they’re running in the same (drive) configuration as they would on Windows. This way I can switch more completely to Debian without having to exert a lot of effort at once. I can move away from certain programs more slowly, or perhaps not at all.

I found a Gnome to Wine Color Scraper to improve the look of my Wine applications, but the registry file it generated didn’t work for my version of Wine. I enabled the debugging option and had to edit the parts where it speaks of HKEY_USERS\S-1-5-4\. For me the number was different. Check in regedit for specifics.

There are many more things you can do with Wine, including playing a fair amount of Windows-based games. Check the website for more information on compatibility.

Comments