Category Archives: My Thoughts

Buddigar

Buddigar: Stable Confusion

Humor is the weapon of self-control.

Budgierigar
Budgierigar

While playing around with Stable Diffusion, I realized that I must have misspelled “Budgerigar” and was surprised to see the monstrous images that it generated. Perhaps I accidentally typed “Buddigar” or some other variation, resulting in the strange images below. Some of them resemble monsters, while others appear to be stores from a distant land outside of the USA.

These images fall into the uncanny valley of creepiness. For instance, I heard on a Lex Fridman podcast that image generators sometimes struggle with creating realistic facial expressions. It’s fascinating to observe what Stable Diffusion produces when prompted to generate an image of a person with a surprised expression. Although the results can be unsettling and bizarre, they’re also quite amusing, like this one….

OMG, a Buddigar!!!!!
OMG,I spot a Buddigar!!!!!

Buddigars

The first one is my favorite in terms of shock and awe.

Buddigar: It's like Golem's Pet.
Buddigar: It’s like Golem’s Pet.

Buddigar tale by ChatGPT (mostly, just with a bit of prompting and edits)

There is a mischievous creature named Buddigar. It’s small and furry, with sharp claws and bright, beady eyes that seemed to sparkle with mischief. Buddigar loves nothing more than causing trouble, and it has a talent for doing so in the most unexpected ways.

If you can’t find your keys, Buddigar is probably to blame. It has a habit of sneaking into people’s pockets and snatching whatever shiny object catches its eye. It wasn’t that Buddigar has any use for these trinkets – it simply enjoys hoarding them, like a dragon with its treasure.

And if your computer is running slow, you could bet that Buddigar had something to do with it. It has a knack for hiding files, moving icons, and generally wreaking havoc on any device it comes across. Even the most tech-savvy of users are no match for Buddigar’s cunning ways.

But Buddigar’s mischief isn’t limited to material possessions. It has a strange talent for causing physical ailments, too. If you have a pain in your hip, for instance, you could be sure that Buddigar has something to do with it. It’s not that Buddigar means to hurt anyone – it simply enjoys the chaos that its actions cause.

The funny thing is, Buddigar doesn’t try to hide its misdeeds. When caught in the act, it simply grunts and declares its mischievous intent proudly. “Buddigar!” it exclaims, with a mischievous twinkle in its eye. “Buddigar take keys! Buddigar slow computer! Buddigar make hip hurt!” And then it scampers away, leaving behind a trail of chaos and confusion.

Despite its mischievous nature, however, Buddigar is impossible to hate. There is just something endearing about its playful antics, and the way it seemed to revel in the chaos it caused. Even Gollum, the famously twisted and corrupted creature from Lord of the Rings, would have adored Buddigar’s mischievous ways. It is so ugly it’s almost gone full circle to cute in an uncanny way.

And so, Buddigar continues to roam the land, causing trouble wherever it goes. Some curse its name, while others simply laugh and shake their heads in amusement. But love it or hate it, there was no denying that Buddigar is one of a kind – a little creature with  a talent for mischief that it’s unmatched by any other.

 

More Buddigars…

red short bob haircut holding up a calendar sai-photographic

Calendar Tricks

Time is like dancing.

There are a few patterns in the modern calendar that can help you figure out days of the week through the year. I just happened to notice this first pattern once when looking at the calendar for the year closely.

2023 Calendar
2023

9 Months of the year “line up” in a pattern with them starting on the same day of the week. This means that there days line up together.

So if you know for example that September 25th is on a Monday, Christmas will be on Monday as well. It is a quick and easy calendar cheat.

In non-leap years:
– January and October start on the same day of the week.
– February, March, and November start on the same day of the week.
– April and July start on the same day of the week.
– September and December start on the same day of the week.

In leap years:
– January, April, and July start on the same day of the week.
– February and August start on the same day of the week.
– March and November start on the same day of the week.
– September and December start on the same day of the week.

This type of pattern can be useful for various purposes, such as planning and organizing events that need to occur on specific days of the week or identifying months with similar day-of-the-week characteristics.

Mentally Calculating the Day of the Week

Also the calendar can have a so called anchor day of the week that appears in a pattern and allows quick mental calculation of a day of the week. This anchor day will ‘move’ through the week from year to year, one day forward for non-leap and two days for leap years. For example the anchor day is Tuesday in 2023, so all the following days of the year will fall on a Tuesday. For 2024, being a leap year the lower dates all fall on a Thursday.

