# tianjara.net | Andrew Harvey's Blog

### Entries tagged "linux".

7th March 2011

...and I'm back. I've finally upgraded from the nvidia proprietary driver, to the open source nouveau driver. After a little bit of time stuck at the console (I somehow managed to break X) trying to remember how to do things without a graphical display, I've got things working normal again.

First impression is compiz seems to be much slicker (ie. animations are smoother) on nouveau rather than the nvidia proprietary driver. I like it.

I had a couple of hiccups in the switch. I needed to clean /etc/X11/xorg.conf down to the 4 line minimal version to get a sane display resolution, and I needed to properly remove the nvidia proprietary driver (apt-get remove worked, but I needed to remove all the non-free nvidia packages). I also needed to install libgl1-mesa-dri-experimental to get direct rendering for compiz and basic OpenGL programs to work. Compiz seems to run fine now. The only noticeable difference in SuperTuxKart is a white flicker...

Tags: linux.
29th August 2009

(Warning, I really have no idea what I'm talking about here, especially tty)

Yesterday Compiz crashed, probably seg faulted. I managed to restart it but then Cario (which Compiz was using) seg faulted. I ended up restart the X server. But just now Compiz crashed again. Most of the time when it crashes all is well it uses the default window manager without the flashy Compiz effects, but this time didn't, I couldn't move windows at all and there were no decorations. I could click launch icons on my top Gnome panel, but whenever I opened up a terminal I could not enter any text although I could still interact with it with the mouse (ie. use menu bars). I ended up (since my web browser was still displaying stuff) typing compiz into a text area in Firefox and selecting it, so I could middle click paste it. Then I created a custom application launcher in my Gnome panel, middle click pasted the command compiz and then I could click that one in the Gnome panel to start compiz again. All was fixed.

But there is something I still can't find the answer for. I tried going into a different tty using Ctrl+Alt+F1, but trying to run compiz in tty1 failed because it was "unable to open display """ and also "no xterm found". What I wanted to do was start a process in tty1 for tty7. I have no clue how to do that. Any ideas? I endeavour to learn more about the X Window System. Oh and if all else failed I could have restarted the X server, but then I loose a lot of stuff in RAM (such as things I haven't saved).

Tags: linux, ubuntu.
29th June 2009

Just some Ubuntu/Unix commands that I seem to find very useful but can be hard to remember at times.

### PDF Concatenation

pdftk in1.pdf in2.pdf cat output out1.pdf

Its annoying that nautilus doesn't integrate this by default, so I could select some PDF's then right click and choose merge. Luckily I can do this with the fairly simple Nautilus Actions Configuration app. But this takes time and the average user doesn't have the time to research these things on how to do it themselves. Of course this could be extended further to match what you can do from the command line, such as choose some method of ordering the files, or choose to do weird things such as rotate every second page. Sure you want to keep things simple, so as a start it would be great to see something basic. There are probably even nautilus scripts in the repositories out there that do this exact thing, but you spend half your time finding them and installing them. I think this should be enabled by default, or put in some options page somewhere.

### Truncate an mp3 file

mpgsplit input.mp3 [00:00:20-00:00:58] -o output.mp3

It appears that this doesn't re-encode so it seems to run very fast.

### Mount an ISO

sudo mount -o loop ~/disk.iso /media/cdrom0

### Strip audio from a video file

ffmpeg -ab 320k -i in.mov outaudio.mp3

Unfortunately when I left out the bit rate, it defaulted to 14K or something much lower than what the source file was using.

### Search all files in the current directory for some string

find . -exec grep "searchthisstring" '{}' \; -print
find . -exec grep -q "searchthisstring" '{}' \; -print

### Trim and nup pdfs

pdfnup --nup 2x2 --pages 26-140 --trim "1cm 1cm 1cm 1cm" infile.pdf

### Wake from Suspend

sudo rtcwake -u -s 12600 -m on

... then you need to manually put the computer in suspend and 12600 seconds later the computer will resume.

### Susped

pm-suspend

### Shutdown

sudo shutdown -h now sudo shutdown -r now

... the -h means halt (shutdown), -r means reboot.

### Tar and Gz all the files in a directory

tar -cvfz file.tar.gz *

wget -S --spider http://www.site.com/file