Category Archives: Uncategorized

Cloud At Cost Remote Desktop

Recently I purchased a rather large Cloud At Cost service plan. It was like $240 for 8 CPUs, 8g memory, and an 80g HDD.

That’s pretty great even though the machine crashes and burns wayyy more often than it should. Well I do dig that it’s still somewhat powerful and I don’t much care that it dies weekly as I only use it for hacking on till I break it anyway, but I don’t like having to entirely rebuild my machine every time CaC borks it up.

To be a bit lazy there I hacked up a little script that helps me take their out of box Ubuntu 14 server and get it up as a remote desktop with some of my preferred tools. This could probably be used on any Ubuntu 14.04 server with minimal hackage.

It’s a bit vulgar, but we’re all adults here and it was hard to pass on this joke.

https://github.com/snuffeluffegus/ErectMyCAC

Some notes to be aware of.

  1. You need to have the ‘expect’ package installed. I think everything else is default.
  2. It’s not fire and forget yet. Keep an eye on it, you will be prompted for user input for grub and iptables.
  3. It does not handle errors. I’m too lazy to implement that in a non vital script.
  4. If your latency is bananas then you probably need to up the sleep time inside the expects. Sometimes CaC is stupid slow.
  5. Edit the line around ~118 if you want to add or remove packages.
  6. The firewall is set up with ports for ssh, http, https, and NoMachine.
  7. If you want to update the NoMachine.deb file go ahead and download the latest .deb package and just rename it correctly.
  8. Bro is the coolest IDS ever so we installed that slice of awesome.
  9. Your new passwords will be output to ‘CAC_{$CACIP}.txt’

That’s it. If you like it then enjoy, and if you’ve got ideas then please let me know.

Flash LibreBoot to Lenovo X200

I did this write up like a year or so ago, but I want to post it up here in case it disappears; though, I think that’s a long shot. I don’t have the very original write up I did and I’m too lazy to dig through github to get  my original, so I need to give some credit to the others that edited the page as I didn’t do literally everything you’ll read.

Copyright © 2014, 2015 Lawrence Wu sagnessagiel@gmail.com
Copyright © 2015 snuffeluffegus <>
Copyright © 2015 Kevin Keijzer <>
Copyright © 2016 Leah Rowe info@minifree.org

Also I’d like to tip my hat to the LibreBoot folks, they’re doing great work!

 

Requirements:

  • An x86, x86_64, or arm7l (for changing the libreboot.rom image mac address)
  • Raspberry Pi and peripherals
  • Relevant SOIC clip
  • 6 female – female jumpers
  • Internet connection
  • Screw drivers

Follow the ThinkPad X200: Initial installation guide to disassemble the laptop, and access the BIOS rom chip.

Note: x86# refers to commands to be run on the x86 computer, and pi# refers to commands to be run on the pi. A good practice is to make a work directory to keep your libreboot stuff inside.

x86# mkdir ~/work

If you’re running Raspian, you can do sudo raspi-config, enable SPI under Advanced and then spidev will be enabled. Simple, eh?

Download Libreboot from their releases page. For your safety, verify the GPG signature as well.

x86# gpg --keyserver prefered.keyserver.org --recv-keys 0x656F212E

x86# for signature in $(ls *.sig); do gpg --verify $signature; done

Install dependencies:

pi# sudo apt-get update && sudo apt-get install libftdi1 libftdi-dev libusb-dev libpci-dev subversion libusb-1.0-0-dev pciutils, zlib, libusb, build-essential

Download and build flashrom.

pi# svn co svn://flashrom.org/flashrom/trunk ~/flashrom

pi# cd ~/flashrom

pi# make

pi# sudo make install

On your x86 box change the libreboot.rom mac address

x86# cd ~/work/libreboot_bin/

Change the mac address on the libreboot images to match yours.

x86# ./ich9macchange XX:XX:XX:XX:XX:XX

Move the libreboot.rom image over to your pi

x86# scp ~/work/libreboot_bin/<path_to_your_bin> pi@your.pi.address:~/flashrom/libreboot.rom

Shutdown your pi, write down your rom chip model, and wire up the clip

pi# sudo shutdown now -hP

Chip model name

Pinout. You may want to download the image so you can zoom in on the text.

Pin # SPI Pin Name Raspberry Pi Pin #
1 not used not used
2 3.3V 1
3 not used not used
4 not used not used
5 not used not used
6 not used not used
7 CS# 24
8 S0/SIO1 21
9 not used not used
10 GND 25
11 not used not used
12 not used not used
13 not used not used
14 not used not used
15 S1/SIO0 19
16 SCLK 23

Note: The raspberry pi 3.3V rail should be sufficient to power the chip during flashing, so no external power supply should be required; however, at the time of writing that has only been tested and confirmed for one chip, the MX25L6405D.

Macronix Spec sheet so you can adjust your pinout for 8 pin 4Mb chips as necessary

At this point connect your SOIC clip to the rom chip before powering on your PI.

Power on your Pi, and run the following. Ensure you swap out “your_chip_name” with the proper name/model of your chip. Check that it can be read successfully. If you cannot read the chip and receive an error similar to “no EEPROM Detected” or “0x0 Chip detected” then you may want to try powering off your PI, and switching the two pins which are connected to the IO ports. I.E. Connect pins (clip)8 to (pi)19 and pins (clip)15 to (pi)21

pi# cd ~/flashrom

pi# ./flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 --chip <your_chip_name> -r romread1.rom

pi# ./flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 --chip <your_chip_name> -r romread2.rom

pi# ./flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 --chip <your_chip_name> -r romread3.rom

pi# sha512sum romread*.rom

If they are identical sha512 hashes then you can generally assume that it’s safe to flash your rom.

pi# ./flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 --chip <your_chip_name> -w libreboot.rom

It may fail a couple times, but keep at it and when you get the message Verifying flash... Verified or Warning: Chip content is identical to the requested image then you’re done.

Shut down your pi, put your box back together, and install a libre OS for great good!