Posts

Showing posts from September, 2015

Trs-80 Nostalgia.

Image
Miss the good old trs-80 III. So do I even thought about trying to find a used one but this emulator popped up and is just the ticket. You will need to create an html file that will start the whole process up. TRS-80.html [code] <!DOCTYPE html> <html> <head> <script type="text/javascript" src="trsemu-1.4.js"></script> <head> <body onload="trsEmu.screen('scrn').button('btn').perf('graph').focus();"> <div id="scrn"> <canvas width="512" height="384" style="background:black"> </canvas></div><br> <div id="graph"> <canvas width="512" height="100" style="background:black"> </canvas></div><br> <input type="button"id="btn" value="Run" onClick="trsEmu.run('toggle');"> <input type="button...

Talk to me.

Image
 Computers are robots without arm or legs. You may want to read this first. http://www.instructables.com/id/Text-to-speech-with-linux/  You may also want to setup automatic login into C1 and C2. i.e. On C3: $ ssh-keygen -t rsa If .ssh directory is already setup and security is not a real issue just press return at all the prompts. $ cd .ssh $ scp .ssh./id_rsa.pub C1:~/. $ scp .ssh./id_rsa.pub C2:~/. If you have rights on C1 and C2, For C1 and C2: You will want to log into them and add the .pub file to the  authorized_keys file. $ cd .ssh $ cat ../id_rsa.pub > authorized_keys Now you can login easily or send commands remotely without having to type in passwords for C3. You could login into C2 and C1 and type the command: $ echo this is a test | festival --tts And you would hear This is  a test from the speakers assuming are turned on and the volume was loud enough. But we might not want to log into C2 or C1 so that To test the speake...

Times are a changing.

Image
Try this at your own risk!! Do not try this while the power supply is connected or plugged in. http://www.instructables.com/id/Atx-to-At-ps-test-cable/ One of the biggest changes from the old Pentium one computer to the newer personal computers is the internal power supply connector. This was a challenge for me as I wanted a dc-dc power supply for my "AT" based robot but they only readily come in atx fornat. AT connector: ATX connector: Unfortunately at the time I needed a converter there was not one made commercially I could find.  You could make a sort of Rube/Goldberg pc power supply something like this: Just did not want to go to that much trouble. So I wonder if an Atx ps would work at least for testing.  Got out the manual for the atx ps I had and started comparing notes. AT: ATX:  Possible connections: Looks like it might work, so I made a crude cable. That evolved into the who connection: Fortunately it worked! ...

Simple web server management script.

Image
Not so long ago while  searching the web for certain cgi scripts found ths very short script in the wayback machine. Apparently the author no longer had the page, The script was twenty lines if that. The script did not seem like that much at first, but then I started adding code. You could even add other scripts to allow itself to be more powerful. The script became more and more useful. Did not fancy it up with advanced html, but it was so useful, put it on all the major servers.  An older version of the web page looks something like this: One of the features I integrated into script was to see what ipaddresses were live on the network. That may not mean so much but if you are on a tablet, that is not and easy thing to do usually. That way you could see if there were any trespassers so to speak. Pretty much know what the usual ip addresses are. If one was missing that meant a device was either down or not connected  A cute feature. If you want to experiment ...

Install once, use many.

