Posts

Showing posts with the label linux

Grub Could be A lot Simpler

Today I reinstalled Windows XP on my son's machine (my old machine). Ubuntu works perfectly with sound, video, and internet, but Windows... In Windows, I had no sound, no internet, and problems with the video card. Then when I tried to update, it said I can't use and English version of XP in Brazil! So I reinstalled with a Brazilian version of XP which blew away the boot sector (and thus the menu for selecting Ubuntu is gone). There are some good instructions here on how to restore grub, but jeez, such a simple program has to be so much work: sudo␣grub find␣/boot/grub/stage1 root␣(hd0,1) setup␣(hd0) Worse, it's even picky about spaces, you need to put a space (shown above as '␣') or you'll get an error message, you've got to be kidding me. If you forget the sudo, it gives you useless error message instead of mentioning that running as root is probably a good idea. I suggest they fix grub with tab completion so that I can just press " r " and...

Hard Drive Cloning in Ubutnu

I'm buying a new computer, but the new computer is without a hard drive nor a video card. My computer is going to Victor who's has increasingly found it difficult to buy games for his computer, even games that are 4 years old. Victor will get my old 120 Gig drive and I'll just use the 450 Gig drive that's also been on my computer for a while. I've been running my computer off an older 120 Gig Maxtor with another 450 Gig used for backup and some larger files. My idea was to offload all the files off the 450 Gig (to my 1 TB drive my video server) and move all my stuff from the 120 to the 450 and just use the 450. I searched the Internet but it was not clear what the best method was to use. In short I: Copied off all the old files off my 450 Gig drive using rsync. I used GParted to clone the 120 GB drive to 450 GB (using copy-paste!). I created a bootable "live" version of GParted CD from here . I unplugged the 120GB drive and just left the 450GB in it...

My Backup Setup

Mostly my "backup" in the past has been putting everything into an offsite subversion repository. This works, but there are always things that I don't have saved that ends up being important and I don't normally save my large images. On occasion, I'll also make copies to DVD (in sets like "pictures") and that works fairly well too, but I don't do it often enough. I've wanted to setup a a real backup setup like provided with bacula , which is very complete and has a great name and subtitle ("It comes by night and sucks the vital essence from your computers."). Under Ubuntu is installs quite easily but getting it setup is quite daunting, it's more for a company wide backup solution. I like the fact that it's written in Python and that it can properly backup even Windows machines, by installing a small program on each machine. But in the end, after reading the whole manual, I never got it setup. I just installed a new drive whic...

Two Great Podcasts

Image
I've been watching two great podcasts (or technically vodcasts ) about two programs I'd like to use more often, Gimp and Inkscape . I've been watching these with Miro which is a useful tool to get and watch podcasts. Miro used to be called Democracy and used to crash all the time in Linux, but this version is much more stable. My only complaint is that you can't multi-task: watch videos while browsing other content from within Miro. One podcast I've been watching for a while is called Meet the Gimp . Ever since I've started watching this podcast I've been enthusiastic about cleaning up and improving my own digital photographs. Now I know how to efficiently cleanup my photos and I go and do it much more often. For example Episode 42 shows how to to quickly improved the color of a photo that looked rather dull and also how to use the healing tool to remove some birds that are just in the way. Or Episode 46 which uses two photographs (both taken with...

Unison Bash Completion

