Raspberry Pi Build Script

Lazy Is Good

I am basically lazy. Lazy is good. It is also known as “efficient”.

I really don’t like to do the same thing three or four times if I can do it once and be done. Consequently, I tend to do things once and put it in a ‘script’ if I think I’m ever going to need it again.

I’ve sunk the better part of 2 or 3 days into figuring out what software I wanted on the R.Pi Model2 to make it a ‘core server'; find out the exact package names to build, and do all the “apt-get install” by hand. At that point, folks usually make a backup image of the product and call it done.

I like having a “build script”. It means your process is repeatable. Done “while doing the build” the first time, it means that if you have a catastrophic failure you don’t have to head scratch about what you did before and / or read notes off of soggy napkins or in cluttered notebooks.

It also means that you can “cooky cutter” another one any time you want.

So here’s my cookie cutter.

The SD Card Software Factory

While the script tells you to do it, this reminder is also a good idea:

You will be running the normal “NOOBS” set up. I’m not going to detail it, as there’s lots of documentation on that already.

Choose to install the Raspbian version of Debian and also check the box in front of the “add a 512 MB EXT file system” option. The script will be marking that partition for NFS export as a nice “scratchpad” you can share with other machines on your network.

When you have all that done, and are logged into the Pi, “become root” before you run the script if you want it to work. You can run it not-as-root, but nothing really gets done. (In fact, I added a bunch of “echo” comments to talk to you while it runs and to ‘syntax check’ it, ran as not-root. Found a few lines that needed close quotes ;-) Hopefully I got all of them…)

I have also taken the pristine “NOOBS download” and put it, along with this build script, onto a 1 GB SD card. I can now use that “portable archive” on darned near any machine to prep the micro-SD card for the Raspberry Pi. Just format the micro-SD to FAT (or FAT32) and copy over the NOOBS files. Then the micro-SD is ready to boot in the Pi as NOOBS install media. I don’t need to hit the ‘NOOBS Download’ every time I want to build a system.

After the basic NOOBS install, I put the 1 GB card into a small USB adapter and plug it into the Raspberry Pi and then copy over this build script. You could just as easily use a USB thumb drive or ‘whatever’.

So with my 1GB “build starter”, and the target micro-SD card, and any computer than can format SD cards and/or copy files, I’m good to run my Raspberry Pi SD card system factory…

The Script

I’m mostly just going to paste the script here. It ought to be more or less self documenting. Any questions, speak up.

I’m also hoping that the WordPress tendency to steal anything with angle brackets in it doesn’t screw things up too much. We’ll see how good my proof reading is ;-)

You will need to scroll the listing to the right to see all of it, but a ‘test mark and copy’ caught it all even off the edge. So a “copy and paste” ought to work fine.

Any line starting with “pi@RaPiM2″ is a command prompt from the computer and is followed by the directory in which I am working. In this case, that added 512 MB partition named /media/data/ (but any directory works fine for this.)

Any line starting with a “#” is a comment and does nothing.
It is advisory only.

Any line starting with “echo” gets printed to your screen when the script is run.

The line that says “cat ./BuildIt” is the Unix / Linux way of saying “print this file to the screen” where “cat” means “conCATenate and print” (yes you can list several files and have them all concatenated if desired). The actual script begins on the very next line with echo ” “.

pi@RaPiM2 /media/data $ 
pi@RaPiM2 /media/data $ 
pi@RaPiM2 /media/data $ cat ./BuildIt 
echo " "
echo "Do the NOOBS install: "
echo " "
echo " https://www.raspberrypi.org/help/noobs-setup/ "
echo " "
echo "and choose the option of having a 512 MB EXT partition added to your SD card"
echo "along with the Raspbian installation.  Then copy this script from an external SD"
echo "card or USB drive into your working directory (home directory or /media/data"
echo "after all the usual and customary NOOBS setup questions are answered and done."
echo " "
#
# In general, I'm encapsulating what all I did in these two postings as a script:
#
# https://chiefio.wordpress.com/2015/07/18/raspberry-pi-m2-unboxing-and-setup/
#
# https://chiefio.wordpress.com/2015/07/22/raspberry-pi-software-setup/
#
# If you didn't already change the password while running NOOBS,
# When done, log in as 'pi' password 'raspberry'.  Change the password.
# passwd
# and respond with the new one when prompted.

echo "Also, to change the name of your machine, edit /etc/hostname and make it"
echo "what you like.  "
echo "Here, I'm going to just set mine by brute force write to the file."
echo " "
echo "echo 'Ra2PiM2' > /etc/hostname "
echo " "

echo "Ra2PiM2"> /etc/hostname 

echo " "
echo "Next, do the 'usual' update upgrade that brings you up to the present"
echo "repository status (need a network connection from here on out)"
echo " "
echo "You can either put 'sudo' in front of each of these commands, or just "
echo "'become root' which is what I usually do."
echo " "
echo "sudo bash"
echo " "
echo "then run this script with ./BuildIt (assuming you didn't change the name"
echo "and that you are 'in' the directory where it is located.)"
echo " "
echo "apt-get update"
echo "apt-get upgrade"
echo " "

apt-get update
apt-get upgrade

echo " "
echo "Start doing useful operational 'packages'. "
echo " "

# This gets the useful tools like "nslookup" for looking at Domain Names

echo " "
echo apt-get install dnsutils
echo " "

apt-get install dnsutils

