Skip to main content

Posts

Showing posts from September, 2016

Bash stuff I should've learned before

I wanted to grab some variables from an xml and parse them into environment variables. After some googling around, I found my answer: Use xmlstarlet to pull the name/value pairs Then use sed to combine them into "name=value" format Then use a while loop with process substitution It ended up being something like #!/bin/bash while read -r line; do   # do some stuff to parse the line   # ...   printf -v $varname "$varval"   export $varname done <<< "$(xmlstarlet sel -t -m "[xml selections here]" -v . -n <[xml file]  | sed 'N;s/\n/=/')" Yay so cool.

Goal smashing and missing

August and September were weird months due to some things happening at work. It's pretty much settled down now, and I will be working on some exciting new things. First off, I didn't hit any of my goals for C or golang projects. However, I did continue working on my small Android project (simple todo list). I'm making really slow progress on it since I spend just one evening per week (or something like it) on it. I've also been making really slow progress on my image processing online class. I've only been spending about an evening per week on it as well. In August and September, I've finished Originals: How Non-Conformists Move the World  (Adam Grant) and Outliers: The Story of Success  (Malcolm Gladwell). I just started Alice's Adventures in Wonderland  for some lighter reading. I also started a class on binary exploitation with a colleague. Kind of going slowly through it, but I am getting more comfortable reading assembly and using gdb. In the m

Clonezilla attempt: Windows 7 HDD to SSD

I've used Clonezilla to try and clone failing hard drives, but I can't recall if I was ever successful with it. A family member's laptop was running slow and we determined it was due to a failing hard drive (can you guess... it was a Seagate drive). There was a bit of a dilemma, though. I had a replacement SSD, but it was smaller than the failing hard drive. Originally, I was going to try this: http://www.seanwingert.com/blogs/clonezilla-clone-bigger-smaller-drive-eg-ssd, but I totally forgot about it because I was entirely thrown off by the extra partitions (the recovery partitions). So what I ended up doing was: 1. Shrink the main Windows partition with gparted 2. Copy the partitions from the source hard drive to the target drive 3. Set the proper flags (e.g. "boot" and "diag") on the target drive's partitions 4. In Clonezilla, do a part-to-local-part clone for each of the partitions It was mostly success except for the recovery partitio