If you don't use unison to keep folders synchronized you really should, it's great. It's like a two way rsync program. Problem is I end up synchronizing a bunchy of folders in different locations for different projects and I prefer to start unison at the command-line. What I want is bash completion for unison. It's not that difficult to setup. I just created a file in /etc/bash_completion.d called "unison" and it looks like this: _unison() { local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" opts=$(python -c 'import glob,os,os.path;x = glob.glob(os.path.expanduser("~/.unison/*.prf")); print " ".join([os.path.split(y)[-1][:-4] for y in x])') COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 } complete -F _unison unison-gtk The python part is all one line and it goes to my ~/.unison folder, lists all the *.prf files and then just gets...

Upgrade to Hardy Heron (Ubuntu 8.04)

This Monday was a holiday here so I thought it might be a good time to upgrade my Linux, a couple of days before the official release. It took a long time to download all the updates, but it seemed to get everything and then started the installation process. I went inside to finish the last few episodes of Lost, I finally watched all 4 seasons of after beginning about a month ago. I have to say that the 4th season is a letdown so far. I mean seriously, you need to have an emotional "constant" for time travel? That really made me cringe, the writers need to stay as far away from math as possible. When I came back to the computer to see how it was going I was at 1% and got an error already. I spent the rest of the night clicking "OK" buttons because it kept finding problems with the install. After a hundred of these it gave up and it quit the upgrade. But by that time, I had already started noticing that things had stopped working, like Gnome Nautilus, ugh. So...

Home Theater PC

This Friday I bought a new PC to be used as my Linux Home Theater PC (HTPC). ATX 480W Slim HTPC cabinet VGA 512 GFORCE 8500GT, PCI CPU Intel Core 2 DUO E6750 DDR2 1GB 667 Kingston DVD/CD DL Samsung Gigabyte GA-P35K - LGA 775 SATA 500 Gig HD (Western Digital) Gyration Wireless 3d Mouse and Keyboard . I tried using the beta of Linux MCE, but it didn't work at all (video problems). I used an older version of Linux MCE and got it working a bit. But I didn't like the fact that it picked it's own name for my machine and user name. I gave up on that and am now using the 8.04 alpha (yes alpha, I never learn) of Mythbuntu . Mythbuntu worked reasonably well out of the box except a lot of the configuration screens didn't fit my 480P. The OK or Next button would be off screen and I couldn't figure out how to move the window up so I could see it (Alt+Drag with the mouse is the trick). Other problems I had was that Myth defaults to hiding your mouse cursor so you can't s...

Bash notes

As a regular linux user I have some hints and tips how to setup bash : Create a ~/.bash_aliases file and store all your aliases and functions there. You'll need to source the file in ~/.bashrc, see below. For common directories you visit create an alias that cd's to that folder starting with _. Using the underscore is short and sweet and doesn't pollute your namespace as much. Here are two examples (the latter also changes the window title): alias _mydir='cd /home/scott/my/dir' alias _other='cd /home/scott/src/projects/other;echo -ne "\033]2;Other Project\007"' Use these cd aliases: alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' alias .....='cd ../../../..' Use these ls aliases. (h is for "human" file sizes, F is for adding a trailing / for directories) alias ls='ls -hF --color=auto' alias ll='ls -lhF --color=auto' alias la='ls -AF --color=auto' alias lrt='ls -lr...

Using Gimp

Image
I was thinking why I keep using GIMP instead of, say, Photoshop. Here are my main reasons in bullet form: It's free and open source and I support that. It uses Python as one of it's scripting languages. I've created two mini utilities using that fact. Using Python-Fu instead of say PIL is that it uses the same object and object names as GIMP uses. Learning more about Python-Fu makes me a better GIMP user since I know better how GIMP works. Create the images using GIMP by hand I can decide later if it might be easy to script. If not, I'll just do it all by hand. I can install GIMP on anyone's machine in minutes, no legal hassles or possibilities of installing a virus from pirated software. Once I install GIMP on a machine, I can use it immediately. I don't have to figure out the interface of a program I'm not familiar with. Some cool new features come out first for GIMP. GIMP can load files directly from the web or FTP. GIMP has everything I need: cli...

Simple fix to Gnome Terminal

I often double click on a filename or folder and then paste it with the middle button (the scroll wheel), in Linux. What annoyed me was that it doesn't get the ~ character so if I'm cutting an pasting my current path as shown on the command line scott@home:~/src/folder/name$ Double click, middle click gives me /src/folder/name and not ~/src/folder/name . How annoying, I have to cursor all the way to the beginning and enter the tilde character. Even worse if there's an error message like: Error in ~/src/folder/name.cc:123 Double click, middle click gives me now /src/folder/name.cc:123 . Now I have to edit both sides. The fix is simple, go to your Gnome Terminal|Profiles... and edit your default profile. The first pane called "General" and has a field called "Select-by-word characters". Add the tilde (~) and remove the colon (:) and you're done. There, I just saved you 2 thousand keystrokes a year.

I'm now a Vi user

Image
I've used my fair share of text editors including Emacs for 2 years and Eclipse several years. My favorite open source program has always been Scite , and I still have it on my launch panel. But now I'm a vi man. I tried to go back to Emacs , but it takes so long to get used to and there are too many funny keystrokes. Emacs users tend to get an Emacs Pinky from using the Ctrl key so much, which was not a problem I was looking forward to. Emacs also seems to have too many choices, too many cool downloads to get, each of which slows down the startup time. I liked Scite because the keyboard was setup similar to Visual Studviio, which I had used for years. It is also a solid program that is very customizable. Also, being open source is great, I even contributed some code to the project. But after reading this article I decided to give vim another try. What got me interested again was the suggestion to always be in 'normal' mode and to be in insert mode only for short...

First time upgrading Ubuntu successfully

The last two time I upgrade Ubuntu I had a lot of problems. After rebooting, my X windows was usually messed up and I had additional problems with the last upgrade. However, this last upgrade was relatively painless, but it did fail the upgrade and then leave the Update Manager without any hint what to do. Of course, now I'm pretty experienced and know all the apt commands by heart. I ran "sudo apt-get -f install" to find the problem then "sudo apt-get remove python-setuptools" which seemed to be the problem package. Then I ran the Update Manager again and it went on it's way. For some reason, after installing everything the Update Manager said it was finished and never asked me if I wanted to reboot so I was a little extra hesitant the first time I rebooted. I crossed my fingers and rebooted and a new Ubuntu came out without any errors. I'd say the nicest thing I've seen so far with the new Feisty Fawn is running "python" and seeing ve...

dos2unix

The other day I was going through some of my files and noticed that some files had the DOS style CR/LF lines, ugh. I couldn't remember what the standard tool in linux is to convert this, turns out it's dos2unix which is linked to fromdos command. The package is called, forgettably, tofromdos, i.e. to install it you need to call: sudo apt-get install tofromdos For such a simple utility it doesn't provide very much, there's no man page and only -h works and not the more common --help, but it does work as advertised. I was surprised that it isn't included in the standard Linux install.

Messed up Ubuntu, again

Image
I've not been having great luck with Ubuntu recently. Two weeks ago I tried an upgrade and failed miserably (see thread ). I was able to backup and essentially reinstall from CD and start all over (which isn't all that hard with Synaptic, it's just click and install and rsync to recover my 45 gig backup). You'll notice that there are no window borders and the console is actually on top of the panel at the top of the screen. Then this week I was playing with vnc2swf and somehow I killed my window manager. Basically, my machine would start up but had no borders around the window, they are unmovable and I can't Alt-Tab to different programs. I 'knew' the problem was with the window manager, but what is that called, and how do I set it up properly? At first I thought it was GDM (the GNOME Display Manager) , but after fiddling with that for a bit I realized (eventually) that I was wrong. Some more surfing and I realized that it is probably metacity (althou...

Linux to take over the desktop?

This topic is brought up quite a bit on the internet ( google search ), but there are some new reasons that we may see a greater takeover of the desktop. Microsoft's new Vista is expensive , has too many versions, Vista requires a beefy computer , Vista's DRM is possibly killing itself . Microsoft has to lock down their operating system because of malware. This will make it more difficult for other software and hardware to work with Windows, and for users to set up their computer the way they want. Compelling gaming consoles and increased PC graphic card costs may kill PC gaming. The big advantage of PC gaming was that you had a better screen, a keyboard and the possibility of stealing games from the Internet. Also, you had a good excuse to purchase a kick-ass computer. Now with high definition televisions and gaming consoles with special remotes , all of a sudden installing games on a PC seems like a lot more work. Really super easy installs with the Synaptic package m...