sonia hamilton – life on the digital bikepath – sonia@snowfrog.net

19 November 2009

cygwin: zsh: zsh compinit: insecure directories

Filed under: Cygwin, Shell, Zsh — Sonia @ 15:21

Using cygwin under Windows, I’ve setup my shell as zsh by editing the launch script:

@echo off
C:
chdir C:\cygwin\bin
zsh -l -i

Unfortunately, this gives a nasty error everytime the shell is started up, due to Cygwin installing zsh incorrectly:

zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]? y

Solution, thanks to wezm.net:

compaudit | xargs chmod g-w

macports: git-upload-pack: command not found

Filed under: Git, Mac — Sonia @ 11:22

When doing a git clone from a repo hosted on a Mac OSX machine (installed using macports), I get this error on the client (Linux, cygwin, whatever):

git-upload-pack: command not found

Solution is to do this on the OSX machine:

cd /usr/bin
sudo ln -s /opt/local/bin/git* .

Obviously some $PATH funkiness is going on somewhere on the Mac, and I should find a better fix. My personal $PATH on the Mac is OK:

$ echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

12 November 2009

DeltaCopy – rsync for Windows

Filed under: Rsync, Ssh — Sonia @ 15:23

A nice little tool I came across – DeltaCopy – for when you have to work with Windows desktops and want to rsync (and don’t want to install Cygwin). I haven’t had time to play with it yet, but apparently the DeltaCopy client will connect to an rsync server.

Out of interest, there’s also a SourceForge package for installing a minimal ssh server on Windows, rather than the full Cygwin.

10 November 2009

Linux and Cisco VPN Client “Remote peer is no longer responding”

Filed under: Linux, Networking — Sonia @ 13:12

I’m using the Cisco VPN client, and it seems unreliable on Linux – it occasionally connects but often just gives up with “Remote peer is no longer responding”.

Apart from the obvious firewall/nat checks [1][2], a solution seems to be to edit the .pcf file, bump up the timeout and force keepalives:

PeerTimeout=180
ForceKeepAlive=1

 

 

3 November 2009

Network access with Exetel HSPA and Antenna

Filed under: Ubuntu, Wireless — Sonia @ 09:21

I got a Huawei HSPA E1762 USB stick a few months ago for 3G network access, together with Exetel’s $5/month Zero Gig plan (uses the Optus network). Great for when I’m out and about and can’t find a wireless signal to jump onto, or I’m at some client who doesn’t allow laptops onto their network. I’ve been using it regularly and still haven’t gone over about 100M usage, so it’s worked out to be very cheap.

Using Network Manager on Ubuntu Jaunty it mostly “just works” – all I needed to do was set the APN to ‘exetel1′. I’ve also bought an antenna for it from The Antenna Shop – gives me better coverage in shadows in the CBD and out in the country. There’s also other bigger antennas available, as well as car antennas.

antenna

antenna

All-in-all a good buy – thanks Dean for the tip.

Addendum

As per Matt’s comment below, Huawei modems currently have problems on Ubuntu Karmic – Problem with Huawei E1762 Mobile Broadband in Karmic, Bug #413989, Bug # 446146.

Also, if you’re ever prompted to enter an “SP CODE” (ie Mac & Windows), enter “BROADBAND”

29 October 2009

Monitoring disk activity using block_dump

Filed under: Monitoring — Sonia @ 11:52

A couple of good links [1][2] came up on the Axxs collective email list about monitoring disk activity under Linux using block_dump.

In a nutshell:

kern.debug setup in syslog.conf (it often is; if sync is used disk activity will obviously be greater)

echo 1 >/proc/sys/vm/block_dump
wait n seconds
echo 0 >/proc/sys/vm/block_dump

Do various grep'ing on /var/log/debug for READ, WRITE, inode, block, etc

Thanks to Andrew Mc & Torrance.

26 October 2009

Script to correct first day of week in en_AU locale

Filed under: Ubuntu — Sonia @ 08:43

I blogged previously about how the Australian locale in Ubuntu incorrectly uses Sunday rather than Monday as the first day of the week, and how to manually fix it. Unfortunately, whenever the locale gets updated (eg via one of Ubuntu’s regular package updates), the locale reverts and you have to manually fix it again.

So I’ve written a script that fixes the locale, and also hooked it into dpkg:

% cat fix_locale.sh
#!/bin/bash

LOCALE_FILE='/usr/share/i18n/locales/en_AU'
if [ -f $LOCALE_FILE ] ; then
 sudo sed -i 's/^first_weekday.*/first_weekday 2/' $LOCALE_FILE
 sudo locale-gen
 killall gnome-panel
fi

To run this automatically, add a stanza like this to /etc/apt/apt.conf:

APT {
 Update {
 Post-Invoke {"/home/sonia/bin/fix_locale.sh"; };
 };
};

The script could be smarter ie check the existing value of first_weekday and only change it if it’s different, but I’ll fix that when I’ve got more time.

23 October 2009

Why “require ‘rubygems’” Is Wrong

Filed under: Ruby — Sonia @ 12:31

A link off the RORO list about Why “require ‘rubygems’” Is Wrong.

In a nutshell, the environment variable RUBYOPT should include rubygems eg

export RUBYOPT="rubygems"

Howto install Virtualbox on Ubuntu Jaunty

Filed under: Ubuntu — Sonia @ 10:10

Here’s how to install Virtualbox 2.1.4 on Ubuntu Jaunty (people are saying 2.2.0 is buggy). And now that Oracle owns Sun, Virtualbox may go the way of the dodo…

No rocket science here – just saving myself time in future.

sudo aptitude install virtualbox-ose virtualbox-ose-source dkms

Applications -> Accessories -> VirtualBox OSE

19 October 2009

Ruby 1.9 shell aliases

Filed under: Ruby — Sonia @ 17:06

I’ve started playing with Ruby 1.9 – the latest and greatest version of Ruby. On Ubuntu Jaunty, 1.8 is considered mainline and 1.9 experimental – here are the shell aliases if using 1.9:

alias ri='/usr/bin/ri1.9'
alias irb='/usr/bin/irb1.9'
alias rdoc='/usr/bin/rdoc1.9'
alias ruby='/usr/bin/ruby1.9'
alias gem='/usr/bin/gem1.9' # belts-and-braces - gem 1.8 & 1.9 are the same version - 1.3.1
Older Posts »

Blog at WordPress.com.