funky networking bug

Able to download at 8-20 Mbps, only able to upload at 300kbps. Advertised rate is more than 10x that. It was on all uploads I tried (ssh, ftp, http).

Aside: it is nearly impossible to do anything on Charter’s website but get stuck in their endless “help pages”.

Finally called and they eventually got me to plug directly into the cable modem, and the problem is gone. So after giving their tech support person high marks, I tried to upgrade to latest free router software but no go, my wrt couldn’t get an IP from charter – downloaded next most recent version to my smart phone and then ftp’d it from my smart phone with an FTP server app over wifi. (I didn’t have the right software to download data from my new smartphone over the cable – darn MTP)

The initial problem was with a very old version of the free router software on a WRT and 1 year old motorola cable modem. The version that would install kinda worked with faster uploads but would frequently crash, so switched to a red vegetable variant with much better results.

xcp add disk

xe sr-list #gives you a list of sr’s from which to pick a sr-uuid

xe vdi-create sr-uuid= name-label= type=user virtual-size=
#the above vdi-create outputs a vdi-uuid

xe vm-list # gives you a list of vm’s from which to pick a vm-uuid

xe vbd-create vm-uuid= vdi-uuid= bootable=false mode=RW type=Disk device= #pick an unused device name (my box had “disks” up to xvdc so I used xvdd)
# the above vbd-create outputs the vbd’s uuid

xe vbd-plug uuid=
#your new devices should now be visible from your domU

new vps with centos 6 for tinydns secondary

yum update -y ;

vi /etc/sysconfig/iptables; #configuring iptables is an exercise for the reader
iptables-restore /etc/sysconfig/iptables;

/etc/init.d/httpd stop;
chkconfig --del httpd;

/etc/init.d/sendmail stop;
chkconfig --del sendmail;

/etc/init.d/xinetd stop;
chkconfig --del xinetd;

#install daemontools (djb does crazy things with symlinks - trust me when I say you want this package installed and built under /usr/local)
yum install gcc -y;
cd /usr/local/src;
wget wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz;
tar zxf daemontools-0.76.tar.gz;
pushd admin/daemontools-0.76;
vi src/conf-cc;# append gcc line with this: -include /usr/include/errno.h ;
./package/install;
popd;

#install ucspi
wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz;
tar zxf ucspi-tcp-0.88.tar.gz;
pushd ucspi-tcp-0.88;
vi conf-cc ;# append gcc line with this: -include /usr/include/errno.h ;
make setup check;
popd;

#install djbdns
wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz;
tar zxf djbdns-1.05.tar.gz;
pushd djbdns-1.05;
vi conf-cc; # append gcc line with this: -include /usr/include/errno.h ;
make setup check;
popd;

#install a local dns server for looking up addresses
useradd -d /var/dnscache -s /bin/false dnscache;
useradd -d /var/dnscache -s /bin/false dnslog;
rm -rf /var/dnscache;
dnscache-conf dnscache dnslog /var/dnscache 127.0.0.1;

touch /var/dnscache/root/ip/127.0.0.1;
ln -sf /var/dnscache /service/;

#update the root nameservers that dnscache above uses
yum install bind-utils -y;

/etc/init.d/named stop;
chkconfig --del named;

for file in `dig |grep root-servers.net|awk '{ print $5 }'`;do host $file;done|grep -v IPv6|grep -v mail|grep -v pointer|awk '{ print $4 }'|sort -n > /var/dnscache/root/servers/@ ;

#setup svscan
#this next line is for centos and variants -- ubuntu doesn't seem to have an #/etc/inittab
vi /etc/inittab # get rid of this line: SV:123456:respawn:/command/svscanboot
#the next 5 lines work on centos and kin and ubuntu and kin
echo "start on runlevel [12345]" > /etc/init/svscan.conf;
echo "respawn" >> /etc/init/svscan.conf;
echo "exec /command/svscanboot" >> /etc/init/svscan.conf;
initctl reload-configuration;
initctl start svscan;

#setup tinydns
useradd -d /var/tinydns -s /bin/false -M tinydns;
useradd -d /var/tinydns -s /bin/false -M tinylog;
tinydns-conf tinydns tinydns /var/tinydns IP;
ln -sf /var/tinydns /service/
# configure your replication
# e.g. rsync over ssh triggered from the Makefile on the primary
# exercise for the reader ...

backup to warm-swapable disk

#physically insert disk
# on this next line the hostN number may be different
echo “- – -” > /sys/class/scsi_host/host5/scan
mount /dev/sdc1 /mnt
rsync -aHxv /boot /mnt
rsync -aHxv /dev /mnt
rsync -aHxv / /mnt
#this is for a special home directory
mount –bind / /media
rsync -axv /media/home/user /mnt/home/
umount /media
umount /dev/sdc1
#stuff to spindown disk
sudo hdparm -Y /dev/sdc
#physically remove disk

djbdns dnscache

This is great simple way to get off of your ISP’s dns, e.g. stop them redirecting you to their search partner when you typo. And very handy if you’re working with DNS or changing webhosts, in that a quick sudo killall dnscache clears out your cache so you can see the new site right away.

#install daemontools (djb does crazy things with symlinks – trust me when I say you want this package installed and built under /usr/local)
yum install gcc
cd /usr/local/src
wget wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
tar zxf daemontools-0.76.tar.gz
pushd admin/daemontools-0.76
vi src/conf-cc # append gcc line with this: -include /usr/include/errno.h
./package/install
popd

#install ucspi
wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
tar zxf ucspi-tcp-0.88.tar.gz
pushd ucspi-tcp-0.88
vi conf-cc # append gcc line with this: -include /usr/include/errno.h
make setup check
popd

