|
![]() |
|
Quick links: [Joyce/Pynchon/Wallace] [Top 100] [The pics] [Warning] [e-Mojis] [Contact]
Each day I update this dump of a site, I execute a script called: mm.sh in iTerm, which looks a little exactly like this:
#!/bin/zsh
rsync -av /Users/lance/development/mattmclaurine.com/mattmclaurine.com/bin/* ~/bin/ &&
mm-makegraphics.sh &&
mm-makePhotos.sh && \ #toprocess->tostamp->_photos
mm-stamp.sh
mm-makeThumbnails.sh && \ # which also calls mm-makeThumbnailHtml.sh
mm-makeAll.sh $1 && # creates index, otherIndex, and calls mm-divy unless --no-divy
mm-makeSitemapXml.sh &&
mm-makeSitemap.sh &&
mm-sync.sh
#########################################################################
#!/bin/zsh
cd /Users/lance/mattmclaurine.com/images/_photos/toprocess/ &&
# photos should already have their filenames assign by this point
# and moved into the toprocess directory...
for image in *.JPG
do
ffmpeg -y -i "$image" -vf scale="-1:1080" \
/Users/lance/mattmclaurine.com/images/_photos/tostamp/"$image"> \
/dev/null2>&1
done
#########################################################################
#!/bin/zsh
cd /Users/lance/mattmclaurine.com/images/_photos/tostamp/ \
for i in *JPG
do
magick composite -gravity south -geometry +0+10 \
/Users/lance/mattmclaurine.com/images/z_stamp/stamp.png \
"$i"out.JPG > /dev/null 2>&1 &&
mv out.JPG "$i"
done &&
mv * /Users/lance/mattmclaurine.com/images/_photos/
#################################################################
#!/bin/zsh
cd /Users/lance/mattmclaurine.com/images/_photos/toprocess && \
for image in *
do
ffmpeg -y -i "$image" -vf scale="600:400" /Users/lance/mattmclaurine.com/images/_thumbnails/"$image" > /dev/null 2>&1
done
rm * || echo "Had a problem deleting the files in /Users/lance/mattmclaurine.com/images/_photos/toprocess"
/Users/lance/bin/mm-makeThumbnailHtml.sh
#############################################################################################################
#!/bin/zsh
cd /Users/lance/mattmclaurine.com/images/_thumbnails && \
ls *JPG > thumbnails && \
sort -r -o thumbnails_sorted thumbnails && \
rm thumbnails.html && \
touch thumbnails.html && \
while read i
do
echo \<a href=\"\/images\/_photos\/"$i"\"\> \
\<img src=\"\/images\/_photos\/"$i"\" \>
width=\"300\" alt=\"mattmclaurine.com\" \
height=\"200\"\>\<\/a> \
>> thumbnails.html
done < thumbnails_sorted
#!/bin/zsh
for i in *
do
shrtdate=`stat -f %SB -t %Y%m%d-%H%M%S "$i"`
mv "$i" $shrtdate-"$i"
done
################################################
#!/bin/zsh
cd /Users/lance/mattmclaurine.com && \
cat templates/html-head.html css/darkmode.css \
templates/html-head-body.html \
templates/header.html \
templates/body.html \
templates/footer.html \
templates/html-body-html.html \
> index.html
cat templates/html-head.html css/darkmode.css \
templates/html-head-body.html \
templates/headerOtherIndex.html \
images/_thumbnails/thumbnails.html \
templates/footerOtherIndex.html \
templates/html-body-html.html \
> otherIndex.html
# Don't forget the pr0n
~/bin/mm-makePr0nHtml.sh
cat templates/html-head.html css/darkmode.css \
templates/html-head-body.html \
templates/header-pr0n.html \
templates/pr0n.html \
templates/html-body-html.html \
> pr0n.html
#Now let's make the old pages...
if [[ $1 != "--no-divy" ]];
then
~/bin/mm-divyUpImagesToHtmlFiles.sh
fi
###################################################
cd /Users/lance/development/mattmclaurine.com/mattmclaurine.com/public_html/templates && \
rm pr0n.html && \
touch pr0n.html && \
while read i
do
echo \<a href=\"\/images\/_photos\/"$i"\"\> \
\<img src=\"\/images\/_thumbnails\/"$i"\" \
width=\"300\" alt=\"$i at mattmclaurine.com\" \
height=\"200\"\>\<\/a\> \
>> pr0n.html
done < pr0n
#!/bin/zsh
cd /Users/lance/mattmclaurine.com/ &&
find 20* -name index.html -delete
if [[ -e images/_thumbnails/thumbnails_sorted ]]; then
previousLink="index.html"
previousYear=""
previousMonth=""
previousDay=""
currentPage=""
nextLink=""
currentDate=""
currentYear=""
currentMonth=""
currentDay=""
nextDate=""
nextYear=""
nextMonth=""
nextDay=""
firstTransition=""
while read image
do
$nextYear/$nextMonth/$nextDay"
if [[ -z $currentPage ]]; then #2nd-If it's the 1st time through
currentPage=$image
currentYear=`echo $image | cut -b 1-4 -`
currentMonth=`echo $image | cut -b 5-6 -`
currentDay=`echo $image | cut -b 7-8 -`currentDate="$currentYear/$currentMonth/$currentDay"
cat templates/html-head.html css/darkmode.css templates/html-head-body.html > \
$currentYear/$currentMonth/$currentDay/index.html
echo "<p>Here are some pictures that I took on $currentYear$currentMonth$currentDay:</p>" >> \
$currentYear/$currentMonth/$currentDay/index.html
echo "<a href=\"/images/_photos/$image\"><img src=\"/images/_thumbnails/$image\" width=\"300\"
height=\"200\"></a>" >> \
$currentYear/$currentMonth/$currentDay/index.html
else #2nd-Valid iterations 2->n
nextLink=$image
nextYear=`echo $image | cut -b 1-4 -`
nextMonth=`echo $image | cut -b 5-6 -`
nextDay=`echo $image | cut -b 7-8 -`
nextDate="$nextYear/$nextMonth/$nextDay"
if [[ $currentDate != $nextDate ]]; then #3rd--transition
#we're transistioning to the new date, so update $current values after writing html
#3rd--transition
if [[ -z $firstTransition ]]; then #4th--first time through?
#this is the first time through and the previous link is just to the index page
previousLinkHtml="<p><a href=\"/index.html\">Previous Page</a>"
nextLinkHtml="<a href=\"/$nextYear/$nextMonth/$nextDay/index.html\">Next Page</a></p>"
# on second thought, I should set previousYear to something
previousYear=$currentYear
previousMonth=$currentMonth
previousDay=$currentDay
#3rd--transition
else #4th--not, no first time
#create those links
previousLinkHtml="<p><a href=\"/$previousYear/$previousMonth/$previousDay/index.html\">Previous Page</a>"
nextLinkHtml="<a href=\"/$nextYear/$nextMonth/$nextDay/index.html\">Next Page</a></p>"
fi
#4th--not the first time
#3rd--transition continued....
#Write the links, and button up links for "current page"
echo "$previousLinkHtml" >> $currentYear/$currentMonth/$currentDay/index.html
spaceIsThePlace=" "
echo $spaceIsThePlace$spaceIsThePlace$spaceIsThePlace$spaceIsThePlace$spaceIsThePlace \
>> $currentYear/$currentMonth/$currentDay/index.html
echo "<a href=\"/index.html\">Go Home</a>" \
>> $currentYear/$currentMonth/$currentDay/index.html
echo $spaceIsThePlace$spaceIsThePlace$spaceIsThePlace$spaceIsThePlace$spaceIsThePlace \
>> $currentYear/$currentMonth/$currentDay/index.html
echo "$nextLinkHtml" >> $currentYear/$currentMonth/$currentDay/index.html
#first, finish off "current"
cat templates/html-body-html.html \
>> $currentYear/$currentMonth/$currentDay/index.html
#second, open the "next file"
cat templates/html-head.html css/darkmode.css
templates/html-head-body.html > $nextYear/$nextMonth/$nextDay/index.html
echo "<p>Here are some pictures that I took on $nextYear$nextMonth$nextDay</p>" >> \
$nextYear/$nextMonth/$nextDay/index.html
echo "<a href=\"/images/_photos/$image\"><img src=\"/images/_thumbnails/$image\" \
width=\"300\" height=\"200\"></a>" >> \
$nextYear/$nextMonth/$nextDay/index.html
previousLink=$currentPage
previousYear=$currentYear
previousMonth=$currentMonth
previousDay=$currentDay
previousDate="$previousYear/$previousMonth/$previousDay"
currentPage=$nextLink
currentYear=$nextYear
currentMonth=$nextMonth
currentDay=$nextDay
currentDate="$currentYear/$currentMonth/$currentDay" #3rd--done with code for transitions
else #3rd-transition: no transition
#No transition, here. Just write $image out each time neede...
echo "<a href=\"/images/_photos/$image\"><img src=\"/images/_thumbnails/$image\" \
width=\"300\"height=\"200\"></a>" >> \
$currentYear/$currentMonth/$currentDay/index.html
fi #3rd-transitions
fi #2nd--1st or nth time?
done < images/_thumbnails/thumbnails_sorted
# but wait, there's one more file to write...
# need to figure out what images are on the last page...which I haven't done yet
# so, the below will not work until that's done...
previousLinkHtml="<a href=\"/$currentYear/$currentMonth/$currentDay/index.html\">Previous Page</a>"
nextLinkHtml="<a href=\"/index.html\">Next Page</a>"
# Note, that at this point $previous=$current, so the below is correct
echo $previousLinkHtml >> $currentYear/$currentMonth/$currentDay/index.html #because current=next at this point in the program
spaceIsThePlace=" "
echo $spaceIsThePlace$spaceIsThePlace$spaceIsThePlace$spaceIsThePlace$spaceIsThePlace \
>> $currentYear/$currentMonth/$currentDay/index.html
echo $nextLinkHtml >> $currentYear/$currentMonth/$currentDay/index.html
cat templates/html-body-html.html >> $currentYear/$currentMonth/$currentDay/index.html
else #1st
print "Sorry, dude, but I don't see a file to parse"
fi #1st
##################################################################################################################################
#!/bin/zsh
cd "/Users/lance/mattmclaurine.com" &&
find . -name "*html" > sitemap &&
sed -i.bak 's_./__' sitemap &&
sort sitemap > sitemap_sorted &&
mv sitemap_sorted sitemap &&
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"> sitemap.xml &&
echo "<urlset xmlns=\"https://www.sitemaps.org/schemas/sitemap/0.9\">" >> sitemap.xml &&
echo "<url>" >> sitemap.xml &&
echo "<loc>https://mattmclaurine.com/index.html</loc>" >> sitemap.xml
echo "</url>" >> sitemap.xml &&
while read url
do
echo "<url>" >> sitemap.xml
echo "<loc>https://mattmclaurine.com/$url</loc>">> sitemap.xml
echo "<lastmod>2023-04-18</lastmod>" >> sitemap.xml
echo "</url>" >> sitemap.xml
done < sitemap &&
echo "</urlset>" >> sitemap.xml
#######################################################################################
#!/bin/zsh
cd /Users/lance/mattmclaurine.com && \
cat templates/html-head.html \
css/darkmode.css \
templates/html-head-body.html \
templates/header-sitemap.html \
> sitemap.html
echo "<p style=\"font-size:12px; \">" \
>> sitemap.html
echo "Here's all the html pages:" \
>> sitemap.html
echo "</p>" >> sitemap.html
echo "<p style=\"font-size:10px; \">" \
>>sitemap.html
echo
while read html
do
echo "<a href=\"$html\">$html</a><br>" \
>> sitemap.html
done < sitemap
echo "</p>" >> sitemap.html
cat templates/footer-sitemap.html >> sitemap.html
cat templates/html-body-html.html >> sitemap.html
#################################################
Here's how I created the graphics (not the ones above on this page, but the one on the home page). CandiceEF is a font I have on my Mac. You should be able to find a similar or the same one if you use a search engine.:
#!/bin/zsh
cd /Users/lance/mattmclaurine.com/images/images &&
echo "Making imagemagick images..."
magick -size 420x100 xc:#111111 -font CandiceEF -pointsize 72 -fill white \
-stroke black -strokewidth 25 -annotate +25+65 'Welcome to' \
-stroke red -strokewidth 20 -annotate +25+65 'Welcome to' \
-stroke black -strokewidth 15 -annotate +25+65 'Welcome to' \
-stroke white -strokewidth 10 -annotate +25+65 'Welcome to' \
-stroke black -strokewidth 2 -annotate +25+65 'Welcome to' \
-fill dodgerblue -draw "text 25,65 'Welcome to'" \
0-welcome-to.jpg
magick -size 900x100 xc:#111111 -font CandiceEF -pointsize 72 -fill white \
-stroke black -strokewidth 25 -annotate +25+65 'Matt McLaurine.com' \
-stroke red -strokewidth 20 -annotate +25+65 'Matt McLaurine.com' \
-stroke black -strokewidth 15 -annotate +25+65 'Matt McLaurine.com' \
-stroke white -strokewidth 10 -annotate +25+65 'Matt McLaurine.com' \
-stroke black -strokewidth 2 -annotate +25+65 'Matt McLaurine.com' \
-fill dodgerblue -draw "text 25,65 'Matt McLaurine.com'" \
0-mm.com.jpg
magick -size 1000x100 xc:#111111 -font CandiceEF -pointsize 50 -fill white \
-stroke black -strokewidth 25 -annotate +25+65 'Pushing that boulder uphill one day at a time' \
-stroke red -strokewidth 20 -annotate +25+65 'Pushing that boulder uphill one day at a time' \
-stroke black -strokewidth 15 -annotate +25+65 'Pushing that boulder uphill one day at a time' \
-stroke white -strokewidth 10 -annotate +25+65 'Pushing that boulder uphill one day at a time' \
-stroke black -strokewidth 2 -annotate +25+65 'Pushing that boulder uphill one day at a time' \
-fill dodgerblue -draw "text 25,65 'Pushing that boulder uphill one day at a time'" \
0-sisyphus.jpg
magick -size 1000x100 xc:#111111 -font CandiceEF -pointsize 32 \
-fill white -draw "text 23,63 'March 8, 2024'" \
-fill white -draw "text 27,67 'March 8, 2024'" \
-fill white -draw "text 24,64 'March 8, 2024'" \
-fill black -draw "text 26,66 'March 8, 2024'" \
-fill gray -draw "text 25,65 'March 8, 2024'" \
1-update.jpg
magick -size 1200x400 -fill dodgerblue -background \#111111 -gravity Center \
-font CandiceEF -pointsize 60 label:' Welcome to \n Matt McLaurine.com \n Pushing that boulder uphill \n one day at a time' \
\( +clone -blur 0x25 -level 0%,50% \) \
-compose screen -composite neonsign.png
MM 240310
(c)2023-2026 All Rights Reserved