Jul 222013
 

Just a quick snippet of code to convert seconds to hours, minutes, and seconds, with the hours shown optionally.


function fromSeconds(seconds, showHours = false) {
if(showHours) {
var hours = Math.floor(seconds / 3600);
seconds = seconds - hours * 3600;
}
var minutes = (Math.floor(seconds/60) < 10) ? "0" + Math.floor(seconds/60) : Math.floor(seconds/60); var seconds = (seconds % 60 > 9) ? seconds % 60 : "0" + seconds % 60;
if(showHours) {
var timestring = hours+":"+minutes+":"+seconds;
} else {
var timestring = minutes+":"+seconds;
}
return timestring;
}

Share
Jul 192013
 

So I’ve recently started dabbling in the fun world of virtalisation, and wanted to use my spare computer as a VMWare ESXi host.
Unfortunately, the NIC in it was unsupported, however the driver that supports the NIC was present in ESXi.
So, with a bit of trickery, I got the installation media recognising my nVidia NIC as a supported device.
This can theoretically be done with any NIC that is supported by the forcedeth driver.
Make sure that your NIC uses the same numbers as mine, otherwise you’ll need to change the numbers that you paste later in this post.
To check, run this command, and you should get something similar back.

# lspci -nn | grep -i ethernet
# 00:07.0 Bridge [0680]: NVIDIA Corporation MCP61 Ethernet [10de:03ef] (rev a2)

Those numbers in the square brackets at the end are the ones we need.

First thing I had to do was grab the VMWare iso, and mount it so I could copy all the files off.

# mkdir installfiles
# mount -o loop VMware-VMvisor-Installer-5.1.0.update01-1065491.x86_64.iso isofile
# cp -r isofile/* installfiles

Once all the files were copied off, we need to use the vmtar utility to modify the files.
The only way that I have found of getting the vmtar utility was to have esxi already installed, and copy vmtar from that.
Once I got the vmtar utility, I could modify the net_forc.v00 archive that contains the forcedeth driver details.

We’ll need to extract the files first

# vmtar -x net_forc.v00 -o net_forc.tar
# tar -xvf net_forc.tar

Once they’re extracted, you’ll see 2 directories, etc and usr.
In /usr/share/hwdata/driver.pciids.d/, there’s a file called forcedeth.ids
Open that up, and add this line, and save the file.

03ef nVidia NForce Network Controller

Next file is in etc/vmware/driver.map.d and called forcedeth.map
Modify that one by adding in this line, and save the file

regtype=linux,bus=pci,id=10de:03ef 0000:0000,driver=forcedeth,class=network

Once those 2 files are modified, package up the files again

# tar -cvf net_forc.tar *
# vmtar -c net_forc.tar -o net_forc.v00

Next step is to package it back up into an iso file.

# mkisofs -relaxed-filenames -J -R -o custom_esxi.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table /installfiles

This command will take all the files in installfiles and re-package them into an ISO.
Once that’s done, you should be able to boot off the ISO and use the MCP61 NIC on vmWare

Share
Jul 192013
 

Hey Everyone.
This version of Raspbian Server Edition is just 2.4 but it’s been upgraded to Jessie rather than Wheezy.
Not much has changed apart from that, but it’ll save you an update 🙂

5431be436a23fd05e779f3a14e8fe05d5a9dc581 RSE2.5.img
4cbb92b1b7700dff3eab95581c3b043a1ccaee1f 1GB-RSE2.5.img

The images can be grabbed from here –
RSE 2.5
RSE 2.5 1GB

Share