If you are using KDE's konsole, it has built-in support for the Zmodem protocol.
2010-10-28
Using sz to transfer files via an existing SSH connection
2010-10-13
Adobe Flash 10 on Ubuntu with Chrome
I was trying to use Chromium on Ubuntu 10.04 Lucid Lynx, and Flash was working, but about:plugins revealed that it was version 9 whereas I wanted 10.
2010-04-15
Syntax error near unexpected token `)'
I was trying to make a case statement in bash, and was getting this error:
./check: line 8: syntax error near unexpected token `)'
./check: line 8: ` 1)'
Turns out this is the error you get if you forget the ;; at the end of each code block.
Posted by
bombcar
at
08:47
0
comments
Labels: bash, case statement, error, linux
2010-04-14
Ubuntu 10.04 Boot Issues
I loaded Beta 2 of Lucid Lynx on a machine; it wouldn't get past the splash screen. I had to hit the spacebar during the Live CD boot to get it to show the boot log; this prevented the splash screen from loading and allowed me to install.
But it wouldn't boot afterwards; it would lockup in the splash screen. Turns out that the menu fr Grub 2 can only be accessed if you hold SHIFT down while booting; then you can remove "quiet splash" from the kernel command line, and boot with CTRL+X.
After it loads, edit /etc/default/grub and change CRUB_CMDLINE_LINUX_DEFAULT to:
Then run update-grub (the above has to be done as root), and the system will continue to boot correctly. The bug seems to be in a package called plymouth; perhaps it will be fixed later.
Posted by
bombcar
at
07:15
0
comments
Labels: 10.04, kernel, linux, lucid lynx, splash screen, ubuntu
2010-02-09
Bringing a recalcitrant SiS ethernet adapter up
I have a SiS900 Ethernet controller that I could assign IP and IPv6 addresses to, but I couldn't bring it up. mii-tool reported that the link was negotiated, and it had worked before my recent kernel compile.
I tried everything I could think of, and recompiled the kernel over and over again. Finally I realized that the other thing I'd changed was turning off SMP support - I turned it back on, and it worked! I think that the card was in INT 19 or something, and I needed SMP support to reach those higher interrupts, even though I had a single core CPU.
Posted by
bombcar
at
22:43
0
comments
Fixing max open files (1024) is smaller than max sockets (4096) errors
If you are running BIND, you may be seeing errors like this in your logs each time you reload or restart named:
Feb 9 22:22:17 mail named[19053]: max open files (1024) is smaller than max sockets (4096)
This is caused by the default number of files that a process can run being set very low, to 1024. By default, in include/linux/fs.h:
You could edit that line and recompile your kernel, but that would involve doing that every time a new kernel was released. An easier option is to edit /etc/security/limits.conf, and add the line:
This sets the default limit for the named user to 4096. Then, edit your named.conf and add
files 4096;
in the options section. Note that you're have to stop and start the named daemon, and not simply run rndc reload, because it needs to actually exit for the changes to take effect. Now the warning will be gone!
2010-02-08
Unicode entry in Ubuntu
To enter Unicode characters in Ubuntu, simply hold down CTRL+SHIFT+U which will create an underlined u: u Then type the hex code for the character you want (with no 0x or anything like that), followed by enter.
∎ (That's 220E, the "QED" character).
Posted by
bombcar
at
15:40
0
comments
2009-10-13
Using a NextWindow touchscreen with Ubuntu
This should work for any X.org based Linux system. The key is to point it at the right event id as follows in /etc/X11/xorg.conf :
Section "InputDevice"
Identifier "touchscreen"
Driver "evtouch"
Option "Device" "/dev/input/by-id/usb-NextWindow_Touchscreen-event-mouse"
Option "DeviceName" "touchscreen"
Option "MinX" "1"
Option "MinY" "1"
Option "MaxX" "32768"
Option "MaxY" "32768"
Option "ReportingMode" "Raw"
Option "Emulate3Buttons" "false"
Option "Emulate3Timeout" "50"
Option "SendCoreEvents" "On"
Option "CorePointer"
EndSection
Note that this is for the newest 2150 versions. Without the /dev/input/by-id line, the event number seemed to change somewhat randomly on reboot.
Posted by
bombcar
at
17:10
3
comments
Labels: linux, nextwindow, touchscreen, ubuntu, X, X.org
2009-09-04
Routing a port through a machine that's not the default router
I have an OpenVPN machine on my network that hosts a VPN, but it is not the default router for the network. I wanted to forward a port for the OpenVPN clients so that they could see another machine on the local network. To do this requires a number of steps.
First, the machine that they'll be connecting to needs a default route added for the OpenVPN network, or the packets will never return. My OpenVPN network is 172.31.4.0 and my local network is 192.168.200.0 in these examples. The OpenVPN server is 172.31.4.1 and 192.168.200.70 on tun0 and eth0 respectively; the machine I want my OpenVPN clients to be able to connect to on port 6666 is 192.168.200.10.
This allows the server to return TCP. Of course, the machine must have its firewall set to allow port 6666 in, but that's simple.
Then, the OpenVPN server needs its forwarding enabled. The commands that worked for me were:
iptables -t nat -A PREROUTING -p tcp --dport 6666 -j DNAT --to 192.168.200.10
iptables -A FORWARD -p tcp -s 192.168.200.10 --sport 6666 -j ACCEPT
iptables -A FORWARD -p tcp -d 192.168.200.10 --dport 6666 -j ACCEPT
This allows the communication in, and the response back out. I had also added these lines to my INPUT and OUTPUT chains; I'm not sure if they were needed:
If not, they don't hurt anything.
2009-08-26
Using SSH to connect to a link-local IPv6 address
It turns out that the self-assigned IPv6 addresses you see are not unique; they're only guaranteed unique on each interface. To ssh to one, you'd need to run:
ssh fe80::21c:c0ff:fe52:c5ec%eth0
for example, where %eth0 specifies eth0.
Posted by
bombcar
at
12:29
0
comments
2009-08-13
Using command line switches in bash scripts
I have a number of bash scripts that do useful things to lists of items, such as this:
./install_stuff.sh 10.0.0.2 10.0.5.3
By using shift, I can have the script run through various IP addresses, for example. But I wanted more. I wanted the same command to sometimes take -t tag as an option and do something different. It turns out there's a relatively easy way to do this using the getopts builtin in bash. However, while it easily found the option (if present), it ruined the shifting feature, until I figured it out. Here's a snippet that sets TAG if -t tag is present, and then is ready to be shifted through as normal.
while getopts "t:h" OPTIONNAME; do
case "$OPTIONNAME" in
t) TAG="$OPTARG";;
[?]) help;;
esac
done
shift $(($OPTIND - 1))
At this point, you can use $1 as normal; it will be the first non-option parameter. Additional options can be specified in a similar manner.
Posted by
bombcar
at
21:58
0
comments
Bypassing SSH host key checks and the SSH agent
Sometimes you have too many SSH keys loaded, and trying to SSH to a box will fail. Sometimes you're trying to SSH to a box that's been rebooted into another OS or from a rescue CD.
The following command will disable key-based authentication, and ignore your known_hosts file:
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o'RSAAuthentication=no' -o 'PubkeyAuthentication=no' 127.0.0.1
Posted by
bombcar
at
17:37
0
comments
2009-07-30
Xen recovery on CentOS
I had a Xen domain crash, and it was a file image based LVM system. To mount the system manually in the host, I had to do:
losetup /dev/loop0 /storage/image.disk
kpartx -a /dev/loop0
vgchange -ay
lvscan
mount /dev/VolGroup00/LogVol00 /mnt
This allowed me to access the LVM volume. To unmount it, I needed to do:
umount /mnt
vgchange -an VolGroup00
kpartx -d /dev/loop0
losetup -d /dev/loop0
Now I could attempt to boot the domain again.
2009-05-19
bzr error on BranchHooks
On one Ubuntu 8.04 system, I was getting the following error:
0.031 looking for plugins in /root/.bazaar/plugins
0.031 looking for plugins in /usr/lib/python2.5/site-packages/bzrlib/plugins
[ 7744] 2009-05-19 09:37:54.672 WARNING: 'BranchHooks' object has no attribute 'install_hook'
[ 7744] 2009-05-19 09:37:54.673 WARNING: Unable to load plugin 'dbus' from '/usr/lib/python2.5/site-packages/bzrlib/plugins'
0.093 Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/bzrlib/plugin.py", line 231, in load_from_dir
exec "import bzrlib.plugins.%s" % name in {}
File "
File "/usr/lib/python2.5/site-packages/bzrlib/plugins/dbus/__init__.py", line 76, in
install_hooks()
File "/usr/lib/python2.5/site-packages/bzrlib/plugins/dbus/hook.py", line 30, in install_hooks
Branch.hooks.install_hook('set_rh', on_set_rh)
AttributeError: 'BranchHooks' object has no attribute 'install_hook'
Everything else worked fine, but it was reporting an issue with install_hook. I tracked it down, and fixed it by deleting the dbus directory in /usr/lib/python2.5/site-packages/bzrlib/plugins - not sure where it had come from, but other systems didn't have it.
2009-03-10
NVidia TwinView on Ubuntu
After using envyng to install the NVIDIA drivers, I would get this error when trying to turn on TwinView:
Failed to set MetaMode (2) 'DFP-0: 1920x1200 @1920x1200 +0+0, DFP-1: nvidia-auto-select @1920x1200 +1920+0' (Mode 3840x1200, id: 60) on X screen 0
Even when running sudo nvidia-settings I would get this error, and things just wouldn't work.
Turns out the correct thing to do is to run sudo nvidia-settings, detect the second screen, and configure it as you want, and don't hit apply - instead hit Save to X Configuration File and then hit CTRL+ALT+BACKSPACE to restart X. This worked for me. Note that it will log you out and close any open programs you have. Now I have double desktops!
2008-11-09
request_module: runaway loop modprobe binfmt-0000
When trying to upgrade my kernel on a Gentoo box I got the above error. Many people discussed it, but all the solutions seemed to be "it went away." However, I couldn't get it to stop occurring until I told Gentoo to rebuild the entire toolchain used by genkernel:
Posted by
bombcar
at
22:56
0
comments
Labels: gentoo, kernel panic, linux
2008-09-04
Apple Remote Desktop and the 3.889 Error
If you have Mac OS X 10.5, you can run "Screen Sharing" which is Apple's version of VNC. However, if you simply enable it and try to connect, you will get an error such as:
VNC server supports protocol version 3.889 (viewer 3.3)
VNC connection failed: Incompatible Version.
This will also appear as similar errors about incompatible security and so forth from various other VNC viewers; the above error is xtightvncviewer on Ubuntu Linux.
The cause of the problem is that Apple's Remote Desktop supports additional features in security that are not part of the normal VNC protocol; to fix it, click "Computer Settings" under Screen Sharing on the Sharing page of System Preferences, and set a password for VNC viewers. Then it will work.
Posted by
bombcar
at
10:47
1 comments
Labels: apple remote desktop, linux, mac os x, vnc
2008-02-25
VMWare Server Timesync on Ubuntu 7.10
I had installed VMWare server on Ubuntu with little pain, but it would not keep the time stable in the XP guest. I had installed the VMWare tools, but it wouldn't help - it would get up to a day off in a short period of time.
Turns out that my processors automatically scale down (Core 2 Quads), and so I needed to edit /etc/vmware/config and add the line host.cpukHz = 2400000 which is the correct one for my 2.4GHz CPU. After this, I restarted the vmware-server service, and the time is perfectly synced.
I was able to confirm the kHz number to use by running burnp6 from the cpuburn package on all four cores and looking at /proc/cpuinfo to see what speed it reached.
2008-01-16
Apache 413 error problems
I had an Apache 2.2.3 HTTPS server configured, and it kept complaining that the uploads were too large. I tried setting the php.ini settings, adding LimitRequestBody, nothing worked. It still died.
Then I looked in the ssl_error_log and discovered:
request body exceeds maximum size for SSL buffer
which was the hint I needed. I was using Apache SSL client certificates, which have a limit of 128K, and if re-negotiation has to happen, a larger POST will fail.
This Bugzilla posting had the clues - You have to set the following as DEFAULTS for your SSL server, not just the directory.
SSLVerifyClient require
Otherwise it forces a renegotiation of some sort, and fails with a 413 error.
2007-12-21
VMWare Server USB on Ubuntu 7.10
If you want to use USB devices with VMWare Server on Ubuntu 7.10 you need to do the following:
Shutdown VMWare
sudo mount -t usbfs usbfs /proc/bus/usb/
Start VMware, and load your virtual machine.
Select the USB device in VM -> Removable Devices -> USB
Note that if you want usbfs to be mounted at boot, you'll want to add this line to /etc/fstab:
usbfs /proc/bus/usb usbfs defaults 0 0
I put it directly under the proc entry.