echo " "
echo " VNC is a nice way to get a remote desktop.  It takes some configuring later."
echo " "

echo " " 
echo apt-get install tightvncserver
echo " "

apt-get install tightvncserver

echo " "
echo "I like wicd for an easier way to manage wireless devices and networks."
echo " "

echo " " 
echo apt-get install wicd
echo " "

apt-get install wicd

echo " "
echo "Scrot is a tool for taking screen shots by saying 'scrot' in a terminal"
echo " "

echo " " 
echo apt-get install scrot
echo " "

apt-get install scrot

# Normally I would install "build-essential" to get things like C compiler
# and some language tools, but they were already installed on the R.PiM2.

# apt-get install build-essential

echo " "
echo "Some 'user land' useful things like browser options and Office / Mail tools."
echo " "
echo "Chromium is the 'chrome' browser from Google but in Linux land"
echo " "

echo " " 
echo apt-get install chromium
echo " "

apt-get install chromium

# IceApe is a "more free" version of IceWeasel that is a "more free" version of
# Firefox that is a rebranded Mozilla that is...   IceDove is the matching
# Thunderbird replacement minus the trademarks, non-free bits, etc.

echo " "
echo "Doing IceApe browser and IceDove mail reader"
echo " "

echo " " 
echo apt-get install iceape
echo apt-get install icedove
echo " "

apt-get install iceape

apt-get install icedove

echo " "
echo "GIMP is the photo editor ( 'photoshop Free'...) "
echo " "

echo " " 
echo apt-get install gimp
echo " "

apt-get install gimp

echo " "
echo "Don't forget Libreoffice - Microsoft?  We don't need no steenking MicroSoft..." 
echo " "

echo " " 
echo apt-get install libreoffice
echo " "

apt-get install libreoffice


# I tried "arora" and got error messages and "xbmc" was not working for sound
# so I'm not installing those again until it's clear they work.  Arora is a
# browser (so who needs "yet another browser" with Epiphany in by default and
# with both IceApe and Chromium installed?...) and I'll likely make a dedicated
# SD card for the media center option as there are 2 Pi Model 2 version up
# and I won't need to screw around with Debian issues...
#apt-get install arora
#apt-get install xbmc

# As I also wanted one of these to be a bittorrent server, I sometimes add
# the "transmission" bittorent code.

echo " "
echo "Adding the 'transmission' bit torrent server"
echo " "

echo " " 
echo apt-get install transmission
echo " "

apt-get install transmission

echo " "
echo "To get NTFS disks (like USB or an NTSB formatted SD card in adapter) to "
echo "work 'read write' instead of just 'read only', you need ntfs-3g"
echo " "

echo " " 
echo apt-get install ntfs-3g
echo " "

apt-get install ntfs-3g

# In Theory, this installed 2 VNC "viewers" so the R.Pi could use VNC to 
# get to other machines.  In practice, I found that one of them locked up
# my console when launched against my own machine as target (might be a 
# PIBKAC problem - Problem Is Between Keyboard And Chair - as the R.Pi
# isn't really expecting to drive 2 video sessions at once (the real one
# and the VNC one inside the real one...) so maybe all is fine and I just
# need to RTFM (Read The, er, "Friendly" Manual) before using software...

echo " "
echo "Some VNC Viewers for being the client instead of the server"
echo "I've not used either of these yet so have no clue about them in practice"
echo " "


echo " " 
echo apt-get install xtightvncviewer
echo apt-get install ssvnc
echo " "

apt-get install xtightvncviewer
apt-get install ssvnc

echo " "
echo "Want an NFS (Network File System) server so you can share disks with" 
echo "your internal network?  This will install the code, then you get to" 
echo "configure things like /etc/exports"
echo " "


echo " " 
echo apt-get install nfs-kernel-server
echo " "

apt-get install nfs-kernel-server

# prior to first use.  Or reboot.

# In your /etc/exports file, put something like:

# /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#

# /YourFileSystem  *(rw,sync,fsid=0,no_root_squash)
# But without the # in front of YourFileSystem... and with your file system...

echo " "
echo "IF you chose that 'add a 512 MB partition option' at build time"
echo "This adds it to the /etc/exports file so it is NFS mountable elsewhere"
echo " "
echo "echo '/media/data   *(rw,sync,fsid=0,no_root_squash,no_subtree_check)' >> /etc/exports"
echo " "

echo "/media/data   *(rw,sync,fsid=0,no_root_squash,no_subtree_check)" >> /etc/exports

# Remember to do a 
echo " "
echo "Restarting the appropriate services so NFS will work"
echo " "
echo " " 
echo service rpcbind restart
echo service nfs-kernel-server restart
echo " "

service rpcbind restart
service nfs-kernel-server restart

# I also made my box a static IP number as it's a server.  You will need to
# make this your own server name and IP numbers.
#
# Here's my /etc/network/interfaces file with leading # to make it comments.
# 
# I will make this a "dump these lines in to replace" in my running version.
#

echo " "
echo "Remember to make your /etc/network/interfaces file have a static IP#"
echo "If you are going to be using PXE boot and such"
echo "My examples are below, but use your own values for your equipment."
echo " "

#auto lo
#iface lo inet loopback

