Posts Tagged ‘ linux

Ubuntu – change custom screensaver text

The default text in the GLText screensaver in Ubuntu is “Host-Name, Kernel Version”. To change this, go to the screensaver folder in the terminal, and copy the gltext.desktop file to your home directory. Open gltext.desktop for editing (using emacs, for example), and change the line that reads:

Exec=gltext -root

to

Exec=gltext -root -front -text 'whatever text you like'

Might need to change permissions. I just ran chmod 777 and that did the trick.

This worked for me using Ubuntu 10.04 (Lucid Lynx).

Macbook Pro – Fink

Wow, it was so weird to power up the new Macbook Pro.  It’s new, but still so familiar – like coming home after being away for a really long time.  It’s been nearly two years, after all, and ALL Linux during that time (at home, anyway).  Not to worry – I have not abandoned my Ubuntu computer!

So first things first – make sure I have what I need to dive back into Python.  Well, luckily, Python is built in already (2.6.1).  So there’s a step I don’t need to worry about.  Next up – Numpy and Scipy.  It’s been so long since I’ve done this.  When installing open source packages on my Mac before, I used Fink.  I have vague memories of Val and Kurt walking me through it way back when.  Unfortunately I didn’t document it very well the first time.  I’ll keep better track this time.

Some notes on Fink install:

1) No binary for OS 10.6.x.  So I need to do a source install.  Instructions here, starting with downloading the source tarball.

2)  Install Xcode Tools (required for installing packages from source).

  • registered as an Apple Developer (woo, fancy), and downloaded xcode_3.2.3_and_ios_sdk_4.0.1.dmg (good lord, it’s 2.28GB!)
  • Run xcode installation

3) unpack the fink tarball

4) Install Fink base setup using ./bootstrap

5) Set PATH environment variable using /sw/bin/pathsetup.sh

And there’s Fink, all set up (hopefully).  It’s getting late, I’ll save Numpy and Scipy for another day.

Linux – save output to a file

I just tried running David’s script, and a waterfall of numbers flew by the terminal window.  Too many – I couldn’t scroll up to the beginning to see if the script was doing what I thought it was.  So how to direct output to a file?  A quick Google search brought me to this site, and below is the useful part:

Standard output >

Many Linux commands print their output to screen. For example, ls does this when it lists the contents of a directory: you see the output, the directory listing, on your screen.cat does the same: it concatenates a file and sends the results to your screen, and thus you can see the file’s contents. But the screen isn’t the only place where the commands can print their output because you can redirect the output of several commands to files, devices, and even to the input of other commands.

The CLI programs that display their results do so usually by sending the results to standard output, or stdout for short. By default, standard output directs its contents to the screen, as you’ve seen with the ls and cat commands. But if you want to direct the output to somewhere else, you can use the > character. For example, to redirect the output to a file, you can use the > character like this:
ls > dir_listing.txt

The above redirects the output of the ls command to a file called dir_listing.txt. Because the output is redirected to a file, you don’t see any results of ls on your screen.

Each time you repeat the above command, the file dir_listing.txt is overwritten with the results of the ls command. If you want to append the new results to the file instead of rewriting it, you can use >> instead:
ls >> dir_listing.txt

Each time you repeat the above command, the new output of ls is added at the end of the dir_listing.txt file instead of overwriting the file.

The following adds the contents of File1 at the end of File2:
cat File1 >> File2

Like I told you before, files aren’t the only places where you can redirect the standard output. You can redirect it to devices, too:
cat sound.wav > /dev/audio

As you saw, in the above example the cat command concatenates a file named sound.wav and the results are sent to a device called /dev/audio. What’s the fun here, then?/dev/audio is the audio device, and when you send there the contents of a sound file, that file is played. So if your sound is properly configured, the above command plays the file sound.wav!

Once I did that, I was able to save the file, and I could see that it was, indeed, doing what it was supposed to be doing (of course it was – it was only a matter of me figuring out how to look at it!).

Here’s the top part of the output (before it turns into a waterfall of numbers):

Bytes: 396 RecordType: 7200 fragmentNumber: 0
Bytes: 4613 RecordType: 7001 fragmentNumber: 0
Bytes: 4837 RecordType: 7000 fragmentNumber: 0
Bytes: 13109 RecordType: 7004 fragmentNumber: 0
Bytes: 21905 RecordType: 7006 fragmentNumber: 0
Bytes: 33072 RecordType: 7027 fragmentNumber: 0
%% DATA RECORD FRAME (11167) bytes
ProtocalVersion: 5
Offset: 60
Sync Pattern: 65535
Size: 11167
Optional Data Offset: 0
Optional Data Identifier: 0
Year: 2009
Day: 353
Second: 55.214169
Hour: 17
Minute: 53
Record Type Identifier: 7027
Device Identifier: 7125
System Enumerator: 0
Flags: 32769
Total Records In Fragmented Data Record Set: 0
Fragment Number: 0
DATA SECTION: 11099 (bytes)
Checksum: 788564
--- Data Section --
(Detection Properties Record)
Sonar Id: 0
Ping Number: 0
Multi-Ping Sequence: 0
Points(?): 500
Size(?): 22
Sample Rate: 34482.757812
Transducer Angle: 0.000000

It’s sonar data! It really is! Okay, mostly header info, but still… It’s probably a bit silly to be this excited about simply running someone else’s program. But I had to figure out at least 4 or 5 things just to get to that point, so it’s not a wasted evening, right?  :-)

Jonny B blogging