All of the following dates have the same day of the week. From these days that anchor the day of the week it is easy to mentally find the day for any date in the month. It is possible to remember that weeks go back 7 and work to the week and then just add or subtract to get to the date that you want to now the day of week for.

Non Leap 1/3, 2/28, 4/4, 5/9, 6/6, 7/11, 8/8, 9/5, 10/10, 11/7, 12/12

Leap 1/4, 2/29, 4/4, 5/9, 6/6, 7/11, 8/8, 9/5, 10/10, 11/7, 12/12

This trick works to help nail down a few holidays too.

July 4th being 1 week before 7/11, falls on that anchor day as well. Halloween too. Christmas and New Years, the day before.

Need to know what date is Labor Day, remember that 9/5 is an anchor day, so just work forward or backward from there.

https://www.timeanddate.com/date/doomsday-rule.html

Calendars also repeat

A helpful thing to know is that calendars repeat with a pattern. So it is possible to look back or forward in time to figure out what dates and days line up. This trick also would allow you to reuse calendars, even antique ones. I once saw this in a government office I visited, the person had an old calendar up on the wall that lined up right for the current year.

https://www.timeanddate.com/calendar/repeating.html

I worked a bit with ChatGPT to help me figure out the pattern. It took making it write some code examples, getting it wrong a bit, me explaining what is wrong and then then it was finally right. For me it was a good exercise in prompting it and getting it to nail the problem. I find it useful to have ChatGPT provide code examples as this makes a good ‘language’ within which I can communicate back and forth with it. It can be as simple as telling ti that the output is wrong and where it is wrong, up to a type of collaboration on the code.

I think it came up with a fair explanation which I have pasted in after the code snippet.

def find_years_with_same_calendar(base_year, num_years=10):
    years_with_same_calendar = []

    while len(years_with_same_calendar) < num_years:
        if is_same_calendar(base_year, 2023):
            years_with_same_calendar.append(base_year)
        base_year -= 1

    return years_with_same_calendar

def is_same_calendar(year1, year2):
    # Check if the days of the week for January 1st match in both years
    return day_of_week(year1, 1, 1) == day_of_week(year2, 1, 1)

def day_of_week(year, month, day):
    anchor_day = datetime.date(2023, 1, 1)
    target_day = datetime.date(year, month, day)
    delta = target_day - anchor_day
    days = delta.days
    return (days + 1) % 7

import datetime

# Example: Find 10 years with the same calendar as the year 2023
years_to_check = find_years_with_same_calendar(2023, num_years=10)
print(f"Years with the same calendar as 2023: {years_to_check}")

 

ChatGPT on Repeating Calendars

Certainly! The pattern you’ve described and that the corrected code now follows is based on finding years with the same calendar as a reference year (2023). This pattern is based on matching the day of the week for January 1st in various years to determine if they share the same calendar.

Here’s how the pattern works:

1. **Reference Year (2023)**: This is the year you’ve selected as your reference point.

2. **Matching the Day of the Week**: The pattern involves matching the day of the week for January 1st in other years with that of the reference year (2023).

3. **6-Year and 11-Year Cycles**: The pattern alternates between a 6-year cycle and an 11-year cycle. In the 6-year cycle, you go back in time by 6 years, and in the 11-year cycle, you go back by 11 years.

4. **Leap Year Influence**: Leap years, which occur every 4 years, can influence the pattern. When you encounter a leap year in the cycle, it might disrupt the alignment by adding an extra day (February 29). Therefore, you need to account for whether the year is a leap year to correctly match the pattern.

The pattern essentially finds years that, despite differences in their actual numerical values, share the same calendar in terms of the day of the week for January 1st. This pattern repeats as you move back in time, allowing you to identify years with the same calendar as your reference year.

For example, you can see that 2017 is 6 years before 2023, 1989 is 11 years before 2023, and 1961 is 11 years before 1989. The pattern repeats with adjustments for leap years and results in a sequence of years with the same calendar.

 

 

 

Penguin

guestbook.cgi

The best way to understand a thing is to try to comprehend it.