#auto eth0
#allow-hotplug eth0
#iface eth0 inet static
#address 172.22.22.253
#netmask 255.255.255.0
#gateway 172.22.22.254
#dns-domain chiefio.home
#dns-nameservers 172.22.22.254 192.168.1.254 192.168.1.1
#
#auto wlan0
#allow-hotplug wlan0
#iface wlan0 inet manual
#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
#
#auto wlan1
#allow-hotplug wlan1
#iface wlan1 inet manual
#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

# Don't forget to do a
# ifdown eth0
# wait a minute for it to quiet down
# ifup eth0

# As I want this to be a DNS server, DHCP server, and PXE server (uses a 
# tftp or "Trivial File Transfer Protocol" server, all of those can come in
# one package with dnsmasq.

echo " "
echo "Installing a light weight but effective DNS, DHCP and TFTP service"
echo " "

echo " " 
echo apt-get install dnsmasq 
echo " "

apt-get install dnsmasq 

echo " "
echo "Yes, it takes configuring.  See the file at"
echo " /etc/dnsmasq.conf"
echo " "

# Then I installed the Apache web server :

# http://www.raspipress.com/2012/09/tutorial-install-apache-php-and-mysql-on-raspberry-pi/

echo " " 
echo "Instlling the Apache Web Servier and related stuff"
echo " "

echo " " 
echo apt-get install apache2 apache2-utils apache2-doc
echo " "

apt-get install apache2 apache2-utils apache2-doc

# and yes, it takes some configuring and even web page building.
# See files in places like /etc/apache2/sites-available and more.

echo " " 
echo apt-get install libapache2-mod-php5 php5 php-pear php5-xcache
echo " "

apt-get install libapache2-mod-php5 php5 php-pear php5-xcache

echo " " 
echo apt-get install php5-mysql
echo " "

apt-get install php5-mysql

echo " " 
echo apt-get install mysql-server mysql-client
echo " "

apt-get install mysql-server mysql-client

#
echo " "
echo "And that's the end of my present install build process."
echo " "
#
# There are several files to edit and configure.  Eventually I'll add a 
# "here script" to dump them from this script to where they belong, or 
# I'll just save a copy and have a 'save / restore' copy process.
#
# Once I get everything configured ;-)
pi@RaPiM2 /media/data $ 

With a fresh 64 GB micro-SD card, it took me about 30 minutes to do the basic NOOBS install and copy files. Then it was another hour to run this script (almost to the minute). That will vary with your network speed and how diligent you are about hitting “Y” when prompted. ;-)

I’m posting this using that chip and the IceApe it installed, so things look to have worked reasonably well.

One quirk I ran into: The NOOBS install did NOT like being behind two layers of NAT (Network Address Translation). I had to move from that 172.x.x.x network out to the 198.162.x.x network to get it to work. I’ve run into that kind of issue before with other products, so it isn’t a Raspberry Pi issue. Just be aware that NAT screws around with network addresses and that some things don’t like them changing underfoot when in use. OTOH, it can sure confuse folks trying to break in ;-)

I generally avoid it, but the router I had available for fast use was already configured with it and for most things it has not been an issue.

After final configuration of those various config files (like for PXE and NFS and such) those config files will also be copied off to the 1 GB chip. I may eventually incorporate them into my ultimate “build script”, or may just leave them as files to drag over by hand if needed.

As the various services I’ve installed “go production”, I’ll post more specifics on how to set it up. But in many cases, the specifics will be specific to your own site and needs; so mine will be more exemplar than ‘copy paste’.

In Conclusion

By making this script, at any time I’m about 1 to 2 hours away from a fully built system. Even if 6 months from now I forget some bits. Even if I’m on the other side of the country via plane stuck in a hotel room and want to make one. Never again will it take 2 or 3 days of my life to paw through the jungle figuring out what matters and what is hiding where. What is missing in the basic build. As my needs change, or new things are discovered, they can be added to the script. New versions made for other special uses. Each time it is used it is, effectively, regression tested, and over time any small errors get ironed out, never to return. That is the benefit of such a build script. The downside is that capricious upstream changes in packages will take some maintenance, but the script will be shouting error at you when that package is no longer available and you will know that something changed.

Hopefully this will be helpful to others in their:

Happy Hacking!

Subscribe to feed

Posted in Tech Bits | Tagged , , , , , , | 10 Comments

Tips – July 2015

Since WordPress has decided that comments on Pages, like the Tips pages, don’t show up in recent comments, it kind of breaks the value of it for me. In response, I’m shifting from a set of “pages” to a set of “postings”. As any given Tips Posting disappears or gets full, I’ll add a new one. That will restore the broken function.

I will be keeping the same general format, with the T page still pointing to both the archive of Tips Pages as well as the series of new Postings. With that, back to the Tips boiler plate:

This is an “overflow” posting from prior Tips pages as they had gotten so large it was taking a long time to load. Same idea, just a new set of space to put pointers to things of interest. The most immediately preceding Tips posting is: https://chiefio.wordpress.com/2015/05/06/tips-may-2015/.

The generic “T” parent page remains up top, where older copies of the various “Tips” pages can be found archived. I have also added a “Tips” category (see list at right) and will be marking Tips postings with that for easy location.

While I’m mostly interested in things having to do with:

Making money, usually via trading
Weather and climate
Quakes, Volcanoes, and other Earth Sciences
Current economic and political events
(often as those last three have impact on the first one…)
And just about any ‘way cool’ interesting science or technology

If something else is interesting you put a “tip” here.

You can also look at the list of “Categories” on the right hand side and get an idea of any other broad area of interest.

