It’s called a resize grip, you can’t disable it (seems to be a common theme nowadays…) and it sucks.
Stay the FUCK out of my windows with this crap!
It’s called a resize grip, you can’t disable it (seems to be a common theme nowadays…) and it sucks.
Stay the FUCK out of my windows with this crap!
I need hardlink support in sftp and the newest ssh version provides this. But there are no packages
for Ubuntu 10.10. Therefor I backported OpenSSH from Ubuntu 11.04 to 10.10. Here you can find
these packages:
The minimum upgrade consists of installing openssh-client and openssh-server.
OpenSSH 5.7 adds hardlink support to the sftp protocol:
sftp(1)/sftp-server(8): add a protocol extension to support a hard link operation. It is available through the “ln” command in the client. The old “ln” behaviour of creating a symlink is available using its “-s” option or through the preexisting “symlink” command
This is awesome as I can use that to make rdup work (better) with sshfs.
I’ve created a patch to add hardlink support to sshfs. See below. I also created packages for ubuntu:
…Or why shell scripting is not really programming. Two scripts, one
called bash-hate:
#!/bin/bash
count=0
cat /dev/null - | while read line; do
((count++))
done
echo $count
and the other one zsh-love:
#!/bin/zsh
count=0
cat /dev/null - | while read line; do
((count++))
done
echo $count
Then:
% cat testfile | ./bash-hate
0
% cat testfile | ./zsh-love
9
(Yes, I know about subshells. Just learn a real programming language.)
It is already possible to use filters in Git. But embedding the current file name in the expanded string is somewhat harder.
You can do this by some edit wrapper which inserts the file name “at the right time”, but I think it is much more cleaner to do this in the git-filter script.
For Puppet I want system administrators to see from which directory in the Git repository the file came from, like so:
Well, the upgrade was easy enough, some weird LDAP database corruption
that was fixed easily by running db4.7_recover in /var/lib/ldap.
There is something fishy going on in /etc/nsswitch and using ‘files’
instead of compat. Got lots of segfaults:
[90474.491264] zsh[5668]: segfault at bfcf07ef ip 001be398 sp
bfce4efc error 6 in libnss_files-2.12.1.so[1bc000+a000]
Not enough for a bug report (yet), I still need to examine this further.
I did a small upgrade to the newest version of Chromium and all of the sudden the fonts in the browser area were all blurry and fuzzy…
After some searching it turned out that WebKit (which Chromium uses for
the rendering) uses the settings from font-config instead of the whatever
you click inside your DE’s configuration tools.
% fc-match -v Arial | egrep 'family|hint'
family: "Arial"(s)
familylang: "en"(s)
hintstyle: 1(i)(w) <- '1' means slight hinting
hinting: FcTrue(w)
autohint: FcFalse(s)
And to remedy the situation:
I have an Asus EeePC on which I’ve installed Ubuntu 9.10. But now I wanted a working hibernate (suspend to disk) and suspend (suspend to memory).
Hibernate was working out of the box (well the going to sleep part, at least), but resuming took almost as long as a cold boot. Another thing was that my wireless was broken after a resume. On my happiness scale (range: 0-10) this scored a 3.
I want to upgrade my server to the new Ubuntu and switch to 64 bit on my main server. This is how I managed to get Ubuntu Lucid (Alpha 3) running on my (test) machine, with RAID1 + BTRFS and 64 bit. It is a running story on how I spend my Saturday afternoon, you might need some decent Linux knowledge to follow my lead.
Here we go.
The following lists sums up my needs and troubles:
One of the oldest tricks in the sys admin’s arsenal is
booting with init=/bin/bash. You’ll need this when
you want to reset the password for root for instance.
It used to go like this: Boot with init=/bin/bash and
after some time you greeted with a prompt ala
root@(none):/#
Most often I then took the following steps:
mount -o rw,remount /
/etc/init.d/networking start
Now you also have networking, so you may upgrade the
system with apt-get or whatever… You are now a
happy puppy.
Familiar with the following?
You are aware of (shell)file which contains a interesting line and you think: “I want to execute this line on the command prompt”. Most people will do the following:
% more <file>
[select interesting bit with your mouse]
[paste]<enter>
And the code gets executed.
I propose the following function: f(), which does the following:
vim of course);The code of the function looks like this:
This is a translation from this article which is published in Dutch
During our work at Octrooicentrum Nederland somebody came up with the following question. During the night a file was created in a directory and he wanted to know who (which process) was responsible for that. My first reaction was: “Can’t be done”.
However, that evening I thought of inotify which could be of help.
With inotify you can watch your file system
and get notified when “something” (read, write, create, etc.)
happens. For (much) more detailed information look in inotify(7).
After running with the old style for a couple of years I wanted
something new. And after a few days battling with Wordpress I decided
to stay with nb, because it just rules.
The theme is loosly based on the design from Wordpress called
SimplicitlyDark and the css from
daring fireball.
But still a new (clean) style. During the restyling I also fixed
the archives and found out that nb cannot handle articles
with [[ in their name.
Apparently the cups driver (ppd) for Ubuntu (in both Karmic and
Jaunty) is not installed by default, see
this and
this for
more information.
The strange thing is that if you look at openprinting.org, it says
Dymo LabelWriter 400
Supplied with CUPS Works perfectly.
Supplied with cups??? Works perfectly?? How, where, when??
Well:
% apt-get source cups
% ls -l cups-1.3.9/ppd/dymo.ppd
-rw-rw-r-- 1 miekg miekg 24K Nov 27 2007 cups-1.3.9/ppd/dymo.ppd
And that’s your ppd file. For good measure I’ve put this up
for download here too.
My small and very personal comparison between Fedora 11 (which I run on my laptop) and Ubuntu 9.10 which is my main Linux distribution.
yum vs apt-getyum is a lot slower than apt-getyum searchyum defaults to ‘N’ (no) when I ask it to install software?All in all I like apt-get a lot better.
Very nice to see this in Fedora 11, I want this too for Ubuntu. Too bad Ubuntu does not use this in 9.10. It will happen in 10.04 (I heard).
I installed my new laptop with Fedora 11, and I must say that it is a very nice distribution. I’m even contemplating leaving PulseAudio enabled, ‘cause it just works. Unlike ubuntu.
To update my story on the KPN dongle (dongel). I just used it on this laptop and it worked out of the box. The only thing you need to remember is that you need to insert the stick before booting you machine. It will not work if you insert it afterwards. If you observe this rule it will just pop up in NetworkManager.
On my new netbook
I wanted to get rid of gdm and
just start X right away. I use auto-login anyway so it
is a bit stupid to first start gdm and then immediately start X.
So I removed gdm and edited /etc/rc.local to start X:
su - miekg -c xinit xterm
But this sort of does not work anymore in Ubuntu Karmic. Karmic
now uses upstart as an init replacement.
So I figured why
not write an upstart job that starts X?
I’ve bought a new 11.1" netbook from Asus, this is going to replace my aging 4G Surf (named charm). I’ve named the new one up, so I’m hoping the Large Hadron Collider is up and running soon and discovers a new flavor of quarks - ‘cause I’m running out of names. (strange is already allocated if I ever buy a Mac and run Linux on that, top and bottom just don’t sound right).
iotop is a very neat tool showing the processes which do the most
i/o in a top-like manner.
Again having fun with SLES:
SLES-10:
# rpm -i /tmp/iotop-0.3.2-1.1.x86_64.rpm
warning: iotop-0.3.2-1.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID ee454f98
error: Failed dependencies:
python >= 2.5 is needed by iotop-0.3.2-1.1.x86_64
Goes off and installs SLES-11
SLES-11:
# rpm -i
warning: /tmp/iotop-0.3.2-1.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID ee454f98
error: Failed dependencies:
python < 2.6 is needed by iotop-0.3.2-1.1.x86_64
Nooooo!
An unofficial rpm of e2fsprogs installed on a SLES 10 system:
# ldd /sbin/e2fsck
libdb-4.3.so => /usr/lib64/libdb-4.3.so (0x00002b5e004e2000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b5e006d6000)
libc.so.6 => /lib64/libc.so.6 (0x00002b5e007ef000)
/lib64/ld-linux-x86-64.so.2 (0x00002b5e003c6000)
Now guess what happens when you reboot?
The nss-ldap module allows you to have your user information
in a LDAP server. Within the module you can select some
options on how to connect to the LDAP server:
hard, use an exponential back-off when connection, waiting
up to 64 seconds before trying a different server.soft, when the server is not responding give up immediately.The problem is, both are insufficient…
With soft you don’t have any benefits for your backup LDAP server.
With the hard policy you can failover to the second (or third) server,
but when you boot the machine (and it does not have networking) you are
stuck with the exponential back-off. This can mean that booting a server
can take a couple of hours: every uid lookup will take 64 seconds.
Well, as I’m off to The Hague for the rest of the year, I need some kind of Internet in the evening. So off to KPN to get a umts card (or dongel as they call it). For late night gaming I’ve also bought a PSP :-)
Well, to make a long story short: this stuff is hard to get working in Ubuntu. When you insert the dongle it is first seen as a cdrom…, only after you successfully install the Windows software it will become a modem. Who comes up with this kind of crap?
After trying out Zabbix, I’m back to
munin and monit for my (small) monitoring needs.
I think the beautiful rrd images of munin are just unbeatable and
monit has never let me down; you can easily restart daemons -
something I was still configuring in zabbix. And
our
Ubuntu Certified Professional Course
also has a few slides on munin. This was the last push I needed.
I was still a bit rusty so I just followed a howto to do the initial configuration.
Well, a lets-install-kernel-2.6.31-on-Ubuntu-Jaunty turned out to be a bad idea. The kernel install went OK, but my X went poef. No more bitmap fonts. Looks like some bad interaction between the X Intel driver and the new kernel mode settings.
Anyhow, I figured why not upgrade to Karmic? 15 minutes later my desktop system was completely hosed and I was left staring at a GRUB 1.97 menu.
I never knew that the GRUB command line allows you to type
With monit services are restarted, ever since I’ve installed zabbix I
wanted the same functionallity. Turns out this is possible, but it
takes some configuration.
Also see the zabbix manual, where it gets interesting from page 160 onwards.
In zabbix go to Configuration->Actions.
Add a new ‘Action Operation’ in which you want to run a remote command.
elektron:/home/miekg/bin/zabbix_service {TRIGGER.NAME}: {STATUS}And zabbix_service is now a shell script which will echo its
arguments to a file in /tmp.
The shell (in this case bash) is packed with features. So much so that
you will probably never ever learn them all. Brace expansion is one of
those things.
What is it? In the bash manual it says:
Brace Expansion
Brace expansion is a mechanism by which arbitrary strings may be generated. This mechanism is similar to pathname expansion, but the filenames generated need not exist
So what is it? You can make your shell generate strings, like so:
Just bought anothor EeePC, this time the 900HD variant. Installing Ubuntu as we speak and giving Windows the boot. The 4 minute encounter with Windows XP (which felt like 4 hours) gave me the impression of a fast machine. This was just a quick peek to see if the hardware was working.
Going with Ubuntu 9.04 - then removing Pulseadio and (maybe) upgrading the kernel to 2.6.30.4.
The trick is to disable the hardisk in the BIOS and to disable all quick boot stuff in there too. So that my SD card with the Ubuntu install will boot.
Excellent idea Ton!
How to make a custom filter in git to expand the string $Hash$ to
something more usefull, ala the $Id$ (which git already supports), but
then with more info (committer, date, etc.).
Which also helped in this case was the Pro Git book which is, as of now, a must buy.
But as always is the case between Ton and me, I find his scripts too long :-) So I miekified his solution.
While rechecking my rdup test-suite one of the tests failed. On closer inspection it was due to the following line:
DAY_BEFORE=$(( $(date +%d) - 1 ))
When $(date +%d) is 10 this yields:
$ DAY_BEFORE=$(( 10 - 1 ))
$ echo $DAY_BEFORE
9
Also with octal values (those starting with a leading zero), it also works:
$ DAY_BEFORE=$(( 06 - 1 ))
$ echo $DAY_BEFORE
5
So when does this go wrong? When the day is 08 or 09 (as it is
today):
A customer wanted some performance figures for a ESX cluster we built. We used our own atop and the trusted workhorse of plotting Gnuplot to make some performance plots.
As said, we used atop for this, it has a nice data gathering
mode which prints out lines like these:
13:40:07 cpu %usr %nice %sys %irq %softirq %steal %wait %idle
13:40:08 all 0 0 0 0 1 0 4 95
13:40:09 all 0 0 1 0 0 0 0 99
We were interested in the values of %usr, %sys, %irq + %softirq,
%wait and %idle.