I ran John Callendar’s guestbook.cgi on one of my servers. It wasn’t a very popular location on the web and the guestbook did not get abused fortunately! It would be very easy for comment spammers, trollers and the like to have a field day with it.
One thing I did to keep an eye on it and see if it got posted to was a script in /etc/cron.weekly to check for updates of the guestbook. It was located on a Raspberry Pi running Raspberian.
The script requires that ssmtp or some mail program is installed.

guestbook-check.sh

#!/bin/bash

# Checks to see if the Guestbook has been written to in the past week.
 # Sends out notification if it has been written to.
 find /usr/lib/cgi-bin/guestbookrev.txt -mtime -7 -exec mail -s "Guestbook Updated" myemail@myisp.net \;

The trick is in the find command where the option -mtime -7 means check to see if the file have been has a modification time of less than 7 days, if so, then execute via the -exec option, whatever comes next on the command line until the \;

Subject line

The mail command mails only a subject line of “Guestbook Updated”. It would be possible to have something in the body and even “cat” the guestbook in to send it in the email.

Auto de Spam

If the guestbook got abused by a spammer or something nasty it might be possible to run a script that would periodically do a cleanup on the file via a search and replace. Using a list of blacklisted words to search on and then replace them with a null character or space.

Reverse Order in Guestbook

It is possible to flip the posts on the guestbook as well if you want them ordered in the opposite order, Last In On Top versus the default of First In On Top. This is done by using…

 pop @all_entries instead of shift @all_entries

…in the code.

More on CGI and Perl

If you are new to CGI and/or Perl scripts be sure to check out John Callender’s tutorial that covers the workings of guestbook.cgi.
guestbook.cgi

Secure computer on user side

Taking Control of Your Online Experience: The Case for Client-Side Content Filtering

I love technology. We love movies, we love television, we love technology.
We are a society where technology is used in an almost inhuman manner.

It appears that social media companies are implementing filters to regulate content, with the intention of creating a more suitable experience for consumers and curbing the dissemination of misinformation. However, the COVID-19 pandemic revealed a potential for bias, suppression, and censorship in this process. Such manipulation could also extend to political motives, where information might be skewed to suit a particular agenda.

Control should be on the users side

This raises the question: Why employ content filtering on the server side when it could be done on the client side? Could users have settings that allow them to customize content filtering based on their preferences? There are valid reasons for such an approach. Users may wish to filter out redundant, repetitive, or annoying content, similar to how ad blockers or spam filters function, but on a more sophisticated scale.

This concept could involve a machine learning component, perhaps utilizing a Bayesian filter. Users could prime it with specific keywords, examples of unwanted posts, and other content to be avoided. This filter would reside within the user’s computer, phone, or even as a browser plug-in. By processing the content at the browser level, the filter could operate effectively, unlike at the router level where encrypted content would be inaccessible. This client-side filter would work similarly to a firewall, analyzing and potentially blocking or redirecting content based on predefined criteria.

AI in the users toolbox

Considering concerns about AI alignment and safety, it’s important to note that the genie is already out of the bottle. Machine learning resources and knowledgeable individuals are widespread. Thus, rather than trying to rein in AI development, the focus should be on leveraging it to the user’s advantage. While organizations like OpenAI strive for responsible AI, and governments aim to establish their standards, consumers require a means to navigate through the information landscape. Users would also want to choose their own alignment rather than have a government or corporation choose it for them as a form of soft censorship.

Fake out the Fake News

This approach could even encompass traditional media, which sometimes appears to convey biased narratives. To address this, a client-side filter could be developed. The name for such a tool is open to discussion—whether it’s dubbed a firewall, content blocker, or a “BS Defender.” Regardless of its name, the need for a user-configurable, trainable, and adaptive filter is evident. This filter could operate through reinforcement learning via human preference selection and incorporate Bayesian adaptive learning.

Next Steps

For someone with coding experience spanning four decades, the framework for such a tool is already something that I can imagine on a high level and it could be done in a few different ways. Right now, I am still thinking on it. The potential exists for this idea to evolve into a comprehensive white paper. On the coding side, a proof of concept could be created, perhaps using Python, to showcase the core filtering concept in action. Sharing this concept for consideration and exploration is crucial in a time when content filtering, covering everything from traditional media to social media and ads, is becoming increasingly important. An adaptable and user-driven filter, bridging the gap between the browser and user experience, holds immense value.

