Of Pi’s and Play

Hello Once again,

Lately I have been in a sort of Tecno slump, I havent really worked on anything Technological in a while, other than a few side projects with the Raspberry Pis, Of which I now run three, Five if you include my Fathers and Father in-laws, which I don’t as they do the same as number one.

Pi number 1 Is my Main media center PC with RaspBMC, It has been attached to my TV for over three months and only gets worked on when I blow it up, I.E. Over clocking and corrupting the SD card, Trying out and failing to get it to boot over NFS, Trying it randomly on USB.

Pi number 2 Protoboard PI, Havent worked on this one much, Runs one of the Debian Distros available, and has a protoboard attached, nothing built and no components bought besides the board and PI

Pi number 3, Kali Linux, Pentesting from a Pi, albeit slow this is actually pretty cool, Reaver runs decently, not fast by any means but I am looking for improvements, but as a dropbox this is awesome.

Both Fathers Pis are Currently Media Centers as well though My Pops may be re-purposed into a small web server as after the death and rebirth of the server I have not been able to get the three nics to coöperate nicely since..

-Jace

Love Virtual Machines and Hypervisors

Ello,

As anyone who checked recently knows I had a HDD failure where My servers Operating system Hard Drive Failed, The Bios would not even recognize the drive being plugged in, So I figured i would be down for a while and set up a small web server in one of my Raspberry Pi’s.

What I did not know was how cheap mechanical Hard drives had become over the last year or so, The boot drive was a 500GB and well within warranty, so I had already planned to send it back to get it repaired/replaced, on a off trip to a local computer store I checked the price for another drive($64 and change) in the mean time and bought it on sight.

Seeing as with most of my recent servers I have switched to running different services in separate VMs I.E.: This Webserver in one, The IRC server in another, etc…

So Once I had the server back up bringing the services up was cake, just load each VM from the most current backup and were back where we were.

Feels good to have a decent back up stratagy.

Jace

Google Readers Demise Gives Birth to Self Hosted RSS Reader

Ello All,

Most seem to say lately that RSS feeds are a dying technology, I would disagree as I use them at least bi-daily if not more, I use them to keep track of My News on Technology, Different Linux and Android Trends, Threats and Vulnerabilities in the Infosec world, Random Web Comics and other Funnies (Memes and such).

So with Googles announcement to Kill off Reader was sudden and very disturbing as like I said I used it to check everything, and nothing else seemed to have what I wanted, nothing until I found out I could Host it my self, Enter Tiny Tiny RSS.

Tiny Tiny RSS, Looks alot like Google Reader but is hosted on my own server so there’s no chance of it getting taken down, less I get attacked that is.

Installation took all of around thirty minutes and I used the tar from the site to do so, I wont go into the installation instructructions as they are available on the website.

Overall I like it so far, Though I have only had it up since six thirty am, I have checked it periodically throughout the day and it updates the count in the tab I have it in.

Jace

Branching(Bridging?) the Server

Well another sort or accomplishment under my belt, I have successfully added a third nice to Server. Set it up for bridging, after trial and error, a lot of aggravations, and finally bucking and asking for help.

I now have a working topology as such:

Nic 1 — LAN 1 — Host only < for the underlying host, media server and storage system.
Nic 2 — LAN 1 — br0 KVM set one, original servers including this web server.
Nic 3 — LAN 2 — br1 KVM set two, new servers on separate wan connection.

All working so far after a few hiccups. Love this stuff!

EOL

Saving the Prime and a Dungeon of Sorts..

Yes NVFlash to save the day not what? a week after it was achieved?, I was trying to Put Ubuntu back on my Prime and before I knew it I had thrashed everything, not only that the only help i got form the Dev lilstevie was, “fastboot flash boot boot.img” Problems he never probably thought of was I never sated i had a Back up of the boot.img, I did luckily but before i knew that i had Kill /system, /boot and others, to the point it wouldn’t boot luily the bricksafe that NVFlash created, After an hour of work and the Discovery that i indeed had a boot.img its safely working again

 

Now the Dungeon!

 

I’m taking another security class this Fall and this I would believe would entail Port scans among other things, My Idea is as such, on my phone, I have an IRC and web server that I will place on the off network of the class to be discovered (hopefully) but a few student, the Site will say something to the tune of “Keep climbing down the Rabbit hole and you may be surprised what you find” corny I know but But its the IRC i really want them to find, For I am hoping to have this set up on Day one of class and hope to see at least one other student log into the IRC before class ends,

IRC still available @ irc.firezen.com

End of Line.

Cron’d Back up!

