Posts

Showing posts from January, 2008

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 -lrthF'
functi…

New Year's Resolutions

My NewYear's Resolutions:
HealthHave a regular exercise program (3 times a week, tennis or squash counts for at least 8 months).Continue eating healthy, but eat little less meat and dessert (hard to quantify).Loose 12kg over the 12 months.Go back on the Shangri-La diet for at least 3 months.
Fix/BuildGet a new computerGive my old computer to Victor.Get another 500 Gig of space.
Make the practice greenIt won't be finished this year, but I plan to have the hole dug, the channels and gravel and the first level of sand done by December.
Do something with MAME.
I have an old computer it may be interesting to get it working as a dedicated MAME setup, if it can handle it and maybe leave it at the farm.Have a commercial printer print up a plasticized design that we draw up for Victor's MAME console I built.Work on my open source programsHave unit tests for all of them.Publish/revive one of my older stuff.
Make one new project this year.
Make 6 commits on some other OSS project that isn&…

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 twomini 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: clipping, masks, l…

Downloading projecteuler.net

Project Euler is having some problems, and in any event, I wanted to download the questions that I haven't completed yet so that I could work on some problems even when I'm off the net. I thought of use httrack which is made for this, but it doesn't seem to support passing cookies from firefox.
Wget is the swiss army knife for things like this here's what I did:
wget --load-cookies $COOKIE --convert-links --recursive --level=1 --restrict-file-names=windows $SITE Where COOKIE points to my firefox cookie file (~/.mozilla/firefox/.defulat/cookies.txt)
and SITE is the project euler site (http://projecteuler.net/index.php?section=problems)
The parameter --convert-links will update the links so that they work offline and --level is to go only one level deep. The restrict-file-names=windows is needed so that firefox can read files with ? or = in it.