Penguin

Linux-vs-Windows

The greatest gift of all to mankind is the friendship and understanding that which we have cultivated with each other and in cooperation.

Nice site Tim. A little backstory on how I found myself here. I found your site while looking up Phillip S. Callahan after reading about him in Dan Barber’s Book, The Third Plate. You have some interesting info on him as well as what I have seen so far on calendar discrepancies.Clocks, calendars, precision timekeeping are other interests of mine and I enjoyed those posts. After that I checked out your categories and that led me here to this post.

I will be speaking from personal experience with what I have experienced on my machines and others that I have worked on. There is a bit of a chronology to this as well.
Back when Windows started, I was a late adopter. I stayed in the command line, the DOS world, until Windows 95. It was out when I was in college and I briefly had Win3.1 until I could install 95 on the machine I had at that point. At the same time I was using the universities computers, a bank of Win95 PCs was located in a convenient computer lab. The Internet was really coming on hard and fast, so the inevitable occurred, the room was packed to the gills with students and there was a waiting line most of the time. But, there was another computer lab mostly for computer science majors, full of Sun Sparcs running UNIX, barely used at all. The room was cooler and quieter too, a bonus. This was when I got a feel for what a non Microsoft OS could be like. I would up learning it enough to use it with fair competency, a struggle at time to remember how to do something at times, but worth the effort to stick with it as it ran so smooth. I wondered if there was anything like this that I could load on a PC. A few years went by and I started to do this with Linux.
The first few machines I used Linux on were set up with dual boot. Red Hat/W98 and later Ubuntu/XP combos on two separate machines, one after the other in time. Setting up Red hat was a pain at the time and not for anyone that is not “good” with computers. Ubuntu was easy to set up, almost as easy as setting up Windows. But, it was much easy to work with than the earlier Red Hat 9.0 and that was the key. It was easy enough for my non-technical minded spouse to use, she was not lost in it in other words and could actually could use it without a lot of questions or frustration. On top of that the performance of both machines was hands down better with Linux. Things like time from a cold boot to the time you could click and open a program were faster. More programs could be run simultaneously without bogging the machine down. Moving around on the screen and opening files went faster as well. On Linux there was minimal weird behavior and very infrequent total lockups, requiring a reboot. There was no degradation either. What I mean is that it seems after having a Windows install running on a machine for years and then loading programs on it one after the other over time, it seems to get more unstable and flaky over time to the point that a fresh install is needed. This has gotten better at least with Win 8, I have noticed. On a machine that I had after the XP/Ubuntu, one was to be the last Windows machine. A Xeon machine (XP/Lubuntu) that had 1GB RAM, it was expensive RDRAM and I chose to ride it out a while as is, Linux seemed to run a bit better with less memory. In other words it would take longer to hit the out of RAM wall and start to swap to the drive and when it did it was less aggressive and didn’t do a lockup for a long time like it did while running XP. A lockup meaning the time you have to just wait for the machine to start responding again as the disk just grinds. As I said, this was the final Windows machine for me, with expensive memory, it paid to toss the PC and get a newer used machine for the same amount of money as an upgrade. This is the machine that I am on now, 6 years old and running Mint XFCE. Right now I am actually composing this while on it running Slackware in a Virtual Box, to test it out a bit. She, my spouse, has basically the same machine, same age, same CPU, with Windows 7 ( after a brief try at Windows 10, which was short as the performance was sub-par, plus the fact that when it did updates it “inhaled” 100% of the bandwidth on my connection for long time periods was frustrating), the speed difference is quite noticeable between the two machines, Win7 vs Mint XFCE. On a cold start with Mint, I can click and open something like Firefox or Word Processor, as soon as the network card is recognized, about 9 seconds after boot. The Win 7 machine takes at least 3-4 times longer. It also performs much more sluggishly overall when it finally “arrives” after a few minutes. My estimate of the speed at which I can maneuver on the Win 7 machine is along the lines of equivalence to when I tried Ubuntu on a Pentium 4 machine, single core, circa 2004, so 14 years old. One final comparison. I had a neighbor with a new machine, a budget one, but new, with Windows 10 and it still moved a lot slower than the 6 year old machine that I have with Mint.

