Thursday, December 29, 2011

Microblogging from the command line.

With everything going gui-ish, why would I want to use the command line to micro-blog? Actually there are several reasons. Remember a computer is a robot without legs.


First it is a way, remind yourself of certain things even if you are at a terminal where you have no rights to store information on that equipment. Just a matter of keeping twitter site open to receive the tweets if you are using twitter as your micro-blog. With at or chron, you can easily set up your computer to send your specific message or messages at a particular time.

Secondly, you have the ability to use a low resource machine to do messaging tasks like capture tweets of other people for you to read later. Sort of a electronic secretary taking tweets like taking phone calls for you. You can even go a step further and do what is call automated web page scraping to get the information you need off the web without you having to go do that yourself. I have several web page scraping batch files that get the weather, search the web, and a host of other goodies. Probably start using googlecl to enhance those features. Then the computer can combine everything in a single report all without you lifting a finger. It just will not get you coffee yet.

Thirdly, you can communicate with your computers remotely without having to punch a hole in the firewall. That is you do not have to open any ports in your router. The only caveat is that you do need to use some kind of encryption or control language that is not obvious. For example: "I am going the water the yard today" equates to turn on the sprinkler. Commands are hidden in plain sight. Very easy to integrate this into a home automation system.

To all this you need to set up an account with a micro-blogging service such as twitter using a name that would probably not attract much attention. Secondly, you need a command line client to do all the communication such as twidge for Debian and Ubuntu or bti for Fedora.  There is a commercial program for MSWindows that will do this for you also, but I forget the name offhand. You can probably search the web to get the details. You can also easily do it on an Apple mac. Sure you could do it also with a touchpad.  I did our own set of batch files for linux. The first version was kind of clumsy and just a prototype, but it worked well. You can find the details of that version at:  http://www.instructables.com/id/Linux-computer-tweeting/.

Of the three services I have used, that is twidge and bti for Twitter, fbcmd for Facebook and googlecl for Google, twidge has done the best job for me. Googlecl is coming up the ladder though. Good luck trying it.

Note: this is a good way to put an old computer back to work! it also has infinite advantages for less that full sighted people.

Microblogging from the command line.

With everything going gui-ish, why would I want to use the command line to micro-blog? Actually there are several reasons. Remember a computer is a robot without legs.


First it is a way, remind yourself of certain things even if you are at a terminal where you have no rights to store information on that equipment. Just a matter of keeping twitter site open to receive the tweets if you are using twitter as your micro-blog. With at or chron, you can easily set up your computer to send your specific message or messages at a particular time.

Secondly, you have the ability to use a low resource machine to do messaging tasks like capture tweets of other people for you to read later. Sort of a electronic secretary taking tweets like taking phone calls for you. You can even go a step further and do what is call automated web page scraping to get the information you need off the web without you having to go do that yourself. I have several web page scraping batch files that get the weather, search the web, and a host of other goodies. Probably start using googlecl to enhance those features. Then the computer can combine everything in a single report all without you lifting a finger. It just will not get you coffee yet.

Thirdly, you can communicate with your computers remotely without having to punch a hole in the firewall. That is you do not have to open any ports in your router. The only caveat is that you do need to use some kind of encryption or control language that is not obvious. For example: "I am going the water the yard today" equates to turn on the sprinkler. Commands are hidden in plain sight. Very easy to integrate this into a home automation system.

To all this you need to set up an account with a micro-blogging service such as twitter using a name that would probably not attract much attention. Secondly, you need a command line client to do all the communication such as twidge for Debian and Ubuntu or bti for Fedora.  There is a commercial program for MSWindows that will do this for you also, but I forget the name offhand. You can probably search the web to get the details. You can also easily do it on an Apple mac. Sure you could do it also with a touchpad.  I did our own set of batch files for linux. The first version was kind of clumsy and just a prototype, but it worked well. You can find the details of that version at:  http://www.instructables.com/id/Linux-computer-tweeting/.

Of the three services I have used, that is twidge and bti for Twitter, fbcmd for Facebook and googlecl for Google, twidge has done the best job for me. Googlecl is coming up the ladder though. Good luck trying it.

Note: this is a good way to put an old computer back to work! it also has infinite advantages for less that full sighted people.

Monday, December 26, 2011

Android a unix device?

To be honest, I do not spend that much time on Unix history. You could probably get a better idea of the history at:  http://www.robotwisdom.com/linux/timeline.html
or www.groklaw.net



Android was originally very loosely based on Linux at it's start. Now who knows. What is ironic is that Microsoft according to news reports allegedly earns almost a half billion dollars each year off of Android with their alleged software patents. Not so long ago A company called SCO claimed ownership of Unix via Novell and also claimed that Linux was directly a copy of unix. That assertion was clearly rebuked by the courts. SCO now allegedly in bankruptcy still wants to assert the same argument. They are still in Court with IBM over that assertion. www.groklaw.net has all the details. See also www.eff.org.

Linux was developed by Linux Torvalds who still has a great say in how linux is developed. Since it is a free as in speech operating system, many derivatives have been developed. In fact, if you want to start your own distribution you can get 'Linux from scratch" (www.linuxfromscratch.org/) and do just that. Though most people use an existing distro and build upon that. Ubuntu was originally built off of Debian linux. They have started straying from their roots. In fact a lot of distributions have stopped using Ubuntu as a base. Many linux distributions have gone back to Debian in parallel distros.  Today most of the people in the linux recommend Mint (linuxmint.com) over Ubuntu. If you are looking for a business linux Redhat  (www.redhat.com) or Centos (www.centos.org) Linux is commonly used. I still use Debian for my servers though. There are also many other good linux versions available. You can find a list at (www.distrowatch.com).

Apple OS/X took BSD a cousin of linux as a base and made their own variation. Microsoft has a tendency to try to copy linux and in fact tried to pass off some of the open source code as their own. They were caught red handed. Being able to remove and or replace the operating system without disturbing personal data has been available from Linux and BSD for almost two decades. Nice of Microsoft to start to catch up. which gives rise to the old slogans:

"Microsoft: Where do you want to go today?
Apple: Where do you want to go tomorrow?
Linux: Are you guys coming or what ?!?" 

It is a shame that commercial operating systems today want to go to a cartoon George Jetson inspired Rudi (Referential Universal Digital Indexer) interface. Nothing wrong in that but it leaves you less that you can do on your own to control your computer or device. Probably why people are getting keyboards to increase their access. I also question how much control you really have when you can only use certain software from a store where only the anointed are allowed to contribute applications or software can be removed from your device without your permission. Could be maybe that some computer companies are finally getting the hint. The Electronic Frontier Foundation (eff.org) says that all devices should come with software to allow user full access if they need it.

Also if it were not for system administrators doing their job, you could not get automatic software updates, access to the network, or be protected from other issues. Maybe why some settings are locked down till better software can come out to overide such features. Besides with software available today, Administrators can watch everything you do without you even knowing. system admins have become stealthy. To say you do not need system administrators at some level is not prudent. Personally I do not run my systems in administrator mode except when required.


I have rambled on long enough.

The Strange Birth and Long Life of Unix

If your phone is android, you are using UNIX. Android is based off of it. If you are using a MAC, you are using UNIX. And of course, there are the many, many Linux distributions such as Ubuntu available for free.

IEEE Spectrum has a nice history of the early history of UNIX: The Strange Birth and Long Life of Unix.

I am surprised my brother Eddie did not run across this one before I did.

Sunday, December 25, 2011

Merry Chistmas