Image
With the internet you can access so many applications say a cooking program to help you prepare meals. The network configuration is pretty simple. It might look something like this: But then you can actually set up your own home web server and the network might look something like this. I have separated the web paths from the internet and the local web server  to make things a little clearer. Now that means you could have even more interesting web applications such as a web desktop. Some with a tablet could still generate documents without having any special applications on the tablet. You even set up many other applications without having to use the web. ( http://www.instructables.com/id/Uses-for-your-own-private-cloud/ ) So now you have double the pleasure. But what if your internet was cut off or you needed to limit your bandwidth. The the network might look something like this, but you would still have access to your local server. This is sometimes kno...

Admin hint.

Image
#1 Admin hint for the day. Keep a list of mac addresses for the network interfaces., Reason I say this is that people will invariably want to use their own equipment on your network i .e. using your bandwidth among other things. Usually if you only use a standard type of network interface, you can go to the dhcp server and see the nonstandard nic mac address stick out like a sore thumb allowing you to pursue the matter further. If there are no oddball mac addresses, you can also compare all network connects against the existing database. If a nic mac address does not match, your off to investigate. You could exclude the non-standard interfaces, but on a public network that is not always practical. If something nefarious was definitely going on, we would shut down the port at the switch. But then they would know you are on to them. Takes judgment. #2 #Microsoft #Windows   Have seen several articles about ow MSAdmins are balking about hav...

Server upgrades.

Image
Upgrading the operating system on your home machine is a piece of cake compared to doing it in the server environment, Generally when you care changing a server os, you use a new systems so that if there are issues you can go back to the old system as a failsafe. There are always issues setup up new operating systems especially with hardware drivers, so dealing with that can be fun. When you set up a new system the storage formats are completely different.   Some applications will balk at that, In some cases it could be just a permissions problem. Also network printers and input devices have to be set up. Remembering once when we went from Novell to NT printing out student invoices did not work or barely worked. The consulting company said it worked when they tested it, but never really did a mass testing. We ended up pooling printers to make things work well enough till a better fix was done. To add to that scenario, you have to make sure the general permissions of fi...

Command line search.

Image
  ______ _ _ ______ _______ ______ _______ _ _ _ / _____)(_) (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_) ( (____ _ _ _____) ) _____ _____) ) _______ _ _ _ \____ \ | | | || __ / | ___) | __ / | ___ || || || | _____) )| |___| || | \ \ | | | | \ \ | | | || || || | (______/ \_____/ |_| |_||_| |_| |_||_| |_| \_____/ Surfraw - Shell Users' Revolutionary Front Rage Against the Web Have done a lot of web page scraping, but never was aware of a tool called surfraw. What surfraw does is takes your browser with a command line argument of your search criteria and retreives everything via the command line. You do not have to load the browser, go to the search engine and enter in the search criteria. Saves a lot of keystrokes and the results can be easily manipulated. For example say you wanted to know in wikipedia about pregnancy. $ surfraw wikipedia what is ...

Command line spreadsheet.

Image
No matter what system you use or even if you do everything by hand, you will need a typewriter (editor), Filing cabinet (database), and an financial worksheet (spreadsheet). Everyone knows about vim, nano, and  for using as editor or word processor. If you have ever wanted to set up a filing cabinet or database, you probably have heard of Mysql (or one of the variants), Postgresql, or even Nosql. What many people have not heard of is a spreadsheet for the command line.One interesting spreadsheet is called simply enough called sc. Some people may lead you to believe it will only support just numbers that is not true. You can even get a help file with: $ scqref > sc_commands ... ...  A:   This overview  B:   Toggle Options  C:   Set Options  D:   Cursor movement commands  E:   Cell entry and editing commands  F:   Line Editing  G:   File comm...

Software Clock

Image
Compile the following code in the qb45 or freebasic compiler.  (c:\>fbc -lang qb clock.bas). Porting to C should be a piece of cake. [code]  '===================================================================== ' thetimeis ' author: computothought '--------------------------------------------------------------------- ' housekeeping ' arrays dim blank$(7) dim num$(10,10) dim colon$(7) ' data num$(0, 1) = "  ###  " num$(0, 2) = " #   # " num$(0, 3) = "# #   #" num$(0, 4) = "#  #  #" num$(0, 5) = "#   # #" num$(0, 6) = " #   # " num$(0, 7) = "  ###  " num$(1, 1) = "   #   " num$(1, 2) = "  ##   " num$(1, 3) = " # #   " num$(1, 4) = "   #   " num$(1, 5) = "   #   " num$(1, 6) = "   #   " num$(1, 7) = " ##### " num$(2, 1) = " ##### " num$(2, 2) = "#     ...

Check a server status.

Image
(Updated with correct code. copied wrong code!) Ever wanted to quickly whether a web server is up without going to the web page. Here is a quickie static cgi-bin script to do that. You can even check not only on local servers but most any web server on the net. The lines that do not have an ip address are virtual hosts from the last mentioned IP address. You will need to refresh the page to get the latest status. The code is written in PHP, so PHP will need to be installed as well as the cgi-bin directory enabled. Most lamp servers have this already setup. There are probably better scripts but this one was quick and dirty. )corrected) [code]  <html> <body> <hr> <center> <h2> Web Server status </h2> </center> <hr> <br /> <table border="1" cellpadding="10"> <tr> <td> Ipaddress </td> <td> Site (and link) </td> <td> Description </td> ...

Chmod me.

Image
Admin hint of the day: Understanding permissions on linux at first can be unsettling. There are several applications that you can access on-line to make it easier. If you have your own server, you can setup the application there and not be dependent on the net. For more information see: http://catcode.com/teachmod/

Scores without the scraping.

Image
Went to run the nfl score scraper and notice that if did not run anymore.   Found a web page that pretty much does it for you. So you can get the scores from the command line.  links2 -dump "http://scoresline.com/scores.asp?Date=9/13/2015&F=NFL"

linux CPU info.

Image
  CPU hardware information The cpu information includes details about the processor, like the architecture, vendor name, model, number of cores, speed of each core etc. There are quite a few commands on linux to get those details about the cpu hardware, and here is a brief about some of the commands. 1. /proc/cpuinfo The /proc/cpuinfo file contains details about individual cpu cores. Output its contents with less or cat. $ less /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 23 model name : Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz stepping : 10 microcode : 0xa07 cpu MHz : 1998.000 cache size : 2048 KB physical id : 0 siblings : 4 core id : 0 cpu cores : 4 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge ...

Beginning graphing

Image
One of the simplest graphs I have seen can be done in bash. You will need a data file and a one line executable to extract the data from the file and then display it. data: Irene     10 Karen     37 Andreas   41 Beatrice  23 Code: SCALE=1; WIDTHL=10; WIDTHR=60; BAR="12345678"; BAR="${BAR//?/==========}"; while read LEFT RIGHT rest ; do RIGHT=$((RIGHT/SCALE)); printf "%${WIDTHL}s: %-${WIDTHR}s\n" "${LEFT:0:$WIDTHL}" "|${BAR:0:$RIGHT}*"; done < data Result:    Irene: |==========*                                                  Karen: |=====================================*                ...