Saturday, June 27, 2015

Allow me to wax philosophical for a moment... On yesterday

(warning, this is not a typical nerd post!)

Children are not born knowing hate.   They are born into a language-less world knowing only love, friendship and cooperation.  Their young minds and bodies need the cooperation of parents to survive and grow.  They don’t know division, bias or hate.  Over time these concepts are absorbed, hopefully not intentionally, but they sneak in.  The idea that people deserve judgement.  That knowing a single fact about a person means you do not need to know anything else.  Sometimes these ideas, ingrained in adults, become reinforced by societal structures.  But we adults make the rules, and we can change them.  

Yesterday, another one of those societal structures was corrected.   That arc of justice was bent just a little more toward that childish ideal world without bias or division.  It’s a long arc, and there is a lot more bend left to go, but it moved.  We all felt it.   

Today, I am proud of my fellow adults.  

Children of today will likely know nothing of rotary telephones or the horrors of dialup internet.  They belong in museums too.  It is exciting to think that, now, maybe, if we just stay out of their way, they will also never know limits to who they can love. 

Sunday, January 18, 2015

The Novena Motherboard / And a post because I was told I should...

Much to my (@sysmatt) delight, my Novena motherboard was waiting on my doorstep when I got home friday night.  Bunnie Huang and (@bunniestudios) Sean Cross's (@xobs) open source motherboard.

At first glance it's simply beautiful.  I knew the dimensions ahead from the mechanical drawings, but it is still surprising how small it is for what is packed into it.  There is a lot of art and engineering that goes into laying out a board of this complexity.


And when was the last time you got anything (that wasn't test gear, and even that is rare today!) that included schematics?  On paper no less!


After making the customary backup copy of the included 4gb SD card, we plug in the very nice 18v 3.4a power brick... (Novena branded, nice touch) and we get linux kernel boot goodness.  I feel at home.  




I think it is pretty safe to say the Novena project is the first of its kind.  There have been many linux devboards over the years, but this one seems special.  It is targeted and tuned for a very specific hacking/fuzzing/etc audience, but also generic enough to be useful for a very broad hobbyist community.  The inclusion of the FPGA just blows the doors off the possibilities.  

That is all for now, Expect more posts a about Novena, and watch my @sysmatt twitter for micro updates!

Enough gushing, time to dig in.
-Matt




Tuesday, November 18, 2014

Manage your Raspberry Pi with a shell session in a web browser -- Introducing ShellInABox

Raspberry Pi B+ top.jpg
Image Credit:" Raspberry Pi B+ top" by Lucasbosch - Own work. Licensed under CC BY-SA 3.0 via Wikimedia Commons
.
Sometimes you need to log into a Pi (Or any Linux system for that matter) and you do not have a SSH client installed on the machine you happen to be behind. I have built lots of Raspberry Pi based gizmos and sent them on their way to parts unknown. Using a little chunk of software called "shellinabox" you can use any modern web browser to get a shell session. No plugins, no Flash, no Java applets, no putty, no trying to find the terminal app on a mac. Just point your browser and login. Shellinabox is remarkably fully featured, supporting full VT terminal, colors, copy/paste clipboard, and more. Running VIM and other full screen applications work perfectly. This awesome software has had a long lineage, originally based on a Java Applet the creator Markus Gutschke recently rewrote it to only use javascript, css and AJAX. All standard in modern browsers.

Shellinabox is completely self contained and does all it's work over one port (tcp/4200 by default). It is also relatively light weight, using about 5MB of memory on my systems. The default configuration does exactly what you would expect, when you point a web browser at it it will ask you for a username and password and logs you in to a shell session. Under the hood there are a lot more capabilities. You can actually substitute any interactive program in place of the login shell.

Installing Shellinabox

If you happen to be running Raspbian this is going to be really easy. Shellinabox is a standard package. All we need to do is install it and optionally do some customization.



pi$ sudo apt-get install shellinabox


If you want to install from source code or just explore how Shellinabox works, visit http://code.google.com/p/shellinabox.

Customize Shellinabox

You can completely skip this section if you like the default look and feel. Personally black text on white background makes my eyes bleed, so below I will include the steps to customize the colors. I prefer black background, call me old school, but I like the CRT type experience for shell sessions. White on black is acceptable, green on black is preferable.

All configuration for Shellinabox happens in /etc/shellinabox and /etc/default/shellinabox. The color themes are all handled by regular CSS so they are easy to modify. Style sheets are stored in files under /etc/shellinabox/options-available and use filenames that define their precidance with a number. This determines the order in which they are interpreted and the underscore (_) or plus (+) determines if they are enabled by default. These files are then symlinked into /etc/shellinabox/options-enabled to make them available to the user. To give me green on black, I create a file /etc/shellinabox/options-available/00+Green On Black.css which contains:


#vt100 #cursor.bright {
  background-color: white;
  color:            black;
}

