Welcome to ~Pi's Blog
" >> /var/www/html/pi/locks.html
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).
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