Parted, GPT and LVM
Always forget this:
(parted) mklabel gpt
(parted) mkpart primary 0 100%
(parted) set 1 lvm on
That is all.
Archive for the ‘Uncategorized’ Category.
Always forget this:
(parted) mklabel gpt
(parted) mkpart primary 0 100%
(parted) set 1 lvm on
That is all.
Just recently I wanted to be able to lock a single process to a specific CPU for testing purposes. A bit of googling lead me to thisnice explanation of how it works.
Essentially you use the taskset command to run a new proc locked to a specific CPU:
% taskset -c 1 sleep 10
Will run ’sleep 10′ locked to CPU #0.
% taskset -c -p 1
pid 1's current affinity list: 0,1
Shows you what PID 1 has its affinity set to.
Every time I need to use this modem on a new mac I end up fighting with it and often giving up. I’ve made it work this time, so I intend to document the process here so I dont spend hours googling next time.
These instructions worked on my iMac and my MacBook Pro both of which were running 10.5.7.
Before you start, make sure the modem is not connected.
First off download the drivers, the ones buried in the three.co.uk support site lack a actual installer even though the documentation suggests you just need to run the installer. WTF am I supposed to do with a bunch of .kext files three? Have you heard of a nice user experience? Clearly not. Click this link and download the zip file from here, inside is a standard OSX installer package. run that.
After that has installed, you dont need to reboot. Plug in the modem and wait a few minutes. The little LED started flashing blue occasionally for me which I think means I’ve got 3G coverage.
Once its calmed down open up network preferences where you should see a few new devices down the left hand side:

The device you are interested in is the HUAWEI Mobile, select that. Then in the ‘Telephone Number’ field enter *99#:

After you have done that click the ‘Advanced’ button. On the resulting pane, select ‘Generic’ from the Vendor drop down. Then select ‘GPRS (GSM/3G)’ from the Model field. If you are in the UK, enter ‘three.co.uk’ into the APN field and leave the CID as 1:

Click ok, and then click Apply on the main Network Preferences pane. After you’ve done this try clicking connect and you should see the following connection confirmation:
A nice little utility to monitor your connection is CheetahWatch which you can get from here.
Just found out how to turn on vmware-tools clocking syncing from inside the guest, rather than editing the .vmx file on the host.
Once you have vmware-tools installed and configured try this:
/usr/sbin/vmware-guestd --cmd "vmx.set_option synctime 0 1"
To verify this has worked look for this line in the corresponding .vmx file:
tools.syncTime = "TRUE"
I’ve just needed to snapshot a virtual machine running under VMware Fusion on my Mac but I only had SSH access. I’ve discovered the vmrun utility which is hidden away in XXX. VMware have a PDF of how to use it here. Very handy!
% export PATH=/Library/Application\ Support/VMware\ Fusion/:$PATH
% vmrun listSnapshots SpaceWalk.vmx
Total snapshots: 1
Fresh 5.2 all updates
% vmrun -T fusion snapshot SpaceWalk.vmx "SpaceWalk Installed"
% vmrun listSnapshots SpaceWalk.vmx
Total snapshots: 2
Fresh 5.2 all updates
SpaceWalk Installed
%
Bravo!
I recently needed to bulk load some entries to the DynDNS custom DNS service, I ended up using wget and a couple of bash for loops. This was the crux of it:
To login:
wget --keep-session-cookies \
--save-cookies cookies.txt \
--post-data="__login=1&username=${USERNAME}&password=${PASSWORD}" \
https://www.dyndns.com/account/
To check you are logged in:
wget --keep-session-cookies \ --load-cookies cookies.txt \ https://www.dyndns.com/account/services/zones/dns/
grep the page for ‘Logged’ you should see it say something like ‘Logged in user: blah’.
Also look towards the bottom of the page for the ‘multiform’ hidden form element, you need the value which is a string, something like ‘jaoEEPpxzAhfadQZ/dpO/A341374′
To add an entry:
NAME=test
IP=1.2.3.4
MULTIFORM="jaoEEPpxzAhfadQZ/dpO/A341374"
wget --keep-session-cookies \
--load-cookies cookies.txt \
--post-data="name_new=${NAME}&ttl_new=600&type_new=A&data_new=${IP}&submit=submit&multiform=${MULTIFORM}" \
https://www.dyndns.com/account/services/zones/dns/
Every so often I need a copy of one or all of these on a new machine. I tend to normally use RPM based distros and always have issues trying to find RPMS of these packages. As a result I’ve packaged them up and put them in my svn repo.
Feel free to checkout that directory, it includes a readme of how to build them for a system I’ve yet to need them on. replace the fc7 or el5 with something appropriate for your distribution.
Direct download links:
Redhat/Centos 5:
Fedora 7: