lostwebsite.net blog

Annex to the Lost Website

Archive for the ‘Ubuntu’ Category

My experience with Adobe Air

leave a comment »

Adobe Air is a new software platform from Adobe which mixes JavaScript and Flash technologies to enable developers to make rich Internet applications that can run on desktop computers. It is remarkable in the world of proprietary applications in the sense that it has included Linux support early on.

See the rest at www.lostwebsite.net…

Written by fdgonthier

November 18, 2009 at 8:00 am

Posted in Linux, Reviews, Ubuntu

Tagged with , , , ,

Good safeguards

with 8 comments

In my last post I’ve shown that some people are annoyed at the fact that they can no longer erase their root directory simply by typing rm -rf /. I’m happy that this possibility is removed. I’m not scared that means Linux is being dumbed down. There are already some safeguards in Linux and nobody is complaining about them because they guard even seasoned users to do things that are dangerous or silly.

See the rest at www.lostwebsite.net…

Written by fdgonthier

May 11, 2009 at 1:23 pm

Arrogant Linux Elitists

with 31 comments

Original post

Did you know that rm -rf / no longer works on recent Ubuntu version? I bet you did not because this command tends to be a bit destructive.

I did not know that. I’ve never been bitten by an accidental rm -rf / but the possibility scares the hell out of me whenever I do a command in my root directory or whenever I write scripts thats erase files.

See the rest at www.lostwebsite.net…

Written by fdgonthier

May 10, 2009 at 3:22 pm

Posted in Debian, Linux, Misc, Ubuntu

Tagged with , , , ,

Annoying non-breakable spaces in Bash/Zsh

with one comment

This is an annoyance I found got around to solve.  In Konsole, with a basic X configuration, when you type AltGr Space, you get a non-breakable space. It might happen in other things X terminal/shell combo, or the both of them might not matter at all.

If you are an heavy shell user, you might hit the AltGr Space combo by accident. This wouldn’t be bad if the shell made it somehow obvious that what you entered in a non-breakable space. The fact is that it doesn’t and it’s then totally impossible to distinguish a regular space with a non-breakable space after it was typed in the shell.

cd $HOME
zsh: no such file or directory: cd /home/fdgonthier

After typing such a command quickly, I was often left wondering what the hell was wrong with my command, since, as far as I could see, it was syntaxically correct.

The problem is that since there is a non-breakable space between cd and $HOME, Zsh wants to execute the whole command as a single command. Since I didn’t know I could even type non-breakable space in X, I checked what the hell the shell was doing by using strace. strace is my favorite diagnosis tool for any kind of problems in Linux. Programs don’t lie when they are spied with strace. The problem is obvious:

execve("cd\302\240/home/fdgonthier", ["cd\302\240/home/fdgonthier"], [/* 30 vars */]) = -1 ENOENT (No such file or directory)

It took me a while but I’ve found that \302\240 is the Unicode sequence for non-breakable space. Once I have found that, I Google search lead me to Launchpad bug 218637.

On this page, you see that you can disable non-breakable space using a xkb option in xorg.conf. Simply add the following in the InputDevice section related to your keyboard.

...
Option "XkbOptions"    "nbsp:none"
...

or use

setxkbmap -option "nbsp:none"

in a console, your favorite initialization file, or elsewhere.

Written by fdgonthier

October 27, 2008 at 2:39 pm

Posted in Debian, Linux, Tips and Tricks, Ubuntu, X11

Tagged with , ,

Partial Debian Mirrors

with 5 comments

The following is a description of the technique I’ve used to create partial Debian mirrors. I have damn near mastered that technique that is not immediately obvious if you don’t know the tool. Nothing there is black magic though, as you will see.

The following example will use the programs called reprepro and
germinate. Both are available on several versions of Ubuntu, Debian Lenny and Debian Sid. I’m not going to explain either in great details. They are well documented in the case of reprepro, and there is enough documentation in germinate.

Required steps

This configuration is necessary in both case.

reprepro is by far my favorite Debian repository manager. It has a steep learning curve at first but once you get past the initial configuration and the first few commands you’ll see it cannot really be made easier.

The first step is to create the directory that will contain the mirror. In that directory create a directory called conf.

In that directory, edit a file named distribution in your favorite editor At this point I usually pop-open the man page for reprepro. Write the following in that file:

