Entries Tagged 'Linux' ↓
July 10th, 2008 — Linux, Other
Because I use Linux on my servers + on my daily desktop (work and private) now, I don’t have an OS to play around with anymore and f*ck up.
So I’ve installed FreeBSD (only in Virtualbox for now). And it worked! Last time I tried to install FreeBSd, it hang on some network-driver issue.
Why FreeBSD? Well, I’ve read some good things about the ports system and it really is nice how you can mix binary/source packages. What’s also nice, is that you can adjust the compile options for each package. Handy for suexec for example!
But why not Gentoo? I’ve tried Gentoo a couple of times. I even had it for a desktop for a while. But it kept giving conflicts between packages and everything is from source. So I find Gentoo a little bit too time consuming for a day-to-day use. Oh, and FreeBSD has a nice installer. Gentoo has not. And it the next version of FreeBSD there may be even a graphical installer! Thumbs up!
The first thing I did after I installed FreeBSD:
pkg_add -r portupgrade fpkg
And what I’ve learned so far: If you use the -P parameter with the port* utilities, it uses binary packages instead of the ports.
I took me a while to figure that one out I was looking for a pkginstall command, but I couldn’t find it. So after reading some docs, it looked like port* was the answer, only you must use different switces.
The second thing I did, was to get rid of the csh shell. What a piece of crap! I installed bash and configured my profile to use bash. After editing /etc/passwd and messing it all up, I found out there was a command to change shell chsh to the rescue.
When I’ve found out how installing packages all works and when I’ve messed up my system for the first time, I think I’m gonna install it on a real computer. Maybe even try FreeBSD with Gnome.
July 8th, 2008 — Linux
Because I’m had (yes, past tense) some issues with Flash player 9 on Ubuntu Hardy Herron, I was looking for some simple way to install Flash 10 on my installation. So I browsed the Ubuntu forums a bit and fout some howto’s. But they all involved some downloading and manual installing the Flash 10 Linux package. Yeah, that was a no-go for me. First of all because it were only some minor issues and because I’m lazy. And manually installing is sooooo 2005.
But then I thought: waaaait a minute, I can pull the same trick I did with ruby 1.8.7 and guessnet! The steps:
- Copy this file to /etc/apt/sources.list.d/intrepid.list
- Apt-get update
- apt-get remove flashplugin-nonfree (just to be save)
- Add flashplugin-nonfree to /etc/apt/preferences (here’s the example how including ruby & guessnet)
- apt-get install flashplugin-nonfree
- Restart firefox
Voila: flash 10
The benefits: no as much cpu-cycles waisted as with Flash 9 (still a lot more than with Flash in Windows) and I don’t have the problem anymore that flash sometimes hangs my browser when I leave a page with Flash on it. Oh, and sometimes Flash didn’t load: that’s solved too!
July 3rd, 2008 — Linux
Since I’ve installed Ubuntu Hardy Herron I have this problem that the Glipper applet keeps crashing whenever I’ve started my Gnome desktop. When I add glipper to the panel again, it doesn’t crash anymore (for that session). I couldn’t find a solution, so I let it slide.
But, when I revisited Ubuntu launchpad today to search for the problem, a solution came up.
Someone was even so kindly to provide a deb with the fixed code. You can find that in the same bug report. Well, it really isn’t “fixed”. It’s just a workarround. But it works and it’s not annoying.
The workaround was really simple. Just add these two lines to the top of the glipper executable:
import time
time.sleep(8)
The glipper execuable in Ubuntu is located here: /usr/lib/glipper/glipper
I don’t know where it is in other distributions.
July 2nd, 2008 — development, Linux
The default vpnc in Ubuntu comes without openssl support. Bugger… But with these few lines of code this is solved:
sudo apt-get update
sudo apt-get build-dep vpnc
sudo apt-get install libssl-dev
mkdir ~/src/vpnc -p
cd ~/src/vpnc
apt-get source vpnc
cd vpnc-*
dpkg-buildpackage
sudo dpkg -i ../vpnc*.deb
Et voila: vpnc with openssl!
June 29th, 2008 — development, Linux, Ruby
There were some vulnerabilities in Ruby which are supposedly fixed in ruby 1.8.7. Because of that and because it’s always nice to have the latest, I installed ruby from Ubuntu Intrepid on Hardy Herron.
And while I was doing that I also decided to install guessnet from Intrepid. So I don’t have to compile guessnet anymore.
It involves two steps:
- Updating you apt sources
- Making sure only ruby and guessnet are going to be installed from the new sources. Not all the packages!
1. Updating your sources
Create /etc/apt/sources.list.d/intrepid.list and copy the following code into it:
deb http://nl.archive.ubuntu.com/ubuntu/ intrepid main restricted multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ intrepid main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://nl.archive.ubuntu.com/ubuntu/ intrepid-updates main restricted multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ intrepid-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://nl.archive.ubuntu.com/ubuntu/ intrepid universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ intrepid universe
deb http://nl.archive.ubuntu.com/ubuntu/ intrepid-updates universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ intrepid-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://nl.archive.ubuntu.com/ubuntu/ intrepid-backports main restricted universe multiverse
# deb-src http://nl.archive.ubuntu.com/ubuntu/ intrepid-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository. This software is not part of Ubuntu, but is
## offered by Canonical and the respective vendors as a service to Ubuntu
## users.
deb http://archive.canonical.com/ubuntu intrepid partner
# deb-src http://archive.canonical.com/ubuntu intrepid partner
deb http://security.ubuntu.com/ubuntu intrepid-security main restricted multiverse
deb-src http://security.ubuntu.com/ubuntu intrepid-security main restricted
deb http://security.ubuntu.com/ubuntu intrepid-security universe
deb-src http://security.ubuntu.com/ubuntu intrepid-security universe
2. Apt preferences
If /etc/apt/preferences does not exist, touch it!
Then copy this code into it:
Package: *
Pin: release v=8.10
Pin-Priority: -1
Package: ruby
Pin: release v=8.10
Pin-Priority: 500
Package: ruby1.8
Pin: release v=8.10
Pin-Priority: 500
Package: libruby
Pin: release v=8.10
Pin-Priority: 500
Package: libruby1.8
Pin: release v=8.10
Pin-Priority: 500
Package: rdoc
Pin: release v=8.10
Pin-Priority: 500
Package: rdoc1.8
Pin: release v=8.10
Pin-Priority: 500
Package: ri
Pin: release v=8.10
Pin-Priority: 500
Package: ri1.8
Pin: release v=8.10
Pin-Priority: 500
Package: irb
Pin: release v=8.10
Pin-Priority: 500
Package: irb1.8
Pin: release v=8.10
Pin-Priority: 500
Package: libopenssl-ruby
Pin: release v=8.10
Pin-Priority: 500
Package: libreadline-ruby
Pin: release v=8.10
Pin-Priority: 500
Package: libreadline-ruby1.8
Pin: release v=8.10
Pin-Priority: 500
Package: ruby-dev
Pin: release v=8.10
Pin-Priority: 500
Package: ruby1.8-dev
Pin: release v=8.10
Pin-Priority: 500
Package: guessnet
Pin: release v=8.10
Pin-Priority: 501
That’s all! “Aptitude update” & “aptitude install ruby guessnet” and you are good to go.
I tried using the “Package” keyword with wildcards, but that’s a no-go
June 28th, 2008 — Linux, PHP
I went to a customer for our three-weekly sprint review, I opened my mail there and it was full with hundreds of failed cronjobs. Ah, shit! Another night at the datacenter? But it wasn’t that bad
The server had ran an update of php that night and it broke. When I ran php4 from the commandline I got these errors:
PHP Warning: mime_magic: type search/400 \\input text/x-tex invalid in Unknown on line 0
PHP Warning: mime_magic: type search/400 \\section text/x-tex invalid in Unknown on line 0
PHP Warning: mime_magic: type search/400 \\setlength text/x-tex invalid in Unknown on line 0
PHP Warning: mime_magic: type search/400 \\documentstyle text/x-tex invalid in Unknown on line 0
PHP Warning: mime_magic: type search/400 \\chapter text/x-tex invalid in Unknown on line 0
PHP Warning: mime_magic: type search/400 \\documentclass text/x-tex invalid in Unknown on line 0
PHP Warning: mime_magic: type regex [Cc]onstant[[:space:]]+[Ss]tory text/x-inform invalid in Unknown on line 0
Wait a minute… I know these errors! But, of course, I hadn’t documented the solution when I first fixed them. So after much searching I found the workarround again:
In the /usr/share/misc/magic.mime file, find the section that begins "# TeX documents, from Daniel Quinlan" and comment out the lines in that section.
# TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com)
#0 search/400 \\input text/x-tex
#0 search/400 \\section text/x-tex
#0 search/400 \\setlength text/x-tex
#0 search/400 \\documentstyle text/x-tex
#0 search/400 \\chapter text/x-tex
#0 search/400 \\documentclass text/x-tex
# Type: Inform interactive fiction language
# URL: http://www.inform-fiction.org/
# From: Reuben Thomas
#0 regex [Cc]onstant[[:space:]]+[Ss]tory text/x-inform
NOTE: For Debian, it appears that this file is located at /usr/share/file/magic.mime!
June 26th, 2008 — development, Linux
I had to make a couple of diff’s lately and I always forget what switch to use
So here is it:
diff orig_file patched_file -u
June 25th, 2008 — development, Linux
On v2 of my website I wrote a post on configuring a webserver for testing/developing purposes. In that post I explained how to adjust the umask of Apache. I did that by changing the Apache startup script. But, of course, when apache is updated/upgraded, you custom mod will dissapear. In coincidence I stumbled upon a post that explained how to add environment variables to apache without modding the distribution scripts.
All you do is adding the desired variables to “/etc/apache2/envars”. That’s it!
June 25th, 2008 — Linux, PHP
I’ve installed rubygems manually (no package manager) in my home directory. But since then “gem –version” reported that it could not it’s version. So now I’ve removed the previous installed version, downloaded the tar and reinstalled. I’ve used this command to install this time:
ruby setup.rb --destdir=~/.rubygems --prefix=/
And now it runs fine!
leon@polly:~$ gem1.8 --version
1.2.0
And I’ve installed ruby 1.8.7 (from Intrepid) on Ubuntu Hardy. But more on that in my next post.
June 20th, 2008 — development, Linux, Ruby
I’ve installed puppet recently and I’m know trying to understand how it works and make use of it
If that’s not difficult enough, I encountered this weird behaviour that the –noop argument didn’t do anything. After an hour of searching I realized it was my own stupid fault!
I had to puppet configuration files: /etc/puppet/puppetd.conf (old way) and /etc/puppet/puppet.conf (new way). I browsed throught the source code and it looks like puppet first checks the old file, if it is found it parses that one. If it’s not found, the new file is parsed. I don’t know why, but if the old file is used, the –noop argument isn’t parsed by puppet. So removing /etc/puppet/puppetd.conf was all I had to do. Pffff….
But why did I create the puppetd.conf file? Because I’v read the “Pulling strings with puppet”-book. And althought it’s fairly new, puppet is advancing at a very high rate. So the book is becoming out-of-date already.