Welcome to ~Pi's Blog
(Mostly content about/for TildeCow)

New user on the server? Visit our n00b page to get started.

31 Mar 19 - Can You Hear Me Now?
I'm using this script to test my ability to register whether my cell phone is in range or not.

27 Mar 19 - Ch Ch Ch Ch Chayngezz! To Locks Webpage
"Locks" is now a BASH script instead of a cron updated HTML page.

22 Mar 19 - Putting Together a Basic Weather Station
Nothing new to report on CowPi for me. I've been busy with another PiZw that is being moulded into a weather station. It reads Temp, Humididty and Pressure currently. At the moment it's only reading conditions in my work room. Once the weather breaks I'll figure a box to mount it in. It may be in storage till then, but in case it's up, you can see the RAW OUTPUT of the sensors. Below is a capture if I did decide to turn it off for a spell.
Current Conditions Screenshot

13 Mar 19 - Texting NOAA Weather to my Dumb Cell Phone
So the cron job that runs this script at 5AM, texts the day's weather to my very dumb cell phone. Sure, I'm online at about that time, but it's the PRINCIPAL of the thing that I can send the weather to my phone. The crontab command is ~/bin/text.weather | telnet mail.MYISP.com 25 Good Times!

9 Mar 19 - Monitoring Boats at Eisenhower Locks
So it's pretty neat to watch a cargo ship transit a lock on the St. Lawrence Seaway. Thing is, Without a smart phone, it isn't the easiest thing to get real-time info on traffic. This bash script renders an HTML page every 15 minutes thanks to a cron job. It steals data from the AIS Marine Traffic site and makes it simple. With images turned off, the page itself is a SUPER-low-bandwidth flat page. Here's the script that gets it all done.