The difference in performance is just what I have experienced and motivated me to move to Linux 100%. Not to mention the stability as well, less odd behavior and virus and malware issues are bonuses. Linux has come of age, it once was a tool that was too technical for the common user but, at this point most people could get up to speed with it fairly quickly. A little learning upfront is an investment that will save time in the long run with all of the spare seconds saved over waiting for Windows to respond to human inputs.
Microsoft has had a few hits, XP and 7 come to mind, but the product seems to go off the rails badly almost every other release, Vista and 8 come to mind. I wonder why 9 was skipped, maybe it was going in the wrong direction early on and that was realized in house before launch, I don’t know the history with that.

To all the readers, happy computing to all, with whatever OS you run,
Erick

Random AI Picture

Windows Death Cross Malaga Bay

Imagination is the power to make a difference in yourself.

My comments on Windows -vs- Linux from Malaga Bay. https://malagabay.wordpress.com/

I thought this was worth a repost here. I came across the Malaga Bay site.
while doing some research on Philip S. Callahan. A very interesting fellow who studied among other things “why is it that crops which are grown on healthy soils never attract diseases and insects.”
https://malagabay.wordpress.com/2016/03/07/philip-callahan-paramagnetism/

https://malagabay.wordpress.com/?s=Philip+S.+Callahan

Microsoft has had a few OK releases in my opinion, Windows XP and 7 come to mind, the rest seem like they have been wrong turns or at least not fully baked in the oven of development and testing….
https://malagabay.wordpress.com/2016/12/30/windows-death-cross/comment-page-1/#comment-14768

Apple Notepad

Termbin

I’d like to make sure everybody is at home when they are on vacation.

http://termbin.com/
An easy to use Pastebin like tool that allows “pasting” from the command line.

Requires that netcat is installed on the PC, which is by default on Linux and can be installed on a Windows computer as well.

.bashrc

I recommended adding an alias to your .bashrc in Linux to make a shorthand to post to termbin…

alias tb='nc termbin.com 9999'

 

Posts stay active for a month as an example I posted the link to this post online via termbin.

Privatebin

Other Bins that are install-able
https://privatebin.net/
https://github.com/PrivateBin/PrivateBin/wiki/Installation

How to Setup A Hastebin Server

http://sergiogervacio.com/host-hastebin-server/

 

termbin.com is powered by Fiche – open source command line pastebin server. There is a link to github repository: https://github.com/solusipse/fiche.

Penguin

Pastepile

Future development depends on the determination of future generations to contribute towards building their own society.

Pastepile is a fork of guestbook.cgi – a simple guestbook script, written by John Callender in 1999. It is the last part of his Beginner’s Guide to CGI Scripting with Perl, Running a Guestbook.
This new version, a.k.a Pastepile, is a dirt simple Perl CGI program that creates a blog like pasting tool to be able to paste notes online or on a local server. Allows grabbing snippets of text or code for later use on whether on the local machine or another on the network. I made it sometime after studying John Callender’s tutorial when I was digging into learning about CGI and Perl several years ago.

History

Pastepile originated as a way to paste snippets of code and write short notes on configuration changes that I make on servers, including a Raspberry Pi that I run. The only requirement is the installation of a web server such as Apache. This little Pastepile tool made it easy to keep track of information related to the servers in one place  and search-able via a browser. After using it in the is mode for a while, I cloned it and started to use it as a general place to paste info and write short notes. This makes it easy to save something while on one machine on the network and be able to retrieve it later on that machine or another.

Example of What it Looks Like


Subject: Running a form-to-email gateway at 19:04:44, Sat Feb 3, 2018 from 192.168.1.7

http://www.resoo.org/docs/perl/begperl/form_to_email.html


Subject: Slackware Linux Essentials at 12:10:03, Thu Feb 1, 2018 from 192.168.1.179

www.slackbook.org/html/index.html


Additions:Remote Address,Time,Reversed Order

Besides stripping down guestbook.cgi to remove code specifc to it’s guestbook function and cleaning up the code to reflect it’s new use, three functional code changes were made. One is to add a timestamp to keep track of when the entry was created. Another change made was showing the IP of the machine the post originates from by reading the environment variable $REMOTE_ADDR to keep track of where the post originates from. Many machines on my network have static IP’s so this is handy for me at least. The final change was to reverse the order of the listing. In guestbook.cgi a First In On Top ordering is the layout of the guestbook posts. For Pastepile I reversed it so the most recent and not the oldest post is on top of the list, Last In On Top ordering. This made sense as the most recently written notes are more likely to be important and I want those to be close to the top of the pile and let the file get long with the aging information at the bottom.

