Posts

Showing posts from November, 2015

Bash animations

Image
Animations in various languages. 1. The donut. $ gcc -lm donut.c -o donut [code]            k;double sin()          ,cos();main(){float A=        0,B=0,i,j,z[1760];char b[      1760];printf("\x1b[2J");for(;;   ){memset(b,32,1760);memset(z,0,7040)   ;for(j=0;6.28>j;j+=0.07)for(i=0;6.28  >i;i+=0.02){float c=sin(i),d=cos(j),e=  sin(A),f=sin(j),g=cos(A),h=d+2,D=1/(c*  h*e+f*g+5),l=cos      (i),m=cos(B),n=s\ in(B),t=c*h*g-f*        e;int x=40+30*D* (l*h*m-t*n),y=            12+15*D*(l*h*n +t*m),o=x+80*y,          N=8*((f*e-c*d*g  )*m-c*d*e-f*g-l        *d*n);if(22>y&&  y>0&&x>0&&80>x&&D>z[o]){z[o]=D;;;b[o]=  ".,-~:;=!*#$@"[N>0?N:0];}}/*#****!!-*/   printf("\x1b[H");for(k=0;1761>k;k++)    putchar(k%80?b[k]:10);A+=0.04;B+=      0.02;}}/*****####*******!!=;:~        ~::==!!!**********!!!==::-          .,~~;;;========;;;:~-.              ..,--------,*/ [/code] Other int

Slide rule

Image
You can make your own temporary slide rule that should somewhat accurate using very simple parts. (not drawn to scale). Styrofoam board. Glue. Clear plastic. Tape. To get some templates: $ wget http://sliderulemuseum.com/REF/scales/SR_scales.zip That need to be cut apart for the sections.  The bottom section is for the backside of the center section, Add labels. Or to put it together. Slider.  Slide rule tutorial: http://sliderulemuseum.com/SR_Course.htm

Clear tv?

Image
Noticed the Cleartv has changed antennas. The original antenna was not received very well and had some scathing reviews. Plus the specifications were easily attainable.   We made our our own version.  http://www.instructables.com/id/ClearTV-antenna-lookalike/   Now I have noticed they have come up wigh a new antenna and the pictures are blurred with no specific technical details in the advertisements. Wondering why that is? If I get a chance to duplicate it I will let you know. Could it be?

Dumb terminal to thin client.

Image
Years ago there real was not a terminal that you could cozy up to to do your computing. In the beginning  there was a punch card machine. You would type in your data, your program in to 80 column punch cards. On this cards you would also have to number them. If the cards went into a pile, there would be an unpleasant experience reorganizing them. Used one of these for writing programs in Fortran. Eventually systems came with enough storage, that you did not need to carry the punch cards and you could print out what you keyed in and the results of what you were working on with the printing terminal. Finance company I worked for had one of thes that connected to an acoustical modem contract the credit bureau.. The finally we get a crt soft of like a tv with a keyboard.  Worked much like the printing terminal. You could even edit what you were working on in real time. Saved a lot of paper. You can not see it very well but the text was in green. Used one of these at a real

Ordering from the menu.

Image
Web pages with menus are sure easy to navigate. In fact, I like all the base menus in one place so that you do not have to go though a maze to get what you want. The menus are just one part of the page, so let's zoom in and see that we are looking at. The menu takes up minimal space, but expanding a pull-downs make it easy to manage. Wrote this years ago so I am sure there are much better ways to do it now, but it still works for me on a private server. The menu is pretty much a large table comprised of sections having each option menu. [code] < td > < form name =" jump1 "> < select name =" menu1 " onchange =" top.location=document.jump1.menu1.options[document.jump1.menu1 ... <!-- option value="../flatpress">Flatpress</option> <option value="../wiki">Mediawiki</option> --> < option value =" ../wordpress ">Wordpress</ option > < option value ="

It's web time.

Image
Ever wonder what would be like to have a local web app for the time without having to connect to some far off unknown place with who knows what hidden features. Now you can have local clock time on your server   <code> <table border = 2 > < tr > < td > < script > var mydate=new Date() var year=mydate.getYear() if (year < 1000) year+=1900 var day=mydate.getDay() var month=mydate.getMonth() var daym=mydate.getDate() if (daym<10) daym="0"+daym var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December") document.write("<small><font color='000000' face=

Open for business?

Image
This is two scripts one to find and record machines on the system at the time and the second script is to find open ports on those systems below 1024. alive.sh [code] #!/bin/bash rm /tmp/goodips is_alive_ping() {   ping -c 1 $1 > /dev/null   [ $? -eq 0 ] && echo $i >> /tmp/goodips } for i in 192.168.1.{1..255} do is_alive_ping $i & disown done [/code] /tmp/goodips 192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4 Now the second script. scannet.sh [code] datafile="/tmp/goodips" a=1 m="not done" while read line do fdata[$a]=$line echo echo $line        let a=a+1        for p in {1..1023};        do        (echo >/dev/tcp/$line/$p) >/dev/null 2>&1 && echo "$p open"        done done < $datafile [/code] results: 192.168.1.1 23 open 53 open 80 open 192.168.1.2 22 open 23 open 25 open 80 open 111 open 443 open 465 open 587 open 192.168.1.3 21 open 80 open

Another Tuxpaint hint.

Image
Using two or more programs together can make a system more powerful. In this case we want to use Tuxpaint and the Gimp.  We will start off using Tuxpaint to make a picture and then take a screen shot just of the drawing. The let's import a picture we have downloaded and use Tuxpaint to edit it and then of course to take a screen shot of that. Then we need a screen shot that was made a while back. The we need to open up the Gimp and set up a new page several times larger than the pictures and then import the three pictures. Then you can export that picture and import it into tuxpaint for final editing. So then you can use it in a web page like you blog or where ever

Secure yourself.

Image
Linux commandment: Thall shall not login remotely as root. If your a good linux admin, you did this when you first set up the machine. $ cd /etc/ssh $ sudo vim sshd_config Change the line that says permit Root login to no /Roo in vim should find the line quickly # Authentication: LoginGraceTime 120 # PermitRootLogin yes PermitRootLogin no StrictModes yes Save and exit the file. Restart the service: $ sudo service ssh restart

The PCinoPi

Image
The PCinoPi available from many junk closets is not faster than a speeding bullet and  not faster than a speeding train but it can easily introduce you to computers and electronics. Will run Pitus Linux, Atomic Linux, Freedos (with Qbasic), among other operating systems right from the floppy drive. (Pictured is an i486 laptop) You can easily do digital control with it's legacy parallel port. Lighting led's is a cinch. Controlling  rocket launchers is another benefit.  Need to do analog input? With a few discrete parts you can even get analog values too. Say grabbing the temperature. If the vga port is new enough, you can even use I2C   Extra cable and interfacing not included but can be built with off the shelf parts. Vga ( http://www.instructables.com/id/Vga-breakout-cable/ )   Rs232 ( http://www.instructables.com/id/DB9-serial-break-out-cable/ ) Parallel ( http://www.instructables.com/id/No-solder-parallel-port-break-out/ )

Tuxpaint cad?

Image
Tuxpaint can be good for drawing pictures, cartoons, and the like, but if we let it stretch it's muscles there is more that can be done. Maybe use it as a sort of drafting program. A drawing usually has at least four views. They are the front, side, top, and isometric (roughly translated at an angle).  If you needed a simple step stool, you certainly can make a drawing to reflect that. In this case you only have a partial isometric, but the point gets across. Maybe you could do a floor plan: A 3d object in 2d. Then all the rest.... Circuit design. Have fun.