#vt100 #scrollable {
  color:            #00ff00;
  background-color: #000000;
}

#vt100 #scrollable.inverted {
  color:            #000000;
  background-color: #00ff00;
}

#vt100 .ansi15 {
  color:            #000000;
}

#vt100 .bgAnsi0 {
  background-color: #00ff00;
}


Then, I make the symlinks:


pi$ cd /etc/shellinabox/options-enabled
pi$ sudo rm -f 00*
pi$ sudo ln -s ../options-available/00+Green\ On\ Black.css  .
pi$ sudo /etc/init.d/shellinabox restart


This will leave you with:


ls -l 
total 4
lrwxrwxrwx 1 root root  42 Nov 18 12:10 00+Green On Black.css -> ../options-available/00+Green On Black.css
lrwxrwxrwx 1 root root  42 May  3  2012 01+Color Terminal.css -> ../options-available/01+Color Terminal.css
lrwxrwxrwx 1 root root  38 May  3  2012 01_Monochrome.css -> ../options-available/01_Monochrome.css
-rw-r--r-- 1 root root 189 May  3  2012 README


Connecting

To connect to your Pi, aim your web browser at port 4200. Use the URL: http://nnn.nnn.nnn.nnn:4200/ where nnn.nnn.nnn.nnn is the IP address or hostname of your Raspberry Pi. You will likely be prompted with a SSL Certificate warning similar to the one below which is from Google Chrome. You can create real certificates for shellinabox, check the documentation if you want to. For now we will proceed by clicking the dialog as shown.


Once past the SSL warning you will be requested to login with a username and password. Do it. Once you are in, you are free to shell around to your hearts content.

Conclusion

Shellinabox is a great little tool to have in your toolbox. When you need to deploy a Raspberry Pi and might need to log in from a station that might not have a SSH client. Use them together, use them in peace.

Thanks for reading, Feedback to @sysmatt on twitter or comment below!

Like this article? Maybe you would like some of my other tutorials and articles: http://sysmatt.blogspot.com/

Saturday, August 30, 2014

Raspberry Pi Backup/Restore scripts and tutorial updated for NOOBs based SD cards!


Raspberry Pi B+ top.jpg
Image Credit:" Raspberry Pi B+ top" by Lucasbosch - Own work. Licensed under CC BY-SA 3.0 via Wikimedia Commons
.
Hi friends, I have made changes to the original article and scripts on github to support NOOBs SD cards. These SD cards can contain one or more raspberry PI operating systems. My scripts will backup one of those (linux based) OSs and allow you to restore it to a fresh SD. Note, it will only backup whichever OS is booted, and only that OS. During the restore script run, it will grow the partitions to fill the entire SD card. I have tested it with Raspbian and Pidora. Thanks and Enjoy!


Quick note of thanks to @KevinSidwar who pointed this out to me, I had never used NOOBs and it's an important feature for my scripts to support since a lot of new Rapsberry Pi come with a NOOBs card these days. Thanks Kevin!
You can find the article at: http://sysmatt.blogspot.com/2014/08/backup-restore-customize-and-clone-your.html