This ought not to be seen as a “limit” on what is “interesting”, more as a “focus list” with other things that are interesting being fair game as well.

Subscribe to feed

Posted in Tips | Tagged | 19 Comments

Why I Like Trump

I’ve been watching The Donald have rocks thrown at him by all sides. Even old friends saying he has to get out of the race. Then his poll numbers go up and all the talking heads are confused. Especially those on the looney side of left where they are nearly crazy what with being torn between their love of schadenfreude and their certainty that “this time for sure” Trump has shot his own foot off and embarrassed the Repuplicans, and their astonishment that The Donald really does not give a damn what they think and is NOT going to have Yet Another Apology Tour. Then there are the folks on the Milktoast Republican Parade side who are all panties in a bunch over Trump saying one of them might be a bit less than impressive, so surely Trump Must Go, or at least, have the Democrat Recommended Standard Apology Tour like they always do…

My hope is that I can explain some of the attraction of The Donald, A.K.A. Mr. Trump, to those of us NOT in the center of power, not involved in the game of Liars Poker that is politics, and who have to fund the game at the point of a gun and against our will.

It all starts with Obama.

Remember that I voted for Obama at one point. It’s not like I’m a rabid Republican (nor am I a Dimocrat…). I’m a hard core middle of the road Independent with Libertarian leanings. I’m from the “Pox on both their houses” school.

I think that makes me qualified to explain why those of us who are not in love with either party are finding The Donald attractive.

Obama ran on a slate of “Hope and Change” with the explicit mandate to shake up Washington, clean out the crap in government, and get things working for Americans again. THAT is what we want. We voted for it twice.

We just didn’t get it.

We haven’t changed, and that’s still what we want. The end to Business As Usual in D.C.

Right out the gate, it was Same-Old-Same-Old even to the extent of putting Madam Hillary back in positions of power and influence and setting her up for the next run at the White House. Then instead of being the agent of real change, he became the agent of More Bigger Brokener In-Your-Face GOVERNMENT! Uber Alles!! Along with making the Federal Government an appendage of the Democratic Party and using it entirely for partisan purposes. Not what we wanted.

So we stuck him with a Republican Congress in the vain hope that he might catch a clue and get back on original message. But he didn’t. We also hoped the Republicans might just find a small bit of spine, what with having both houses of Congress, and raise a bit of a fuss over things like, oh, incredibly out of control debt growth and massive intrusive Government.

But no. Best they could muster the courage to do was be a tiny bit obstructionist on a few bits of legislation while watching The Big O bypass them and explain to the world that we have a Presidential Empire and not a Republic. Oh, and the UN calls the shots, not congress… Just need a pen in the White House and friends at the UN. Constitution? Why, that old thing? No worries there, we have imaginative judges who will just redefine what “is is”, find that anything is a tax, so unlimited, decide that there is no real right of privacy and that this is not a problem for Roe v Wade that depends on one. And so much more.

Where is the “Bill Of The Month” that Obama MUST veto? Where are the Congressional Investigations into all this crap? WHERE are the heads rolling at the IRS and EPA? Where’s the “defund the NSF” bill with the explicit text in it calling it out as an agent of the UN Agenda 21 and the Democrats and no longer worth funding? Where’s the “defund the {insert left-wing-nut agency of your choice}” bill parade of horrors that would let me think that ANYTHING has a hope of changing?

Hardly a peep from the Republicans. Just soft murmurs about not upsetting the Democrats and the need for ever more Apology Tours and ever more Trainloads of money shipped out for anything BUT government that does it’s core job well. (See the VA that can’t do the basics of medical care for Veterans as a prime example).

Along Came A Donald

So in the midst of Republicans who can’t be bothered to even SHOW what they would try to do via bills passed, even if then vetoed, and who have all the courage of a wet mouse, and clearly don’t give a damn about shrinking government and have little interest in making it run efficiently, along comes a guy who doesn’t take any crap and calls crap crap when he smells it.

What’s not to like?

We want someone who is willing to offend the entrenched, stomp on toes in comfortable $2000 shoes, NOT go on Yet Another Apology Tour, and who is fundamentally offended by the astounding level of graft, corruption, featherbedding, inefficiency, and BLOAT that is D.C.

Do I wish he could be a bit more polite toward other Republicans? Maybe follow Reagan’s 11th Commandment that Thou Shalt Not Speak Ill of Another Republican? Well, sure. Maybe. But then he wouldn’t be The Donald. And if he’s that cowed about Republicans, how will he go in and “Kick butt and take names” with Dimocrats?

Basically, from our point of view out here in the far center field upper deck back bleachers, Washington D.C. is so incredibly entrenched as a giant money sucking money laundering favor dispensing Special Interest Grand Central Station that we really don’t give a damn if you fix it or break it as anything is better than what it is now. We tried the nice sounding “fix it” of Hope and Change so maybe we need the Trump Bull in their china closet to just go break the damn thing and we can start over.

If this doesn’t work, BTW, then it’s up to The States to have a constitutional convention and just rip the thing to shreds, or we’re toast as the debt monster will have us worse than Greece in about 5 years (once interest rates rise above zero).

Trump is a cranky, angry, junk-yard-dog mean S.O.B. with enough money to not find a $Million bribe, er, “campaign contribution” offer even remotely of influence.

And we’re at the point where we’re cranky, angry and want a junk-yard-dog to go chew on some ankles (and work their way up from there…)