Jonathan Beaudoin, an old friend of mine from UNB, has recently moved down to UNH… and he’s got a blog!  Yay for nerdy blogs!  Check it out here:  2bitbrain.blogspot.com.  It’s totally on my Google Reader list, as of 5 minutes ago.

Jonathan does some really neat research, and is a fantastic combination of computer scientist/hydrographer /general smarty-pants, so I’m looking forward to following his adventures as he moves into mac-land.

Video editing in Ubuntu/Linux

My cousin Alexandra created this AWESOME video of her scooter road trip… check it out!

Scoot Scoot from ABEK on Vimeo.

This was great especially great because I have been meaning to look at what’s available for linux video editors. It used to be so easy to put together a nice home video using my old Powerbook.  But alas, the Powerbook is not in working order these days… But surely there is an open-source, linuxy solution!  A quick google search turned up this webpage, listing the author’s top 10 free video editors for Ubuntu (and presumably any flavor or linux). After having a look at the comments, it sort of seemed like the best one of the lot is KDEnlive, so I downloaded it.

I am in France for work, and am collecting video in the hopes that I will have a chance to put it together using KDEnlive (or maybe one of the other ones in the list).  I am not sure, but I suspect I will run into issues trying to do video editing using my little netbook – I’ll find out soon enough!

Back from Peru!

Hey – it’s been a while…but I’m back from Peru, ready to jump back on the Linux/Ubuntu/Python/GMT/MBsystem train – especially since I’ve gotten some tips in the meantime that will hopefully get me back on track with the issues I was having.  (I’m talking about you, GDAL! Thanks Kurt and Monica for your help!)

Happy Pi day, everyone!

Netflix on Ubuntu

We just got Netflix a couple of weeks ago, and can’t believe we didn’t have it sooner. We got the cheapest package – one disc at a time – but it’s fine because we can watch lots of movies and TV shows using our Playstation and online. Well, we can watch online using John’s Mac laptop, but currently it’s not possible using my Ubuntu netbook. boo! This is fine as long as John’s here, but soon he’ll be gone to Africa, and what will I do then?? Oh right, watch the movies on Playstation…but what if I have to travel and want to watch movies on my netbook? I took a quick look around, and discovered that there is currently no official support for streaming Netflix on linux. Apparently, watching Netflix requires Silverlight, a Microsoft product. There is an open-source version of Silverlight called Moonlight, but I have not read any success stories with Moonlight and Netflix. I guess there’s also the possibility of using Wine. I also read somewhere that Boxee supports Netflix viewing, and I know that Boxee is available for Linux, so maybe that will work. But the more I read, the more I think there’s not much hope for Netflix in Ubuntu right now. Boo!

The Playstation works well for me, although it’s annoying that you can’t search for titles. I’m not sure how much I like their setup for browsing either – you need to go through the lists of movies within a category one at a time. So even if you know there’s a movie you want to see in, say, the “violent war movies” category, you have to click through every single title before it. Obviously not a showstopper, but also sort of annoying.

I love the foreign films section. We just watched a really great Italian movie called “Amarcord”. It’s set in a small coastal village in Italy in the 1930′s, full of larger-than-life characters with huge personalities. The village reminded us of the small towns we visited when working in Calabria. One scene, on the night of a bonfire, with crowds of people dancing and music playing, reminded us of the Tarantella festival that we went to in the mountains.

Debian, Ubuntu, and dpkg

Over the last few days,  I’ve been trying to get GMT up and running on Ubuntu 9.10.  I’ve run into several roadblocks and difficulties along the way, including problems with installing and accessing supporting software packages.  The one that’s been causing me the most headaches is GDAL.

Kurt was helping me to figure it all out, and in the process introduced me to a new command that I’d never used before:  dpkg.  He got me to use it to look for installed packages.   I looked up the man page for it, and discovered that it is a package manager for Debian.  Which led to my question “What is Debian?”.  I’ve seen all kinds of references to Debian in Ubuntu, and lots of cross references in documentation and online forums.  I always thought Debian was a completely different OS, but there is more to it than that.

Here is a link to a page on the Ubuntu website:  Debian and Ubuntu. Ubuntu is built on the Debian Linux distribution. It is supposed to have more frequent security updates, a nicer desktop user interface, and frequent system updates so that an up-to-date Ubuntu system will provide access to software packages that are at most 6 months old. The Ubuntu website also claims that they provide bug fixes and feedback to Debian during their development process, not just at the release. In fact, there are supposedly several Ubuntu developers who are also Debian developers.

However, it’s probably worth knowing about the other side, too – some people really like Debian a lot more than Ubuntu, or other Debian-based distros.  This person discusses some dissent over Ubuntu being owned by a company (Canonical), thus undermining its open-source-ness.  Debian’s also strict about free software, while Ubuntu, apparently, is a bit lax on that issue. (re-branding Firefox as Iceweasel??)  They also say that Debian is compatible with Special Computer Architecture – so more robust for unusual setups, I guess.

In any case, I am happy with Ubuntu 9.10, but it’s good to know some background.

AUV runs on Debian Linux

This is sort of old news (October 2009), but I just found it on the Debian website. This article describes how a team of 35 students at Cornell University won a competition for autonomous underwater vehicles, AUVs (or unmanned underwater vehicles, UUVs). And their award winning underwater robot runs on Debian. Cool!

Installing Emacs on Windows

I tend to do everything I possibly can on Linux, but once in a while, I need to figure it out on Windows (*cringe). For example, today I am going to install Emacs on Windows. I quite literally have no clue how to do this, but a quick Google search turned up this page, which describes it in painful detail.