Monday, July 25, 2011

iptables command line

Weirdly,
iptables -vn -N
doesn't work -- why aren't the v and the n ignored?  Sigh.

Wednesday, July 20, 2011

X11 connection rejected because of wrong authentication.





This is a less than completely useful error message; I got it when I 'ssh -X'ed to a Linux host form OSX and tried to 'sudo system-config-securitylevel'.  Here's the actual message


X11 connection rejected because of wrong authentication.
The application 'system-config-securitylevel.py' lost its connection to the display localhost:10.0;
most likely the X server was shut down or you killed/destroyed
the application.

A workaround is to do 'sudo xterm' and then 'mkxauth -m username' and then do the 'system-config-securitylevel'.
I don't have a clue as to why and don't have time to figure it out...

Update: a better approach is probably "sudo -- sh -c 'mkxauth -m beaty; command"

Another update: under debian "xauth merge /home/beaty/.Xauthority"

Sunday, June 26, 2011

Useful Windows links

I ran into a weird situation where Add or Remove Programs had a huge blank space; the following fixed it: http://blogs.msdn.com/b/oldnewthing/archive/2005/05/26/422076.aspx

In the process of hunting this down, I also found that the great CCleaner needs to be run multiple times to completely clean out a registry...

Add total folder size to listing: http://windowsxp.mvps.org/foldersize.htm

Friday, June 10, 2011

Linux minimal printer install

yum install cups
yum install gutenprint-cups
yum install system-config-printer

$DISPLAY not set for ssh -X

Ran into an one i hadn't seen around this; had all the right settings in /etc/ssh/sshd_config for X forwarding on a minimal server, but still no joy.  Did a 'yum install xauth' and life was good again.

Monday, May 9, 2011

Quick source code searching on Linux

While working on a fix in the JDK, I wanted to find all occurrences of a string in large collection of Java source.  I ended up using http://swish-e.org/  Its default file type is *ML, so a simple config file of:
IndexOnly .java
IndexContents TXT* .java
did the trick.  'swish-e -c swish-e.con -i .' and then 'swish-e -w word' -- blazingly fast.

Building OpenJava 7 on Ubuntu 11

sudo apt-get install mercurial
hg clone http://hg.openjdk.java.net/jdk7/jdk7
cd jdk7
sh -x ./get_source.sh

sudo aptitude install openjdk-6-jdk gcc-4.2 g++-4.2
sudo aptitude install libmotif-dev
sudo apt-get install ant
sudo apt-get install libasound2-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install gawk
sudo apt-get install libxext-dev
sudo apt-get install libxrender-dev
sudo apt-get install libxtst-dev
export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk
make ALLOW_DOWNLOADS=true
Then a 'make ALLOW_DOWNLOADS=true' gets things rolling.  Not sure why this isn't documented anywhere that was easy to find. One can also go to http://jdk7.java.net/download.html export LANG=C export ALT_BOOTDIR=/home/beaty/jdk1.7.0_04 export ALT_JDK_IMPORT_PATH=/home/beaty/jdk1.7.0_04 export ALT_HOTSPOT_IMPORT_PATH=/home/beaty/jdk1.7.0_04