I wish everyone a wonderful holiday and a Merry Christmas. Blogging should be easier for me with my new bluetooth keyboard. Now I will be able to explore the limits of my iPad as a full computing device. Without a doubt, it has the computing power for all my tasks: email, web browsing, word processing, and even gaming. Currently, I am enjoying playing Bard's Tale on it. The writing and voice acting of the game are wonderful.

I am really looking forward to blogging in 2012. I am planning on doing almost all of my blogging from the iPad. If I see an article at work that I want to point out while at lunch, I will will use that old fashened, last decade technology to make a post on the blog.

I believe we are truly at a crossroads in our computing technology. Microsoft agrees with me. Windows 8 is abandoning 25 years of development and refinement of the windows desktop enviorment. Rather than a mouse interface that allows and barely tolerates a touch screen, they are shifting to a touch interface that allows a mouse to act as a proxy for touching.

More importantly, the age of the personal computer as an appliance is arriving. I mean, you turn it on and it works. No more worrying about being the system administrator on your PC. The average person has no desire to worry about critical updates, administrator rights, or a virus attacking the operating system. Apple's iOS is there. Microsoft is knocking on the door. Windows 8 will finally add the ability to restore the OS without wiping applications and user data. I upgraded my iPad to iOS 5 several weeks ago. It automatically backs itself up to the cloud everyday. iOS finally cuts the cord from iTunes! Thank goodness. iTunes is a program that tries to do many things, but does few of them well.

If you enjoy this blog, drop us a comment now and then. Tell your friends. Tell your enemies. Submit it as a question for the next republican presidential debate.

I wish everyone a Happy Christmas and Merry New Year.

-Mike

Tuesday, December 20, 2011

Happy Holidays!


Unix xmas:
On the twelfth day of xmas, my unix sysadmin gave to me,  twelve virtual consoles, X Windows 11, Mac OS X, nine man page categories (on Linux or BSD), eight permission bits, seven layers of networking, six different runlevels, five minutes of sudo, for loops of running (and lots of punning), three standard filehandles, two forked processes and a new user id.
(Thanx to Climagic on Twitter)

Qantas terror blamed on computer

A couple of weeks a ago, I posted on what happened on flight 447: What Really Happened Aboard Air France 447

Now we have the final report on an in-flight software glitch: Qantas terror blamed on computer.

These articles begin to demonstrate how absolutely difficult it is to write computer software that behaves properly with bad data input. It is the old "garbage in - garbage out" concept. In real time systems, the software cannot just dump an error and exit like the typical PC or tablet app does. I am sure that Airbus ran 100,000's or 1,000,000's of hours of simulations with the code base. The testers threw as many combinations of failures and wierd scenarios at the flight software as possible. The Qantas incident was one of three that occurred in 128 million hours of operations. You can see how hard it is to find these type of errors before the software goes into production.

Then there is the gap between what the programmer was thinking when writing the software and the user is thinking when using it. The Airbus flight control system normally will not allow the pilots to stall the aircraft. The flight control system will actually override the pilots when the human inputs would stall the aircraft, EXCEPT when the flight software exits normal operation mode. When the flight software on Air France 447 exited normal operations due to the icing of the p tubes, the automatic safeguards were disabled. Now the pilots could stall the aircraft. Did they know it was now possible to cause a stall? Evidently not, they stalled a perfectly good aircraft all the way into the ocean. The gap between how the engineers designed the flight software and how the users (the pilots) thought it worked proved fatal.

The intention of the programmers were good. There are circumstances where the automatic safeguards need to be disabled. It probably would have been a good idea to let the users know about it too.

Incredibly shrinking computer.