Thus the appeal of The Donald.

About Winning

But can he win?

Frankly, I’m not caring at the moment. This stage of things is about waking up TPTB in the Republican Party Control Machine that they have a problem in their house with having not done a damn thing that matters that I can point at. And also about letting the Democrat Party Control Machine know that there is a serious level of anger with the whole of D.C. on the part of We The People and we’re looking to sharpen our pitchforks and get the tar bubbling if this politics thing doesn’t start working for us instead of for Friends Of Giant Government.

There’s miles to go before a Republican Candidate is selected. (The Democrats having already planned the coronation of Madam Hillary – though even there the Cranky Folks have sent Bernie Sanders to light a fire under her ample tush and bugger things up a little. Hey, Hillary, we’re not fond of you either…)

This is all about “FIX The Damn Thing!” and all against “More of the same, tuned a bit for messaging”.

In short: Why would I ever give a damn if the Republican is “electable” if he isn’t going to be one whit different from what we have had since Johnson and Nixon?

(IMHO, Ike was the last great President we had, though Kennedy had his points and was especially good on economics. Reagan? Yeah, good enough. Except for things like increasing debt and amnesty for millions – how’d that work out…)

So is the Trump Vote just a “protest vote”? Maybe. At least at this stage.

But, frankly (as though I haven’t been so far ;-) There’s not one on the Republican slate of candidates that I’d call “bad”. I’d hate to see a “Bush / Clinton” contest redux, but mostly just because our government ought not to be dynastic. With that said, Jeb did a fine job running Florida, is more “electable” with Democrats, and the parts I don’t like in his policies are unlikely to change anyway.

Then things just go “up” from there. I’d love to see a Rubio / Cruz ticket. Two Hispanics, think Hispanics might vote for that? Or a Carly / Carson slate – women and black. And all of them with decent enough policy goals. Heck, a Huckabee / Jindal ticket would be an interesting one too.

Compare any of them with the likely Hillary / Sanders ticket and “Debt to the Horizon with Equality in Bankruptcy for All!”…

And maybe, just maybe, Trump will be heard enough for someone, anyone, in politics to catch a clue about just how POed the average Joe and Jane have become. “If we can’t fix it, maybe we can break it” … catchy campaign slogan? Maybe we need a write in campaign to “Send Mr. Smith to Washington” on the promise to at least stop it from having “Business As Usual” and sucking up every loose dollar in the country.

What America needs right now is a darned good top to bottom pruning of the entire Government. Cut that sucker to at least 1/2 the present size and scope. We’re just looking at Trump and thinking maybe he’s got the courage and grit to get ‘er done. In short, I see him as a kind of Uber Rich Honorary Mr. Smith who would not mind at all rattling some cages.

Subscribe to feed

Posted in Political Current Events | Tagged , , | 27 Comments

The Iron Sun, Pro Link and Anti Density

Folks who have been here a while will be very familiar with O. Manuel. He often pops up putting a comment about nuclear history with conspiratorial overtones to it on completely unrelated threads (though lately has been much more reserved about that and staying near or on topic for a thread – thanks!)

On another posting (about floods in California), he put up a comment:

omanuel says:
22 July 2015 at 3:17 am
Thanks to Climategate emails and the damning official responses, the Sun’s pulsar core is gaining traction:

https://malagabay.wordpress.com/2015/07/21/keplers-160-minute-solar-cycle/

Clicking through some links on it, I found another posting that claimed similar evidence for an Iron Sun

http://www.thesurfaceofthesun.com/

The first thing of interest was that “160 minute” oscillation of the Sun. A rather big thing that I’d never heard of before. The damn thing is ringing at 160 minutes period and nobody thinks that matters? Sheesh.

The article links to the wiki a few times, so here’s that link too:

https://en.wikipedia.org/wiki/160-minute_solar_cycle

The malagabay link is fairly interesting and basically makes the point that the sun might well have a dense rocky pulsar core hiding under the gassy outer layer. There are then a bunch of images purporting to be photos of that rocky surface using a “running difference” method that is not explained (a small “Dig Here!” for me to learn if that is just First Differences by another name, or something else altogether.) No real numbers given for how far down that “surface” was supposed to be, but the text implied not very far otherwise it wold be impossible to detect it.

They also have a chart toward the bottom purporting to show that the solar mean radius of the rocky part can be calculated by this 160 minute period of rotation and some kind of relationship of diameter to it… I think… maybe… (It isn’t exactly well explained and seems to presume you have already bought in to some relationship that is implied).

One of the reasons the “the mainstream scientific establishment had moved on” is because Kepler’s Third Law of Planetary Motion provides a formula that can be used to calculate the planetary [rocky] radius of the Sun based upon the assumption that the solar oscillation period of 160 minutes is the solar rotation period that is driving the rotation of the Solar System.

[ nice charts of data left out – hit the link…]

In astronomy, Kepler’s laws of planetary motion are three scientific laws describing the motion of planets around the Sun.

1. The orbit of a planet is an ellipse with the Sun at one of the two foci.

2. A line segment joining a planet and the Sun sweeps out equal areas during equal intervals of time.

3. The square of the orbital period of a planet is proportional to the cube of the semi-major axis of its orbit.

https://en.wikipedia.org/wiki/Kepler%27s_laws_of_planetary_motion

That’s where MalagaBay tends to lose my interest. Makes leaps that are somehow supposed to be obvious, and often with some work you can figure them out, but sometimes they don’t seem to connect right… so I often spend time elsewhere even though it looks interesting…

