Sunday, October 26, 2014

Adding a new disk to an LVM Ubuntu system

Today I'm adding another disk to my main Linux server.

I used cgdisk to write a partition table. I set the partition type to 8e00 for LVM (Logical Volume Manager?)

sudo pvcreate /dev/sdb1

$ sudo lvcreate --extents 100%FREE -n lvdisk2 vgdisk2 
  Logical volume "lvdisk2" created

$ sudo vgcreate vgdisk2 /dev/sdb1

  Volume group "vgdisk2" successfully created

sudo mkdir /mnt/disk2
sudo mount /dev/vgdisk2/lvdisk2 /mnt/disk2/

And it's up!

Tuesday, October 21, 2014

Avoiding Paralells price gouging

Paralells makes a virtual machine software for the Mac, called Paralells Desktop. They said I needed to upgrade their product to before upgrading to Mac OS X 10.10 Yosemite (although it seems they may have been lying).

The upgrade price in the US is $50, but if you're located in Europe they charge you $76 for exactly the same thing. Not a respectful way to treat your customers to charge 50% more for a download depending on where you live. (Note - it's not just the VAT).

So, the way to avoid paying their EU surcharge is to use a free web proxy like www.webproxyusa.com. Go to the site, enter "http://www.parallels.com" in the web address box, and navigate to the download you want. Note: don't enter any credit card details using the web proxy since it circumvents encryption. But enter your e-mail address and pay by Paypal. It's OK to enter an EU address. The price ended up being $59.41 including VAT.

There you go - save some money!

Thursday, October 02, 2014

Ubuntu server maintenance

I'm doing some server maintenance today.

The main reason being that Ubuntu 13.10 systems are not updated to fix the Shellshock security hole, so I'll try to upgrade my main server to 14.04 or 14.10.

I had a full /boot partition first which I needed to fix. I had to move two initrd files (initrd.img-3.11.0-15-generic and initrd.img-3.11.0-17-generic) to /tmp temporarily to be able to fix it.

I then did an "apt-get install -f" to fix some broken package stuff, probably due to the full /boot partition.

I still got some out of diskspace errors, so I guess I have to move another initrd or two to /tmp:


run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.11.0-26-generic /boot/vmlinuz-3.11.0-26-generic
update-initramfs: Generating /boot/initrd.img-3.11.0-26-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.11.0-26-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.11.0-26
Rerunning "sudo apt-get -f install". It's very slow when doing "running depmod". Success! I now have 23M free on /boot. 

I'll try running apt-get autoremove. I now have 87 MB free on /boot.

I now do:

sudo apt-get purge linux-image-3.11.0-23-generic
sudo apt-get purge linux-image-3.11.0-24-generic
sudo apt-get purge linux-image-3.11.0-15-generic 
The last command removed the running kernel, which I hadn't really planned to do. Oh well. Now I have 155 MB free on /boot.

Actually, I got a bit worried, so I reinstalled the running kernel (3.11.0-15). 140 MB free.

Now I'll try again to upgrade to 14.04:

Hm. I did some kind of resurrect in the previously failed 14.04 installation window. I wonder if the installation restarted properly? I don't dare to interrupt it, so I'll let it run.

Rebooted after 240 days uptime. It is taking a very long time with the hard disk light on. I hope it is just a forced fsck.

For some reason the network didn't come up on the first boot, but after the next reboot.



Saturday, August 30, 2014

Adding StartCom CA Cert to JDK 1.7.0 on Mac OS X to access FYB-SE API

I tried to access the Bitcoin exchange FYB-SE's API using a Java program under JDK 1.7.0 on Mac OS X 10.9.4. I got an exception:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
The reason is that FYB-SE's https SSL security certificate was issued by the Israeli certificate authority StartCom, whose Certificate authority (CA) certificate is not listed in Java's database of trusted certificate authorities.

My fix was to download Smartcom's CA certificate from http://www.startssl.com/certs/ca.crt. Then I did the following:
cd /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/security/
cp cacerts cacerts.orig
sudo keytool -importcert -file ~/certs/ca.crt -keystore cacerts
After this, my Java program trusted the certificate, and got stuck at the next error instead ;-)

Did you find this useful? Please Flattr me! 

Sunday, May 25, 2014

Installing OctoPrint for an original PrintrBot Plus with a TP-Link TL-WN725N Wifi adapter

I'm trying to make my Printrbot Plus accessible over WiFi so that I can move it outdoors when printing, to reduce exposure to dangerous fumes and nanoparticles.

I formatted the SD-card on my MacBook Pro using the SD Formatter program downloaded from here (following instructions here).

I used the 2014-01-07 Wheezy Octopi 0.8.0 image from here.

I then unzipped the OctoPi image and copied it to the SD card using:

sudo dd if=2014-01-07-wheezy-octopi-0.8.0.img of=/dev/rdisk3 bs=1m

I connected my Pi to the wired ethernet network and booted it. After boot I could ssh to octopi.local with username pi and password raspberry.

I ran sudo raspi-config on first boot to enlarge the initial partition to fill the card, and set my time zone, and rebooted.

The OctoPi interface is now available at http://octopi.local/

Next step was to set up my TP-Link TL-WN725N Wifi adapter.

I used uname -a to determine my OS version (was 3.10.25+ #622). Using this list, I determined i had to download this file:

https://dl.dropboxusercontent.com/u/80256631/8188eu-20131219.tar.gz

I downloaded:


wget https://dl.dropboxusercontent.com/u/80256631/8188eu-20131219.tar.gz

unpacked:

tar -xf 8188eu-20131219.tar.gz

installed:
sudo install -p -m 644 8188eu.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless
sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8188eu.ko
sudo depmod -a

Checked that the dongle was installed with iwconfig

Installed my favorit editor 'emacs' (took a while): sudo apt-get install emacs

I edited the wpa_supplicant.conf file to add my WiFi password:

sudo emacs /etc/wpa_supplicant/wpa_supplicant.conf

I added:

network={
ssid=""
psk=""
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
auth_alg=OPEN

}

I took down and and up the interface (not sure if it was neccessary), and could see with ifconfig that wlan0 had an IP address on my wifi network. Note that this was not obvious from the iwconfig results.

I have not tried a print yet, but it's looking good.

Tuesday, February 18, 2014

Getting an Azoteq IQS213 IC touch IC to work with a Nordic Semiconductor nRF51822 microcontroller

I'm trying to get an Azoteq IQS213 touch controller to work with the Nordic Semiconductor NRF51822 processor in my smartwatch project.

According to the IQS213 documentation, the ready / TO2 line is supposed to go low after startup to signal that the IQS is ready to receive commands from the controller.

However, this is not happening. The TO2 line is supposed to have a 4.7 kOhm pull-up resistor. Instead I have used the processor's internal 11-16 kOhm resistor as pull-up. Since it's larger than the specified resistor, it should not prevent the line from going low.

I've verified:

  • Power (2.8V)
  • Ground
  • VReg (1.68 V)
  • Checked for shorts
  • Orientation of chip
Still no ready low.

Next step will be to look for anomaly notes from Azoteq, and program an ACK handshake to see if that could work.