February 2, 2012 at 21:52
· Filed under Language, Linux
Ubuntu comes with a large swath of international fonts installed by default, but Debian requires a little more attention. Although I can’t read the languages, I can recognize which script is which. Besides, boxes are just ugly.
East Asian: apt-get install ttf-arphic-uming ttf-wqy-zenhei ttf-sazanami-mincho ttf-sazanami-gothic ttf-unfonts-core (source)
If you’re just switching from Windows and you don’t like to enter passwords every time you want to access your disks, fstab is what you need. Of course it also applies to e.g. ext4 partitions that you didn’t assign a mount point during the installation of your OS, but when you’ve come that far along you probably already know this.
By far the best explanation of fstab I’ve found was on ArchWiki, so I won’t waste my time reiterating what is stated there. I’ll merely try to further clarify a few things that were less immediately obvious to myself and needed a little experimentation.
In many ways fstab is what I always wanted in Windows. For a long, long time I’ve maintained a C partition (dedicated Windows, so I could wipe it without really affecting anything), a D partition (my primary data container), and later, as I added more HDDs, I think I got up to G. There are some hacks available, like NTFS junction points, but they don’t really protect against the fundamental flaw of drive letter assignment compared to the much more sensible mechanism of mount points.
When you mount a partition manually through your GUI, by clicking on it and entering your password, it creates a temporary entry in /etc/mtab; this entry can be used to as a starting point for fstab entries. However, for more reliable partition mounting you need to use UUIDs. You can obtain this using blkid /mnt/sda1, where /mnt/sda1 should be replaced with whatever partition you want to print a UUID for. This command needs to be run as root, i.e. with su or sudo.
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
If you prefer to use a GUI, there are some options, but I haven’t tried any of them.
Skype Call Recorder delivers on the promise of its name. It records calls, with the participants split into two separate channels if you want — which you do if you want the option of raising or lowering the volume of one participant.
A while ago, I wrote about using Wine in order to switch completely to Linux a lot quicker than would be possible if you had to figure out replacements for various pieces of peripheral software. In the case of µTorrent this meant that I could keep on seeding all the torrents I’ve downloaded over the years and not having to set up my RSS feeds and other preferences once more, but it’s not all sunshine. Aside from minor bugs in Wine, it simply uses a lot more memory and sometimes CPU. As an unscientific guestimate, it seems about 5 times as memory hungry as on Windows.
In the not too distant past, fixing this would’ve required a switch to e.g. qBittorrent, but an alpha version of µTorrent Server is now available for Linux. It can do everything normal µTorrent can, but not everything is necessarily available through its default WebUI. Luckily an alternative WebUI is available and I’d highly recommend it over what comes with the µTorrent Server by default. It enables RSS feeds and filters, among other things. I think it’s probably no more than a newer version, so perhaps you can ignore this part of this post if you’re reading this in a few months time.
One thing that doesn’t seem to be mentioned in the documentation anywhere is that you can access the WebUI through http://localhost:8080/gui/.
Now for switching over the data and configuration files. Luckily µTorrent for Linux uses the same data files, so you can easily copy over rss.dat (feeds configuration) and resume.dat (locations of torrents). Of course that won’t fix the problem that directory structures are slightly different on the respective platforms, and I don’t think you can make symbolic links to drive letters except in Wine. That’s where BEncode Editor comes in, as described in an article about moving your µTorrent files. I couldn’t find a similar utility for Linux, but no matter, it works quite well in — drum roll — Wine. I downloaded version 0.7.1.0, the latest at the time of writing.
You should read through the guide I linked, but of course some slight adjustments will have to be made. In my case I did some reorganizing of my HDDs after I hadn’t booted into Windows for a month, but the differences for my torrents weren’t that big. I replaced D:\downloads\torrents\ globally with /media/downloads/torrents/ as outlined in the text. I repeated similar commands for my E:\ and I:\, but of course the specifics will be different for everyone. To finish it off you can replace all instances of \ with /.
Something similar can be done for rss.dat, but I had already adjusted all my filters manually in the µTorrent WebUI.
Assuming you run this command in the directory where you put the µTorrent Server executable, you can run cp /somewhere/uTorrent-for-Windows-folder/*.torrent to copy over all the relevant *.torrent files.
There are some slight inconveniences. For example, you can’t open in folder directly, but you have to navigate there manually or copy the location from the WebUI. However, if you were using Wine you’d already given up on proper integration regardless. I think it’s easier to copy the proper Linux path from the WebUI than to mentally line up Wine drives and directories with real ones.
As one final caveat this method didn’t seem to remember proper times when downloads finished and instead “downloaded” all my torrents at that point in time. I’m sure that could be avoided somehow (perhaps by copying over settings.dat?) but for my purposes it didn’t matter.
A while ago I wrote about screen, which makes your SSH experience more satisfying. There are some enhancements you can make to screen with .screenrc, but Byobu does more by default than I ever could be bothered to figure out. It seems to come pre-installed on Ubuntu, while aptitude install byubo suffices for Debian.
I thought it’d be even better if screen automatically attached itself when logging in through SSH, and clearly I wasn’t alone in that thought. I made a slight adjustment to the code I found so that Byobu is utilized when available and otherwise regular screen will load. Screen is often installed by default, unlike Byobu, so that way I won’t have to install or compile Byobu to reap the benefits of my custom .bashrc.
# From http://tlug.dnho.net/node/239
# "The following code when added to your .bashrc file will, after logging in via ssh, look for any unattached screen sessions and automatically attach to the first one found. If only attached sessions are found then a list of these will be outputted to std out. Finally, If there are no screen sessions running at all then a new screen session will be created."
if [ $SSH_TTY ] && [ ! $WINDOW ]; then
SCREENLIST=`screen -ls | grep 'Attached'`
if [ $? -eq "0" ]; then
echo -e "Screen is already running and attached:\n ${SCREENLIST}"
else
type -P byobu &>/dev/null && byobu -U -R || screen -U -R
fi
fi
# Optionally adding the following will alter your prompt to let you easily know which window within a screen session you are currently in.
if [ $TERM = "screen" ]; then
PS1='window ${WINDOW} '$PS1
fi
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.
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
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.
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.
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.
I like my pictures rotated in such a way that I don’t have to depend on application support for them to be displayed correctly. jpegtran (pre-installed on most distros) is a wonderful application with many features, including lossless rotation, but it’s too laborious for my purposes. That’s where jhead comes in.
You can simply go into a directory, run a command like the following, and everything will be done automatically for you.
jhead -autorot *.JPG
Of course I wouldn’t run it if you don’t have a backup available. I always keep the pictures around on my camera until I’ve confirmed that all processing was successful and then I still don’t delete them until the adjusted files were also copied to my external HDD in my semi-regular backup regime.
Another utility that can perform the same task is exiftran, but despite being more or less dedicated to this very purpose it’s not even easier to use: I’d expect exiftran *.JPG to default to the equivalent of the jhead -autorot *.JPG command I posted above, but instead you have to use exiftran -ai *.JPG. All other things being equal for my purposes, I decided to go with jhead because it has many more features — although last year I decided that exiv2 is superior to jhead in ease of use for most of those features.
If you’re just looking for the occasional lossless rotation, you could also try the Geeqie image viewer and manager. It integrates calls to exiftran, but beware that you explicitly have to choose the lossless option, as there are also lossy rotate options.