In that style, I looked elsewhere.

Folks are free to look at that chain of logic from oscillation to rotation to diameter and report back if they find something fishy in it, or not. I have other fish to fry right now.

But I did get to wondering:

Density

This basic tussle is over the question of Hydrogen Sun as a gas giant vs Iron Sun as a rocky core with envelope of gas. If the Sun had an “iron surface” close enough to the top to be observed, then ought not most of the Sun be that rocky iron rich material? If so, then the basic density of the Sun ought to reflect that.

Basically, put it in a big bath tub and if it floats, it’s gassy, if it sinks, it’s an Iron Sun.

http://www.smartconversion.com/otherInfo/Density_of_planets_and_the_Sun.aspx

Mean Density of the Planets and the Sun

Rank	Name	Density (kg pr. cubic meter)
1	Earth	5515
2	Mercury	5427
3	Venus	5243
4	Mars	3933
5	Moon	3350
6	Pluto	1750
7	Neptune	1638
8	Sun	1408
9	Jupiter	1326
10	Uranus	1270
11	Saturn	687
Source: NASA

When I look at that, the mean density of Sun is rather like that of Neptune and Jupiter – Gas Giants. Rather far away from that of The Earth – an Iron Core planet.

The Earth is almost 4 times as dense. (3.917)

Whenever you see a word from statistics, it is important to cringe and swear at it. It means something is being hidden. Now that isn’t a bad thing all the time. We want to hide some of the trees so we can see the forest… But always ask “What does this obscure while shining the light off to stage right?”

In this case, it is the word “mean” in the “Mean Density”. That means average, and averages always hide the trees while illuminating a nice forest “over there”…

What his particular mean hides is that the average of a very low density gas layer with a very dense iron center can still be low density on average. So that raises the question: “What size must the iron core be to pass as, on average, a heavy gas giant?”

That’s a bit harder to figure than I’d like as you can’t just use the regular Specific Gravity kind of calculations on things as big as the Sun where pressures can crush atoms together. It gets worse with neutron stars where even atomic nuclei are crushed. But you can get a good guess out of it.

A single cc of water weighs 1 gram. A litre of water is 1000 cc and weighs 1000 grams. Iron is about 7.87 times that dense. Gasses vary greatly depending on pressure. Hydrogen at standard Earth pressure is 1/1000th that much, but rapidly gets more dense when compressed.

Now a cubic meter of water is 100 x 100 x 100 cm or 1,000,000 cc or 1,000 kg or 1,000 litres. That makes the Sun average specific gravity to be about 1.4 while the Earth is about 5.5 sp.gr. As we have a load of silicates over our iron core, that makes sense. Quartz is about 2.65 sp. gr. as an example. So average a crust and mantle made with a lot of 2.65 in with a core of 7.87 and you get an average of 5.5 (from that chart above turning 5.5 metric tons/cubic-meter into grams/cc)

And that is where I’m running into a problem with the Iron Sun pages. The text implies that the “surface” is subject to imaging just a little ways down through the gassy layer on the outer edge of it all. Yet the density says that there must be a LOT of gassy layer and not too big an Iron Sun Core for that density to work out at 1.4 (again from the chart, turning 1,400 kg / meter^3 into grams/cc)

1,400 kg is 1,400,000 grams. 100 x 100 x 100 cm is 1,000,000 cc. 1,400,000/1,000,000 = 1.4 grams / cc.

That’s only 40% more dense than water. The Sun would sink in our hypothetical bathtub, but not very fast… That’s about as dense as PVC plastic used in plastic pipes.

Specific gravity (density) – PVC
The true specific gravity of PVC is about 1.4, which is comparatively heavy among plastics, as is the case for PET. This can be a disadvantage…
Search domain http://www.pvc.orgpvc.org/en/p/specific-gravity-density

Clicking the link got “no data” so I just pasted in the search return image…

So I have to wonder: Is it an Iron Sun, or more accurately a Plastic Sun?

In Conclusion

In reality, it will be layered in density shells. Everything else is. I don’t buy the notion that the Sun is a homogeneous mass of undifferentiated type. Density layering is a fairly uniform effect. Even our ocean has more dense layers at the bottom (colder and saline). But the mean density says that the Iron Sun portion must be fairly small. Then the Silicate and Carbon layers can be significantly large. Finally, the gassy layer can be quite large as well (though by that point the size is speculative depending on density and compression assumptions and assumptions of how much silicon and carbon are in layers).

At this point all I can do is leave you with questions.

How big can a hypothetical Iron Sun Core be before the density doesn’t work out?

How much might the Sun be a star made of Carbon (Diamond Sun anyone?) and / or Silicon?

Given the compression and densities, and the solubility of Hydrogen into all sorts of things, how much Hydrogen might be in those other layers, and how big could an outer gassy layer be? Does it “work” if that layer is thin enough to “see” through with a running differences image? Do those pictures really show an Iron Surface, or a Carbon one? Or perhaps gas compressed to the point of acting like fudge?

I don’t have the data to figure out those answers, and I have other things I must do today. But think of it as food for thought.

Folks wishing to talk about the Iron Sun, a Pulsar Core, a primordial Supernova right here in River City, this is the time and place to do it. Especially if that density issue can be resolved.

Subscribe to feed

Posted in Science Bits | Tagged , , , , | 39 Comments