#install djbdns
wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
tar zxf djbdns-1.05.tar.gz
pushd djbdns-1.05
vi conf-cc # append gcc line with this: -include /usr/include/errno.h
make setup check
popd

#install a local dns server for looking up addresses
useradd -d /var/dnscache -s /bin/false dnscache
useradd -d /var/dnscache -s /bin/false dnslog
rm /var/dnscache/.bash*
dnscache-conf dnscache dnslog /var/dnscache 127.0.0.1
touch /var/dnscache/root/ip/127.0.0.1
ln -sf /var/dnscache /service/

#update the root nameservers that dnscache above uses
yum install bind-utils
for file in `dig |grep root-servers.net|awk '{ print $5 }'`;do host $file;done|grep -v IPv6|grep -v mail|grep -v pointer|awk '{ print $4 }'|sort -n > /var/dnscache/root/servers/@

#setup svscan
# this next line is for centos and kin (ubuntu doesn’t seem to have /etc/inittab
vi /etc/inittab # get rid of this line: SV:123456:respawn:/command/svscanboot
# the next 5 lines are for both centos and kin, and for ubuntu and kin
echo " start on runlevel [12345]" > /etc/init/svscan.conf
echo "respawn" >> /etc/init/svscan.conf
echo "exec /command/svscanboot" >> /etc/init/svscan.conf
initctl reload-configuration
initctl start svscan

The above is a copy from my other post: http://rln.d13dns.com/2014/07/20/new-vps-with-centos-6-for-tinydns-secondary/

Others have also talked about setting up dnscache:
http://packetnexus.com/2010/12/how-to-install-djbs-dnscache-on-ubuntu-10-10/

oh Nvidia 6150se how I hate thee

I have been battling with you since I purchased you 4 years ago on a BIOSTAR MCP6P M2+ motherboard. The many dozens of hours of tweaking to keep you and ubuntu playing nicely. The iterative search for the right combination of nvidia drivers each time I changed anything. The final straw came on an innocent apt-get update/upgrade cycle when poof no X after reboot, I probably just needed to rebuild the installed driver for a new kernel, but I panicked and tried to reinstall the nvidia driver and was unable to get any of the currently available drivers to work. What did work was replacing you. good bye.

oh grub2 how I hate thee

let me count the ways…

infinity plus 1) you think you are smart but you are not,
infinity plus 2) you do not give the people the power they need to help out when you are not smart — see number 1.

I simply wanted to upgrade my 1TB of software raid 1 to 1.5 TB of software raid 1, besides the time for copying and syncing it should be a slam dunk, but thanks to grub2 it was a super utter cluster f*ck.

I started by transitioning to a non mirrored 1.5 Tb disk with boot, swap and root, then after I was able to boot that, I built a set of degraded raid1’s on the other disk and then tried to bring the the first 1.5.

however my partition on the first half of the degraded raid was slightly larger than partition on the second half, I tried to resize it but then it wouldn’t boot… so I got to do the whole 1TB copy with billions of hard links over again… These are the steps to resize a raided partition if you are not using it for root http://www.howtoforge.com/how-to-resize-raid-partitions-shrink-and-grow-software-raid

Finally on the system 10 days later, still need to add the other half of the degraded disk, but this time they are the same size.

For grub2 help this page was helpful, (mostly pages 2 and 3): http://www.howtoforge.com/how-to-set-up-software-raid1-on-a-running-system-incl-grub2-configuration-ubuntu-10.04

I also manually updated the device map /boot/grub/device.map which may have helped things, dunno…

There was a post I read along the way but can’t find the URL that talked about using chroot, after mounting some things like dev and proc into the future chroot, that sounded promising, but I didn’t have to do that.

I also tried a shit ton of different ways to tell grub to boot my degraded mirror, ran grub-install, update-grub, and update-initramfs many, many, many times, what ultimately seemed to work was to run update-grub and grub-install again after I hacked my way to getting grub to boot up with root on /dev/md2. After the raid is done re-syncing I’ll try to pull the half that I built first and try to boot from the new half.

grub2 help for kernel upgrade on Ubuntu 12.04 domU on XCP

I wouldn’t be posting if this wasn’t yet another corner case, where things don’t work as they should… I likely built my xcp-xapi box at a bad time for xcp-xapi and grub2, hopefully this helps others…

Situation: installing new virtual kernel on Ubuntu 12.04 domU kernel upgrade crashes royally:

Error: Starting VM – Using to parse /boot/grub/grub.cfg – WARNING:root:Unknown directive load_video – WARNING:root:Unknown directive terminal_output – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive else – WARNING:root:Unknown directive export – WARNING:root:Unknown image directive recordfail – WARNING:root:Unknown image directive gfxmode – WARNING:root:Unknown image directive recordfail – WARNING:root:Unknown directive submenu – WARNING:root:Unknown image directive recordfail – WARNING:root:Unknown image directive gfxmode – WARNING:root:Unknown image directive recordfail – Traceback (most recent call last): – File “/usr/lib/xcp/lib/pygrub.xcp”, line 853, in – raise RuntimeError, “Unable to find partition containing kernel” – RuntimeError: Unable to find partition containing kernel

Background: Ubuntu 12.04 dom0 running xcp

Work around (http://blog.403labs.com/post/1546501840/paravirtulization-with-citrix-xenserver-5-5-and-ubuntu):

 xe vm-param-set uuid=<VM-UUID> PV-bootloader-args="--kernel=/boot/vmlinuz-3.2.0-29-virtual --ramdisk=/boot/initrd.img-3.2.0-29-virtual"
xe vm-param-set uuid=<VM-UUID> PV-args="root=UUID=<disk-UUID> ro -- console=hvc0"