/p/

For ease of access via a shorter link a simple index.html redirector page was place in /var/www/p/, following a 4chan-esqe style of folder naming and a nice short link to get to the pastepile.cgi script, which lives in the /usr/lib/cgi-bin/ directory. The /p/ directory also holds the pastepile.html file that is created by pastepile.cgi as it’s data page.

 Redirector Example for /var/www/p/index.html

<HTML>
<HEAD>
<meta http-equiv="refresh" content="0; url='http://192.168.1.17/cgi-bin/pastepile.cgi'"/>
</HEAD>
<BODY>
<p><a href="http://192.168.1.17/cgi-bin/pastepile.cgi">Redirect</a></p>

</BODY>
</HTML>

paste-pile-mover.sh

A helper script called pastepile-file-mover.sh, moves the pastepile.html, the data file created by pastepile.cgi from it’s default location to a date stamped file in a location set in the script BASEDIR/dir/filename. Where BASEDIR is your choice ( I use /var/www/p/), dir is the current year and filename is YYYYMMDD.html, so that that there is a  year and date hierarchy. I allow this script to run at the start of the month via root CRON to “clean” out the Pastepile and archive the old one, much the same way that log are rotated.

0 0 1 * * /home/erick/bin/pastepile-file-mover.sh

pastepile-file-mover.sh

#!/bin/bash

# Move the pastepile.html file from it's default location to a date stamped
# file in a location BASEDIR/dir/filename
# So that it has year and date heirarchy

# For now, Monthly, Move pastepile over to year dir and datestamped HTML file
#0 0 1 * * /home/erick/bin/pastepile-file-mover.sh



BASEDIR=/var/www/p
# Testing
#BASEDIR=/tmp

dir=$(date +"%Y")
#echo $dir

#File name timestamped
filename=$(date +"%Y%m%d").html
#echo $filename

# Make the YEAR dir if it dow not exist.
if [ ! -d "$BASEDIR/$dir" ]; then
  # Control will enter here if $DIRECTORY doesn't exist.
  mkdir $BASEDIR/$dir
fi

# Do the move to the YEAR directory with the YYYYMMDD.html filename.
mv $BASEDIR/pastepile.html $BASEDIR/$dir/$filename

# This is needed make a new pastepile.html and chmod 666
# else pastepile.cgi does not work, it can't make it's own output file.
touch $BASEDIR/pastepile.html
chmod 666 $BASEDIR/pastepile.html

Last but not least pastepile.cgi

#!/usr/bin/perl -Tw

# pastepile.cgi a fork of...
# guestbook.cgi - a simple guestbook script

# This program is copyright 1999 by John Callender.

# This program is free and open software. You may use, copy, modify,
# distribute and sell this program (and any modified variants) in any way
# you wish, provided you do not restrict others from doing the same.

# pastepile.cgi - guestbook.cgi, modded to become # a pastepile program. Erick Clasen Jan 25,2018
# This new version is a dirt simple CGI program that creates a blog like
# pasting tool to be able to paste notes online or on a local server.
# allows grabbing snippets of text or code for later use on whether
# on the local machine or another on the network.

$data_file = '/var/www/p/pastepile.html';

$max_entries = 0; # how many guestbook entries to save?
                   # set to '0' (zero) for infinite entries...

use CGI;
use Fcntl;
$query = new CGI;

unless ($action = $query->param('action')) {
    $action = 'none';
}

print <<"EndOfText";
Content-type: text/html

<HTML>
<HEAD>
<TITLE>Raspberry Pi Server Paste Pile</TITLE>
</HEAD>
<BODY>
<H1>Raspberry Pi Server Paste Pile</H1> 
<P><EM>$ENV{DOCUMENT_ROOT}/p/</EM></P>



<A HREF="../status/index.html">Back to Status Index</A>&nbsp;
<A HREF="../p/2018">2018 Paste Archive</A>

<P>You can <A HREF="#form">add your own subject and entry</A> using the form at the bottom of the page. Here we is has your pastes...</P>

<HR>
EndOfText

