Friday, April 27, 2012

Do it for the Kitty!

Technician hints.


iComputing hints or ideas.
Just some thoughts or suggestions I have put together. Just a few. more coming.
For more details see: http://www.instructables.com/id/Computing-hints-or-ideas/

Running a hosted computer in your browser.

What? You can not run a hosted computer in your browser. Actually you can now the virtual machines have advanced so much that instead of the output of the virtual machine just going to a window on your computer, it can be re-directed to a web browser.  So if you have software for your older obsolete machines, you can in a lot of cases still run that software. This is especially important for those old games you still can not put down.  One the web based machines we like to run is the good old Commodore 64.


So when the better half wants you to move onto new equipment, just let her know you need a web server for biz reasons. She does not have to know. Older computers are nice, but it would be even nicer if you could run multiple operating systems and be able to get to them from anywhere. Done. There are now several emulators that can run pc software such as Linux, BSD, and some of the proprietary operating systems.  A good example would be say at a kiosk where you obviously can not run your software. Just log into the web browser and point it towards your web server. Or you might be at a friends who only runs proprietary software, but you want to run Linux. Again, just get to your web browser.


You can even play with a command line linux in a browser at: http://bellard.org/jslinux/. This is great for teachers as they can expose students to the command line for linux compared to a mswindows command line without having to install or host linux. 



There are even some emulators that run on Java. You can find this on at: http://jpc.sourceforge.net/home_home.html. These are also great for schools to let students test other operating systems without having to install the software on machines. The only caveat is the disk space required for each student to be using their own disk image.



Anyway that is just a thumb nail of what you can do. As the descendants of Paladin might say: Have computer, will network......

Thursday, April 26, 2012

How hosting companies rake in the dough.

It seems amazing how hosting companies can have sites so cheap sometimes. Not knowing what goes on behind the scenes, you might think you have a whole computer just for your web site. It could be that way for more premium site rates. Amazon and all the major sites do two things. What they do is two fold. They use one set of hardware to set up what is known as virtual machines. One computer can emulate one or more additional machines. You do not have to purchase additional hardware to have another computer to set up a web site.  Almost like getting a computer for free.


The second thing they can do is have what is known as virtual hosts. That is you can run many websites with only one computer. So every time a hosting company signs up someone to use their equipment for having a web site, it is almost like free money as it does not cost them any additional money to host your site (unless their equipment is at full capacity). For example, we love to have virtual web hosting. You can set up websites for special purposes and be at their own special web address. For example, we are running all the following sites and more all on an old Intel now a Pentium III computer (on a private network).







Amazing is it not. What a cost savings and ROI (Return on investment). Before some web host wants to charge you an arm and a leg to host your site, ask them what you are really getting for your money.


Put that old PPC Mac back to work.

Does Apple no longer want to support your good old Apple Macintosh? The machine is still good, but it pretty much sits in the corner?  Well if you are open to new options, you can put that old system back to work with more up to date software than the old OS/X. Enter Mint PPC which is a linux distribution. Linux is a cousin to the BSD operating system that OS/X is based on. You can get native BSD for the ppc mac also.  Very user friendly, though you might have to learn at least a little bit new. You can even update the desktop so it looks like the traditional desktop. Had some old Macs myself that have since gone to a better place. I ran Ubuntu and Debian Linux on G3's quite well. In fact, you can get what is known as a live cd and try Linux without even installing it. Check it out!




For more information see:
http://mintppc.org/
http://www.debian.org/ports/powerpc/
https://fedoraproject.org/wiki/Architectures/PowerPC
https://wiki.ubuntu.com/PowerPC

Tuesday, April 24, 2012

Weather radar in ascii.

Once in a while I sort of come up with a neat idea. At least it is to me. Just because you have an old system, does not mean you can not teach it new tricks. Done a lot of page scraping to get weather details, but it would be nice to use radar screens from the command line. So details in this case are not so necessary. The overall view of the weather to see what kinds of weather fronts are approaching is.

Here we go. We need to collect some historical data (i.e. radar screens). You can get these from the radar.weather.gov using the 3 letter designation for the area you are interested in. For example, I believe the Dallas Fort Worth area is supposed to be FWS. You do not have to collect data just for your area. Collect data for several areas and get an overview of the weather all around.