Well this Weeks mini project was to get a automated backup of all my Virtual machines on my KVM host, the first hurdle was to shut down the running VMs this is completed by executing virsh shutdown x where x is the domain number of the VM, I normally never have more then five machines running so I started the script with

 

#!/bin/bash

virsh shutdown 1

virsh shutdown 2

virsh shutdown 3

virsh shutdown 4

virsh shutdown 5

 

after this the VMs shutdown now I figured Compression would be key as most of these VMs have forty gigabyte hard drives if not bigger but normally only use about half.

 

Originally I started with tar.bz2 with the following command

sudo tar jcvf VM-Backup.tar.bz2 dir_1 dir_2

Sadly this took forever!! upon a little research it was due to the fact that bzip2 isn’t SMP compliant otherwise known as using multiple cores or CPUs

so next I tried Gzip with this command

sudo tar zcf VM-Backup.tar.gz dir_1 dir_2

To the same effect so I started to invest time in google until i found a SMP compatible BZIP2 here: http://compression.ca/pbzip2/ and was finally happy with the results with this command

sudo tar cfv VM-Backup.tar.bz2 –use-compress-prog=pbzip2 dir_1 dir_2

This used all cores available and maxed them during compression, for being a quad core system it cut the compression time roughly down to a third of what it was.

Now that things are starting to look up I decided I wanted to Log when the script ran and tag the output files with the date and time of Backup this was done by making a Variable for date

DATE=$(date +%m%d%Y-%H%M)

at this point what ever you put $DATE in it will output MMDDYYYY-HHmm so I wrote a few echo lines like this one

echo “Nightly Backup Started for $DATE” > /location/of/log

After all was said and done it was brought to my attention a question, “How do you check your backups for data integrity?” so I tagged on the end of all the compression scripts an md5 hash output

&& md5sum * > VM-Backup-$DATE.MD5 

you may notice the $DATE again I wanted to make sure the same MD5 matched the Backup file, I then thought about the space this is going to take up and figured one backup being kept is good enough to each time this script is ran it changes directory into the back up directory and deletes all files with

cd /location/of/backup/

rm *

and finished off with a reboot as I plan to run this weekly, this is my finished script changed for system anonymity

#!/bin/bash

DATE=$(date +%m%d%Y-%H%M)

#echo $DATE

echo “Nightly Backup Started for $DATE” > /location/of/log

cd /location/of/backup/

rm *

virsh shutdown 1
virsh shutdown 2
virsh shutdown 3
virsh shutdown 4
virsh shutdown 5

#sudo tar jcvf VM-Backup-$DATE.tar.bz2 dir1 dir2 && md5sum * > VM-Backup-$DATE.MD5

#sudo tar zcf VM-Backup-$DATE.tar.gz dir1 dir2 && md5sum * > VM-Backup-$DATE.MD5

sudo tar cfv VM-Backup-$DATE.tar.bz2 –use-compress-prog=pbzip2 dir1 dir2 && md5sum * > VM-Backup-$DATE.MD5

DATETWO=$(date +%m%d%Y-%H%M)

echo “Nightly Backup Complete for $DATETWO” > /location/of/log

 

sudo reboot

 

 

Enjoy and leave me tips if you have suggestions or kudos

Python!

Well when boredom insures I take to geekdom and this time as i am still slightly miffed with my server, Though currently it is working as expected with one nitch, the graphics card even when not in use is consistently sitting at 61-63 C, In the end should i not find a fix for it once everything is set up the Card will be removed..

 

Now (SQUIRL!) back to was i was saying In boredom i take the geek road and read or find something to teach me.. Today it is Python within the last, eh two hours because I’m a slow reader I have learned some of the basics and created this!

 

Jace@WesternKingdom:~$ python madlib.py
Please give me a Noun: boy
Please give me a Verb: running
Please give me a Proper Noun: Mack
Another Please: Harry
Please give me a Number: 2
And another Number: 6
And a Third number: 19
This Software Code named Mack Is Version number 2 . 6 . 19 Released by Harry for running the boy

 

n = raw_input(“Please give me a Noun: “)
v = raw_input(“Please give me a Verb: “)
s = raw_input(“Please give me a Proper Noun: “)
S = raw_input(“Another Please: “)
V = input(“Please give me a Number: “)
Vv = input(“And another Number: “)
Vvv = input(“And a Third number: “)

print “This Software Code named”, s,”Is Version number”, V,”.”, Vv,”.”, Vvv, “Released by”, S, “for”, v, “the”, n

 

Not bad for having started on a few hours ago.. the code will run when pasted back in a .py