# Input action to add a new entry. ----------------------
if ($action eq 'Add entry') {

    # process the form submission
    # and assemble the guestbook entry


    # Input the subect and the paste which is called a comment here in this code.
    $subject = $query->param('subject');

    $comment = $query->param('comment');

    # clean up and fiddle with $subject
 unless ($subject) {
        $subject = 'No Subject';
   if (length($subject) > 50) {
        $subject = 'Subject line too long >50 chars';
    }
# End Input action to add a new entry. ----------------------



    }

    # Add a time stamp, put in variable theTime. This allows the paste to be timestamped.
    
    @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
    @weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
    @digits = qw(00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 59 59);
    ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek) = localtime();
    $year = 1900 + $yearOffset;
    $theTime = "$digits[$hour]:$digits[$minute]:$digits[$second], $weekDays[$dayOfWeek] $months[$month] $dayOfMonth, $year";

    # untaint variable
    unless ($theTime =~ /^([^<]*)$/) {
        die "couldn't untaint name: $theTime\n";
    }
    $theTime = $1;

    

    # clean up and fiddle with $subject--------------------------------

    $subject_clean = "$subject";
    $subject_clean =~ s/, , /, /;        # remove duplicate ', '
    $subject_clean =~ s/^, //;           # remove initial ', '
    $subject_clean =~ s/, $//;           # remove final ', '
    if ($subject_clean =~ /^[,\s]+$/) {
        # nothing but commas and whitespace
        $subject_clean = 'Subject format wrong!!';
    }
    
    if (length($subject_clean) > 75) {
        $subject_clean = 'Subject too long.';
    }

    # disable HTML tags
    $subject_clean =~ s/</&lt;/g;

    # untaint variable
    unless ($subject_clean =~ /^([^<]*)$/) {
        die "couldn't untaint subject_clean: $subject_clean\n";
    }
    $subject_clean = $1;

    

    # clean up and fiddle with $comment----------------------------

    if (length($comment) > 32768) {
        $comment = '...overloaded blog buffer chars > 32768.';
    }
    unless ($comment) {
        $comment = '...nothing to speak of.';
    }

    # fix line-endings
    $comment =~ s/\r\n?/\n/g;

    # lose HTML tags
    $comment =~ s/</&lt;/g;

    # untaint variable
    unless ($comment =~ /^([^<]*)$/) {
        die "couldn't untaint comment: $comment\n";
    }
    $comment = $1;
    # end cleanup #comment-----------------------------------------

    

    # assemble finished guestbook entry -- anything after this line until EndofText will show in the post!!!!!

    # Enviroment variable for REMOTE_ADDR is grabbed and printed directly. No untainting, but probably safe to do.

    $entry = <<"EndOfText";

<P><STRONG> Subject: $subject_clean </STRONG> at <EM>$theTime </EM> from <EM>$ENV{REMOTE_ADDR} </EM> <BR>
<BLOCKQUOTE>$comment</BLOCKQUOTE></P>
<HR>
EndOfText

    # open non-destructively, read old entries, write out new
   $all_entries .= $entry;
    sysopen(ENTRIES, "$data_file", O_RDWR)
                             or die "can't open $data_file: $!";
    flock(ENTRIES, 2)        or die "can't LOCK_EX $data_file: $!";
    while(<ENTRIES>) {
        $all_entries .= $_;
    }

 if ($max_entries) {

          # lop the tail off the guestbook, if necessary

          @all_entries = split(/<HR>/i, $all_entries);
          $entry_count = @all_entries - 1;

          while ($entry_count > $max_entries) {
              pop @all_entries;
              $entry_count = @all_entries - 1;
          }

          $all_entries = join('<HR>', @all_entries);

      }


   

    # now write out to $data_file

    seek(ENTRIES, 0, 0)        or die "can't rewind $data_file: $!";
    truncate(ENTRIES, 0)       or die "can't truncate $data_file: $!";
    print ENTRIES $all_entries or die "can't print to $data_file: $!";
    close(ENTRIES)             or die "can't close $data_file: $!";

}

# display the guestbook a.k.a pastepile.html

open (IN, "$data_file") or die "Can't open $data_file for reading: $!";
flock(IN, 1)            or die "Can't get LOCK_SH on $data_file: $!";
while (<IN>) {
    print;
}
close IN                or die "Can't close $data_file: $!";

# display the form    

