Tuesday, April 29, 2008

Static Lib contents

It is written at the top of the ar manpage, but I seem to miss it every time: to print all symbols contained in a static archive, emit
nm --print-armap [archive]
really simple.

Saturday, April 19, 2008

firefox and system-wide installation/deployment of certificates

wanted to add CACert.org Root Certificate in firefox for all users on a system. it seems as if this were not possible...
(but see: http://wiki.cacert.org/wiki/NSSLib and https://bugzilla.mozilla.org/show_bug.cgi?id=215243)

however, one can use certutil to create a cert8.db and deploy that with the default profile - of course, that doesn't help with users who already have profiles...

certutil -N -d . 

Wednesday, April 2, 2008

VIM: Punch the Mode Line

mode line: lines at top or bottom of source code files that contain options for configuring the editor, c.f.:

:help modeline


(of course, in emacs 'mode line' denotes a entirely different concept...)

Monday, March 24, 2008

OpenVPN, Tunnelblick, bridged network (tap device), mDNSResponder, and daapd on OS X

tried to get the music library from a server running firefly to a mac via an OpenVPN tunnel 
- where the same server is also the OpenVPN server and is using a tap device and
- the mac was using Tunnelblick 

though this setup seemed to work for my linux machine it didn't quite do the job on the mac: there the mdns information was only used occasionally (though ethereal aka. wireshark confirmed that it was being transmitted).

currently i think that the mDNSResponder is behaving - at least - strange and a possible work-around seems to be 
- install the tun/tap-driver separately from Tunnelblick (so the driver is loaded at boot time and mDNSResponder is not 'surprised' by its late appearance...)
- turn the interface of the internet connection (the one tunnelblick uses to connect to the server - not the tap one...) off and on 

Wednesday, March 19, 2008

Tuesday, March 18, 2008

quick reminder: Getting X11 forwarding through ssh working after running su

$ xauth list $DISPLAY
You'll get something like

somehost.somedomain:10 mit-magic-cookie-1 4d22408a71a55b41ccd1657d377923ae

Then, after having done su, tell the new user what the cookie is:

$ xauth add somehost.somedomain:10 MIT-MAGIC-COOKIE-1 4d22408a71a55b41ccd1657d377923ae

(just copy'n-paste the output of the above 'xauth list' onto 'xauth add') That's it. Now, you _should_ be able to start any X application.


references:
  1. http://www.debian-administration.org/articles/494
related:
  1. http://www.windowsecurity.com/whitepapers/Improving_XWindows_security.html

Setup Samba for Bonjour networking with OS X 10.5 Leopard

put the following into /etc/avahi/services/[somename].service on a linux machine running samba and avahi-daemon:
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->

<!DOCTYPE service-group SYSTEM "avahi-service.dtd">

<service-group>
<name replace-wildcards="yes">%h filer</name>
<service>
<type>_smb._tcp</type>

<port>139</port>
<host-name>zaphod.bn.dev</host-name>
</service>
</service-group>


references:

Friday, February 15, 2008

Negate find results

Find files that do not match expression and dostuff on them:
find ./ [expressions] -prune -or [dostuff]
Example:
find ./ -name '.svn' -prune -or -type f -print
finds all non-svn files and prints their paths on stdout

Sunday, February 10, 2008

Zero Config User Initiated Cross Platfrom Remote Desktop Assistance

Use Case
you frequently give remote assistance to users in very heterogeneous environments

Problem

user-side firewalling makes it impossible to just start up e.g. a vnc server.

Solution
let the user initiate a ssh tunnel from his machine to yours, forwarding his local vnc server port.

Rationale

it is way easier for you to allow for incoming traffic once than it is to do the same on every user's machine.

Implementation

Server
enable your sshd and create a dedicated help user with shell /bin/false
Client
use a shell script to start the vnc server and the ssh tunnel. this is only non-trivial for windows, so I shall outline that below.
Extensions
  • use a private/public key pair for ssh authentication
  • use a different server user for each supported user
  • automatically react on incoming ssh sessions
Esp. the last one is interesting: you can tell people to "just click on the support button when you need help" and you will get instant notification with direct access to their desktop.

Appendix: Client on Windows

  1. Download the tightvnc zip distribution, unzip
  2. Download plink (the putty ssh command line client) and save it into the vnc folder
  3. start winvnc.exe
  4. enter a password (you will use this later when using your vnc client to connect to the user's machines), fix the port to 5900, quit the application
  5. startup regedit
  6. add a dword key "AllowLoopback" with value 1 to LOCAL_MACHINE\Software\ORL\WinVNC3
  7. export LOCAL_MACHINE and CURRENT_USER\Software\ORL to vnc.reg and vnc2.reg in your vnc folder
  8. close regedit
  9. create the batch file and zip the whole directory for distribution:
create a file run.bat in your vnc directory that contains the following lines:

reg import vnc.reg
reg import vnc2.reg
taskkill /F /IM winvnc.exe
start winvnc -run -shareall
plink helpaccount@my.dns.org -pw helppassword -N -R 5900:localhost:5900
where helpaccount and helppassword match the local account you created on your server and my.dns.org is your server's hostname.
after running this script, you should be able use a vnc viewer to connect to localhost on your server and see the client's screen. you will want to set -compress 9 -encoding tight explicitly to tune the connection.

Monday, February 4, 2008

top (unix command) with two samples in logging mode - but only the second matters

i wanted to use the unix top command with GeekTools and found that this wasn't as straight forward as i had expected...

anyways, the following bundle does the trick:
top -o cpu -l 2 -u -S | sed -e '2,/^Processes:/ d'

Saturday, January 26, 2008

Saturday, December 15, 2007

Open in (OS X) Terminal here...

...seems so handy! but doesn't come with the system.
now, obviously the problem has already been encountered before:
http://c-command.com/scripts/finder/open-in-terminal

so i used this to get started (and finished) - result is a Finder.app Workflow:

on run {input, parameters}

   repeat with i in input
     my processItem(i)
   end repeat

   return input
end run

...just accompany this snippet with on processItem(i) and on canChangeDirectoryTo(f), save it as Workflow - done.

Monday, November 12, 2007

ElsterFormular "Externe Exception C0FB007F" und WINE

while I was still having a windows machine ElsterFormular was the software i used once a year. now, that i have no windows machine anymore things got a bit more complicated.

i couldn't find a software to submit a 'Umsatzsteuererklärung' (not the 'Umsatzsteuervoranmeldung'), that was free and available for linux and OS X - i couldn't even find one that was available for any of the two operating systems...

that is when WINE came into play (on the linux machine):
  • Debian GNU/Linux (mostly stable; but with some testing packages) with Kernel 2.6.22
  • wine 0.9.44-1
  • ElsterFormular 2006-2007 (8.2.2.0)
and it mostly worked. however, i couldn't transmit data nor could i use the update feature ('Test der Datenübermittlung an das Finanzamt', 'Steuererklärung an das Finanzamt übermitteln...', 'Update von ElsterFormular') but only got
Externe Exception C0FB007F
and the solution was not to reinstall the software (pointed out here and on some other threads here) - i tried that - but to install
  • mfc42.dll
  • Jet 4.0 Service Pack 8 (SP8) für Windows 95 / 98 / NT 4.0
as described on http://ladisch.de/elster.html.


references:

Friday, November 9, 2007

imapsync - personal reminder...

at the end of a long story there was the need to transfer mail from a Lotus Domino server to a local Thunderbird account... anyways, for some other reasons it seemed quite a good idea to transfer them to a local IMAP server, and the have Thunderbird download all mail.

after some different IMAP servers the best solution seemed to be dovecot - with the others there were problems, e.g. with extended attributes.

copying mails from Domino to the local IMAP server was then done with imapsync:
imapsync --host1 domino.e.t.c --user1 "USERNAME" --authmech1 PLAIN --host2 localhost --user2 dummy --authmech2 PLAIN --prefix2 "~/mail/" --syncinternaldates --split1 50 --split2 50 --nofastio1 --debug

references
  1. http://www.mozilla-europe.org/de/products/thunderbird/
  2. http://www.dovecot.org/
  3. http://www.linux-france.org/prj/imapsync/

Wednesday, November 7, 2007

self-signed certificate with multiple DNS names (aka subjectAltName)

following [1] and adding
subjectAltName = DNS:PROBABLY_YOUR_COMMONNAME,DNS:*.SOME_DOMAIN_NAME
to the [ v3_ca ] section of your openssl.cnf file should do the trick.

unfortunately, the DNS:copy:commonName didn't work for me...


references:
  1. http://www.debian-administration.org/articles/284
  2. http://reductivelabs.com/trac/puppet/wiki/MultipleCertificateAuthorities
  3. http://wiki.cacert.org/wiki/VhostTaskForce