Codename: etch
Architectures: amd64 source
Description: Debian Etch (required package only)
Components: main
Update: debian-etch-update

That’s all we need in that file right now. This describes what distribution this mirror will include. You can have several distributions in a mirror. Most field are self explanatory except perhaps the Updates field which will explain below.

Partial mirror, using reprepro only

The next step explain how to create a partial mirror using just reprepro. reprepro is powerful enough to select a subset of a whole package archive.

Name: debian-etch-update
Method: http://gulus.usherbrooke.ca/debian
Components: main
Architectures: amd64 source
FilterFormula: Priority (==required)

The content above is the content of your conf/updates file. It includes all the rules needed to update the distributions configured in the distributions file. The distribution etch we created in is linked to its respective update rule by the Update configuration field.

The key to partial mirroring in this case is the FilterFormula field, which selects just the Debian package in required in a very basic installation. There is also a FilterList field which can select just the set of package you list. This is the basis of the next section.

To start mirroring, go in the mirror directory and do:

reprepro -V update etch

and reprepro will start downloading packages. The -V argument activates verbose mode. After successfully creating the archive, you can reuse the same command to update your mirror.

Germinate and reprepro

germinate is an oddball program which, given a set of package, will recursively find all packages a set of package depend on.

As a simple example, if you tell germinate to germinate the dependencies from the package python, it will list libssl, libreadline and will eventually find libc6. It can also fetch build dependencies if you want everything needed to build the package you want.

We will use germinate to create a Debian repository that mirrors just the set of package the python2.5 package depends on.

germinate is a very specialised tool which sees little use outside making new Debian and Ubuntu derivative distributions. It’s very powerful but a bit confusing. I’ll give the basic recipe you need to know to accomplish our current goal. If there is enough or any interest, I give more use cases for germinate.

  1. Create directories called seeds and germinate. The former will include the files we give as input to germinate. The later will include germinate‘s output.

  2. In the seeds directory, create files called blacklist, required, STRUCTURE and supported. The blacklist and required will stay empty.

  3. In the STRUCTURE file, put the following:

    required:
    supported:
    

  4. In the required file, put the following:

     * python2.5
    

    Don’t forget the space at the start of the line.

  5. You can then run germinate.

    (MIRROR=http://gulus.usherbrooke.ca/debian
      cd germinate && \
      germinate -v \
                -m $MIRROR \
                -d etch \
                -c main \
                -s seeds \
                -S file:///tmp/temp-distro \
                --no-rdepends)
    

    where you can replace /tmp/temp-distro with the base directory of your mirror.

You should see a bunch of files created in the germinate directory. The only file we are interested in is germinate/required.

germinate output is meant to be human-readable so we need a bit of parsing to extract the required information.

The following Bash magic does the trick:

for pkg in $(cat germinate/required \
  | tail -n +3 \
  | head -n -2 \
  | cut -d '|' -f 1); do\
 echo $pkg install; \
done > mirror.packages

The resulting mirror.package is now suitable to act as a filter for reprepro.

Replace the FilterFormula line in conf/updates by:

FilterList: purge ../mirror.packages

purge tells reprepro not to do anything for packages not in the list.

Then run:

reprepro -V update etch

to create your mirror.

Written by fdgonthier

October 21, 2008 at 10:40 pm

Ubuntu on Sid

leave a comment »

Did you know you could pretty much install Ubuntu on Debian Sid? Now you do!

Well, yes and no.

Yes because I installed a set of Ubuntu packages on a (de)bootstrapped Sid Debian distribution.

No because the debootstrap actually installed Ubuntu packages, and the set of packages Ubuntu and Debian install at their base are actually quite similar.

If you diff the 2 debootstraps scripts (Ubuntu Gutsy vs. Debian Sid), you’ll see very little difference between the 2. To make that work you have to alias the Debian Sid distribution to Gutsy otherwise deboostrap will fail saying it can’t find the source distribution on the mirror.

On the CD I’m making, I’m using a custom distribution name, made off Ubuntu packages. With a quick hack to deboostrap, you can make debootstrap install Sid using Gutsy packages!

Written by fdgonthier

November 26, 2007 at 2:41 am

Posted in Debian, Linux, Misc, Tips and Tricks, Ubuntu

Tagged with , ,

Follow

Get every new post delivered to your Inbox.