print <<"EndOfText";
<A NAME="form"><H2>Add a comment/entry to the paste pile (no HTML):</H2></A>

<FORM METHOD="POST" ACTION="pastepile.cgi">
<TABLE>



<TR>
<TD ALIGN="right"><STRONG>Subject: </STRONG></TD>
<TD><INPUT NAME="subject" SIZE=30></TD>
</TR>

<TR>
<TD ALIGN="right"><STRONG>Entry :</STRONG></TD>
<TD>
<TEXTAREA NAME="comment" ROWS=5 COLS=30 WRAP="virtual"></TEXTAREA>
</TD>
</TR>

<TR><TD COLSPAN=2> </TD></TR>
<TR>
<TD> </TD>
<TD><INPUT TYPE="submit" NAME="action" VALUE="Add entry"></TD>
</TR>
</TABLE>

</FORM>
</BODY>
</HTML>
EndOfText

 

fb-submit

Meta Response

Does the interaction of social and emotional data with the power of social and emotional data translate into positive results?

Recently I was given a Meta Survey via Facebook and I replied with this…

What is your biggest concern about Meta?

I work with ML/AI and I know it is possible to steer people with it to get a given outcome in very subtle ways. My concern is that companies like Meta are steering people towards content that produces a psychological reaction that then produces addictive behavior in order to keep them engaged with the goal of gathering personal data for the purposes of sale of such data and targeting people with advertising that encourages them to consume more than they would under normal circumstances. Generally with social media the corporations running it are extracting a resource, as in data, time and attention from people in a way that tilts the scales in favor the social media platform providers. To improve this would require more transparency with regards to the data that is collected and an ‘open book’ policy where individuals must give consent to all elements of data harvesting and are allowed to access the records that are kept on their personal data. Also, to have tools built into the platforms that allow people to block things as simple as using keywords to black/whitelist content and optimize the user experience in a way that allows them to override algorithmic control of the content that they are presented with, including advertising. AI/ML works best when it is collaborating with the user and not in the role of an invisible hand that exercises control over their experience from beyond their control.

What do you value most about Meta?

The fact that there has been some open source release of code such as PyTorch which I use on a regular basis.

Meta Survey
Meta Survey

 

Extremism and Mental Illness and Social Media

There is something that is pushing extremes and actually it is in both directions. This seems to have happened ever so slowly, it has crept in. Someone I heard on a podcast said once “Almost everyone is in Wokeistan or Trumpistan and there are like 7 people left on Earth that are like WTF???” It is an exaggeration but makes a point. There are disturbing things in the realm of mental illness, one of the worst is the fact that there is now a catagory for suicide in pre teens. There was no such category at one point as it was too rare of an outlier to keep track of, since 2007 there is. What happened around that time? Smartphones with social media apps, correlation is not always causation but, it does make you wonder. If anything the issue pushing extremes can be found in the media, both traditional as it grapples with loss of market and pushes more extreme ‘bait’ to keep viewers. And, lastly you guessed it, social media in which the invisible hand of algorithms feed us content determined by large corporate interests. I think that it will, and this is the hope, that it will selfcorrect, the pendulum when it gets to an extreme will eventually go in the other direction. This is the blessing of free, democratic countries, change is possible. Democracies are a mess but, they are the best we have as of now,considering the alternatives have generally turned out worse for people.

iPhone Mounting

The beauty of love is not in your beauty but in your ability to make it manifest.

Mostly because I have had to look up how to mount an iPhone on Linux Mint 18.0 a few times and had to look it up,I made a helper script. – iPhone-mount.sh

#!/bin/bash
 # Allow non-root users to mount with ifuse!
 #sudo nano /etc/fuse.conf
 # Allow non-root users to specify the allow_other or allow_root mount op$
 # UNCOMMENT user_allow_other

# Pair the iPhone
 idevicepair pair
 sleep 5
 # Mount it
 ifuse /home/erick/iPhone

Allow users to mount via ifuse

In /etc/fuse.conf uncomment user_allow_other to let users mount devices. This makes it easy to mount the device in your home directory for instance with full access to it.

Mint and Mounting

The iPhone mounts fine on Mint 18.0. My desktop has a newer version and I had to do work to it before mounting the iPhone worked. Apparently something got lost between versions.

https://www.dedoimedo.com/computers/linux-iphone-6.html