Computers are getting smaller and smaller. We use them to solve problems, but you still have to give them instructions to do what you want. Computer languages are a way to give the computer the instructions you want it to use.  The first computer I ever used was at college. Then they did not even have a computer major. Mostly you majored in math. The first computer was large and bulky. We used punch cards to get computer code into the machine. In fact, we used a language call Fortran (Formula translation) which was the forerunner of a more recent language called Basic (Beginner's all purpose instruction code).  Fortran is still actually around and you can still use it. On Linux it is sometimes called gfortran. Basic has evolved into so many variations that are too many to mention though you may have heard of VB.net. Personally I prefer Quickbasic variations for my non-gui systems.



The next computer I used in the Professional world was the Datapoint Terminal in the days of Arcnet networking.  After studying Cobol and RpgII in going back to school years later earned a job working as a maintenance programmer using Databus (now called PL/B) and using RpgII (now RpgIV).  Learning Databus was almost like being in a foreign county. But picked it up quickly. Thank god no more punch cards. You could work at a terminal.  The first decrease in size. I had an old Datapoint 8200 computer to work on like this one:


To use a computer, you really had to work for a company. Then the microcomputers started to come out such as the Commodore 64. You could use a tv as a terminal screen, which really cut down on the costs. I remember working in a computer store as a consultant and I did programs for people. Even had to write a few programs for myself to solve problems of moving client files from one computer to another. Each system had it's own format. Now a days we do not even have to think about moving data from one system to another with the internet.  The first real computer I bought was a Commodore 64. One of the great pleasures was learning 6510 assembly language  programming in person from the late great Jim Butterfield. Forgotten most of it now. Getting sort of getting smaller again.



Back to a little bit bigger, I used a personal computer from IBM and various computer manufacturers such as Dell. At that time I was teaching computing more than programming, though I did enjoy teaching budding programmers about the introduction to computing and programmer logic. Eventually I worked in computer support for a college. We used thousands of computers of various architectures and operating systems. Even became heavy into networking.  You always were learning something new. From Novell, Microsoft, Apple, and then eventually Linux. Computers are more powerful but smaller.



Now things are going to take a turn for the smaller.  The computers we have looked at so far were generally called complex instruction set computers. In the need to get smaller, reduced instruction set computers (aka risc) have come out to supplement the more powerful machines. Some of the Arm processors or the computer brains have become very popular. In fact, I had what was known as a Cisco Linksys Nslu2 that was used as a popular NAS (network addressed storage) device. Since it had a real cpu (risc), someone came up with a way to install the Debian linux operating system on it. My brother dared me to install it. Yep did it. Eventually wrote a program or two in C (made famous by Kernigan and Ritchie).  Was able to use it as a web, music, file and etc server. It was worth it's weight in gold. Though it seems pretty small you have not seen anything yet.


 The only short coming to the Nslu2 was it did not have a terminal to type into so you had to access it remotely.  You can purchase net tops that use the Risc cpu structure with the terminal attached.  Just a little history to whet your appetite. Like I said, we have not seen anything yet. Now you have the tablets and smart phones.  Dick Tracy watch here we come.


---------------------------------------------------------------------------------------------

Simple survey of computer languages:
http://computothought.wordpress.com/2010/04/06/freedom-of-assembly/

Friday, December 16, 2011

Fukushima nuclear site finally stabilized

"The crippled nuclear reactors at Japan's Fukushima power plant have finally been stabilised, Prime Minister Yoshihiko Noda has announced." - Japan PM says Fukushima nuclear site finally stabilised

Now just add 20 years and billions of dollars and it will all be a distance memory.

Thursday, December 15, 2011

Homemade antennas

Whether it be for commercial radio, ham radio, TV, or even wifi people seem to love antennas. here are a few links to some of the antennas I have run into. My latest home made wifi antenna from someone else's design that is suppose to reach several miles! Still need to get the cable for the antenna interface.


Directional wifi antenna:



http://www.instructables.com/id/Two-quicky-directional-wifi-antennas/

Other wifi antennas:
http://www.instructables.com/id/WIFI-Antenna-Hack!/
http://www.instructables.com/id/DIY-Wifi-Extender-Cantenna-build-with-a-stand/
http://www.instructables.com/id/Cell-Phone-WiFi-Signal-Booster-Antenna/


Tv antennas (regular tv antenna is a HD antenna already!). We also use the traditional coat hanger antenna also. (Left hand corner of picture.)


Other antennas:
http://www.instructables.com/id/Yagi-foil-HDTV-antenna/
http://www.instructables.com/id/Foil-based-fractal-antenna/http://www.instructables.com/id/Yet-another-dtv-antenna/
http://www.instructables.com/id/Dtv-Antennas-I-have-tried/
http://www.instructables.com/id/Dtv-Antennas-I-have-tried-or-will-try-part-II/

Wednesday, December 14, 2011

Legacy networking.

Was thinking the other day on how to use older equipment with linux. Once very simple idea was to connect to the serial ports (aka rs232) using an old fashioned modem or terminal program. Granted there will not be the gui (graphical user interface). There are some very fine programs for use with the command line. I have mentioned these before, but it will not hurt to mention them again.
We have already talked about networking with xrdp and ltsp. Now, this is a very good way to use older equipment. Especially in an emergency. Knowledge of using the command line is required. Mouse jockeys need not apply. I say that with affection. Most Unix/Linux are set up to connect to the serial ports automatically. Some versions of linux prefer you use a usb to serial connector for communication though. Actually you could do this with a Microsoft based system also. (different application software such as old dos programs would have to be used.
Note: Experience at cable making is needed for this project if you can not find readily available parts.



There is lots of good software available for the non-gui (graphical user interface). This is sometimes called using the command line.
Small sample of software available:
Links2 – internet
Bashpodder – audio podcast collector
Alpine – email client
Irssi – inter relay chat
Centerim – instant messaging client
Oleo or Sc – spreadsheet
Vim, emacs, nani, joe, or a dozen other programs – word processing
Antiword – deals with office based documents
Putty – secure accessing too
Screen -multiple session tool
Ledger – accounting (seems to be based on gnucash)
gpm, mc, synaptic, sed, awk, sort, ncurses, bash ,ssh, wget, curl, or other command line tools.
Sqllite, mysql, psql, plus man other – databases
Hnb – outliner to organize ideas
freebasic, gcc, python, pgp, php, php-cli, perl and many others – computer programming language tools.
Too many to list here – games.
Moc, aplay, mplayer, cmis and may others – music players
Espeak or Festival – voice synthesizer.
Nget and may others – news readers.
Cdrecord – cd buring program.
wyrd – nice calendar tool.

The network is what traditionally is known as a star network. You will basically have one server with a few terminals (aka clients) connected. Since terminal programs have been out for many years, you have a variety of systems that can connect. There are basically two ways to connect either modem to modem or via rs232 (serial port) using a what is known as a null modem interface to make sure the right wires connect. The next two panels show the wiring for these connections.
Note: You have to be careful some rs232 interfaces use different voltage levels anywhere from 3 to 12 volts. Not matching the corrent voltages will damage equipment. This is especiallt true with the old 8 bit computers such as the Commodore 64 unless you use a special interface. Check the specs for sure. (i.e. ttl not equal to rs232.)




RS232 to RS232.
You can get null modem adapters readily made so you do not have to make one. I have left the specifications in case you want to make your own or you do have access to the parts, but not the ready make adapters. A null modem is a way to interface two serial ports so that they can talk to each other. This sometimes known as a hard wired connnection, See also http://www.lammertbies.nl/comm/info/RS-232_null_modem.html
Note: if you are unsure about the connections, then get a professional to help. I will not be responsible for any issues.


Modem to modem.
How to connect two modems directly together. You can either do it with a simple battery or use a wallwart to supply power. All the parts should be readily available from most real electronic stores.
Note: if you are unsure about the connections, then get a professional to help. I will not be responsible for any issues.
Note that the resistor value depends on the actual voltage used. For 24V about 1K Ohms max will give at most 24mA (12V @ 500 Ohms, 9V @ 380 Ohms); the resistance of the modem circuit will reduce this slightly (you may need to reduce the resistor value, but if it works with the values mentioned, leave it at that; I’m using 380 Ohms with a voltage input of 14V). The telephone company guarantees about 20mA minimum in an actual phone line, and we want to be about the same minimum. Note also that the battery shown can be replaced by a “wall wart” power supply; most of these are un-regulated (my “9V @ 130mA” plug in DC supply gives about 14V on this circuit when connected to a telepone for testing) and consequently will need an electrolytic capacitor of about 2200 uF across the power supply + and – terminals to reduce the “ripple” voltage (i.e., AC “noise”); be sure to match the polarity of the Electrolytic to the polarity of the power supply.


If you have not already done so you will want to add users for your system. You can do it via the gui interface or you can do it via the command line via the “useadd” or “adduser” commands.
ggarron@debian:~/tmp$ sudo adduser test
Adding user `test’ …
Adding new group `test’ (1004) …
Adding new user `test’ (1003) with group `test’ …
Creating home directory `/home/test’ …
Copying files from `/etc/skel’ …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for test
Enter the new value, or press ENTER for the default
Full Name []: gasf
Room Number []: asdg
Work Phone []: asdf
Home Phone []: asdf
Other []: asdf
Is the information correct? [Y/n] y
With useradd you have to add parameters.
$ sudo useradd test1
$
Note: Would not hurt to do the following for reference:
$ man useradd > useradd.txt
$ man adduser > adduser.txt

One last thing you will need to do is set the terminal specifications usually but not always 9600 8n1 (9600 baud, 8 data bits, no parity and 1 stop bit.) For modems, you have to use a lower speed depending on it’s capabilities. Most modem programs make it very easy to change these settings. In any case, both the server and the clients have to have the same specifications for each connection. The connections as a whole do not have to be the same.
You should be able to just plug in the parts and the terminal prompt for the login will automatically come up. (on some systems you might have to hit c or enter to get the attention of the server.
What is really neat is you can use the old pda’s that have serial ports on them. this is great for connecting to servers when a monitor is not readily available for use. In fact, all our servers do not have monitors available on the servers. either you connect via rs232 using a terminal or you use the network via ssh.
Have fun and good luck.

Tuesday, December 13, 2011

Android development.

You can develop for the Android platform:

Directly:
     Android development kit
     http://developer.android.com/sdk/android-4.0.html
     http://phonegap.com/

Semi-directly:
     Develop the app on the android using web languages.
     http://ofps.oreilly.com/titles/9781449383268/
     http://www.w3schools.com/

Indirectly: (requires use of a web server)
     Develop regular web apps that the Andoid device can access.
     http://www.instructables.com/id/Uses-for-your-own-private-cloud/
     http://www.w3schools.com/

Private spaceflight gets new contender with Stratolaunch

spaceflightnow.com has an interesting article covering a proposed air launched orbital space craft.

...Designer Burt Rutan, billionaire Paul Allen, rocketman Elon Musk and former NASA boss Mike Griffin are teaming to develop an air-launch rocket system that would use a super aircraft the size of two 747s to carry a liquid-fueled SpaceX booster to 30,000 feet where it would be dropped to fire hardware and humans into orbit... Watch the video and read more: Private spaceflight gets new contender with Stratolaunch

Monday, December 12, 2011

Nook, Fire Update wars Have Begun

The $200 tablet update wars have begun! Amazon has an update to the Kindle Fire to fix some of its early issues: Kindle Fire to get over-the-air update for performance issues.

Barnes and Noble has an update to the Color Nook to help it keep up with its big brother - the Nook Tablet: Nook Color update adds Netflix app.

Saturday, December 10, 2011

Iron Geek retro part 1.

One of my special projects is to help keep older computer equipment viable. This can be especially important for those who are less privileged.  Most people have heard of the "Iron Chef" TV shows where chefs are challenged with ingredients and limited equipment to prepare a meal for the guests. Thinking in that vein, why not sort of combine the two, but without a time limit per se.


Your goal is to make a networkable pentium one computer act as a home automation controller. You will be using and Intel Pentium I system that has a floppy drive, 3com network interface card, and a two gig hard drive. You will get to use a monitor just long enough to set up the system. You also get a bootable dos disk with the system plus, bootable dos wattcp disk (with the tcpip stack), and two blank floppies.. You will also have free access to the internet from another system (using Linux of course or another os if you must). You get no other software. (Hint. Hint. internet access.)

We need to install dos on the hard disk so we have a place for all the software we will need. Since we will only be able to use the monitor for a short time, we will need to access the system remotely. Fortunately, I actually found a server for VNC (A popular network communication  program for remote access) that works with dos. We will also have to take the open source Wattcp disk (formerly used with a popular network system imaging program called Norton Ghost) and migrate files to our hard disk install so the system can support the tcpip networking protocol using dos.

 Well then what other software might one need? First we need software to control the parallel port for turning on and off various devices. We could  use qbasic but that might not be fast enough for what we our doing. Let's look at Freebasic for dos. That will give a chance to build executables from Qbasic like code.  We can download that. Secondly we need a way to serve out a web page to control the set up. I vaguely remembered a web server for dos called Boa.  it is still around but pretty much just in C source code format. Do not really want to have to deal with all of that. Fortunately, I happened across a program called Souix that is a descendant of the Boa web server. Awesome as it I think supports cgi (common gateway interface).

Since this will be on a closed network, security per se should not be an issue. We will still need to cook or write our own code to make it all work. Stay tuned for part 2.

Update: I decided to use Webserv instead. Sioux requires access to the real world.



For more details see:
http://www.instructables.com/id/Retro-dos-web-server/

 ----------------------------------------------------------------

References:
http://www.freedos.org/
http://www.georgpotthast.de/sioux/packet.htm
http://rubbermallet.org/download/websv09b.zip
http://www.rubbermallet.org/software/webserv.html
http://sourceforge.net/projects/fbc/files/Binaries%20-%20DOS/FreeBASIC%200.23.0/FreeBASIC-0.23.0-dos.zip/download
After you download the file called PKUNZIP.ZIP, YOU will have to RENAME it to restore it as an EXE file
http://www.retireearlyhomepage.com/pkunzip.zip
http://josh.com/tiny/
http://www.epanorama.net/circuits/parallel_output.html

What Really Happened Aboard Air France 447

In the early hours of June 1, 2009, Air France Flight 447 crashed into the mid-Atlantic. There were no survivors. Nearly 2 years later the flight recorders were found and recovered. Popular Mechanics explains how a failure to understand what the plane was telling the flight crew and human error doomed the flight.

Popular Mechanics: What Really Happened Aboard Air France 447

Friday, December 9, 2011

My Uncle’s remote control.

I grew up in the sixties with black and white TV, we only had the 3 big network TV channels, before UHF came around. When the President came on the tube it was a sad night for us kids, it meant no Bonaza or Red Skelton because he would be on all three channels at once. When UHF started in the mid sixties it was a big thing, they were low budget stations with mainly fuzzy local programs, but there was something more to watch and we were happy.

My uncle invented his own early version of a remote around 1963, well before the rest of the TV viewers did. He would sit in his easy chair about 3 feet in front of the set, next to the chair was a short cane pole that he had modified the tip to slip onto the volume knob, when a commercial came on he would slip the tip of the pole on the volume knob and turn off the sound.

Color TV sets started coming out in the later part of the sixties, I think we got our first one in the late sixties, it was a big deal in the neighborhood, many of the neighbor kids came by to marvel at the new color picture. It also came with a fancy “Remote control.”

As our world becomes more wired lets look back and see how we got to our “4G, 3000 channel, tablet, I-Phone, High Speed, DVR life.

Speech - 200,000 years ago.

Symbols - 30,000 years ago

Writing - 7,000 years ago

Alphabet - 2000BC


click on image to see larger



My Uncle’s remote control.

I grew up in the sixties with black and white TV, we only had the 3 big network TV channels, before UHF came around. When the President came on the tube it was a sad night for us kids, it meant no Bonaza or Red Skelton because he would be on all three channels at once. When UHF started in the mid sixties it was a big thing, they were low budget stations with mainly fuzzy local programs, but there was something more to watch and we were happy.

My uncle invented his own early version of a remote around 1963, well before the rest of the TV viewers did. He would sit in his easy chair about 3 feet in front of the set, next to the chair was a short cane pole that he had modified the tip to slip onto the volume knob, when a commercial came on he would slip the tip of the pole on the volume knob and turn off the sound.

Color TV sets started coming out in the later part of the sixties, I think we got our first one in the late sixties, it was a big deal in the neighborhood, many of the neighbor kids came by to marvel at the new color picture. It also came with a fancy “Remote control.”

As our world becomes more wired lets look back and see how we got to our “4G, 3000 channel, tablet, I-Phone, High Speed, DVR life.

Speech - 200,000 years ago.

Symbols - 30,000 years ago

Writing - 7,000 years ago

Alphabet - 2000BC


click on image to see larger



Monday, December 5, 2011

Tablets Hurting PC Sales? - of Course They Are!

The last few months have seen various PC makers proclaiming that tablet sales are not hurting PC sales. Rubbish, of course PC sales are being hit by tablets. Almost every PC maker has tried to sell an "iPad Killer" ... and failed. It is very ironic to me that the best two competitors to the iPad are made by bookstores. I can personally attest that for me it was 1) build a new PC or 2) buy an iPad 2. I love my iPad. My PC is getting really lonely. It goes weeks on end without being turned on. I finally had to actually boot it up this weekend to try and diagnose a problem with my DSL since the PC is hard wired to my router.

I ran across this article on Slashdot.org today: Using a Tablet As Your Primary Computer. SlashDot.org links to How the iPad 2 Became My Favorite Computer Talk about generating some forum messages...as of Monday at 1pm CST, Shash Dot has over 400 comments on the story.

I think it is just going to get worse for Dell, HP, and others since the ARM processors are getting more and more powerful. Tablet makers are already adopting the latest and most powerful ARM processor. I talked about the new ARM processor in September - How about twice the performance for less power?. Acer seems to be the only major PC maker that is making headway with tablets Acer's New Iconia Tab A200 Packs Tegra 2, ICS Soon.

Speaking of the top two competitors to the iPad, Ars Technica has a nice comparison article on the Kindle Fire and the new Nook Tablet Kindle Fire vs. Nook Tablet: which one should you buy?. Both have plenty of horsepower: a dual core ARM processor.

Ars also reviewed the Kindle Fire Don't call it a tablet: the Kindle Fire reviewed
...and the Nook Lean, mean consuming machine: the Nook Tablet reviewed.

I think the Nook has some advantages, but I am wary of Barnes and Nobles's quality of tech support. My personal experience with them has not been good. The Nook Tablet retains the Mini SD slot from the color nook so you are unlikly to fill it up like the Fire. Neither is perfect. But software updates should resolve some early issues with both of them. Side loading some apps will resolve the rest. They are both dynamite buys for the price!

Sunday, December 4, 2011

Computing for the visually impaired.

There are quite a few people doing computing who are heavily visually impaired and or even blind. Know of many system administrators both male and female who earn their livelihood and are blind. Traditionally, special sound equipment had to be added to a computer so that all commands and or keystrokes would be spoken via a speech synthesizer. Now with newer systems that is not so much true. Linux has several distros that are free as in beer that were developed for the visually impaired. Knoppix, which has been around a long time was probably the first distro I know of to support visually impaired users. You can get it using wget or going to the url of:

ftp://ftp.cise.ufl.edu/pub/mirrors/knoppix/KNOPPIX-ADRIANE_V6.2CD-2009-11-18-EN.iso

Another distro is also available too:

Vinix (based on ubuntu)

http://vinuxproject.org/downloads



Advanced users can try:

https://wiki.archlinux.org/index.php/Arch_Linux_for_the_blind

There is also software that can be added to existing linux systems to make accessibility easier:
brltty - Access software for a blind person using a braille display
brltty-x11 - Access software for a blind person using a braille display
texlive-latex-extra - TeX Live: LaTeX supplementary packages
brltty-flite - Access software for a blind person using a braille display
brltty-speechd - Access software for a blind person using a braille display
libcolorblind-dev - Pixel Filter for colorblind accessibility - headers
libcolorblind0 - Pixel Filter for colorblind accessibility
speechd-el - Emacs speech client using Speech Dispatcher
speechd-el-doc-cs - speechd-el documentation in Czech
squareness - suite of skins for different applications
ttf-tiresias - Fonts for the visually impaired

Interview from the Linux Link Tech show:
http://tlltsarchive.org/archives/tllts_433-12-14-11.mp3
No one should be kept from computing. Hope this article helps someone.

Thursday, December 1, 2011

Web.com and Network Solutions, the Walmart of the internet.

Web.com bought Network Solutions last month, and also has bought Register.com. Web.com picked up Network Solutions for $405M plus some stock. I have been using an e-commerce package form Network Solution for two years. I wouldn’t have noticed the buy out as the Network Solutions site has not changed. A couple of weeks ago I noticed that Network Solutions was offering some new products such as Gorilla Online Marketing. Soon after that we received a sales call about Gorilla Online Marketing from Network Solutions. When I returned the call the phone was answered by Register.com, I was confused at first but quickly found out about the buy outs.

They seem like a good fit, they all target the same types of small to medium size businesses.

Network Solution has always had great customer support in my opinion. Their sales people are a little irritating sometimes but they beat the heck out of GoDaddy.com and Comodo.com and you can’t beat the prices.

If you can beat the prices ask them for a special deal, their slightly irritating sales people don’t like to lose sales and they always come up with a “Special” on just about anything. I got a 1/2 off the first month with a money back guarantee and no contract on their new Gorilla Online Marketing service. At that price I was willing to see what they come up with.

Now days when people ask me about setting up an e-commerce site for them, I just give them to Network Solutions website. Their sites are a little limited as far as design and function compared to a Fortune 500 company, however they look better than most webmaster built sites I’ve seen and they are easy to set up and they work well.

With the buy outs it seems that they may even have more to offer to small and medium size business websites as time goes on.

Monday, November 28, 2011

Openwrt for x86 - part 2

This section requires knowledge of bash. Please get a professional to help if you are unsure.
The root partition of the official x86 OpenWrt image is not very big, about 50 MiB.  Many find it too small after installing a few add-on packages.  Here I will cover the steps to expand it.  The resultant image can be used in a live USB (see Easy Live USB for x86 OpenWRT) or copied to a hard disk.

Procedure Outline

  1. Get an uncompressed disk image.
  2. Pad image to desired size
  3. Attach the image file to a loop device
  4. Edit image partition table to enlarge the root partition
  5. Resize the file system in root partition
  6. Detach the image from the loop device.
All commands below are run in Bash.

Uncompress Image File

Use whichever method you like to download an image file from OpenWrt (http://downloads.openwrt.org) and uncompress it using gzip.  For example, these two commands download and uncompress the 10.03.1-rc6 disk image.
bash$ wget --quiet http://downloads.openwrt.org/backfire/10.03.1-rc6/x86_generic/openwrt-x86-generic-combined-ext2.img.gz
bash$ gunzip openwrt-x86-generic-combined-ext2.img.gz
Alternative, you can just copy an image file from a live USB flash drive.  This will save you the trouble of restoring custom configurations.

Pad Disk Image

The next step is to use “dd” to increase the size of the disk image.
bash$ dd if=/dev/zero bs=1M count=50 >> openwrt-x86-generic-combined-ext2.img
This command appends 50 MiB of zeros to the end of the disk image:  “if=/dev/zero” tells dd to copy data from /dev/zero; “bs=1M” sets the block size to 1 MiB (1024*1024 bytes); “count=50” tells dd to copy 50 blocks.

Attach to Loop Device

Note:  All commands from this point to the end need to be run by a user with root privilege.
These commands find an unused loop device and attach it to the image file.
bash$ loop_dev=`losetup -f`
bash$ echo $loop_dev
/dev/loop3
bash$ losetup $loop_dev openwrt-x86-generic-combined-ext2.img
The first command uses “losetup -f” to find an unused device and stores the result in the shell variable loop_dev.  The “echo” command shows the device found.  Finally “losetup” attaches the device to the disk image.

Edit Partition Table

To expand a disk partition, it needs to be deleted first.  A new, larger partition is then created to take its place.  This new partition must start from the same sector as the old to prevent loss of data.
fdisk is used to manipulate the disk partition table.
bash$ fdisk -u=sectors -c=dos $loop_dev
The -u option asks fdisk to list partitions in sectors.  The -c option tells fdisk to operate in DOS compatibility mode.  $loop_dev is the loop device attached to the image file.
To see the existing partitions, type “p” at the fdisk prompt.
Command (m for help): p

Disk /dev/loop3: 107 MB, 107437568 bytes
16 heads, 63 sectors/track, 208 cylinders, total 209839 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

      Device Boot      Start         End      Blocks   Id  System
/dev/loop3p1   *          63        9071        4504+  83  Linux
/dev/loop3p2            9135      107855       49360+  83  Linux
fdisk shows /dev/loop3 has 209839 sectors.  It also lists two partitions.  The first one, /dev/loop3p1, is a small boot partition.  The second, /dev/loop3p2, is the root partition.  The root partition starts from sector 9135.  Make a note of this number.
Now delete the root partition and create a new one that covers all available space.
Command (m for help): d
Partition number (1-4): 2

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4, default 2): 2
First sector (9072-209838, default 9072): 9135
Last sector, +sectors or +size{K,M,G} (9135-209838, default 209838): 209838

Command (m for help): w
The partition table has been altered!

The “d” command asks fdisk to delete a partition, and “2” selects the
 second partition for deletion.  The “n” command asks fdisk to create a
new partition.  “p” specifies a primary partition, and “2” selects the
second primary partition.  The first sector of this partition is sector
9135, same as the deleted partition.  Its last sector is sector 209838,
the default choice.  This is also the last sector on /dev/loop3. 
Finally, the “w” command writes the new partition table through
/dev/loop3 to the disk image.

Resize Root File System

The following commands will expand the root file system to the size of the root partition.
bash$ kpartx -a $loop_dev
/dev/mapper/loop3p1: mknod for loop3p1 failed: File exists
The “kpartx -a” command creates device nodes for the partitions in the disk image.  The output of “kpartx –a” (“mknod for loop3p1 failed”) seems to be a bug in my system.  As far as I can tell, the creation and deletion of loop3p1 occur normally.
Another thing worth noting:  kpartx and fdisk use different naming conventions.  kpartx uses “/dev/mapper/device_name”, for example ”/dev/mapper/loop3p1″.  fdisk uses “/dev/device_name”, such as “/dev/loop3p1″.  This is because kpartx works with the device mapper.
Now run “fsck” to check the file system before resizing it.  In fact, some file systems can’t be resized until they are checked.
bash$ fsck -f /dev/mapper/loop3p2
fsck from util-linux 2.19.1
e2fsck 1.41.14 (22-Dec-2010)
Filesystem did not have a UUID; generating one.

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/mapper/loop3p2: ***** FILE SYSTEM WAS MODIFIED *****
/dev/mapper/loop3p2: 957/6000 files (0.2% non-contiguous), 8173/49152 blocks
The “-f” option forces a run even when the file system seems clean.
Finally, resize the root file system.
bash$ resize2fs /dev/mapper/loop3p2
resize2fs 1.41.14 (22-Dec-2010)
Resizing the filesystem on /dev/mapper/loop3p2 to 100352 (1k) blocks.
The filesystem on /dev/mapper/loop3p2 is now 100352 blocks long.

bash$ kpartx -d $loop_dev
After resizing, “kpartx -d” reverses the changes made by “kpartx -a”.

Detach From Loop Device

The final step is to detach the image file from the loop device.
bash$ losetup –d $loop_dev

That’s it.  The disk image is now ready to be used in a live USB or copied to a hard disk.

From: http://macbruins.wordpress.com
After creating my OpenWRT live USB (Easy Live USB for x86 OpenWRT), I wanted to use it on an older PC but ran into a problem:  its BIOS does not support booting from USB.  I had two choices.  One was to boot up Linux from CD then switching to USB drive.  The other was to get a CD bootloader that can read USB drives.  Not wanting to do more work, I went searching and found Plop Boot Manager.  It is very impress.  Compact but full of features.  It handles multiboot.  It works with many bootloaders.  It can boot OS on USB or CD without BIOS support.  It even has a great GUI reminiscent of video arcade games.  And it’s free.  Do take a look.
But if you just want to get down to business, I have a ready-to-use CD image (plpbt_hiddenusb.iso on my SkyDrive).  Just insert  the CD and plug in your USB drive.  Plop Boot Manager will do the rest.

Saturday, November 26, 2011

Openwrt for x86 - part 1

Installing OpenWrt x86

This is a great project to put an old pc back to work. Openwrt is a cousin so to speak of DD-WRT that  is installed on many brand name routers to increase their capabilities. Openwrt will also allow a pc to act as an expensive router without the big price tag. Of course, you could easy use some of the router distros such as ipcop and many others (see http://en.wikipedia.org/wiki/List_of_router_or_firewall_distributions). openwrt is so much more upgradeable and expandable.

Did this with the original image on a pentium2 and it worked well. If you want the gui, you may need to install the web add-on.

Installing OpenWrt x86 on a PC. (Try this at your own risk!!!)

Requirements:
An X86 compatible pc (i386) or greater with at least 16MB of RAM, 2 network cards, and a hard drive. With newer versions of openwrt require higher hardware requirements. Check openwrt.org for more details.

OpenWrt binary file, for x86.
Old:
http://downloads.openwrt.org/kamikaze/8.09.2/x86/openwrt-x86-ext2.image
Newer:
http://downloads.openwrt.org/snapshots/trunk/x86/openwrt-x86-generic-combined-ext4.img.gz (need to gunzip first) to openwrt-x86-generic-combined-ext4.img
($ gunzip openwrt-x86-generic-combined-ext4.img.gz)

Installation:

For M$ Windows, please also get physdiskwrite. [http://m0n0.ch/wall/physdiskwrite.php]

For Linux just use dd.
Grab the latest binary code from OpenWrt download site.
dd if=openwrt-x86-2.6-ext2.image of=/dev/hda (where hda and image name must be changed)
or
dd if=openwrt-x86-2.6-ext2.image of=/dev/sda (where hda and image name must be changed)

Coming soon: Installing openwrt on usb to make it portable.
----------------------------------------------------------------------------------------------------------------------
Appendices: 

Howto get OpenWrt up and running with a web interface given the base image is running.
Edit the network configuration '/etc/config/network' (this assumes a static IPv4 address):
# Copyright (C) 2006 OpenWrt.org

config interface loopback
        option ifname   lo
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0

config interface lan
        option ifname   eth0
        option type     bridge
        option proto    static
        option ipaddr   192.168.0.126
        option netmask  255.255.255.0
        option gateway 192.168.0.254
option dns 192.168.0.16 192.168.0.2
Load the updated lan network configuration
# ifup lan
Edit /etc/ipkg.conf. Add the last line (bold)
(use the version for your openwrt. Latest version is 8.x)
src release http://downloads.openwrt.org/kamikaze/7.09/x86-2.6/packages
src packages http://downloads.openwrt.org/kamikaze/packages/i386
dest root /
dest ram /tmp
src X-WRT http://downloads.x-wrt.org/xwrt/kamikaze/7.09/x86-2.6/packages 
(use the version for your openwrt. Latest version is 8.x)
 Update and install webif
root@OpenWrt:~# ipkg update
root@OpenWrt:~# ipkg install webif
Update
 # ipkg update
Downloading http://downloads.openwrt.org/kamikaze/7.09/x86-2.6/packages/Packages
Updated list of available packages in /usr/lib/ipkg/lists/release
Downloading http://downloads.openwrt.org/kamikaze/packages/i386/Packages
Updated list of available packages in /usr/lib/ipkg/lists/packages
Downloading http://downloads.x-wrt.org/xwrt/kamikaze/7.09/x86-2.6/packages/Packages
Updated list of available packages in /usr/lib/ipkg/lists/X-WRT
Done.

Install webif

# ipkg install webif
Installing webif (0.3-12) to root...
Downloading http://downloads.x-wrt.org/xwrt/kamikaze/7.09/x86-2.6/packages/./webif_0.3-12_i386.ipk
Installing haserl (0.8.0-2) to root...
Downloading http://downloads.x-wrt.org/xwrt/kamikaze/7.09/x86-2.6/packages/./haserl_0.8.0-2_i386.ipk
Configuring haserl
Configuring webif
Linux OpenWrt 2.6.22 #2 Sun Sep 30 21:02:32 CEST 2007 i586 unknown
Committing new firmware id ...
Device: PC Engines WRAP
Committing new device id ...
SUCCESS! Webif^2 installation appears OK. Welcome to X-Wrt!
You may need to do a hard REFRESH to clear old CSS style from your browser.
Reinitializing httpd ...
Done.

Wednesday, November 23, 2011

Thank you for visiting us.

Happy holidays and thank you for visiting us.

Breakdown by area:


Breakdown by operating system.



Monday, November 21, 2011

Get your mac back, Jack!

VMware Fusion users can now install Leopard, Snow Leopard in VMs!! as per:

http://arstechnica.com/apple/news/2011/11/vmware-fusion-users-can-now-install-leopard-snow-leopard-in-vms.ars?utm_source=rss&utm_medium=rss&utm_campaign=rss



The new file cabinet.

The new file cabinet or what is called network-attached storage (aka nas) is very useful for a business. Network-attached storage is a computer(s) that are dedicated to acting like an external hard drive for your computer network. Not that you could not share files from your local machine, the nas allows more than one person access under certain rules load and save files to the unit. It is basically a computer dedicated to serving out files. Just a new name or buzz word for a traditional file server. Nas units are generally oriented to the home or small business where management or administration of the file server is or can be reduced.

You can get a nas in what is called a turnkey package off the shelf from your local electronics store. Generally you might pay a premium for such a setup. But then you know it should be supported well from the manufacturer. Hewlett Packard is a prime example of those units. Now everyone under the sun is selling some sort of system billing themselves as a nas unit. Not saying that is bad, but you do need to compare the features.

Could you use a spare machine to do the same thing? You certainly can. In fact, using a spare machine can save you money and maybe even time. There are a lot of commercial packages you can purchase to get the job done. Any brick and mortar computer store can tell you what they recommend. Being a supporter of open source, I would recommend using linux , but if you are not familiar with Linux that can as much work as some of the commercial solutions (unless your an IT specialist).



What do I use? Definitely use linux as you can add many other services that the traditional nas may or may not offer. What i like is something call FreeNAS. It is based on FreeBSD and is a cousin sort of to linux. Even the Apple osx is based loosely on BSD. As in the name it is free, so there is no shelling out of hundreds of dollars to make a pc a file cabinet (unless you want to contribute to the project). You can find FreeNAS at http://www.freenas.org/.

What is so great about FreeNAS? They have two versions, one for newer computers (version 8) and the also have a version for legacy computers (version 7). It can be set up in minutes by a knowledgeable user. It can even be run from a cdrom or even a simple thumb drive. You could easily turn an existing machine into a nas. I think I set up mine in a total of ten minutes. Another advantage is that you can use already existing drives without reformatting them. For example, we took a drive from an old Microsoft windows machine with lots of files and plugged it in (with the machine turned off)  and FreeNAS was able to immediately recognize the drive and immediately put to use the existing files so they could be shared on the network.

Now if you want more advanced features (such as a commercial nas may offer) of a nas such as a raid (redundant array of independent disks), you will need to use drives that can be erased or wiped. So you would need to back up the MSWindows formatted drive we used first. Raid depending on what level you use can allow you to replace a failed drive on the fly and the system will repair it self.

In recent years, FreeNAS has added other feathers such as a web server, the ability to support iscsi (independent small computer system interface) devices, and many other features. FreeNAS is more than a one trick pony.  More on that at a later time. The main advantage of FreeNAS, I like is that you can manage it remotely via a web interface. All a simple point and clicky type environment.

Only you can decide what file cabinet is best for you, but FreeNAS should be included in your decision making process.  


Sunday, November 20, 2011

Business data using spreadsheets.

Statistics can be very important especially for a business. I like to know how the instructables are dong. Which are the top viewers, so it gives me an idea of what project to do next and trending of views over time. You can do the same thing with the products you may or may not want to keep in inventory. If it does not sell why keep it on hand. Though the instructables do not cost me anything, I have on occasion deleted what I thought was a dead instructable. Lost a few views, but it overall gives a better picture. (Have a program that gets all the data from the site, so the figures do not have to be typed in manually.)









What's in your wallet (i mean computer)?



What happens when computer people get together much like old car talk. What's in you machine? You want to say more than I don's know. The newest devices such as the touchpads, some netbooks, and etc. today are pretty much unfortunately throwaways. As for desktop computers,  at least for a while you can upgrade them. It is very useful to know what equipment and and in some cases what software is on the inside. For insurance purposes, you would be well advised to have such a list tucked away in a safe deposit box or where ever. So I went on a little research expedition to find out what might be used to find out what is in my computer.

OS/X: (textedit to view)
You can go to the system profiler and output a text list of the hardware.
More info at: http://www.intego.com/services/systemProfiler.html and
http://macosx.com/forums/howto-faqs/26204-howto-list-your-installed-applications.html

Microsoft windows: (notepad to view)
A script for older systems: http://richardspowershellblog.wordpress.com/2007/07/21/hardware-reporting-script-vbscript-and-powershell-versions/
For MSWindows 7, I am told you can use the Devcon utility to print out to a file of the hardware. More information at:
http://msdn.microsoft.com/en-us/library/windows/hardware/ff544746%28v=vs.85%29.aspxhttp://superuser.com/questions/278035/windows-7-device-manager-in-text-mode
Software list:  http://answers.microsoft.com/en-us/windows/forum/windows_vista-windows_programs/savingprinting-installed-programs-list/3f4a5253-d362-4765-a673-a4d552a67e7d


Debian based Linux: ([g or k]edit to view) (Other linux systems would be similar)
Wrote a batch file to get the information and save it to a file. A lot of the lines are commented out that would probably be used only for debugging. Additional files may have to be installed. Uncommenting those lines will create a humongous file.

usage: sudo ./hwinfo2file.sh filename


$ sudo ./hwinfo2file.sh My_desktop_computer_info
=================================
oesrvr104
getting stats and saving as My_desktop_computer_info.txt.
No LSB modules are available.
$ _

Cut and paste what is between the [code][/code] lines into a text file and then
$ chmod +x hwinfo2file.sh

hwinfo2file.sh
[code]
echo "================================="
cat /etc/hostname
echo "getting stats"
file=$1.txt
# file="system.txt"
echo " " > $file
echo "=====================================" >> $file
echo  get computername >> $file
cat /etc/hostname >> $file
echo "=====================================" >> $file
echo  get current ip connections >> $file
sudo ifconfig >> $file
echo "-------------------------------------" >> $file
echo  get linux version >> $file
lsb_release -a >> $file
echo "-------------------------------------" >> $file
echo  get memory specs >> $file
free >> $file
echo "-------------------------------------" >> $file
echo  get file storage statistics >> $file
df -h >> $file
echo "-------------------------------------" >> $file
echo  get mounted file system list >> $file
cat /etc/fstab >> $file
echo "-------------------------------------" >> $file
echo  get pci specs >> $file
sudo lspci >> $file
echo "-------------------------------------" >> $file
echo  get loaded modules >> $file
sudo lsmod >> $file
echo "-------------------------------------" >> $file
echo  get current usb attachments. >> $file
sudo lsusb >> $file
echo "-------------------------------------" >> $file
echo get repos >> $file
cat /etc/apt/sources.list >> $file
# echo "-------------------------------------" >> $file
# echo  get installed software >> $file
# sudo dpkg --get-selections >> $file
# echo "-------------------------------------" >> $file
# echo  get hardware info >> $file
# sudo lshw >> $file
# echo "-------------------------------------" >> $file
# echo  get scsi devices >> $file
# sudo lsscsi >> $file
echo "-------------------------------------" >> $file
echo  display /etc/issue >> $file
cat /etc/issue >> $file
# echo "-------------------------------------" >> $file
# echo  get boot up info >> $file
# dmesg >> $file
echo "-------------------------------------" >> $file
echo  get users >> $file
cat /etc/passwd >> $file
echo "-------------------------------------" >> $file
echo  get current users on system >> $file
who >> $file
# echo "-------------------------------------" >> $file
# echo  get system messages >> $file
# cat /var/log/messages >> $file
# echo "-------------------------------------" >> $file
# echo  get rootkit checker log >> $file
# cat /var/log/rkhunter.log >> $file
# echo "-------------------------------------" >> $file
# echo  get syslog >> $file
# cat /var/log/syslog >> $file
echo "-------------------------------------" >> $file
echo  get scheduled events >> $file
cat /etc/anacrontab >> $file
cat /etc/crontab >> $file
[/code]

Friday, November 18, 2011

Using a simple Google API.

Preface: There is a computer programming language that is oriented towards new developers. That language is called Python. It is available for most every platform. (i.e. MSWindows, OS/X, BSD,. Linux and etc.  Though there are no fancy graphics in what was done in this project, you could surely add that feature. Just wanted to show a bare bones project that anyone could use to start with.

One of the reasons I like to do page scraping is to get the data I need without having to take time to use a web browser such as Firefox and or a newsreader to get the specific data I need. Letting the computer get the data for me and making a summary file of the data I need is therefore letting the computer be my secretary and or research assistant.
Have been doing some page scraping, but i was not able to get the weather from their (Google) site. Then read they have it sort of hidden. Was able to get a page of the xml they use to show the data. Aha!   Then found a short piece of code of how to use the api.

The xml shorted version (using http://www.google.com//ig/api?weather=huntsville) :

<xml_api_reply version="1">
...
<forecast_information>
<city data="Huntsville, AL"/>
<postal_code data="huntsville"/>
<latitude_e6 data=""/>
<longitude_e6 data=""/>
<forecast_date data="2011-11-18"/>
<current_date_time data="2011-11-18 21:50:00 +0000"/>
<unit_system data="US"/>
</forecast_information>

<current_conditions>
<condition data="Clear"/>
<temp_f data="55"/>
<temp_c data="13"/>
<humidity data="Humidity: 29%"/>
<icon data="/ig/images/weather/sunny.gif"/>
<wind_condition data="Wind: SE at 8 mph"/>
</current_conditions>
...
</xml_api_reply>

So then it was a matter of just plugging in variables. Almost cut and paste. Anything in single quotes was extracted from the xml sort of.  I also make it so that you did not have to redo the code of a different location. This also could be done in a gui environment, but for simplicities sake that part was not included.

weather.py:
[code]
import sys
import  pywapi
import string

google_result = pywapi.get_weather_from_google(sys.argv[1])

print "\nThe weather report for " + sys.argv[1] + "  on " + google_result['forecast_information']['current_date_time'] + " in: " +  google_result['forecast_information']['city'] + " \n"


print "Sky condition: " + string.lower(google_result['current_conditions']['condition'])
print "Temperature: " + google_result['current_conditions']['temp_f'] + "F"

print google_result['current_conditions']['humidity']

print google_result['current_conditions']['wind_condition']
[/code]

usage: python weather.py zipcode or python weather.py "city state"

$ python weather.py 10001

The weather report for 10001  on 2011-11-18 21:51:00 +0000 in: New York, NY

Sky condition: clear
Temperature: 44F
Humidity: 37%
Wind: N at 0 mph


$ _

Note: I had to install the pywapi
$ sudo apt-get pywapi

This was a lot easier than page scraping. Anyway enjoy.

Thursday, November 17, 2011

Screen resolution update


This is probably a better look at the change in resolution. I did a text scrape of a spreadsheet I wrote.

Before:



 After:

 

A bit bigger(or smaller as the case may be).....

Linux screen resolution

Note: This also works for the graphics mode.


Do this at your own risk as I will not be responsible for any issues:

One of the biggest complaints I get is the text screen is too small. I generally agree. More recent computers actually have the ability to use a higher resolution, but do not take advantage of it in the default mode. This article is for more advanced users. Please get help before starting this project if you are at least the little bit. unsure.

You will need to have the documentation for both your video card and for your monitor. You will see numbers like 640x48 800x600 1024x768. Take those numbers and use the lower of the two from the video card and the monitor settings. If you can only use 640x400 then stop here. The 640x400 is the default. There is a 320x200, but I have not see that in years,

In my case the highest resolution for the monitor was 800x600. Still a boost over the default 640x400 screen.

Lastly you need to find out what your linux system uses to boot, Lilo(we will not consider it), Grub (aka Grub1) or Grub 2.

For our purposes we will be using Grub 2 for the images. Pictures at this point, are the original screen shots.

--------------------------------------------------------

Grub 1:

This is the easiest setup. as you only have to edit one file and then reboot.

$ sudo vim /boot/grub/menu.lst

or if you do not have vim

$ sudo nano  /boot/grub/menu.lst'


# (0) Arch Linux
title  Arch Linux
root   (hd2,2)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/1069fde9-8696-49a8-bbec-b8f35458f4d9 ro
initrd /boot/kernel26.img


We need to choose the number for our monitor and graphics card. we need to look at the table to get a number that linux understands. We are just going to use the 256 line as colors are not critical for our test setup. In our case it is 800x600, so we would use 0x303.


640x480 800x600 1024x768 1280x1024
256 0x301 0x303 0x305 0x307
32k 0x310 0x313 0x316 0x319
64k 0x311 0x314 0x317 0x31A
16M 0x312 0x315 0x318 0x31B

You will need to translate the hexadecimal numbers to decimal. Using a search engine can convert it for you. We need to append vga=771 to the kernel line.

# (0) Arch Linux
title  Arch Linux
root   (hd2,2)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/1069fde9-8696-49a8-bbec-b8f35458f4d9 ro vga=771
initrd /boot/kernel26.img

Check you woirk. Some times it might be a good idea to copy the original lines, so in case the numbers do not work you can always still get into the system.

# (0) Arch Linux
title  Arch Linux
root   (hd2,2)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/1069fde9-8696-49a8-bbec-b8f35458f4d9 ro vga=774
initrd /boot/kernel26.img
# (1) Arch Linux
title  Arch Linux default resolution
root   (hd2,2)
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/1069fde9-8696-49a8-bbec-b8f35458f4d9 ro
initrd /boot/kernel26.img

Check your work, save your work, and reboot. You should not ge able to do the new resolution.
---------------------------------

Grub2

Grub2 is a little more complicated and you need to be extra careful.

First we need to edit the /etc/default/grub file. At least you no longer have to do the hex conversion.

$ sudo vim /etc/default/grub go down to this part of the file and add GRUB_GFXMODE=800x600 leaving the original line as is.

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
GRUB_GFXMODE=800x600

Save that. Now we need to edit /etc/grub.d/00_header

$ sudo vim /etc/grub.d/00_header

Go down where it says: set gfxmode=1280x800 and on the very next line put set gfxpayload=keep.
 My file looked a bit different, but just ignore it and just add the one line.

set gfxmode=1280x800
set gfxpayload=keep
insmod gfxterm
insmod vbe


Mine:
if loadfont `make_system_path_relative_to_its_root "${GRUB_FONT_PATH}"` ; then
  set gfxmode=${GRUB_GFXMODE}
  set gfxpayload=keep
  load_video
  insmod gfxterm
fi


Save your work. Now the files are edited we need to tell the system of the changes.

$ sudo update-grub

IGenerating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-5-686
Found initrd image: /boot/initrd.img-2.6.32-5-686
done
$ _

If there are no error messages, you should be ready to reboot.
$ sudo reboot

---------------------------------------------------------------------------------------


Like almost getting a new monitor for free. Even the spreadsheet had 10 additional lines to work with. If we were able to go to 1024x768, you would really see the difference!!!  Most monitors but not all will easily do that and better if your video card supports it.  Good luck!