tag:blogger.com,1999:blog-83858262269525231472024-03-05T15:31:55.627-05:00@sysMatt - Matt HoskinsRandom ramblings of a common nerd. IT Professional, Kitchen Hacker, Electronics hobbyist, and coder of microprocessors small and large. This is my corner of the web. @sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-8385826226952523147.post-25677266258052527972017-04-14T16:45:00.000-04:002017-04-15T13:10:44.016-04:00Simple Led Nameplates for coworkers -- Kicad/PL9823/Atmega8/Arduino/NeoPixel /w github<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilrzrwZ-jrvgUlQfZkA_2TsDn8CLuPbufFtRZJPAL0D3ncybQJ409cOyhqG5sAVyJoNu2OURdnezqjeP3Znj6gmyh5FReRVNaw5zO-zz8FMpc1klVP-zlroTwR2xkL1u28qcmTpKelLZ4l/s1600/10x10-name-sign-redacted.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilrzrwZ-jrvgUlQfZkA_2TsDn8CLuPbufFtRZJPAL0D3ncybQJ409cOyhqG5sAVyJoNu2OURdnezqjeP3Znj6gmyh5FReRVNaw5zO-zz8FMpc1klVP-zlroTwR2xkL1u28qcmTpKelLZ4l/s320/10x10-name-sign-redacted.jpg" width="320" /></a></div>
This was a quickie that came out really cool...<br />
<br />
I designed this project around parts I have mass quantities of... Mainly leftovers from other projects. This kind of thing is a great way to pare down your parts hoard! This why the PCB is a mishmash of odd components... I have a crap load of ATMega8 PDIP package chips... like seriously 300 or so of them. (Dont ask) So I tend to use them everywhere. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8kq47O8DcIoHb7_sD-wkj81fs6swi4GFHd4bIDBgRzoDvkiQM2Nd3YohFEbLaMcWjFdMSCglmtq-6oBYmdTKipgonmNrNScqLBTGYuRkTW6PpkC0ZtGB9fa1ZxXENeD4eNbjZXoH1qyC8/s1600/10x10-sign-back-cropped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="310" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8kq47O8DcIoHb7_sD-wkj81fs6swi4GFHd4bIDBgRzoDvkiQM2Nd3YohFEbLaMcWjFdMSCglmtq-6oBYmdTKipgonmNrNScqLBTGYuRkTW6PpkC0ZtGB9fa1ZxXENeD4eNbjZXoH1qyC8/s320/10x10-sign-back-cropped.jpg" width="320" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBBs2UkJK0YZF3EKcPAfGso6niugPMdtc6EzTo-LEh6aR589eI5GhQBDdpn25FwTvJ9-heaAERGzV-8x-8cyRTTQvqw1Fo-htTYqDT7Ud4UNK8AxBpYTUltvpvL2eyYw4B8V3QO8QtkxVQ/s1600/20170414_152145.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBBs2UkJK0YZF3EKcPAfGso6niugPMdtc6EzTo-LEh6aR589eI5GhQBDdpn25FwTvJ9-heaAERGzV-8x-8cyRTTQvqw1Fo-htTYqDT7Ud4UNK8AxBpYTUltvpvL2eyYw4B8V3QO8QtkxVQ/s320/20170414_152145.gif" width="320" /></a></div>
I designed these around <a href="http://dirtypcbs.com/">http://dirtypcbs.com/</a> prototype service which is 10 boards 10x10cm for around 16 bucks. This means my friends get one sign and about 9 personalized coasters ;-)<br />
<br />
In kicad I simply plopped my prebuilt ATMega8 MCU board sck file as a hierarchical sheet then broke out nets for the brightness knob analog input, button input and PL9823 pixel data output (A ws2812 compatible in a 8MM T package LED... I LOVE These things!).<br />
<br />
<br />
Using 12 of these PL9823 8mm devices is way overkill but you can control the brightness with the pot, I didn't really know how it would cast through the PCB so I figured better to be too bright than too dim. It sure is pretty though. I do the fronts in 1.2mm thickness and the back in 1.6mm. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipJJryACx0bGZpZo-idZ87ACNyV_k5SpAqpDk2ICdzwxF0_3RO2UoUipUE2xGgzkVsWHLz55C6B-89xgGH40nr0RE-m1MrbF2SV-GKApZfrqsqQDNyGT5V8-tADq6Bxvpz1XH3kVyt1Jho/s1600/20170414_152240.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipJJryACx0bGZpZo-idZ87ACNyV_k5SpAqpDk2ICdzwxF0_3RO2UoUipUE2xGgzkVsWHLz55C6B-89xgGH40nr0RE-m1MrbF2SV-GKApZfrqsqQDNyGT5V8-tADq6Bxvpz1XH3kVyt1Jho/s320/20170414_152240.jpg" width="320" /></a></div>
I put the footprint for two POTs since i have lots of both. Also my original ATMega board needed timekeeping it had footprints for crystal oscillator, this design didn't so I did not populate the crystal and even left out some of the bulk and bypass caps... simply not needed. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY7QLXjneKlsdEFW3YtSs52Ucbb4MyMBUYp8UA0uTJBiZHeQTUVK9CsKYBLvENjTYT-DxyyaNH6EGaYK7lVBtr3Z2T8rPfnGI4131vD-QyWPjE2ku50gWvQEYZx_aVTqYvWyYNTJjCInbj/s1600/20170414_152228%25280%2529.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjY7QLXjneKlsdEFW3YtSs52Ucbb4MyMBUYp8UA0uTJBiZHeQTUVK9CsKYBLvENjTYT-DxyyaNH6EGaYK7lVBtr3Z2T8rPfnGI4131vD-QyWPjE2ku50gWvQEYZx_aVTqYvWyYNTJjCInbj/s320/20170414_152228%25280%2529.jpg" width="320" /></a></div>
<br />
The pixels are arranged in a string of course, and I added headers for the input and output data... This way I can chain them to another neopixel board or another one of these that simply does not have the MCU populated. With things like this I try to make the boards are re-usable as possible. Adding extra footprints is free!<br />
<br />
<br />
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- iot1 -->
<br />
<ins class="adsbygoogle" data-ad-client="ca-pub-1453746380794860" data-ad-slot="1747193239" style="display: inline-block; height: 90px; width: 728px;"></ins><script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br />
The whole design took a couple hours since I was re-using huge parts of previous designs. If i had it all to do again I probably would have added a serial header to allow easier re-programming. As it is, I am using an ISP programmer which most people will not have on hand. But this was a carry over from the reused block. If i had done that, this board would look like a Arduino UNO in the Arduino UI. But oh well, that will be V2.5 I guess...<br />
<br />
For the logos and graphics i used KiCad's Bitmap2Component and put them on the solder mask layer. The front has most of the solder mask removed on the back and selectively removed on the front. This combined with copper layers determines where and how the light passes through the PCB. The red soldermask completely absorbs some wavelengths of light while the fiberglass PCB transmits everything. So you get a great alternating effect as a given color reacts to the different materials. You really have lots of options to get some cool effects. <br />
<br />
I have posted all the design files and code to github. Links below! Enjoy!<br />
<br />
Sources: <a href="https://github.com/sysmatt-industries/SYSMATT-PL9823-SIGN-10X10">https://github.com/sysmatt-industries/SYSMATT-PL9823-SIGN-10X10</a><br />
<br />
<br />
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- iot1 -->
<br />
<ins class="adsbygoogle" data-ad-client="ca-pub-1453746380794860" data-ad-slot="1747193239" style="display: inline-block; height: 90px; width: 728px;"></ins><script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-57160272451504795302016-11-28T10:35:00.000-05:002016-12-01T19:43:49.983-05:00IoT Stranger Danger! -- From an IT Professional and Electronics Hobbyist / Ramble-n-RantI sit on two sides of this problem. I am an IT Professional, currently Enterprise Architect at New Jersey Institute of Technology. My Department manages everything server, storage and network on our campus. We see every manner of device installed (or attempted to be installed) on our network. Consumer devices, smartphones, industrial control devices, PLCs, cameras ... Everything (Even a internet connected fish tank! Seriously.)<br />
<br />
On the other hand, because of my embedded/electronics background, I am intimately familiar with the microprocessors, firmware complexities, networking stacks and protocols at play in these devices. Quite simply when you build a device, try to make it as cheap as possible, then make it participate in an increasingly complex network jungle, you are asking for trouble.
<br />
<br />
Consumer devices are built down to a cost, which means they will often use the smallest microcontroller possible and offload complexity "elsewhere". This means devices like WiFi light bulbs and thermostats often depend on a service running in the cloud for advanced functionality. The simpler you can make a hardware device the less likely there will be show stopping bugs. By using a cloud service the product designer moves some of that bug risk to something under their direct control. A server run in the cloud is capable of giving the user a lush App/GUI, complex functionality and integration with an ever changing field of other devices.<br />
<br />
The IoT ecosystem is rapidly evolving, making sure that a consumer device works with IFTTT, twitter, gmail, facebook etc is a minefield of APIs. Putting that complexity directly in the device would be expensive and require frequent firmware updates. (more on that later!)
<br />
<br />
So, these devices often depend on a cloud service, Does the owner need to know? Most will not care until it stops working. But the design of the device and how it communicates with the owner will largely determine it's lifespan.<br />
<br />
From a user's perspective, if it stops working, it's broken and when it's broken, it's trash. Many of these devices will have a direct and short path to the landfill if the company goes belly up and/or shuts down the cloud components. For example, NEST, now owned by Google, announced they would be shutting down their "Revolv" cloud service making the hardware devices junk. To their credit they offered the users a refund. But it's a good example of how a physical device's functionality depends on stuff outside the control of the user. <br />
<br />
Let's talk about security... It's a jungle out there. We often think that our local network (home or corporate) is a walled off garden. But this is not really the case. The jungle creeps in...<br />
<br />
Consider small embedded device... Let's say a consumer WiFi controlled lightbulb... camera, or a network connected alarm panel. Believe it or not, they are remarkably similar. All have a small microcontroller running a minimal (but complicated!) network stack. They are both likely to be "stuck in time" and forgotten after being installed. Meaning, once the owner "gets it working" it will rarely (or never) have it's firmware updated, at least as long as it continues to work. And finally, after some duration, sometimes remarkably short for consumer items, the company that produced this device will stop supporting it, or worse completely disappear. From the above cloud discussion we know this can spell certain doom for the complex functionality, but lets assume that this device allows you to directly control it and does not rely on a cloud service.
<br />
<br />
When network connected devices get "stuck in time" they become a hazard to the network owner. (this means you) This can be a campus with 10,000 deices or your home network with ~10 devices. The scale is different but the hazard is the same.
<br />
<br />
In some cases the device firmware is vulnerable to direct attack. Perhaps a OpenSSL or HTTPD vulnerability, maybe combined with a Linux kernel hole that allows arbitrary code execution. This can mean that another peer device on the same network can gain access to and control or adulterate firmware on a device. This can be a toehold for a larger attack or simply become a "bot" used to attack elsewhere on the network.
<br />
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- iot1 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="1747193239"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br />
Even if an attacker is not a peer on your local network, these devices are often allowed to make unfettered outgoing connections. If you can induce a device to make an outgoing call to a malicious site, perhaps a malicious DNS server, you may be able to exploit a hole which gives you access an attacker can build on. This means an attacker need not already be on your network. You at home, could browse a malicious website, your computer gets infected and looks for other vulnerable devices on your network. This really does happen and it means your DVR or IP Camera may be quietly participating on a Distributed denial of service (DDoS) attack controlled by a BOTnet.
(See: <a href="http://arstechnica.co.uk/information-technology/2016/10/inside-the-machine-uprising-how-cameras-dvrs-took-down-parts-of-the-internet/">http://arstechnica.co.uk/information-technology/2016/10/inside-the-machine-uprising-how-cameras-dvrs-took-down-parts-of-the-internet/</a>) <br />
<br />
Ok, So we have the cloud service evaporation risk, the "Stuck in time" risk, and all those security risks. What should we do? Simply keep using normal light switches? (Well yes, but don't get me started on that...)
<br />
<br />
I think we all just need to understand where we are in IoT's hypecycle (See: <a href="https://en.wikipedia.org/wiki/Hype_cycle">https://en.wikipedia.org/wiki/Hype_cycle</a>) ... We are firmly, I think, on the roller coaster headed down toward the "Trough of Disillusionment". There are going to be some big IoT casualties, some big security exploits, and a LOT of junk in landfills. Understand the risks and proceed with caution. Some suggestions:
<br />
<br>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- iot2 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="3223926439"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br>
<br />
<ul>
<li>
Don't buy expensive crap -- This might sound obvious but the wording is specific. If your going to spend a wad of cash on a gadget, try to understand the parent companies commitment to being in business and product support in comparison to how bid the wad is. If you are buying a whiz-bang cheapo ~$20 IoT gizmo, it's not too difficult to recoup that value even if it doesn't last that long. (putting landfill ecology aside) </li>
<li>Build a wall -- You might consider setting up a isolated WiFi WAP dedicated to un-trusted IoT devices. Decent consumer access points are sub $50 these days, and most will intelligently select non-conflicting channels. This can offer a lot of protection but can also break funcationality, its a trade off. </li>
<li>Keep on top of firmware -- Some IoT devices will tell you wen new firmware is available... but that only works if you actually look at the app from time to time. Lots of these gizmos are set-and-forget, well try not to forget them for too long. </li>
<li>Keep on top of the vendor -- If the company is out of biz or if the product is abandoned/end-of-life'ed it is likely that firmware updates will dry up and you will not know. If this happens it is important to consider taking those devices off the network. They become a growing risk as new security vulnerabilities are found. </li>
<li>Buy devices that have direct control -- Some devices have direct control in addition to a more luscious IoT API. This means, for instance, even if IFTTT support evaporates you can still have some level of control using direct communication with the IoT device. This is usually a web interface running right on the device, or a app that does not require a cloud service. </li>
</ul>
<br />
In the coming years there will be lots of development of IoT security. There is a gaping hole for some enterprising developer to fill with a intelligent stateful firewall aimed at IoT devices. Think of this as a virus/malware protection for your home network that prevents IoT devices from doing bad things based on signatures and heuristics. I think this will be a growth area for consumer home networking in the next couple years. Until then, keep safe!<br />
<br />
<br />
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- iot3 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="4700659634"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br />
<br />
<br />
<br />
<br />@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-42844493198156851222015-06-27T10:25:00.001-04:002015-06-27T10:38:39.979-04:00Allow me to wax philosophical for a moment... On yesterday<span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;">(warning, this is not a typical nerd post!)</span><br />
<span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span id="docs-internal-guid-f2b8c3b3-3566-ed83-5053-3801246c8763"><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;">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. </span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;">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. </span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;">Today, I am proud of my fellow adults. </span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;">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. </span></span>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-29064548323401766492015-01-18T13:58:00.000-05:002015-01-18T13:58:32.035-05:00The Novena Motherboard / And a post because I was told I should...Much to my (<a href="https://twitter.com/sysmatt" target="_blank">@sysmatt</a>) delight, my <a href="http://www.kosagi.com/w/index.php?title=Novena_Main_Page" target="_blank">Novena</a> motherboard was waiting on my doorstep when I got home friday night. Bunnie Huang and (<a href="https://twitter.com/bunniestudios" target="_blank">@bunniestudios</a>) Sean Cross's (<a href="https://twitter.com/xobs" target="_blank">@xobs</a>) open source motherboard. <br />
<br />
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. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjUggfLdGwE5dx9BNSs1LhcN_JdwRnZh5EwnzbMewQarz3InDja_Z3_4Rg0xAyf7rq07-Ia_XzVkFJ5TYpSaVVn3lU_mBV3_5rc-cd9YcBwhO1hOEQrXb-A6I_gEj2LiDd54Mtsc13DQS1/s1600/20150116_180922.jpg" height="225" width="400" /></div>
<br />
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! <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW14tVgvpNyCe2kN6ikYWIJ6BHDD5EQkerKXj8cQS0lsmn3BtzHulzO0iCjJw3VWPFw7c9QXvZR1D0KGcXf5r8SYuRcXwly4DmtnoqrgSTkar2_FygxC7OW_s9G6sshIMnmg3XXfxNADOz/s1600/20150116_182144.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW14tVgvpNyCe2kN6ikYWIJ6BHDD5EQkerKXj8cQS0lsmn3BtzHulzO0iCjJw3VWPFw7c9QXvZR1D0KGcXf5r8SYuRcXwly4DmtnoqrgSTkar2_FygxC7OW_s9G6sshIMnmg3XXfxNADOz/s1600/20150116_182144.jpg" height="225" width="400" /></a></div>
<br />
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. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBfx6YlsbMc6RipPtWbazWvahYnD6krMOty2nCbYoVlyMPYLxu1aL9TfllemywyMCpT30sTKCY1E4QpSjCqIsrhu35jYDlqxFZuIG519r4HM69XHuy0OEi5PB5YxxckRatH0CncQ7Fffw4/s1600/20150118_134625.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBfx6YlsbMc6RipPtWbazWvahYnD6krMOty2nCbYoVlyMPYLxu1aL9TfllemywyMCpT30sTKCY1E4QpSjCqIsrhu35jYDlqxFZuIG519r4HM69XHuy0OEi5PB5YxxckRatH0CncQ7Fffw4/s1600/20150118_134625.jpg" height="225" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpb_1khIPUF5TSkr9bNQkSSHWT22cGVyK45AGNQR5oIuonUS4UeSzYgVl7dfBNhFHtKFzbhxJM0Sm6ALz1HMQVa3m9_60N5yYE8DGXEU1jrohIzZOb454xOp3p1U7H1gSgVEsrenvgK7KX/s1600/20150118_134638.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpb_1khIPUF5TSkr9bNQkSSHWT22cGVyK45AGNQR5oIuonUS4UeSzYgVl7dfBNhFHtKFzbhxJM0Sm6ALz1HMQVa3m9_60N5yYE8DGXEU1jrohIzZOb454xOp3p1U7H1gSgVEsrenvgK7KX/s1600/20150118_134638.jpg" height="225" width="400" /></a></div>
<br />
<br />
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. <br />
<br />
That is all for now, Expect more posts a about Novena, and watch my @sysmatt twitter for micro updates!<br />
<br />
Enough gushing, time to dig in.<br />
-Matt<br />
<br />
<br />
<br />
<br />@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-84549858710412182892014-11-18T12:48:00.000-05:002014-11-18T13:19:39.474-05:00Manage your Raspberry Pi with a shell session in a web browser -- Introducing ShellInABox <style>
.highlight { background-color:yellow; color: black; }
.typed { text-decoration:underline; font-weight:bold; }
</style>
<div id="fb-root">
</div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<a href="http://commons.wikimedia.org/wiki/File:Raspberry_Pi_B%2B_top.jpg#mediaviewer/File:Raspberry_Pi_B%2B_top.jpg"><img alt="Raspberry Pi B+ top.jpg" src="http://upload.wikimedia.org/wikipedia/commons/6/6f/Raspberry_Pi_B%2B_top.jpg" height="145" width="216" /></a><br />
<small><small><small>Image Credit:"<a href="http://commons.wikimedia.org/wiki/File:Raspberry_Pi_B%2B_top.jpg#mediaviewer/File:Raspberry_Pi_B%2B_top.jpg"> Raspberry Pi B+ top</a>" by <a href="https://commons.wikimedia.org/wiki/User:Lucasbosch" title="User:Lucasbosch">Lucasbosch</a> - <span class="int-own-work">Own work</span>. Licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0" title="Creative Commons Attribution-Share Alike 3.0">CC BY-SA 3.0</a> via <a href="https://commons.wikimedia.org/wiki/">Wikimedia Commons</a></small></small></small><br />
.
<br />
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. <p>
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.
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- siib0 -->
<ins class="adsbygoogle"
style="display:inline-block;width:336px;height:280px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="4502844431"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<h2>Installing Shellinabox</h2>
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. <p>
<p><br>
<table><tr><td bgcolor="darkblue"><pre><code>
pi$ <span class="typed">sudo apt-get install shellinabox</span>
</code></pre></td></tr></table><p><br>
If you want to install from source code or just explore how Shellinabox works, visit <a href="http://code.google.com/p/shellinabox">http://code.google.com/p/shellinabox</a>. <p>
<h2>Customize Shellinabox</h2>
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. <p>
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:
<p><table><tr><td bgcolor="darkblue"><pre><code>
#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;
}
</code></pre></td></tr></table><p><br>
Then, I make the symlinks:
<p><table><tr><td bgcolor="darkblue"><pre><code>
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
</code></pre></td></tr></table><p><br>
This will leave you with:
<p><table><tr><td bgcolor="darkblue"><pre><code>
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
</code></pre></td></tr></table><p><br>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- siib1 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="5979577639"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<h2>Connecting</h2>
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. <p>
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqAq4vdiCKRF15XpimalBTlE3_MhhM5biC04O8gmouoE-pYIWGP4uNd-JCXe7C9s-JJaX_h07olY9_Wc4GceBUEzOUqa8hIH52XOpx7igXC4pI4zTki8SF3DgF8cEsuxweL0_oJcPnk0Jw/s1600/Privacy+error+-+Google+Chrome_017.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqAq4vdiCKRF15XpimalBTlE3_MhhM5biC04O8gmouoE-pYIWGP4uNd-JCXe7C9s-JJaX_h07olY9_Wc4GceBUEzOUqa8hIH52XOpx7igXC4pI4zTki8SF3DgF8cEsuxweL0_oJcPnk0Jw/s1600/Privacy+error+-+Google+Chrome_017.png" /></a></div><p><br>
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. <p>
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY4RXQ-aNvWpe7F0lTqwEN_zldpNXxiEhNdEDtfEwChBAwfLyEDqlNl-MvaLz6PFaopJanQP8uLG5_FfqRZpeCf7_FCoeodgjUPz_URqH6e8BEbJDWkIaBLHlIJF96W38uuUW8Og2atQRM/s1600/Shell+In+A+Box+-+Google+Chrome_018.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgY4RXQ-aNvWpe7F0lTqwEN_zldpNXxiEhNdEDtfEwChBAwfLyEDqlNl-MvaLz6PFaopJanQP8uLG5_FfqRZpeCf7_FCoeodgjUPz_URqH6e8BEbJDWkIaBLHlIJF96W38uuUW8Og2atQRM/s1600/Shell+In+A+Box+-+Google+Chrome_018.png" /></a></div><p>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- siib3 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="7456310833"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<h2>Conclusion</h2>
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.
<p>
Thanks for reading, Feedback to @sysmatt on twitter or comment below! <p>
Like this article? Maybe you would like some of my other tutorials and articles: <a href="http://sysmatt.blogspot.com/">http://sysmatt.blogspot.com/</a><p>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-68530212056481503872014-09-05T11:12:00.001-04:002014-09-05T11:12:31.143-04:00Busy Beaver Turing Machines - Computerphile<iframe allowfullscreen="" frameborder="0" height="270" src="//www.youtube.com/embed/CE8UhcyJS0I" width="480"></iframe>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-64024117685692334042014-08-30T11:07:00.000-04:002014-08-30T12:49:31.000-04:00Raspberry Pi Backup/Restore scripts and tutorial updated for NOOBs based SD cards!<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<br />
<a href="http://commons.wikimedia.org/wiki/File:Raspberry_Pi_B%2B_top.jpg#mediaviewer/File:Raspberry_Pi_B%2B_top.jpg"><img alt="Raspberry Pi B+ top.jpg" src="http://upload.wikimedia.org/wikipedia/commons/6/6f/Raspberry_Pi_B%2B_top.jpg" height="145" width="216" /></a><br />
<small><small><small>Image Credit:"<a href="http://commons.wikimedia.org/wiki/File:Raspberry_Pi_B%2B_top.jpg#mediaviewer/File:Raspberry_Pi_B%2B_top.jpg"> Raspberry Pi B+ top</a>" by <a href="https://commons.wikimedia.org/wiki/User:Lucasbosch" title="User:Lucasbosch">Lucasbosch</a> - <span class="int-own-work">Own work</span>. Licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0" title="Creative Commons Attribution-Share Alike 3.0">CC BY-SA 3.0</a> via <a href="https://commons.wikimedia.org/wiki/">Wikimedia Commons</a></small></small></small><br />
.
<br />
Hi friends, I have made changes to the <a href="http://sysmatt.blogspot.com/2014/08/backup-restore-customize-and-clone-your.html">original article</a> 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!
<p><br> 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! <br>
You can find the article at: <a href="http://sysmatt.blogspot.com/2014/08/backup-restore-customize-and-clone-your.html">http://sysmatt.blogspot.com/2014/08/backup-restore-customize-and-clone-your.html</a><br><p>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- rn1 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="7770392831"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script><br>
<div class="fb-like" data-href="https://www.facebook.com/sysmatt" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-86628631548192259892014-08-17T17:48:00.000-04:002014-08-30T13:01:39.772-04:00Classroom (mini) Supercomputer using Raspberry Pi<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.olcf.ornl.gov/wp-content/uploads/2014/05/robert.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="270" src="https://www.olcf.ornl.gov/wp-content/uploads/2014/05/robert.jpg" width="320" /></a></div>
<br />
Ok, so it will not solve the next quantum physics conundrum, but it might just ignite a spark in the next comp sci or physics genius. This is "<a href="https://www.olcf.ornl.gov/2014/06/02/titans-tiny-counterpart-engages-educates/" target="_blank">Tiny Titan</a>" designed at Oak Ridge National Laboratory specifically to get students thinking parallel. Writing software for massive high performance computing (HPC) systems is no easy task. With the simple hardware design built from low cost $35 Raspberry Pi boards and example projects a student can get their feet wet. On the Tiny Titan github there is example code in C and Python and lots of documentation. <br />
<br />
Tiny Titan: <a href="https://www.olcf.ornl.gov/2014/06/02/titans-tiny-counterpart-engages-educates/">https://www.olcf.ornl.gov/2014/06/02/titans-tiny-counterpart-engages-educates/</a><br />
GitHub: <a href="https://github.com/TinyTitan">https://github.com/TinyTitan</a><br />
<br />
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- tt -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="3004592833"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br />
<div class="fb-like" data-href="http://sysmatt.blogspot.com/2014/08/classroom-mini-supercomputer-using.html" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-13299785943995082732014-08-17T00:09:00.001-04:002014-08-30T12:58:16.048-04:00UNIX: Old School (updated for Raspberry Pi!) <style>
.highlight { background-color:yellow; color: black; }
.typed { font-weight:bold; }
</style>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<h2>Preface</h2>
It's been a long time since I originally wrote this article back in 2005 for Linux Journal. Do people even read paper any more? *smirk* I figured it needed a little update. I will walk you through all the steps necessary to boot up ancient UNIX (ancient as in 1970s) on your very own computer using the SIMH simulator. I also include special notes if you want to run the examples on the Raspberry Pi and Raspbian. (Which didn't even exist in 2005!). Enjoy!
<p>
<p><a href="http://commons.wikimedia.org/wiki/File:Pdp-11-40.jpg#mediaviewer/File:Pdp-11-40.jpg"><img src="http://upload.wikimedia.org/wikipedia/commons/e/ee/Pdp-11-40.jpg" alt="Pdp-11-40.jpg" height="480" width="360"></a><br>
<small><small>Image Credit: "<a href="http://commons.wikimedia.org/wiki/File:Pdp-11-40.jpg#mediaviewer/File:Pdp-11-40.jpg">Pdp-11-40</a>" by <a href="//commons.wikimedia.org/wiki/User:Stefan_K%C3%B6gl" title="User:Stefan Kögl">Stefan_Kögl</a> - <span class="int-own-work">Own work</span>. <BR>Licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0/" title="Creative Commons Attribution-Share Alike 3.0">CC BY-SA 3.0</a> via <a href="//commons.wikimedia.org/wiki/">Wikimedia Commons</a>.</small></small></p>
I have been called “nostalgic beyond my years” by some, and I suppose
that is accurate. I was born in 1976 during UNIX's childhood. Little did I know we would grow up together and meet later in life.
<p>I have always had a voracious
appetite for early minicomputer and mainframe history. I believe
recorded history itself is the single-most important innovation of human
existence. We humans seem to have a hard-wired compulsion to record,
pass on and learn from the mistakes and successes of those before us.
Open-source software and hardware is the natural evolution of this concept applied
to technology. In the Open Source philosophy, we are all
free to learn from the wealth of software created by the masses that
came before us. By examining the evolution of a project, we can learn
from the mistakes of others and, perhaps most important, copy verbatim from
their successes. By harnessing this freely available history as well
as unfettered cooperation, we advance the common good.
</p><p>
Recently, some companies have begun to loosen their grip on the early
computing “intellectual property”. Although some have not fully embraced
open source, these sometimes small, token gestures offer us a wealth
of knowledge. In this article, I focus on how we
can explore early operating system history by running
“historic” UNIX
releases on our very own Linux boxes using a simulator. The SCO Group
(Yes, “them”, previously Caldera, Inc.) claims current ownership of early
UNIXes and has released them under an “Ancient Unix”
license, which allows
for noncommercial use.
<p>I focus here on the UNIX V5 release, because it
is the earliest available UNIX. UNIX V6, V7 and various early BSD releases
are also available. If you plan on trying out any of these OSes,
examine the licenses included with each before booting them up.
<p>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- uos1 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="5613308836"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<h2>Stranger in a Strange Land: the UNIX V5 User Environment
</h2><p>
The UNIX V5 system provided in the disk image we will use is rather stark and
unfriendly compared to modern, lush UNIX/Linux systems. Here are a few pointers before we get started:
<ul><li>
sh is the shell. It's only 858 lines of C; don't expect it to work
like the /bin/bash shell.
</li><li>
Use <span class=typed>chdir</span> to change the default directory.
</li><li>
Backspace and arrow keys rarely work.
</li><li>
<span class=typed>ed</span> is the text editor; see <a href="http://en.wikipedia.org/wiki/Ed">en.wikipedia.org/wiki/Ed</a>.
</li><li>
<span class=typed>bas</span> is a basic interpreter.
</li><li>
<span class=typed>fc</span> is a FORTRAN interpreter.
</li><li>
<span class=typed>cc</span> is the C compiler.
</li><li>
Source code is in /usr/source.
</li><li>
There are not many files (528), so use <span class=typed>find / -print</span> to
see what else is included. It should scroll by just fast enough to read it ;-)
</li></ul>
In order to explore these OSes, we need to be able to run them on
commonly available computing hardware. Luckily, we have simulators
for this purpose. Because of its quality and depth of support,
one of the most popular simulators is SIMH, It was created in 1993. SIMH is available from
the SIMH Web site (see the Resources below). SIMH is available as source code and compiles and runs on every popular
*nix OS, as
well as Microsoft Windows. It is capable of simulating a wide range of
early computer systems, including Digital Equipment Corp.'s PDP and VAX
systems, the MITS Altair, early IBM systems and many more. Some of
the most historically significant systems are DEC's PDP series, the
birth-system of UNIX.
<p>
SIMH is a ground-up system simulator; it simulates the CPU, memory,
firmware and devices of a number of early computer systems. This
means that original distributed software can run unmodified on these
simulated systems. SIMH successfully simulates devices such as disks,
tape drives, printers and networking devices. This means that not only
can we run these historic systems, but we can communicate and transfer
data to and from them using modern technologies and protocols. A great
deal of thanks is owed to the authors and contributors of SIMH. Their decision to
release under open source furthers all our understanding
of our history and guarantees that this history will always be free.
<p>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- uos2 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="7090042035"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<h2>Getting Started: Installing SIMH</h2>
<p>
<TABLE border=1><TR>
<TD><img src="http://upload.wikimedia.org/wikipedia/en/c/cb/Raspberry_Pi_Logo.svg" alt="Raspberry Pi Logo.svg" height="72" width="57">
</TD><TD>
<b>Raspberry Pi Note</b><br> If you are running this on a Raspberry Pi running Raspbian you are in luck, SIMH is available as pre-built software. Skip the compile in this section and just install simh using apt-get:<BR><span class=typed>sudo apt-get install simh</span><BR>Then just skip to <A href="#running">Running UNIX V5</A>
</TD></TR></TABLE>
<p>
Below I will detail the command line steps needed to download and compile the SIMH source code.
The latest SIMH release is V3.9-0 at the time of this writing.
<p> If you want to use Ethernet emulation, you will need to install the PCAP development packages for your OS. The SIMH installation documents explain
how to do this, and you can skip this step if you're not going to be using
networking support on your simulated machines. If you are running Fedora or similar you can simply run:
<table><tbody><tr><td bgcolor="darkblue"><pre><code>
$ <span class=typed>sudo yum -y install libpcap-devel</span>
</code></pre></td></tr></tbody></table><p>
The stuff you type to compile SIMH is below in <span class=typed>bold</span>.
<table><tbody><tr><td bgcolor="darkblue"><pre><code>
$ <span class=typed>mkdir simh</span>
$ <span class=typed>cd simh</span>
$ <span class=typed>wget http://simh.trailing-edge.com/sources/simhv39-0.zip</span>
$ <span class=typed>unzip simhv39-0.zip</span>
$ <span class=typed>mkdir BIN </span> (Note all CAPS)
$ <span class=typed>gmake USE_NETWORK=1 all</span>
(Note: Only include USE_NETWORK=1 if you have PCAP development libs installed)
<span class=highlight>(compilation chatter omitted, go get a cup of coffee, this will take a moment... You can ignore any WARNINGs)</span>
$ <span class=typed>ls -l ./BIN/</span>
total 11624
-rwxrwxr-x 1 matt matt 301959 Jul 16 18:45 altair
-rwxrwxr-x 1 matt matt 482274 Jul 16 18:45 altairz80
-rwxrwxr-x 1 matt matt 529317 Jul 16 18:44 eclipse
-rwxrwxr-x 1 matt matt 297590 Jul 16 18:45 gri
-rwxrwxr-x 1 matt matt 375737 Jul 16 18:44 h316
-rwxrwxr-x 1 matt matt 577678 Jul 16 18:44 hp2100
-rwxrwxr-x 1 matt matt 355225 Jul 16 18:44 i1401
-rwxrwxr-x 1 matt matt 381672 Jul 16 18:45 i1620
-rwxrwxr-x 1 matt matt 441079 Jul 16 18:46 ibm1130
-rwxrwxr-x 1 matt matt 502037 Jul 16 18:46 id16
-rwxrwxr-x 1 matt matt 508378 Jul 16 18:46 id32
-rwxrwxr-x 1 matt matt 294614 Jul 16 18:46 lgp
-rwxrwxr-x 1 matt matt 434940 Jul 16 18:44 nova
-rwxrwxr-x 1 matt matt 345034 Jul 16 18:41 pdp1
-rwxrwxr-x 1 matt matt 752055 Jul 16 18:43 pdp10
-rwxrwxr-x 1 matt matt 1055376 Jul 16 18:43 pdp11
-rwxrwxr-x 1 matt matt 474153 Jul 16 18:42 pdp15
-rwxrwxr-x 1 matt matt 459203 Jul 16 18:41 pdp4
-rwxrwxr-x 1 matt matt 460363 Jul 16 18:41 pdp7
-rwxrwxr-x 1 matt matt 499473 Jul 16 18:42 pdp8
-rwxrwxr-x 1 matt matt 467662 Jul 16 18:42 pdp9
-rwxrwxr-x 1 matt matt 352233 Jul 16 18:45 s3
-rwxrwxr-x 1 matt matt 429312 Jul 16 18:46 sds
-rwxrwxr-x 1 matt matt 982694 Jul 16 18:43 vax
</code></pre></td></tr></tbody></table><p>
This builds all possible system simulators. Each simulator becomes
a separate binary in the ./BIN/ directory. SIMH can be run as any
normal user, but if you want to use Ethernet network simulation, you
need to execute it as root (under UNIX) to allow libpcap access to the
Ethernet device. Otherwise, continue as any non-root user. Our particular example of UNIX V5 does not use networking.
<p>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- uos3 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="8566775233"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<A name=running> </A>
<h2>Running UNIX V5</h2><p>
<TABLE border=1><TR>
<TD><img src="http://upload.wikimedia.org/wikipedia/en/c/cb/Raspberry_Pi_Logo.svg" alt="Raspberry Pi Logo.svg" height="72" width="57">
</TD><TD>
<b>Raspberry Pi Note</b><br> If you are running this on a Raspberry Pi running Raspbian you can perform all these steps as the "pi" user in it's home directory. Make sure you have at least 4MB of free space. (Yes, You read the correct. The entire UNIX V5 is less then 4MB.)
</TD></TR></TABLE><p>
UNIX V5, released in June 1974, was still very early in UNIX
development at Bell Labs. Much of the system was still written
in assembler. This disk image includes a working C compiler (cc)
and a great deal of interesting source code under /usr/source.<p>
To begin our exploration, we must download the UNIX V5 disk image. In the same shell as you compiled SIMH, run the following:
<table><tbody><tr><td bgcolor="darkblue"><pre><code>
$ <span class=typed>mkdir uv5</span>
$ <span class=typed>cd uv5</span>
$ <span class=typed>wget http://simh.trailing-edge.com/kits/uv5swre.zip</span>
$ <span class=typed>unzip uv5swre.zip</span>
</code></pre></td></tr></tbody></table><p>
This zip archive contains
the pre-installed image file as well as a README and file containing
license information. The disk image is a snapshot of a working installed
system. In this case, it is simulating an RK05 disk drive. We must now
collect the pieces we need to get this system booted. Begin by copying the BIN/pdp11 binary from under the SIMH build into our uv5 directory, then we will create a small config file "pdp11.ini" that tells the simulator how to boot UNIX.
<p>
<TABLE border=1><TR>
<TD><img src="http://upload.wikimedia.org/wikipedia/en/c/cb/Raspberry_Pi_Logo.svg" alt="Raspberry Pi Logo.svg" height="72" width="57">
</TD><TD>
<b>Raspberry Pi Note</b><br> If you are running this on a Raspberry Pi running Raspbian skip the next step where you copy (cp) the pdp11 binary and instead, run the following:<br>
<span class=typed>ln -s /usr/bin/pdp11 .</span>
</TD></TR></TABLE>
<p>
<table><tbody><tr><td bgcolor="darkblue"><pre><code>
$ <span class=typed>cp ../BIN/pdp11 .</span>
</code></pre></td></tr></tbody></table><p>
Create a file pdp11.ini with your favorite editor and place the following lines in it.
<table><tbody><tr><td bgcolor="darkblue"><pre><code><span class=typed>
set cpu U18
attach rk0 unix_v5_rk.dsk
boot rk0
</span></code></pre></td></tr></tbody></table><p>
<p>
This tells the simulator what kind of CPU to emulate and to attach the
unix_v5_rk.dsk file as a simulated RK-style disk using the rk0
device name. Finally, this file tells the simulator to boot the OS
image on that disk.
<p>
Your uv5 simulator directory should look like the following:
<table><tbody><tr><td bgcolor="darkblue"><pre><code>
$ <span class=typed>ls -l </span>
total 3916
-rw-rw-rw- 1 matt matt 12299 Jan 24 2002 AncientUnix.pdf
-rwxrwxr-x 1 matt matt 681169 Aug 16 20:13 pdp11
-rw-rw-r-- 1 matt matt 47 Aug 16 20:18 pdp11.ini
-rw-rw-rw- 1 matt matt 263 Nov 25 1996 README.txt
-rw-rw-rw- 1 matt matt 2494464 Sep 8 1998 unix_v5_rk.dsk
-rw-rw-r-- 1 matt matt 806708 Jan 31 2002 uv5swre.zip
</code></pre></td></tr></tbody></table><p>
<p>
We are ready. Let's boot UNIX V5 and have some fun! Follow the example session below or go off on your own exploring. Note, you will likely need to use CTRL-h as backspace if you make a mistake.
<table><tbody><tr><td bgcolor="darkblue"><pre><code>
$ <span class=typed>./pdp11</span>
PDP-11 simulator V3.9-0
Disabling XQ
@<span class=typed>unix</span>
login: <span class=typed>root</span>
# <span class=typed>ls -l /</span>
total 60
drwxr-xr-x 2 bin 944 Nov 26 18:13 bin
drwxr-xr-x 2 bin 80 Nov 26 18:13 dev
drwxr-xr-x 2 bin 240 Mar 21 12:07 etc
drwxr-xr-x 2 bin 224 Nov 26 18:13 lib
drwxr-xr-x 2 bin 32 Nov 26 18:13 mnt
drwxrwxrwx 2 bin 112 Mar 21 12:11 tmp
-rwxrwxrwx 1 bin 25802 Mar 21 12:07 unix
drwxr-xr-x 14 bin 224 Nov 26 18:13 usr
</code></pre></td></tr></tbody></table><p>
Let's look at some source code, starting with the "echo" program. It's small and simple.
<table><tbody><tr><td bgcolor="darkblue"><pre><code>
# <span class=typed>chdir /usr/source/s1</span>
# <span class=typed>cat echo.c</span>
main(argc, argv)
int argc;
char *argv[];
{
int i;
argc--;
for(i=1; i<=argc; i++)
printf("%s%c", argv[i], i==argc? '\n': ' ');
}
</code></pre></td></tr></tbody></table><p>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- uos6 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="4636103238"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Let's compile the echo program, rename it and run a "Hello World"
<table><tbody><tr><td bgcolor="darkblue"><pre><code>
# <span class=typed>cc echo.c</span>
# <span class=typed>mv a.out newecho</span>
# <span class=typed>./newecho Hello World</span>
Hello World
</code></pre></td></tr></tbody></table><p>
Nice! Now, let's create, compile and run our own hello world C program. We will use "cat" as a poor man's editor to create the source file.
<table><tbody><tr><td bgcolor="darkblue"><pre><code>
# <span class=typed>chdir /tmp</span>
# <span class=typed>cat >hello.c
main()
{
printf ("Hello World!\n");
}</span>
<span class=highlight>Hit CTRL-d here</span>
# <span class=typed>cc hello.c</span>
# <span class=typed>./a.out</span>
Hello World!
</code></pre></td></tr></tbody></table><p>
Let's try a basic program next, use cat to create hello.b with some basic source
<table><tbody><tr><td bgcolor="darkblue"><pre><code>
# <span class=typed>cat >hello.b
10 print "Hello World!"</span>
<span class=highlight>Hit CTRL-d here</span>
# <span class=typed>bas hello.b</span>
<span class=typed>run</span>
Hello World!
</code></pre></td></tr></tbody></table><p>
All done for now, Let's HALT the system. In true historical UNIX style, we will run sync three times, then push the HALT button. Or in our case, the SIMH equivalent which is CTRL-e
<table><tbody><tr><td bgcolor="darkblue"><pre><code>
# <span class=typed>sync; sync; sync</span>
# <span class=highlight>Hit CTRL-e here</span>
Simulation stopped, PC: 001726 (MOV (SP)+,177776)
sim> <span class=typed>exit</span>
Goodbye
</code></pre></td></tr></tbody></table><p>
<p>
That's it! You're up and running. You have officially set your fingers on a
“real” historical UNIX system. As you can see, there is plenty of source
code to look over and a working compiler to play with. UNIX V5 is only
one of the early operating systems you can explore with SIMH. On the
SIMH Web site, you will find a repository of disk images for lots of other systems. The learning curve can be quite steep on these older OSs but there is a lot to learn from them. You can find conceptual bit and pieces of them strewn about inside all modern systems. It's living history at your fingertips.
<p>
If you are interested in seeing what a PDP-11 system and RK05 disk
actually looked like, take a look at the photo gallery on the SIMH Web site
(see Resources). Also, try searching Google Images
for a wealth of great photographs.
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- uos4 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="1043508430"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<h2>Resources</h2>
<ul>
<li>SIMH Web Site: <a href="http://simh.trailing-edge.com">simh.trailing-edge.com</a>
<li>SIMH Users Guide: <a href="http://simh.trailing-edge.com/pdf/simh_doc.pdf">http://simh.trailing-edge.com/pdf/simh_doc.pdf</a>
<li>SIMH Photo Gallery: <a href="http://simh.trailing-edge.com/photos.html">simh.trailing-edge.com/photos.html</a>
<li>SIMH Contributors: <a href="http://simh.trailing-edge.com/contrib.html">simh.trailing-edge.com/contrib.html</a>
<li>PDP-11 History and Photos: <a href="http://www.pdp11.org">www.pdp11.org</a>
<li>UNIX History Timeline (Printable!): <a href="http://www.levenez.com/unix/">www.levenez.com/unix/</a>
<li>Open Group UNIX History: <a href="http://www.unix.org/what_is_unix">www.unix.org/what_is_unix</a>
<li>The Unix Heritage Society: <a href="http://www.tuhs.org">www.tuhs.org</a>
<li>PDP Unix Preservation Society: <a href="http://minnie.tuhs.org/PUPS">minnie.tuhs.org/PUPS</a>
</ul>
<h2>
About the author</h2>
Matthew is the Senior Enterprise Architect at the New Jersey Institute of Technology (NJIT). When he is not working, he enjoys hacking on electronics, microcontrollers and embedded systems. He can also make a mean falafel when the circumstances call for it. Matthew is a total nerd and thus completely useless in conversations regarding "sports". Matthew also greatly dislikes talking about himself in the third person in author biographies.
<p> For more random nonsense from Matthew he suggests following him on <a href="https://twitter.com/sysmatt">twitter: @sysmatt </a>
<p>Like this article? See more of <a href="https://sites.google.com/site/sysmattpublishedworks/">Matt's published works</a>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- uos5 -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="2520241634"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="fb-like" data-href="http://sysmatt.blogspot.com/2014/08/unix-old-school-updated-for-raspberry-pi.html" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-18353041992742029462014-08-13T01:02:00.002-04:002014-08-13T01:02:44.736-04:00So, That was interesting. I've written articles for print media, Quite a few for the likes of Linux Journal. My recent blog post <a href="http://sysmatt.blogspot.com/2014/08/backup-restore-customize-and-clone-your.html">http://sysmatt.blogspot.com/2014/08/backup-restore-customize-and-clone-your.html</a> was somewhat of an experiment. <br />
<br />
The response has been really cool. It got picked up by <a href="http://hackaday.com/2014/08/11/raspberry-pi-backup-scripts/" target="_blank">Hackaday</a> and <a href="http://lifehacker.com/easily-backup-and-clone-raspberry-pi-sd-cards-1620293961" target="_blank">Lifehacker</a>. It was also re-tweeted by <a href="https://twitter.com/sysmatt/status/498947222961393667" target="_blank">Adafruit</a> and a dozen others. And heck of a lot more feedback when when my stuff ended up on dead trees. <br />
<br />
Anyway, this was sort of a ramble, but i think there will be more posts like the last one. It's been a ride!@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-37235336534691597412014-08-09T20:11:00.003-04:002014-08-09T20:11:45.131-04:00Novena Open Source Board and Laptop / Linux / Bunnie Huang et al -- Collected Videos I'm a backer. Very excited. Here is a collection of good videos covering the Novena board and laptop
<hr>
<iframe width="560" height="315" src="//www.youtube.com/embed/ITAJ2Ud4zp8" frameborder="0" allowfullscreen></iframe>
<hr>
<iframe width="560" height="315" src="//www.youtube.com/embed/G9mjDt-4XIM" frameborder="0" allowfullscreen></iframe>
<hr>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<iframe width="560" height="315" src="//www.youtube.com/embed/LIi8fAkOU_g" frameborder="0" allowfullscreen></iframe>
<hr>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="1974001639"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<iframe width="560" height="315" src="//www.youtube.com/embed/-MtntO35JxE" frameborder="0" allowfullscreen></iframe>
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1453746380794860"
data-ad-slot="9497268439"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-41233045804301743852014-08-06T19:19:00.003-04:002014-08-06T19:19:32.753-04:00Great blog post about NAND storage, reverse engineering and recoveryAmazing stuff: <a href="http://joshuawise.com/projects/ndfslave">http://joshuawise.com/projects/ndfslave</a><p>
Joshua Wise accidentally destroys his SD card, rather be content with data loss and move on -- He pulls out a FPGA devboard and de-solders the NAND chip. This great blog post walks us through the entire process from smashed SD card to files recovered. @sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-18799852125508437562014-08-06T10:35:00.000-04:002015-06-27T17:16:52.325-04:00Backup, Restore, Customize and Clone your Raspberry Pi SD Cards (tutorial) [Updated 8/30 for NOOBs SD]<style>
.highlight { background-color:yellow; color: black; }
.typed { text-decoration:underline; font-weight:bold; }
</style>
<div id="fb-root">
</div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<a href="http://commons.wikimedia.org/wiki/File:Raspberry_Pi_B%2B_top.jpg#mediaviewer/File:Raspberry_Pi_B%2B_top.jpg"><img alt="Raspberry Pi B+ top.jpg" src="http://upload.wikimedia.org/wikipedia/commons/6/6f/Raspberry_Pi_B%2B_top.jpg" height="145" width="216" /></a><br />
<small><small><small>Image Credit:"<a href="http://commons.wikimedia.org/wiki/File:Raspberry_Pi_B%2B_top.jpg#mediaviewer/File:Raspberry_Pi_B%2B_top.jpg"> Raspberry Pi B+ top</a>" by <a href="https://commons.wikimedia.org/wiki/User:Lucasbosch" title="User:Lucasbosch">Lucasbosch</a> - <span class="int-own-work">Own work</span>. Licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0" title="Creative Commons Attribution-Share Alike 3.0">CC BY-SA 3.0</a> via <a href="https://commons.wikimedia.org/wiki/">Wikimedia Commons</a></small></small></small><br />
.
<br />
<b>NOOBs Users</b>: Note, My scripts on github have now been updated to support NOOBs distribution SD cards. See below in the script section for more details. <br />
<br />
<b>Ladies and gentlemen, if you are like me, you probably have a few raspberry pi.</b> (Piis?) I have found them to be great little Linux development boards supported by a huge community. Whenever I need a net connected microprocessor project, the pi is an easy win. I have used it in internet connected clocks, LED signs, RGB lighting projects and so many other crazy projects. They make a great internet gateway for Arduino projects. This use is the very definition of "embedded", a raspberry pi with no keyboard, mouse or monitor. It boots, connects and does it's programmed task. It would be a huge inconvenience to manually configure every one of these starting from a raspbian .img file. Even if your not into electronics, manipulating the SD cards directly will make your life a little easier.<br />
Now would be a great time to introduce my "day job". I am a professional *NIX system administrator and system architect. So when I see a raspberry pi I see a Linux box. UNIX/Linux systems are very easy to clone, it's just a pile of files. I will start with some basic theory and how to work with the SD card from the command line. Then, I will introduce you to my scripts which automate the process.<br />
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- rpi-clone-embed1 -->
<ins class="adsbygoogle" data-ad-client="ca-pub-1453746380794860" data-ad-slot="9199877230" style="display: inline-block; height: 90px; width: 728px;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br />
<br />
<br />
<br />
<h2>
No Magic here</h2>
Exactly how the raspberry pi boots is widely misunderstood. And no wonder, it's ummm, <a href="http://thekandyancode.wordpress.com/2013/09/21/how-the-raspberry-pi-boots-up/">complicated</a>. In almost every computer architecture "bootstrap" is messy and complicated. For the user though, the raspberry pi has kept it pretty simple, its just files on the SD. Interface wise, the SD card looks like a disk. Upon that disk are two partitions, a DOS (vfat) partition which contains almost everything necessary for booting, configuration, firmware, and kernel images. Why FAT? Well, when constructing a bootstrap process, the name of the game is simplicity and small code size. The DOS FAT filesystem is very simple compared to modern filesystems, it's also very well understood and pretty universal. The "userland" part of the Linux operating system lives in the second partition which is usually ext4. When the raspberry pi powers on, small chunks of firmware step by step load code into the GPU and CPU until it can eventually load the Linux kernel. This finally makes the system smart enough to mount the slash "/" partition and do all the userland linuxy stuff.So once we understand how it's using the SD card, we can duplicate it and pre-configure if before we even power it on. No magic, It's all just regular files and some *NIX know-how. <br />
Why not just use "dd"? The problem with the standard unix dd utility is it only copies raw disk blocks. For one, your average SD card is mostly unused disk blocks. But dd just copies them sequentially and wastes a lot of time. If you store just the OS files, you get automatic resizing when you restore your archive to a different size SD card. As long as the destination SD is big enough to hold the image, it doesn't matter what size the source card was. Finally, the tar approach allows you to untar and re-tar the archive to modify the archive without it ever booting.
<br />
<h2>
Basic Manual Cloning</h2>
The first use case we will explore cloning a running raspberry pi to a fresh SD card. To make things easy, we will do all these steps on the actual raspberry pi. You will need to have one free USB port and a USB SD card reader. We will do this step-by-step from the command line, this will give you a good idea how my scripts are constructed later.Power on your Raspberry pi, and log in by whatever means you prefer (graphical, ssh, etc). Get to a command prompt and sudo to a root shell, everything we are going to do needs root privilege. You will also need to install the dosfstools package which is used later. Then, plug in your SD card to any free USB port. Use the "dmesg" utility to dump the kernel log, look at the output to determine what scsi device your new SD card has been assigned. (stuff you type is <span class="typed">underlined</span>)<br />
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
pi$ <span class="typed">sudo su</span>
root# <span class="typed">apt-get install dosfstools</span>
root# <span class="typed">apt-get install rsync</span>
root# <span class="typed">dmesg</span>
[ 147.590292] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 147.977885] sd 0:0:0:0: [sda] 15759360 512-byte logical blocks: (8.06 GB/7.51 GiB)
[ 147.978590] sd 0:0:0:0: [sda] Write Protect is off
[ 147.978623] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[ 147.979287] sd 0:0:0:0: [sda] No Caching mode page found
[ 147.979314] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 147.982973] sd 0:0:0:0: [sda] No Caching mode page found
[ 147.983007] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 147.986412] <span class="highlight">sda</span>: sda1 sda2
[ 147.990030] sd 0:0:0:0: [sda] No Caching mode page found
[ 147.990064] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 147.990089] sd 0:0:0:0: [sda] Attached SCSI removable disk
</code></pre>
</td></tr>
</tbody></table>
<br />
From the above, we can see that our SD card has been assigned "sda" which means /dev/sda is how we will get to it.<br />
First, we need to create the two partitions to hold our /boot and / (slash) filesystems. We do this with the GNU parted utility.<br />
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">parted /dev/sda</span>
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) <span class="typed">mklabel msdos</span>
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? <span class="typed">y</span>
(parted) <span class="typed">mkpart primary fat16 1MiB 64MB</span>
(parted) <span class="typed">mkpart primary ext4 64MB -1s</span>
(parted) <span class="typed">print</span>
Model: Single Flash Reader (scsi)
Disk /dev/sda: 8069MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 64.0MB 62.9MB primary fat16 lba
2 64.0MB 8069MB 8005MB primary
(parted) <span class="typed">quit</span>
</code></pre>
</td></tr>
</tbody></table>
<br />
To summarize what we just did. First we use the "mklabel" to create a fresh msdos style partition table on /dev/sda, you will have to answer "y" to the warning. Next we create the partition to hold our FAT /boot filesystem, with a size of 64MB. Next we tell parted to create another partition to hold our slash (/) filesystem starting at the 64MB mark, and ending at the last available sector of the disk (-1s). We tell parted that these two partitions will be fat16 and ext4 respectively so it will set the correct partition type on each.<br />
Finally we "print" the resulting partition table so we can see it, then exit with "quit"<br />
The two partitions we just created are now available as devices /dev/sda1 and /dev/sda2. Next we need to format them. This is done with the mkfs.vfat and mkfs.ext4 commands:<br />
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">mkfs.vfat /dev/sda1</span>
mkfs.vfat 3.0.13 (30 Jun 2012)
root# <span class="typed">mkfs.ext4 -j /dev/sda2</span>
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
488640 inodes, 1954304 blocks
97715 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2004877312
60 block groups
32768 blocks per group, 32768 fragments per group
8144 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
</code></pre>
</td></tr>
</tbody></table>
Excellent! Now we need to mount these two partitions somewhere so we can copy data to it. Let's make a temporary directory under /tmp/newpi and do all our work under it. Below are the commands to mount our SD cards:<br />
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">mkdir /tmp/newpi</span>
root# <span class="typed">mount /dev/sda2 /tmp/newpi</span>
root# <span class="typed">mkdir /tmp/newpi/boot </span>
root# <span class="typed">mount /dev/sda1 /tmp/newpi/boot</span>
root# <span class="typed">df -h</span>
Filesystem Size Used Avail Use% Mounted on
rootfs 15G 2.3G 12G 17% /
/dev/root 15G 2.3G 12G 17% /
devtmpfs 215M 0 215M 0% /dev
tmpfs 44M 248K 44M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 88M 0 88M 0% /run/shm
/dev/mmcblk0p1 60M 9.4M 51M 16% /boot
tmpfs 10M 0 10M 0% /tmp
<span class="highlight">/dev/sda2 7.3G 17M 6.9G 1% /tmp/newpi
/dev/sda1 60M 0 60M 0% /tmp/newpi/boot</span>
</code></pre>
</td></tr>
</tbody></table>
<br />
Nice! The output of the "df" command will show us that both slash and boot have been mounted and are the expected sizes. In my case I am using a 8gb SD card. Next, we will execute a command to copy our existing raspbian OS installed on our running pi into our mounted SD card. Now, a couple notes about live cloning. If you are running any services that keep data files open (like mysql, postgresql, apt-get, or other applications) these should be shutdown to insure you get a clean copy. We will use the rsync utility for this copy, we will tell it to only copy / (slash) and /boot, further, we will also tell rsync not to cross filesystem boundaries (--one-file-system).
<br />
Why do we specify slash (/) and boot separately? If you look above at the df listing you can see lots of other filesystems mounted. Some of these are ramdisks and virtual filesystems (/sys, /dev, /tmp, and /proc for instance). We do not want to copy these at all. By using the --one-file-system and specifying explicitly slash (/) and /boot, we only capture the OS tree of files. ( Note, the rsync is sensitive to trailing slashes on the source and destination directory names, make sure you run it exactly as below)
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">rsync -av --one-file-system / /boot /tmp/newpi/</span>
(lots and lots of files print out...)
var/log/news/news.notice
var/log/ntpstats/
var/log/samba/
var/mail/
var/opt/
var/spool/
var/spool/rsyslog/
var/tmp/
var/www/
sent 2204324795 bytes received 1303348 bytes 2608667.23 bytes/sec
total size is 2199215758 speedup is 1.00
root# <span class="typed">df -h</span>
Filesystem Size Used Avail Use% Mounted on
rootfs 15G 2.3G 12G 17% /
/dev/root 15G 2.3G 12G 17% /
devtmpfs 215M 0 215M 0% /dev
tmpfs 44M 248K 44M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 88M 0 88M 0% /run/shm
/dev/mmcblk0p1 60M 9.4M 51M 16% /boot
tmpfs 10M 0 10M 0% /tmp
<span class="highlight">/dev/sda2 7.3G 2.3G 4.6G 33% /tmp/newpi
/dev/sda1 60M 9.4M 51M 16% /tmp/newpi/boot</span>
</code></pre>
</td></tr>
</tbody></table>
Cool, after the copy completes, we run "df -h" again and can see that the destination slash mounted on /tmp/newpi matches in size our running system's slash, at about 2.3G. So now, what else can we do? Well the sky is the limit really. We have a ready to roll raspbian SD card mounted and ready to customize!<br />
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
Just a couple examples of things you can customize...
Change the hostname
root# <span class="typed">vim /tmp/newpi/etc/hostname</span>
</code></pre>
<br />
<pre><code>
(or without using an editor)
root# <span class="typed">echo "mynewhostname" > /tmp/newpi/etc/hostname</span>
</code></pre>
<br />
<pre><code>
Change the network interface settings, or set a different static IP:
root# <span class="typed">vim /tmp/newpi/etc/network/interfaces</span>
</code></pre>
Example: Wireless /w DHCP:
<br />
<pre><code>
auto lo
iface lo inet loopback
iface eth0 inet dhcp
iface default inet dhcp
auto wlan0
allow-hotplug wlan0 eth0
iface wlan0 inet dhcp
wpa-passphrase MY-WIRELESS-PASSPHRASE
wpa-ssid MY-WIRELESS-SSID
</code></pre>
Example: Wireless /w static IP:
<br />
<pre><code>
auto lo
iface lo inet loopback
iface eth0 inet dhcp
iface default inet dhcp
auto wlan0
allow-hotplug wlan0 eth0
iface wlan0 inet static
wpa-passphrase MY-WIRELESS-PASSPHRASE
wpa-ssid MY-WIRELESS-SSID
address 192.168.1.22
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.1
</code></pre>
<br />
<br />
<br /></td></tr>
</tbody></table>
<br />
(<b>NOOBs Users</b>: If you are running a SD card created with NOOBs, you will need to manually modify the boot/cmdline.txt and etc/fstab files on your new SD card <i><b>before you can boot</b></i>. You must edit and substitute the mmcblk0p* device names for the proper ones. In the fstab, slash (/) should be /dev/mmcblk0p and /boot should be /dev/mmcblk0p1. In the cmdline.txt file, root= part should be root=/dev/mmcblk0p2. Once you have done that the OS that you backed up will be the only OS on the new SD card event if your NOOBs SD had multiple flavors of raspberry pi OS installed. My scripts on github discussed in the next section handle all of this automatically, which makes things a bit easier.)These are just a few examples. When your ready to try out your cloned SD card, you should unmount it using the following commands. Make sure you close any shells or change your current working directory (cd) off the new devices or you will get an error when you try to unmount.<br />
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">umount /tmp/newpi/boot</span>
root# <span class="typed">umount /tmp/newpi</span>
</code></pre>
</td></tr>
</tbody></table>
<br />
You can now safely pull the SD card out and put it in your destination raspberry pi. It should boot and work just like any other SD card.<br />
<br />
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- rpi-clone-embed2 -->
<ins class="adsbygoogle" data-ad-client="ca-pub-1453746380794860" data-ad-slot="9978606430" style="display: inline-block; height: 90px; width: 728px;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br />
<br />
<br />
<h2>
Sysmatt's Scripts</h2>
Now that we have the basic concepts down, Let me show you some of my scripts to automate creating SD cards. These scripts allow you to create and store backup copies of your running raspberry pi systems. You can use this to construct a library of standard, tested, known good images. Very useful when someone wants you to build them a copy of your next talking clock project!We need to retrieve and install the scripts. You will find a link at the end of this article to the current version of the scripts. Download the latest tar archive and untar it into /usr/local/bin as shown below<br />
Download the latest zip from <a href="http://github.com/sysmatt-industries/sysmatt-rpi-tools/">github</a><br />
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">cd /tmp</span>
root# <span class="typed">wget -O sysmatt-rpi-tools.zip https://github.com/sysmatt-industries/sysmatt-rpi-tools/archive/master.zip</span>
</code></pre>
</td></tr>
</tbody></table>
<br />
Install to /usr/local/bin or any other location you prefer
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">unzip sysmatt-rpi-tools.zip</span>
root# <span class="typed">cd sysmatt-rpi-tools-master/</span>
root# <span class="typed">chmod +x sysmatt.rpi.*</span>
root# <span class="typed">mv sysmatt.rpi.* /usr/local/bin</span>
</code></pre>
</td></tr>
</tbody></table>
<br />
(<b>NOOBs Users</b>: These scripts have been updated to work with NOOBs SD cards. NOOBs is the SD card image that allows you to have multiple raspberry pi OS installed in different partitions. The way this is handled by the scripts is the OS you are running when you run the backup script is the ONLY os that is backed up. When you run the restore script it will automatically modify the files in /etc and /boot to reflect the changed partition numbers. Essentially this "peels out" one OS from your NOOBs SD and makes it the only OS running on the new (restored) SD. This also automatically grows the restored OS to fill the entire SD card.)<br />
<br />
<br />
<h2>
Making a backup archive</h2>
In these scripts I just use a tar archive to store the image. This makes them nicely portable and easy to modify. The first script is used to create the backup copy of the running raspberry pi. This script, "sysmatt.rpi.backup.gtar", by default creates it's backup file under the pi user's home directory with a default filename containing the hostname of the raspberry pi and the datestamp. You can override this filename by specifying an alternate on the command line. Below, I will run this script on the new pi we just cloned.If you so not have enough free disk space on your SD card to hold the tar archive you might want to write it to a flash drive or network mounted filesystem. You should be fine if your SD card is 8gb or larger and have not downloaded too much software/data. <br />
To write the tar archive to /home/pi/backups:
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">mkdir -p /home/pi/backups</span>
root# <span class="typed">sysmatt.rpi.backup.gtar</span>
(Lots and lots of files listed...)
</code></pre>
</td></tr>
</tbody></table>
<br />
Or, to specify an alternate location, run it with a filename argument:
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">sysmatt.rpi.backup.gtar /root/my.pi.backup.tar.gz</span>
</code></pre>
</td></tr>
</tbody></table>
<br />
Either of the above will result in a backup copy of the running system being stored in a tar archive file. Again, a note of caution, if you have any programs that are actively writing to data files (mysql/postgresql/apt-get/etc) these should be not run while you make this clone so you get a clean copy. <br />
<br />
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- rpi-clone-embed3 -->
<ins class="adsbygoogle" data-ad-client="ca-pub-1453746380794860" data-ad-slot="2455339638" style="display: inline-block; height: 90px; width: 728px;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br />
<br />
<h2>
Restoring / Cloning</h2>
The next script in the arsenal is a little more complicated. It is called "sysmatt.rpi.restore.sd.card", it automates all the steps we did above with partitioning, creating filesystems, and copying the raspbian image (in the tar archive we just created). This script will destroy everything on the destination SD card, so be careful! First, we insert our destination SD card into a free USB port and discover what /dev/sd? device it has been assigned. You should never assume without checking dmesg!Tip: This script will also work just fine on any Linux box, so you can create SD cards from a workstation also. <br />
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">dmesg</span>
(removes lots of lines...)
[ 6832.265765] scsi1 : usb-storage 1-1.2:1.0
[ 6833.262698] scsi 1:0:0:0: Direct-Access Single Flash Reader 1.00 PQ: 0 ANSI: 0
[ 6833.265306] sd 1:0:0:0: Attached scsi generic sg0 type 0
[ 6833.772774] sd 1:0:0:0: [sda] 15644672 512-byte logical blocks: (8.01 GB/7.45 GiB)
[ 6833.773480] sd 1:0:0:0: [sda] Write Protect is off
[ 6833.773513] sd 1:0:0:0: [sda] Mode Sense: 03 00 00 00
[ 6833.774183] sd 1:0:0:0: [sda] No Caching mode page found
[ 6833.774211] sd 1:0:0:0: [sda] Assuming drive cache: write through
[ 6833.777814] sd 1:0:0:0: [sda] No Caching mode page found
[ 6833.777846] sd 1:0:0:0: [sda] Assuming drive cache: write through
[ 6833.779191] <span class="highlight">sda</span>: sda1 sda2
[ 6833.785295] sd 1:0:0:0: [sda] No Caching mode page found
[ 6833.785330] sd 1:0:0:0: [sda] Assuming drive cache: write through
[ 6833.785360] sd 1:0:0:0: [sda] Attached SCSI removable disk
</code></pre>
</td></tr>
</tbody></table>
<br />
Ok, looks like this was assigned /dev/sda also. Don't assume!<br />
Now we run the sysmatt.rpi.restore.sd.card script passing the name of the SD device and the tar archive to restore from. Note, your specific filename will be different.<br />
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">ls -l /home/pi/backups/pi.mynewhostname.20140804162905.backup.tar.gz</span>
-rwxr-xr-x 1 root root 1431671079 Aug 4 17:49 /home/pi/backups/pi.mynewhostname.20140804162905.backup.tar.gz
</code></pre>
</td></tr>
</tbody></table>
<br />
Above listed is the tar archive we just created. We will now restore it using the next script. Note, it is interactive and will ask you for confirmation. Before the script exits it will give you the opportunity to modify the resulting SD card before it unmounts it.
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">sysmatt.rpi.restore.sd.card /dev/sda /home/pi/backups/pi.mynewhostname.20140804162905.backup.tar.gz</span>
=== /dev/sda Current Partition Table - To be destroyed! ===
Model: Single Flash Reader (scsi)
Disk /dev/sda: 8010MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 64.0MB 62.9MB primary fat16 lba
2 64.0MB 8010MB 7946MB primary ext4
PRESS <span class="typed">ENTER</span> to DESTROY /dev/sda, Press CTRL-c to abort
Model: Single Flash Reader (scsi)
Disk /dev/sda: 8010MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 64.0MB 62.9MB primary fat16 lba
2 64.0MB 8010MB 7946MB primary ext4
mkfs.vfat 3.0.13 (30 Jun 2012)
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
485760 inodes, 1939968 blocks
96998 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1988100096
60 block groups
32768 blocks per group, 32768 fragments per group
8096 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 7.2G 17M 6.8G 1% /tmp/pi.sd.324943213
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 60M 0 60M 0% /tmp/pi.sd.324943213/boot
Press <span class="typed">ENTER</span> To begin image restore
(lots and lots of files listed here ...)
boot/fixup_cd.dat
boot/fixup_x.dat
boot/kernel.img
boot/start.elf
boot/start_cd.elf
boot/start_x.elf
boot/issue.txt
boot/LICENSE.oracle
boot/kernel_emergency.img
tar: boot: implausibly old time stamp 1970-01-01 00:00:00
=DONE=
The SD is mounted at: /tmp/pi.sd.324943213
Now would be a good time to make modifications in another shell session...
Press ENTER To unmount or CTRL-c to exit leaving mounted.
</code></pre>
</td></tr>
</tbody></table>
<br />
Now here, the script is paused waiting for input, and you have a choice. If you wish to make changes to the SD card you can open another terminal and modify it under the mountpoint shown (/tmp/pi.sd.324943213 in this example), for instance, change the hostname like we did previously:<br />
<table><tbody>
<tr><td bgcolor="darkblue"><pre><code>
root# <span class="typed">echo "yetanotherpi" > /tmp/pi.sd.324943213/etc/hostname</span>
</code></pre>
</td></tr>
</tbody></table>
<br />
When you are done with your modifications, you can return to the session running the script and hit enter. It will unmount the SD card from it's temporary mountpoint. Make sure you have closed any programs or shells that might be holding the filesystems open. You can always try unmounting again with the "umount" command if necessary. <br />
After it is unmounted, you can pull and insert it into your raspberry pi and boot it up. If you want to make the script non-interactive, feel free to remove or comment out the "read" lines that ask for confirmation. But do so at your own risk!<br />
I hope you found this little tutorial helpful. Using these utilities and scripts you can build your own library of standard OS images, preconfigured for particular applications. This makes duplicating projects very easy and quick! If you have feedback on the tutorial or any of the scripts please let me know at matthoskins @ gmail.com or on twitter @sysmatt.<br />
<br />
<h2>
About the author</h2>
Matthew is the Senior Enterprise Architect at the New Jersey Institute of Technology (NJIT). When he is not working, he enjoys hacking on electronics, microcontrollers and embedded systems. He can also make a mean falafel when the circumstances call for it. Matthew is a total nerd and thus completely useless in conversations regarding "sports". Matthew also greatly dislikes talking about himself in the third person in author biographies. For more random nonsense from Matthew he suggests following him on <a href="https://twitter.com/sysmatt">twitter: @sysmatt </a>Like this article? See more of <a href="https://sites.google.com/site/sysmattpublishedworks/">Matt's published works</a>
<br />
<h2>
Resources:</h2>
GitHub: <a href="https://github.com/sysmatt-industries/sysmatt-rpi-tools/">https://github.com/sysmatt-industries/sysmatt-rpi-tools/</a>Good article about the Raspberry Pi's bootstrap process: <a href="http://thekandyancode.wordpress.com/2013/09/21/how-the-raspberry-pi-boots-up/">http://thekandyancode.wordpress.com/2013/09/21/how-the-raspberry-pi-boots-up/</a>
<br />
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- rpi-clone-embed-footer -->
<ins class="adsbygoogle" data-ad-client="ca-pub-1453746380794860" data-ad-slot="3932072839" style="display: inline-block; height: 90px; width: 728px;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="fb-like" data-action="like" data-href="http://sysmatt.blogspot.com/2014/08/raspberry-pi-backuprestore-scripts-and.html" data-layout="standard" data-share="true" data-show-faces="true">
</div>
<br />
<br />
@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-8125185055625054552014-08-05T15:23:00.000-04:002014-08-05T15:23:29.280-04:00Hold on to your hats people... Greetings all, I am putting the finishing touches on a few new full length articles which will be published on this blog. Hold on to your hats, Matt is publishing again! The first one will be titled: "Backup, Restore, Customize and Clone your Raspberry Pi SD Cards"... These are mostly Raspberry Pi from a pure Linux perspective. @sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-9466055388924471912012-08-21T12:00:00.003-04:002012-08-21T12:00:44.680-04:00Time for a post... Follow me on twitter! @sysmattDo it!@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-64633172080785370292010-06-27T22:22:00.000-04:002010-06-27T22:22:06.907-04:007-Segment LED Arduino Conway's Game of Life Display (UPDATE1)Update. Enclosed now, in beautiful ruby red plexi from eStreet plastics. Also added two relays, simply for sound effects. See video below. Life generations progress faster upon every iteration, speed maxes out at 100 generations. Max generations are 65k, upon which an integer rolls over and a new simulation is started.<br />
<br />
<br />
<br />
<br />
<object height="364" width="445"><param name="movie" value="http://www.youtube.com/v/iemj07Mzags&hl=en_US&fs=1&rel=0&color1=0x006699&color2=0x54abd6&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/iemj07Mzags&hl=en_US&fs=1&rel=0&color1=0x006699&color2=0x54abd6&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="445" height="364"></embed></object>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-13922594839483164052010-06-11T12:36:00.000-04:002010-06-11T12:36:27.144-04:00Arduino based Network NTP Clock (Update2)Progress... Started building case. Ruby red plexi from eStreet Plastics. Looks really slick. Yes, that IS masking tape holding part of the 7-segment display in... I am still waiting for some IPS weld-on #3 glue... Damn ebay. <br />
<br />
<br />
<object height="364" width="445"><param name="movie" value="http://www.youtube.com/v/yBtnbvFPNmw&hl=en_US&fs=1&color1=0x006699&color2=0x54abd6&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/yBtnbvFPNmw&hl=en_US&fs=1&color1=0x006699&color2=0x54abd6&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="445" height="364"></embed></object>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-42391012701709064652010-05-29T22:27:00.000-04:002010-05-29T22:27:04.624-04:00Arduino based Network NTP Clock (Update1)More progress, Added a Sure Electronics 0832 Green Matrix LED Display for continuous time display. Crappy video posted to youtube, <a href="http://www.youtube.com/watch?v=6AZAUVIAZak">http://www.youtube.com/watch?v=6AZAUVIAZak</a><br />
<br />
Code almost done, still some tweaking needed. Enclosure is next.<br />
<br />
<object width="445" height="364"><param name="movie" value="http://www.youtube.com/v/6AZAUVIAZak&hl=en_US&fs=1&color1=0x006699&color2=0x54abd6&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/6AZAUVIAZak&hl=en_US&fs=1&color1=0x006699&color2=0x54abd6&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="445" height="364"></embed></object>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-78860225736714661472010-05-05T19:01:00.001-04:002010-05-05T19:03:42.641-04:00Arduino based Network NTP ClockEthernet, DHCP, IP, NTP, and all under 16k. Sets software RTC in sync to an NTP server. Displays time in seconds since 1970 (ala UNIX), 24hr format, Day of week, and full date. Red LED 7-Segment displays using 74HC595 shift registers. <br />
<br />
Video: <a href="http://www.youtube.com/watch?v=QFSf9rBVMDY">http://www.youtube.com/watch?v=QFSf9rBVMDY</a><br />
<br />
<object height="364" width="445"><param name="movie" value="http://www.youtube.com/v/QFSf9rBVMDY&hl=en_US&fs=1&rel=0&color1=0x006699&color2=0x54abd6&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/QFSf9rBVMDY&hl=en_US&fs=1&rel=0&color1=0x006699&color2=0x54abd6&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="445" height="364"></embed></object>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-67805771847901358092010-05-03T10:50:00.000-04:002010-05-03T10:50:16.547-04:007-Segment LED Shift Register detailWhile building another 7-Segment LED display for a project I took some photos. I've been asked by some for more detail on how those things are build and chained together. This is the same style display I used in the Game of Life display from an earlier post. These modules are assembled each with a 74HC595 shift register glued to the back "dead bug" style. Each segment is driven by a output bit thru a resistor. It makes for a very simple static (no scanning or multiplexing) display and very simply programming in the microprocessor. I really have to make a circuit board for this! Displays by the inch anyone?<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnBwguWc8ZMA4-b57i_pVIH9LZT2tTQxb9sjY6W5UYjBRkICu7qa6wAuczsNXnCrpCz9Zl_k_tYJHpyXJbfQ94YaIDV4xUW3y6VqPRM8LXG9NdohkXY3LTmt8Ng55Tp5PmbIYSXQDMuAO_/s1600/00090.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnBwguWc8ZMA4-b57i_pVIH9LZT2tTQxb9sjY6W5UYjBRkICu7qa6wAuczsNXnCrpCz9Zl_k_tYJHpyXJbfQ94YaIDV4xUW3y6VqPRM8LXG9NdohkXY3LTmt8Ng55Tp5PmbIYSXQDMuAO_/s200/00090.jpg" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhx-8jypdx83UxgrH8kbLj9EYq-I0cNZaa1LWZa9ZYvwkA8FLjykzkb1k9VNm-gNP9v9kmm6P01HHWatgKKBip-mym7O7Y6efBDFKFY0wv0XluNkqSYWm7reR4_bzt1rlz4di5Gq5d7jQZ/s1600/00096.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhx-8jypdx83UxgrH8kbLj9EYq-I0cNZaa1LWZa9ZYvwkA8FLjykzkb1k9VNm-gNP9v9kmm6P01HHWatgKKBip-mym7O7Y6efBDFKFY0wv0XluNkqSYWm7reR4_bzt1rlz4di5Gq5d7jQZ/s200/00096.jpg" width="200" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoil0fdsLsvKStUYuHc30uccPUTePtd7QHlEOqylgC4SSflt1l109x92XhkkkBp1iyESE4gEXId5BoNHRubZbVxRZmK__hL9akT5VxBTVbPulYweDjLHxesMwbTVXVCgcorrYg31OHc7bZ/s1600/00105.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoil0fdsLsvKStUYuHc30uccPUTePtd7QHlEOqylgC4SSflt1l109x92XhkkkBp1iyESE4gEXId5BoNHRubZbVxRZmK__hL9akT5VxBTVbPulYweDjLHxesMwbTVXVCgcorrYg31OHc7bZ/s200/00105.jpg" width="200" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBekoTG4a4tCn-3LdMmoMbSD1R2SjWS_4AD_PyH2H74-Ezh6O7WpQ68DP3BUsEkM8a7mgi2mONd7PA_jbdMukjXa3bZLam_yMwZwFHYub2sbgIfJUDjc4TzWDN0iZubkJEgO897SCPNx-N/s1600/00109.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBekoTG4a4tCn-3LdMmoMbSD1R2SjWS_4AD_PyH2H74-Ezh6O7WpQ68DP3BUsEkM8a7mgi2mONd7PA_jbdMukjXa3bZLam_yMwZwFHYub2sbgIfJUDjc4TzWDN0iZubkJEgO897SCPNx-N/s200/00109.jpg" width="200" /></a></div><br />
<br />
<br />
Full Photo Album: <a href="http://picasaweb.google.com/matthoskins/ProjectsArduinoLED7SegmentShiftRegisterDisplaysDeadBugStyle?feat=directlink">http://picasaweb.google.com/matthoskins/ProjectsArduinoLED7SegmentShiftRegisterDisplaysDeadBugStyle?feat=directlink</a>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-57849037502622757272010-04-18T20:19:00.001-04:002010-04-18T20:29:35.532-04:00Long time / Arduino ProjectsSo its been a long while since I've posted anything. Been busy.<br />
<br />
But lately I have been hacking on Arduino projects. Primarily I have revived my 10x8 7-Segment LED matrix display. When I built this thing way back in 2004, I drove it with a PC parallel port. Now I have created a Arduino based controller and coded a Conway's Game of Life simulation.<br />
<br />
Each 7-segment display has a 74HC595 shift register on the back, soldered directly to the display using 1/8w 300R as jumpers. Its all one long shift register, whole thing is driven by only three I/O pins. Its nice, simple because there is no scanning, but is SUCKS juice. Very low CPU requirements.<br />
<br />
See Photos below, and link to video.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFh98aNLEk9U9hM595np1LLFQw-5ObpFwmnU_NNiOT_AFByCiA7RiytsneAcZAhR-xSuFDX3irRDc1_O8BYtl1XyY7k5DBe0_ZNA-NyOo47f0E0tQhBpaGx9TrOjZoDoG8ybPqJa2Up9_c/s1600/IMG00070.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFh98aNLEk9U9hM595np1LLFQw-5ObpFwmnU_NNiOT_AFByCiA7RiytsneAcZAhR-xSuFDX3irRDc1_O8BYtl1XyY7k5DBe0_ZNA-NyOo47f0E0tQhBpaGx9TrOjZoDoG8ybPqJa2Up9_c/s200/IMG00070.jpg" width="150" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMROY1CGlLZs3Fx17tG4_earvkPxQsW3F_wmViEK1OIXeU9UIoEQvtLzdu9C3xNzBDq9QX_i_cZi594MwUqQHQcLY8hMSMwU-j4LvbrgEgr-yRPI26EjFEeq282yB0eycsd_dzwa35H273/s1600/IMG00069.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMROY1CGlLZs3Fx17tG4_earvkPxQsW3F_wmViEK1OIXeU9UIoEQvtLzdu9C3xNzBDq9QX_i_cZi594MwUqQHQcLY8hMSMwU-j4LvbrgEgr-yRPI26EjFEeq282yB0eycsd_dzwa35H273/s200/IMG00069.jpg" width="150" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: left;">Link to all photos: <a href="http://picasaweb.google.com/matthoskins/GameOfLifeArduino7SegmentLEDMatrix?feat=directlink">http://picasaweb.google.com/matthoskins/GameOfLifeArduino7SegmentLEDMatrix?feat=directlink</a></div><br />
Link to video: <a href="http://www.youtube.com/watch?v=TCSMSq5wLNs">http://www.youtube.com/watch?v=TCSMSq5wLNs</a>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-43766727677859257922010-01-03T13:42:00.002-05:002010-01-03T17:07:53.218-05:00VMware Data Recovery Appliance 1.1: Shows improvementWe have been using the VMware Data Recovery Appliance (or trying to) since it was released. Overall it has been a bumpy road, but the latest release shows a lot of promise. <br />
<br />
Improvements in stability are obvious, but we still run into issues where backup jobs stop running for no reason. This means that you have to monitor somehow, unfortunately there appears to be no good way to automate this. <br />
<br />
You are still limited to 100 VMs per appliance, this would be OK if it were possible to attach more than one appliance for management to a VC client session simultaneously. Even better would be a unified console of some kind. <br />
<br />
The 100 VM limitation can be worked around using carefully designed Resource Pools. The VDR appliance "notices" when a VM has been added to a RP properly.<br />
<br />
At this point I would suggest completely skipping CIFS. It is horribly unreliable. In fact when you attempt to configure a CIFS destination you are greeted with a warning that in many more words says this. <br />
<br />
If your goal is to send VM backups to remote storage, I would suggest a NFS datastore, and using VMDK storage on that. The VDR appliance seems to deal with this very well. <br />
<br />
The total size of the destination dedupe store is still limited to 1TB per destination, and a max (suggested) of two destinations. VMware's explanation for this suggests performance issues with larger stores. <br />
<br />
In our experience, the data deduplication works very well. You can pack a lot of backups into that 1TB of storage.<br />
<br />
The hot-add backup mechanism works very well and created very little I/O impact while running backups. However, if the appliance does not shutdown properly orphan devices are left attached to the appliance. These often need to be removed manually. <br />
<br />
Overall, the VDR appliance shows a lot of promise. We would like to see better management, better stability, easier scaling and some kind of monitoring capability are needed. We would like to see the backup tasks and progress shown in the normal VC task list. This would help with the monitoring. A published API would also be helpful for us to write our own NAGIOS plugins.@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-10170343947108045992009-12-19T09:17:00.000-05:002009-12-19T09:17:13.630-05:00Upgrading to VMware vSphere 4? Check the HCL!If you are upgrading your VMware VI3 compute complexes to VMware vSphere 4, you will need to confirm that all your hardware is certified for the release you are upgrading to. Most hardware manufacturers will only do the certification work while a system is considered a current product. This can be as short as two years. <br />
<br />
After a server, blade or storage array is no longer availible for sale, you may be STUCK on whatever ESX rev you are currently running. This is a big problem for vManagers who want to use new features only availible for vSphere 4. Even worse, VMware Update Manager makes it dangerously simple to upgrade your entire cluster to vSphere 4 with a few mouse clicks. Regardless if your hardware is still certified. <br />
<br />
<ul><li>Keeping compute and storage hardware on a life cycle plan is critical, and keep that plan aligned as best as possible with the software. </li>
<li>Talk to your vendors, demand a policy on VMware HCL certification. </li>
<li>Understand your hardware vendor's product lifecycle</li>
<li>Check the HCL:<a href="http://www.vmware.com/go/hcl"> VMware's Live Hardware Compatibility Guide</a> </li>
</ul>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-7478248001324101772009-12-17T18:55:00.000-05:002009-12-17T18:55:20.494-05:00New Article: Simple Virtual Appliances with Linux and XenComing to a news stand near you, Article in LJ. Full article is on the web if you have a LJ subscription. <br />
<br />
<a href="http://www.linuxjournal.com/issue/189">http://www.linuxjournal.com/issue/189</a>@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.comtag:blogger.com,1999:blog-8385826226952523147.post-84152665823719204552009-11-08T09:57:00.000-05:002009-11-08T09:57:37.589-05:00My SIMH (Linux Journal) was translated into Hungarian...<a href="http://www.linuxvilag.hu/content/files/cikk/63/cikk_63_32_34.pdf">http://www.linuxvilag.hu/content/files/cikk/63/cikk_63_32_34.pdf</a><br />
<br />
Apparently there is no translation for "MattGlue"@sysMatthttp://www.blogger.com/profile/12310866312554328304noreply@blogger.com