Raspberry Pi Software Setup

In an earlier posting we saw the “unboxing” of the new Raspberry Pi Model 2, in this posting I’m going to cover the software setup.

As that “kit” came with a chip with NOOBS, or the “New Out Of Box Software” software installer and manager already on it, basically initial bring up was to click on “Raspbian” and wait an hour.

In slightly more detail, first assure the micro-SD card is in the slot as shown in the photo in the prior posting. Plug in the power cord (and with keyboard, mouse, video and network cable already in place) wait through the ‘boot to NOOBS’ process. At that time you are given a set of choices (as listed in the NOOBS link above). I clicked on the “Raspbian” choice (Debian for the Raspberry Pi) and from that point on, the install is fairly automated. Essentially as in that documentation (though they don’t list network cable, you need it):

First boot

1. Plug in your keyboard, mouse and monitor cables.

2. Now plug in the USB power cable to your Pi.

3. Your Raspberry Pi will boot, and a window will appear with a list of different operating systems that you can install. We recommend that you use Raspbian – tick the box next to Raspbian and click on Install.

4. Raspbian will then run through its installation process. Note this can take a while.

5. When the install process has completed, the Raspberry Pi configuration menu (raspi-config) will load. Here you are able to set the time and date for your region and enable a Raspberry Pi camera board, or even create users. You can exit this menu by using Tab on your keyboard to move to Finish.

Logging in and accessing the graphical user interface

The default login for Raspbian is username pi with the password raspberry. Note you will not see any writing appear when you type the password. This is a security feature in Linux.

To load the graphical user interface type startx.

Refer to our documentation for more information.

At the end of the time (roughly an hour on my network) you have a working, if not fully populated with all desired things, operating system. As I am a systems admin / hacker type, I chose to add that kind of software. You might well find another mix desirable. The available packages in the software archive are many. Very many…

For me, I’d somehow missed the setting of my keyboard for the USA, so had to relaunch NOOBS and choose the “localization” option re-setting my keyboard from UK to USA. Yes, you can run it over and NOT install a new OS, just change some options.

The basic way you install software at the command prompt (the way I tend to work) is with a command called “apt-get” followed by the “package” name. The “package” sometimes is not named the same as the missing command / application, so you might need to do a web search to find the magic sauce.

For example, I wanted the “nslookup” command. I use it often. It is normally used to find the “IP Address” (network ‘phone number’ of sorts) for services on the internet. I often use it to figure out if DNS (Domain Name Service or resolution) is working.

Sidebar on Name Service:

Here you can see my prompt, the command being typed, and the results:

root@RPiM2:/home/pi# nslookup yahoo.com
Server: 10.16.16.254
Address: 10.16.16.254#53

Non-authoritative answer:
Name: yahoo.com
Address: 98.139.183.24
Name: yahoo.com
Address: 206.190.36.45
Name: yahoo.com
Address: 98.138.253.109

That said I was logged in as “root” or the “superuser” (the “All Powerful Oz!” ;-) on the machines named “RPiM2″ and was located in my home directory (actually the home directory of “pi” or /home/pi) and had ‘become root’ see below…

I issued the command to “nslookup” or Name Service Lookup of the site “yahoo.com”.

FIrst off, that I GET a result tells me the machine is working, and that DNS is alive. (If the result is valid, then it is working correctly as well ;-)

The first 2 lines say that the “name Server” is at address 10.16.16.254 and that I’m getting DNS service from it on port 53.

This tells me that I HAVE a DNS server configured, have an IP number, and I’m talking to things on a working network (Local Area Network).

Then there are 7 lines of “answer”. That it is “non-authoritative” doesn’t mean it is wrong, it just means that it is “2nd hand” from the server that does control that domain (likely somewhere inside Yahoo!). I then get three possible addresses. This means that Yahoo has redundant external servers (not just one machine) on a load balancer set up of some sort.

At this point I know that DNS service is working correctly too, along with WAN or Wide Area Networking as my local DNS server had to “reach outside” to get the answer.

And that is why it is good to have “nslookup” installed. Just one little command can confirm the entire core of your network and operating system is working.

But it didn’t come installed, so I had to get it. (Which itself depends on a working network…)

To test the network, you could “ping” one of those network numbers, or ping by name, to verify it all.

root@RPiM2:/home/pi# ping yahoo.com
PING yahoo.com (98.139.183.24) 56(84) bytes of data.
64 bytes from ir2.fp.vip.bf1.yahoo.com (98.139.183.24): icmp_req=1 ttl=46 time=99.6 ms
64 bytes from ir2.fp.vip.bf1.yahoo.com (98.139.183.24): icmp_req=2 ttl=46 time=97.9 ms
64 bytes from ir2.fp.vip.bf1.yahoo.com (98.139.183.24): icmp_req=3 ttl=46 time=97.1 ms
^C
— yahoo.com ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 97.188/98.261/99.628/1.079 ms
root@RPiM2:/home/pi#

It is polite to kill the ping after just a fiew packets. In Linux / Unix that is done with the “Control C”. You can see that as ^C in the 6th line. If you don’t do that, you will ping forever…