7 Mar 19 - What Did I Name That Script?
Owing to the nature of the command line environment I tend to forget all the scripts I have written and use (yes, I'm old). So I wrote this nifty little bit of code to remind me. It's basically a directory lister that includes reminder text located in each script. And it was fun to make it colorful (easier readability was my excuse).
Bindex Output Screenshot

5 Mar 19 - Tossers Attempting root SSH
I threw a little script together to stop an ip from repeatedly trying to login to ssh as root with different password attempts. It's not standard and it's not perfect, but it will suffice for now. The script runs as a cron job a few times a day. God damned people sucking the fun out of everything.
THIS IS WHY WE CAN'T HAVE NICE THINGS!

1 Mar 19 - Monitoring Members' Disk Usage
Because TildeCow is such a small server I feel it will become important to have limits on members' disk usage as we grow into a community. I've set an arbitrary (yet considered) limit of 500M per member at this point. This simple script allows me to keep tabs on it without poking around members' data. See the alias below that allows me to do it with only the command $ udisk

1 Mar 19 - Loving BASH Aliases
In the ~ directory of every CowPi user there is (or can be) a special file called .bash_aliases which basically is a list the shell uses to substitute a specified string for some key word. I suppose this can have a number of uses but I rely on it mostly to shorten common but lengthy commands to a single word. Here is my current aliases file:

The last line cleverly reminds me of my defined aliases but, as was pointed out to me, it MUST be the last line or else every other alias below it would also be expanded and result in a mess!

27 Feb 19 - An interesting CLI application
Typing: telnet mapscii.me
Will serve up a full screen world map enviroment in text. Users can zoom in to see local details just like on Google Maps. The project is open source and can be launched from your local machine (no need to go through CowPi).

23 Feb 19 - ROVER Protocol - First Musings
ROVER exchanges data between users on federated systems. It's a play on FIDO (as in NET). Basically it's just a directory in the Apache HTML area. It contains a directory named for each machine that accesses it.
Example: System AspireOne accesses www.tildecow.com/rover/AspireOne/
See /var/www/html/rover/ABOUT.ROVER for latest info

20 Feb 19 - Latest Changes to Users' Files
NAME: latest - list recently changed user content
SYNOPSIS: latest -[days]
DESCRIPTION: The BASH script /bin/latest lists all user content having been changed in the last -days days in both /var/www and /home as well as their sub-directories.

19 Feb 19 - Search Member Content
NAME: search - list member files containing a search term
SYNOPSIS: search [expression]
DESCRIPTION: The BASH script /bin/search searches /home and /var/www/html recursively for files containing [expression] and outputs their names. It creates two temporary dot files: ~/.searches and ~/.nul which are rewritten at each call. It excludes dot files and dot directories.

18 Feb 19 - CowPi Webring
I would like to encourage all CowPi Members to add the following code to their index.html page. It implements a bog standard late 90s webring to move guests around the webspace. All you have to do is add this snipet and the BASH scripts will do the rest. Also feel free to change the look of the webring interface it is pretty bland.

Visit the bottom of my index.html page to see the finished product.

12 Feb 19 - Send me a message via the web
My index page now features a form allowing surfers to send a 144 character message to me. All messages are appended to ~pi/web.messages. I use cat to view them and nano to remove old messages. Here is the script.

10 Feb 19 - Visitors to the Apache server
So after a wee break I accomplished a new thing. The Apache2 server has a status page at http://localhost/srver-status that lists "who" is doing "what" on the server. (Much of the time it's a russian or korean or african site trying to access a number of predictable php and mysql exploits) I just thought it would be fun to see where all the traffic was coming from. The script at /home/pi/bin/served returns each unique country name for the visitors listed in server-status.

31 Jan 19 - Rolling Dice with a Bash CGI Script
Point your browser at rollthebones.html and try out this basic poly-dice rolling application. It uses the shell script located at /usr/lib/cgi-bin/wwwdice.sh

28 Jan 19 - Including "Special Chatacters" in your files
IBM Model 5150 was the original "PC" and when it rolled out in 1981 it included an ascii character set called code page 437 . The char set included the usual stuff (a..z etc) but also made room for symbols: Ω and borders: ╔ and more. You can use any of these on CowPi to dress up your screens. Here's an example: To make a √ hold down crtl+shift+u then release and type 221a then the space bar - and voila! Visit the Wikipedia link above to view the codes and the chars they produce.

27 Jan 19 - Append my latest blog post to www.tildecow.com/pi
The script ~pi/bin/post_project will show my latest post in ~pi/blog.html appended to the bottom of my CowPi WWW page. Examine the script. Also examine ~pi/blog.html to see how I mark out the segment to append. The process is transparent by making a crontab for the script.
UPDATE: This doesn't do this anymore (I killed the cron job) but the script is still there for reference.

26 Jan 19 - Rollin' Rollin' Rollin'
A Simple script that will 'roll' xdy dice and share the
results with another logged in user via the # write command.
Open it # nano /home/pi/bin/dice to read the expected syntax.

25 Jan 19 - Faking dynamic content under HTML 2.0
The script /home/pi/bin/update_apache adds the current date
to the bottom of /var/www/html/index.html It runs as a cron
job at 1AM local time and gives the illusion of dynamic
web content using only bash.

24 Jan 19 - Commandline tooting to Mastodon
Check out my script at /home/pi/bin/toot_users
It's set up as a cron job and reports the current
number of users on cowpi if =>2 several times a day.

21 Jan 19 - So ~CCH has a Forum,,, Kinda
It uses flat files to emulate basic message board functions.
Read about it. Just type # cat /home/forum/READ.ME | more

20 Jan 19 - Fancy a game of chess
If someone wants to start a game of chess with me,
check out /home/pi/chess_game in your text editor of choice.

20 Jan 19 - Display ANSI color options
How does your terminal app deal with 256 color ansi codes?
Run the script with $ /home/pi/bin/ansi256 to see how it works.
Then check out the guts in nano: $ nano /home/pi/bin/ansi256

11 Jan 19 - A fortune telling cow
I installed $ fortune and $ cowsay today.
Try them each out at the command line.
Then enter $ fortune | cowsay and watch the fun.

10 Jan 19 - So hot it's smokin'
Here's a simple bash script I made that will report the temperature
of the ARM processor on the cowpi server.
Run the script with $ /home/pi/bin/pi_temp to see how it works.
Then check out the guts in nano: $ nano /home/pi/bin/pi_temp