(http://www.leonardsguide.com/us-airport-codes.shtml)

You need to collect data. Cron is the perfect tool for the job. We need to create a batch file that will collect the pictures using cron. You will need to find the three letter designation of your area. You can get that from the national weather service. Note we put d.sh in the bin directory because it is in the executable directory path.

d.sh:

Code:
DAY=$(date +"%m%d%y%H%M%S")
# picfn="pic$DAY.png"
# echo $picfn
wget http://radar.weather.gov/ridge/Thumbs/FWS.png -O fws$DAY.png
*/1 * * * * /home/eddie/bin/d.sh

We will set it to grab a picture once a minute. AT most once a hour is fine unless you know you have inclement weather coming. Set the collection at 1 per minute for our example. That will fill up a hard drive quickly so be careful.

$ chmod +x d.sh

$ crontab -e to add d.sh to your cronfile.

You should be collecting radar images once you have that set up. We are beginning to collect a few pictures. Now we need to convert the picture(s) to a text file.

Convert.sh:
Code:
for g  in fws*.png
do
echo $g
img2txt -W 80 -f utf8 img2txt -W  80 -H 25 utf8 $g > $g.txt
done
Note: We used img2txt -W 80 -f utf8 img2txt -W 160 -H 60 utf8 $g > $g.txt

$ chmod +x convert.sh

$ ./convert.sh

You see the file names to be converted on the screen as they are processed. Then you should be able to to list the generated text.files.

$ ls fws*.txt

We could examine each txt file to see what the weather was at the moment, but that is time consuming. Better to have sort of a page flipping to see how the weather was over time. So far so good. Now we need to create a batch file to show the animation. This is also a good start to a text based slide show.

show.sh:
Code:
for g  in fws*.txt
do
tput cup 0 0
 cat $g
done
$ chmod +x show.sh

$ ./show.sh

Watch the show. If there is not much weather change or you have only collected a few frames, you not see the whiz boom you might want to. Definitely try it when a storm is coming your way (if it is safe to do so!!)

Sunday, April 22, 2012

Thinking twice about using the cloud.

After the Megaupload incident (https://www.eff.org/deeplinks/2012/04/court-orders-megaupload-parties-come-plan), it makes me wonder whether I want to use the cloud. Innocent users with their files not available is making that a real mess.

You can easily set up a server on a system such as an old computer for your home network or you can get some of the turnkey nas'es (networked addressed storage or network hard drive that have a server built in). Some of them even support what is know as the (M/L/W)amp stack. If you have one of these units there are a few starter programs that can make access to your personal media very easy.

For  pictures, you might use Gallery2 (gallery2.org). Some network hardrives come with this software now.  It is what we use to store pictures and makes it real easy to access them with just a web browser.


If you want to easily access your media then try xbmc (xbmc.org) which is available for the major platforms and does not need a web server to work.



For the web server there are a host of programs to look at such as Jinsora, Plex, Mediatomb and etc.


If you just want to server only music, you might want to consider MT-daapd also known as Firefly (will run without a web server).  Most itunes compatible devices should connect to it.

You can even set up your own private blog and include media. Wordpress (www.wordpress.org) is probably one of the more popular ones.


The home web server is the next home appliance in my opinion. Have been using one for quite a few years. (http://www.instructables.com/id/Uses-for-your-own-private-cloud/)


 Gave you just enough to whet your appetite.

How to Start a Neighborhood Intranet.

Traditionally, neighborhood intranet was called guerilla networking (not to be confused with guerilla marketing). Known people that have done this for years. My personal feeling is that you not connect it to the real internet. If you want to connect to the internet, have a separate network. All of it is easy to set up, but there is a minefield of legal issues. Caveat Emptor.

http://www.ehow.com/how_2070419_start-neighborhood-intranet.html
 http://www.meetdageeks.com/2012/02/your-own-intranet.html

Friday, April 20, 2012

Cutting cable the cord - additional options.



If you were lucky enough to get the free coupons for the free dtv converters, you could still use your analog TV for watching television. In fact, we use the dtv converter with a dvd player in the man-cave. (http://www.instructables.com/id/Extra-TV-setup/) We get about sixty stations, but only use about twenty of them. You will get the traditional major TV networks for free. Ironically, more and more cable is coming back to over the air TV in one form or another. See your favorite Food TV chefs on "The Chew".


Also cut the cord, but we went in a different direction. We use OTA (Over-the-air) HDTV. (Works best in large metropolitan areas). Actually, most television stations still transmit the old fashion way. You can not use the old fashion tv tuner, but again you can use the dtv converter with an old fashion TV antenna. You do not need to use a special HDTV antenna. Marketing hype for an existing TV antenna. You can also make your own for almost free. You can find some of them here: http://www.instructables.com/id/Antennas-TV-Wifi-and-etc/


And you get pretty good reception for the lower channels. Use a real TV instead of what we have shown here. Most newer TV's have a built in Digital TV tuner, so you do not need the DTV converter.


Then again, you could splurge and get a FTA (free to air) satellite dish setup and the system should pay for it self in a year. I bought some dss type stuff hoping to convert it for this type of use, but no can do. You need special equipment. Have some spare electronic parts now. You can go to   http://www.ftalist.com/index.php to get more information about it.



Since the traditional tuners in vcr's are worthless for the most part, you can only record a set channel. You will want to look at other options. The new way is to use a dvr (digital video recorder). You can get standalone units that are pretty much have replaced the traditional vcr. There are many companies that sell these type of units.  http://www.hauppauge.com/site/products/data_hdpvr.html You can go one step farther and use a computer to act as a dvr. MSWindows media center and Linux MythTV are among the leaders.  They also make it easy to add home automation control features.  We use MythTV.  http://www.instructables.com/id/Setting-up-a-computer-based-DVR-with-Mythtv-for-l/




If you use a computer, you probably have a network and will want to stream or send live media content plus your saved recordings to your media players. You can also use your existing internet connection to stream media to your local media players. You can obviously use your existing computers with special software such as XMBC which is available for the major platforms (http://xbmc.org/) either as an application or run from a live cd.



You can also use standalone media players from  Boxee (originally based on xmbc), Netflix, Sony, Tivo, Netgear, Roku and a host of others.


Lastly, the traditional remote control is now bowing out to the touchpad applications. We like to use the Chumby while sitting in bed to control the MythTV setup. 


It's your move.

 Update: more and more websites are also trying to get on the cord cutter bandwagon. (i.e.  http://gigaom.com/video/roku-tips-cord-cutters/)

Cutting the Cable Cord - Will Comcast and Direct TV be the next Blockbuster?

As services such as Netflix and Hulu plus get better and better will more and more people cut the cable cord and save money? It is starting... Cord Cutting is Real: 1 Million TV Subscribers Lost to Streaming Services.

I am really tired of paying close to $50 a month for cable. If I can use a local HD antenna and see my other favorite shows on Netflix and Hulu plus for about $20 a month instead of $50... that's a $360 a year I am saving. The technology and bandwidth are in place to get your favorite shows via your network connection. It is only a matter of time until the cable company monopoly is broken. Blockbusters had its business plan ripped out from under them by advancing technology. The result: Bankruptcy. Actually driving somewhere to get a DVD? Redbox? You've got to be kidding.

The cable companies are facing the same specter in the face. DirectTV, you REALLY expect me to pay you $4.99 to watch a movie on demand when Amazon has it for less? Competition is good!

Remember when people actually paid to get the news delivered to their house each morning? Delivered Newspapers, Driving to rent movies, paying for channels you NEVER watch, and other Horse and buggy stuff are all going to go away. If cable TV does not adapt, they will be swept away by the new reality that our technology allows.

Thursday, April 19, 2012

How to Beat a Patent Troll

Drew Curtis, founder of fark.com: Drew Curtis: How I beat a patent troll

Best quote: "Don't negotiate with terrorists."

If you have 6 minutes, watch this video....

Wednesday, April 18, 2012

Commanding again.

Odds and ends:


#Date and time
$ date +"Date: %m/%d/%y Time: %H:%M:%S"
Date: 09/17/14 Time: 08:34:28

Format a usb stick:
$ sudo umount /dev/sdb1
$ sudo mkdosfs -F 32 -I /dev/sdb1

#Quick way to stop a misbehaving program.
format: pkill progname

$ pkill firefox

#Get a file from youtube:
format youtube-dl url -flv

$ youtube-dl https://www.youtube.com/watch?v=UenUUP2GM4g&list=UUa88-y7odLz96HGE4bI41Lg

#Extract a file directly to a web directory from another host.
$ sudo tar username@host::/home/username/diroffile/filename.tar


From HPR:

#Strip the audio of a video.
$ ffmpeg -i glue.flv glue.mp3

# Possible pretty output file, but takes up extra space.
$ ffmpeg -i glue.flv -target ntsc-dvd output.mpg

# original install
ls -l /var/log/installer
# uptime
uptime
# Quicknote
cat > filename <<EOF
# Quick append
cat >> filename <<EOF

#Gif to avi
convert test.gif old%02d.jpg
ffmpeg -r 25 -i old%02d.jpg -y -an new.avi

# Strip music
mplayer -ao pcm:fast:file=batmanpiano.mp3 -vo null -vc null Batmanpiano.flv


——————————————————

We will be doing some interfacing with a bike.




Get ready for some freebasic goodness.

————————————————

Arduino:
The one from Radio Shack is socketed.
The one from Osepp (at Fry’s) is not.

————————————————




Just a few links for gaming:

Gaming:

Mineos – (Minecraft) http://en.sourceforge.jp/projects/sfnet_mineosplus/
Live gamers – http://live.linux-gamers.net/
Gamedrift – http://gamedrift.org/ ($$$)
Sabayon Linux (gaming edition) – http://www.sabayon.org/
Zorin OS Gaming edition. http://www.zorin-os.com/

———-
Game serving: http://www.dragonbe.be/

Tuesday, April 17, 2012

Good old text adventures.


Decided I wanted to play good old Zork. Went looking for where to get the games. Whoopie, they are free now! Used to be you would have a install a program for each version of the story. They now have what is called a zmachine, so that all you have to do is load in the stories for each of the games as you want to play them.    So I downloaded several games including hitchhiker's guide to the galaxy.  Mmm goodness!

http://www.instructables.com/id/Play-Zork-and-other-zmachine-files-on-Linux/




Having been a system administrator for many years installing client/server applications, "What else can I do?", came to mind. Then I thought about it, Do I need to download a zmachine for all the systems. Is there a better way especially for touchpads? And there is. Found Zplet for use on a web server. Installed it, some stories, and a little html to put it all together. Even more goodness.

http://www.instructables.com/id/Installing-Zork-and-the-zmachine-on-your-web-serve/

Try it!

Top instructables.

www.instructables.com/member/computothought


General instructables.


Hacking Geeks.


Some links to instructables.



Some links to instructables: (www.instructables.com/member/computothought)

Web related:
http://www.instructables.com/id/Web-related/

Coathangers:
http://www.instructables.com/id/Coathanger-projects/

Data-mining:
http://www.instructables.com/id/Data-mining/

Electronic Guides:
http://www.instructables.com/id/Electronic-Guides/

M$
http://www.instructables.com/id/Microsoft-themed-instructables/

Linux
http://www.instructables.com/id/Linux-themed-instructables/

Antennas:
http://www.instructables.com/id/Antennas-TV-Wifi-and-etc/

Food:
 http://www.instructables.com/id/Our-food-instructables/

Thursday, April 12, 2012

Cut and paste.

Play pretend here for a second. You are a new accountant for a company and you  need to make a consolidated financial report of many units. (This example is way over simplified, but I think you will get the idea.) You need to get a report out, but you do not have time to re-enter figures, because all the units send their data in ascii or what is known as text files. How can we get the computer to compile the data so it can be easily entered into the spreadsheet?  Heres how!

A good prerequisite for this post is at: http://www.linuxintheshell.org/

Units one two and three send their data in, but they are in an ascii file. We want to convert them  so they can be easily converted for use in a spreadsheet.
From Unit 1 in unit1:
                       Unit 1
Income:        5000
Expenses    2000
Data from Unit  2 in unit2:
                      Unit 2
Income        45000
Expenses   46000
Data from Unit 3 in unit3:
                     Unit 3
Income       18000
Expenses  18000
Files should look something more like this:
Then after we cut the files they should look like this:
Lets create a program to compile the data. Nice thing about this is all we have to do to add units is use the same type file in the directory. No requirements to change the file. Warning it will kill the old cutitdata, so be sure and back all the files up and and delete ones you do not need. There is of course and easier way, but we will save that for later….
compiledata.sh
[code]
# Get data from unit files and create .CUT files.
for f in unit?
do
    newfile="$f.CUT"
    cut -c 12-25 $f > $newfile
done

# create tmpfile.
touch cutfile
rm cutfile
touch cutfile

#create Labels for the file.
echo " " > cutitfile
echo Income: >> cutitfile
echo Expenses >> cutitfile

# put it all together.
for g  in unit?.CUT
do
   paste --d , cutitfile  $g >> cutfile
   mv cutfile cutitfile
done

# uncomment the next line if you want to use sc
# psc -d , < cutitfile > Units.sc
[/code]

Make an executable file:
$ chmod +x  compiledata.sh

Run the program:
$./compiledata.sh
See the result file:
$ cat cutitfile
, Unit 1, Unit 2, Unit 3
Income:, 5000, 45000, 18000
Expenses, 2000, 46000, 18000
This is what is known as a comma delimited file which most spreadsheets can import easily.
Now we can use the spreadsheet to import the data.
Choose the file:
Using the comma splits out the cells like we want them.
Raw data:
After the window dressing.
`
If you want to stay completely command line, you can use the program called sc.
You will need to do a conversion though.
$ psc -d , < cutitfile > Units.sc
$ sc Units.sc

Wisp of an internet.

Had to stay at my brother's house last summer while the AC was being replaced. While there, he was kind enough to let me access his wifi. It was real easy. You just log in and your on-line. The neat part of it was you are blocked out of using the local area network. He uses a wireless router from that company in Cupertino, California. I wanted to have the same thing but did not want to spend one hundred plus dollars on a new router like he did.

Recently I purchased a used Cisco Linksys wrt-54g from the local Goodwill store specializing in computer stuff real cheap. Knew that you could upgrade the firmware with dd-wrt, openwrt, and a host of others. In fact, I think I had installed dd-wrt. Wanted more like what my brother has. After doing some research, I found some firmware. Known as CoovaAP, it is known is what is called a Wisp (wifi inTERnet service provider. Well I wanted it for our intranet (local area full service network without internet access). We have sort of our own mini cloud (web, media and etc.) servers. So it still is a Wisp (Wireless inTRAnet service provider. You can also set this software for a stand alone machine acting as a wireless access point.


Installed CoovaAP on the router and now it can be accessed within the range of the router. This is a great set up say for a school, church, or in a small town. More information at: http://www.coova.org/CoovaAP

One application I like to use installed on the web server is eyeOS (http://www.instructables.com/id/eyeOS/). It is sort of a gui driven web desktop that works perfectly with your touchpads, ipads, and or laptops. We use it with the Chumby.


We have lots of other applicatons also that can be accessed. i.e. http://www.instructables.com/id/Uses-for-your-own-private-cloud/.   Great for accessing the Garage POS.  Think I talked about setting up your own private intranet in an earlier post (http://www.meetdageeks.com/2012/02/your-own-intranet.html).  You can start from there!



Saturday, April 7, 2012

Monday, April 2, 2012

Back up your web site.

We have no trouble about backing up our personal computers. What do we do about what we have on-line? I found a fairly easy solution for one site called Blogger.com. Guess what it is?  That good old wget command. You could download a site with:

$ wget -c -r www.whateverthesitenameis.com

The command will recursively get all of the website it can and stay on top of getting the site till it is done. So then (if your computer supports long file names), you would have a directory called www.whateverthesitenameis.com. Cool.

You can also go to www.archive.org and have them back up your site. This is great for any site you do not want to lose.





Then I thought about it and wanted to go one step further. That is directly put the files on another local server so I could access them at will. Also did not want to interfere with the existing web pages. So we need an Apache web server that supports virtual hosts. On that server where you have administrative rights. You want to set up your web directory such as:

$ cd /var/www
$ sudo mkdir -p www.whateverthesitenameis.com/html

Then let’s get the files.

$ cd www.whateverthesitenameis.com/html
$ sudo wget -c -r www.whateverthesitenameis.com

Now we need to let the server know about the new site. We need to come up with a site name that is not either used on the web or one you can use with a viable dns address. Your network will probably use the net address first and not find your local site, use an unused url and put it in your local dns with the local servers ipaddress. Let’s substitute a new name such as www.mysitebackedup.com. We will need to make a file with that name on the apache server in the sites-available directory in the Apache2 file structure. i.e.

192.168.1.61 should be the ipaddress of the web site of your web server instead.

$ sudo nano /etc/apache2/sites-available/www.mysitebackedup.com

<VirtualHost 192.168.1.61:80>
ServerName www.mysitebackedup.com
ServerAlias www.mysitebackedup.com
ServerAdmin me@there.com
DocumentRoot /var/www/www.whateverthesitenameis.com/html
</VirtualHost>

Then you need to make a link to the that file in the sites enabled directory.

$ cd /etc/apache2/sites-enabled/
$ ln -s ../sites-available/www.mysitebackedup.com .

Then you need to restart the server to let it have the updates and the details of the new site.

$ sudo service apache2 restart

You should be able to reach your local site now if the local dns has been updated for the new site. I did have to disable "use proxy" in my Firefox to see the site.  Any time you need to update the site, just go back to the same directory and run the wget command again. Clear your web browser cache if you still have a problem.