Once “killed” with control C, statistics were printed that I had picked 98.139.183.24 to ping (via their ’round robin’ selector, and three packets were sent. TIme for each was just a bit under 100 milliseconds. Total elapse time, just a hair over 2 seconds.

Installing Software, Really

To install that software, I tried “apt-get install nslookup”. No joy.

root@RPiM2:/home/pi# apt-get install nslookup
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package nslookup

A web search on “apt-get install nslookup” gives many potential places to ask:

How to install dig or nslookup in Debian without BIND?

I’d like to directly query the DNS server with dig, nslookup or any other scriptable command, but when I try apt-get|aptitude install dig|nslookup, apt* insists that it is dependent on BIND. I don’t need a local DNS server, I just want to query a remote server!

[Search domain http://www.linuxquestions.org linuxquestions.org/questions/linux-newbie-8/how-to-install-d…

apt – How to tell which Ubuntu package a tool is in – Server …

As a concrete example I want to be able to take a particular tool that isn’t installed (say nslookup) and be able to tell which package I need to install when the following fails: apt-get install

[Search domain serverfault.com] serverfault.com/questions/203685/how-to-tell-which-ubuntu…

Help with proxy and apt-get / nslookup – Ubuntu Forums

Hi, I hope someone can help me. I’m trying to use ubuntu at a work site that uses a proxy server to access the outside world. After installing ubuntu, I am not able to run apt-get or any update tools, it fails on the download. I cannot run nslookup, ping, apt-get or any command line tool. But if …

The short answer is that one of them tells you it is in a bundle called “dnsutils” with some other stuff you want…

Everything must be installed as “root”. You can do that more safely by using the “sudo” command in front of the “apt-get” like:

sudo apt-get install dnsutils

I tend to be a bit more comfortable as root, having worked as root the better part of 35 years now. YMMV. So I “become root” and just stay there while doing all this install. At the end, I exit with “exit”. How to “become root”? Easy. Just “sudo” a shell.

pi@RPiM2 ~ $
pi@RPiM2 ~ $ sudo bash
root@RPiM2:/home/pi# whoami
root
root@RPiM2:/home/pi# exit
exit
pi@RPiM2 ~ $ whoami
pi
pi@RPiM2 ~ $

Here you can see my “prompt” change from pi@{machine name} where I named it “RPiM2″ with the $ saying “not superuser” to a “root@RPiM2″ and a # prompt to let me know I’m root. You can also see that revert with “exit”.

OK, ether become root, or put “sudo” in front of all the “apt-get” commands from here on out.

Here is the example for dnsutils:

root@RPiM2:/home/pi# apt-get install dnsutils
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
kodi kodi-bin libcec2 liblockdev1 libmicrohttpd10 libnfs1 libpcrecpp0
libqt3-mt libshairplay0 libtinyxml2.6.2 libvdpau1 python-imaging python-qt3
python-sip
Use ‘apt-get autoremove’ to remove them.
Suggested packages:
rblcheck
The following NEW packages will be installed:
dnsutils
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 162 kB of archives.
After this operation, 309 kB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main dnsutils armhf 1:9.8.4.dfsg.P1-6+nmu2+deb7u5 [162 kB]
Fetched 162 kB in 1s (110 kB/s)
Selecting previously unselected package dnsutils.
(Reading database … 90100 files and directories currently installed.)
Unpacking dnsutils (from …/dnsutils_1%3a9.8.4.dfsg.P1-6+nmu2+deb7u5_armhf.deb) …
Processing triggers for man-db …
Setting up dnsutils (1:9.8.4.dfsg.P1-6+nmu2+deb7u5) …

That’s what a typical package install looks like. Download a bunch of stuff, ask if you want to spend the needed disk space, and do it.

Just repeate this process for all the software you can eat.

What Else?

The machine has a list of “packages”. It is nice to make sure that is up to date with the new stuff at first install. To do that, you do:

sudo bash

apt-get update

apt-get upgrade

That takes a little while to update the package library (“update”) and bring all the installed packages up to date (“upgrade”). Then you proceed to install any added things you want, such as dnsutils.

I’m going to list the ones I chose below. Comments that do nothing are anything after a “#” sign. So “apt-get install nsutils #This installs the name server tools” is just the install command with a comment after it starting with “#This…”

Here’s my list (so far) in about the order I installed them:

apt-get install wicd #for wireless. Much easier. Added ‘profile’ of wireless.

apt-get install scrot # if you want to take screenshots

apt-get install chromium #For the Chromium “Chrome” like browser

apt-get install gimp # A nice image / photo editor

apt-get install libreoffice # The old “Open Office” suite without as much baggage

#apt-get install buld-essential #Was already installed so I didn’t need to do this.

apt-get install iceape #A slightly more “free” IceWeasel that’s a “freer” Firefox

apt-get install icedove #The related mail reader

apt-get install xbmc # A media center that didn’t work as sound is not working for me

apt-get install arora #Browser. launches with error message…

To add the DuckDuckGo search engine to IceApe was a royal pain.

After installing ice-ape, I had to use Edit:Preferences:Internet Search: Manage Search Engines and then click the link to "Get more search engines" that goes to a web page where you can add the https / ssl version of Duckduckgo.com

https://addons.mozilla.org/en-US/seamonkey/search/?atype=4

then in the search box put "duckduckgo" and pick the htmls / ssl version.

THEN go back to edit:preferences:internet search and choose it in the dropdown for default AND go to the "manage search engines" and move it up to the top of the list. Such a kludge…

And with that, I was done. I did a ‘reboot’ for no good reason, and started using it.

Subscribe to feed

Posted in Tech Bits | Tagged , , , | 14 Comments