18/11/2008

SSH port changes and the openSuSE firewall

Note to self - when changing the SSH port from default 22, keep in mind:
  • Change listening port in Webmin (port number > 1024 recommended)
  • Let Webmin handle the sighup (existing connections are kept)
  • No webmin available: Change port in /etc/ssh/sshd_config (right where it says "Port") . It's easier just to restart (but all connections are killed)
    sudo /etc/init.d/ssh restart
    If you need a sighup (e.g. when you administrate over ssh):
    $ sudo -s
    # ps -alxww | grep ssh
    # kill -9 <process (3rd column) with 4th column "1">
  • YaSt and firewall: YaST->Security and Users->Firewall->Allowed Services. To simply allow SSH in the drop-down list is no use, as YaST automatically assumes port 22.
    Go to "Advanced..." and open the matching TCP and UDP ports.
  • Now I can't log in any more...: a ssh connection from shell needs the -p option
    $ ssh -p <portnum> <username>@<IP>;
    scp wants the -P option (capital P - can't they unify that?);
    other services like Unison (modify the profile files) or fish:// specify the portwith <user>@<IP>:<port>
  • I want to mount a remote ssh share:
    sshfs -p <portnum> <username>@<IP>:<folder> <share>

Most of the research by daWuzzzz.

17/11/2008

Move panel widgets in KDE 4.1


Taken from the doyoulinux KDE4-review. Moving widgets on the panel in KDE 4.1.3 (SuSE Factory) works, yet it takes some googling to find out how:
  1. Get the panel into config mode by clicking the Plasma icon at the right end of the panel. The panel will increase in size and show some handles as shown above. (I cut out the middle portion to save space). If the Plasma icon isn't there, you probably have to unlock the widgets by right-clicking on a non-widget panel area.
  2. When you move your mouse over any panel widget a 4-way-arrow appears, indicating that you can drag the widget around.

16/11/2008

Improve low-res text images in GIMP


My inner nerd loves pasting stuff to doors and walls, including an image I stole from BoingBoing. 500x500 px looks OK on-screen, but printed on A4 crappy as hell. Here is a one-minute GIMP howto for cleaning up simple b/w text or vector-like images.
1.Convert to greyscale (Image->Mode->Greyscale) and scale up (Image->Scale Image... scaling by 4 did OK for me). This takes care of discolourations, the scaling operation also smoothes the image. If you are not happy yet, include another Gaussian blur.
2. Adjust the colour curves to overexpose the whitish areas and underexpose the grey-to-black ones. I displayed the curves in log style to show better the rather small dark pixel peak. Pull most of the dark peak down to zero and most of the light peak to full white. This will also take care of compression artifacts in the "white" areas.

That's it. Good enough to stick to an office door at least.

10/11/2008

Palatino in LaTeX - the modern variant

In order to use palatino as font in a LaTeX document one runs into trouble if the package units is used and one wants to use the palatino.sty.

Use the modern version called mathpazo.sty which contains also the math fonts, but you will have to set the sans serif and typewriter by hand (the old palatino.sty still set Helvetica and Courier, respectively). mathpazo.sty also knows some options - please refer to the documentation.

One problem: mathpazo.sty doesn't know greek letters in the math alphabet \mathrm . Normally this is no problem, but if you use the package units you will end up without the greek symbols in the unit, because it uses the text mode. A (not very nice) workaround would be:
\[\unit[1]{\text{$\mu$} m} \]
or \unit[1]{$\mu$m}
Note that the \text command is from the ams package, which you will need as well.

Thanks to an anonymous colleague for pointing this out.

Addendum:
As avocadohead pointed out (see comment to this post), the usage of the package SIunits instead of units is unproblematic with greek letters.
However, please note that the syntax of both packages differs:
\usepackage{units}: \unit[3]{unit}
\usepackage{SIunits}: \unit{3}{unit}

05/11/2008

They call it Fast Fourier Transform

Memory Leaks in the python-numeric FFT module
At present, I'm doing 2d-FFTs on extracted movies 4000-6000 frames in length. Sadly, Python cancels the job after about 2000 frames citing segfaults or memory errors, as it's running out of 2GB each of RAM and swapspace...

KSysGuard serves as a primitive debugging tool here. Note that you actually have to kill Python to ultimately free your memory. The culprit was the fft2d function from the FFT module (comes with python-numeric). I didn't find any related issues online, so maybe it's just me. However, using fft2 from scipy.fftpack (Documentation here) resolves the issue. Computing times are more or less equal for both packages.

02/11/2008

Vanity Statcounting

Hooray, we cracked 10,000 visitors! Actually, some blogs get 10 times more in one day... Visitor with the IP 72.222.146.134 from Scottsdale, Arizona, you have our exclusive permission to download the following image of a nice and tasteful flower arrangement. If you contact us, we might even send you a package of genuine German Gummi Bears.

So it's time for an off-topic post on a previously undocumented office sport: vanity statcounting.
First: The ego boost. NASA dropped in. The Ivy League. Porsche. Nokia. Some actual human being from Mountain View. Completely makes your day.
Seriously, US military, no weapons of mass destruction here - oh, all right, you were googling "quicktime". Whew.
Second: competition. Try beating taaris' 'automount NTFS' post in popularity. Did I just shoot myself in the foot...?
Third: Feel totally international. Seriously, why oh why is Iceland ignoring us this week?
Fourth: Fun with statistics. (Is that an oxymoron or what?) Here's to penguin world domination: Two thirds of our visitors use Linux! OK, might be slightly topic related.
More from the animal kingdom: Firefox rules the browser stats. IE: also ran. Six to ten percent. On principle, we don't apologise for screwed-up layout in IE 6.
Chrome users started dropping in on the day after the release, whereas the Google bot is still running on Mozilla. Makes one trust in beta releases. (Seriously, people: version 0.2? Not to mention handing your complete browsing behaviour to Google on a silver salver?)
Fifth: one might actually use the keyword stats to improve one's posts. Gah. Booooring.
Sixth: Be a Do-Gooder. Wait for nice comments. If necessary, beg for them.
Seventh: Our Google PageRank™. It's 0.0000(0). Nice round number. Proud of it.
Last but not least: our sincere apologies to all the frustrated guys googling "bitches in latex".