I'm curious to know more about what automations people use day-to-day. Either cron jobs or other services?
Does it make your day easier?
Just buying bread might be more 'automatic', but we've been evolving the process and recipe for the last 6+ months, and honestly the bread is now better than any but the best artisan loaves available locally, and hugely cheaper.
To save time, and overcome laziness, we pre-mix 'wet' and 'dry' 'kits' in batches of 6 or 10 loaves at a time, and divide into loaf-sized portions. Wet is water, sugar, honey, oil, salt, etc. Dry is various flours, oats, multigrains, etc.
When it comes time to make bread (usually the night before we want it), it's a simple matter of pouring a wet kit into the machine, sprinkling over a dry kit, some yeast, setting the timer and pressing 'start'.
The kids do that, and do most of the batch prep, which we/they've optimised for teamwork, and for example we've 3d printed scoops in the right measures for the recipe, to speed measurements.
So from my point of view, I almost have 'automatic bread' :)
- There's only one bakery in my area that has keto bread, but infrequently. I have a daily bot that scans the bakery page on the Uber eats equivalent webpage, then alerts me when bread is available.
- On my phone I get a notification in the morning. When I click it, it copies my daily journals markdown template, opens the note app. Then I paste and write.
- I have a bot that scans hacker news for keywords and notifies me. Which alerted me to this post. :)
- I have a bot that which scans reddit and twitter for keywords.
- I have a bot that watches Rotten Tomatoes for upcoming Sci-fi movies that are rated "Fresh". Then creates an RSS feed for me.
- A bot that watches my side project and lets me know when it goes down.
- My entire side project is completely automated and a daily email goes out automatically (https://randomdailyart.com/)
- I get email reminders and notifications on my phone to remain in contact with people using https://www.monicahq.com/.
- Built a telegram bot where my SO and I can quickly add entries into a google sheet, for tracking who paid for what.
I'm sure there's more but that's all I can think of on the top of my head.
I have a tool I wrote which is doing periodic searches for specified queries on different sites and generates RSS feeds with new results + HTML reports (so I can find people with overlapping interests, e.g. if the same person matched against multiple queries) [2]. Sort of like google alerts, but much better. So there is some daily scraping for that.
I'm using a somewhat hacky tool which 'compiles' a python spec for jobs to systemd and makes it very easy to maintain. [1]
As for making my day easier.. not always yet, but certainly makes it more fun. I live by the motto "Never spend 6 minutes doing something by hand when you can spend 6 hours failing to automate it" :)
[0] https://beepb00p.xyz/my-data.html#consumers
I did the same think for my production application environment. One command to go from no infrastructure to production grade cloud application deployment. https://github.com/cloud-computer/cloud-computer
[ $1 ] || { echo "Notify what?"; exit; }
curl -X "POST" "https://push.techulus.com/api/v1/notify/$PUSHKEY" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{ "title": "Linux", "body": "'$1'" }'
echo;
I use this app[1] that notifies my cellphone, so I wrote this bash script that I call when a long task is done, so it notify me when I'm away.Twitter follows/unfollows for me, my wife, and my Twitter bot
Stock movements for the few stocks (RSUs) I have
Confirmation that several daily backups (db dumps etc) were successful
Upcoming SSL cert and domain expirations
New GitHub stars
Disk space left on my personal server (running out tends to make it crash)
I know that looks like a lot of stuff, but the goal is for the script to programmatically determine which ones cross the threshold into being actionable/important and to hide/de-prioritize the unimportant ones for me so I can confidently ignore them and focus on any important ones.
I have a shell script that that creates a new markdown file for that day, which I write my journal entry into.
Another script compiles a year's worth of journal entries into an epub.
Another workflow I made is similar, but for tasks. So every day I run a shell script that copies the last day's tasks to a new file with the new day's date, forcing me to evaluate what was done the previous day (if anything). Some days are great, some days not so much.
The tasks also show in my browser's new tab page to further reinforce.
function notifyme() {
MSG=${1:-'Terminal is done'}
TITLE=${2:-"Done!"}
osascript -e "display notification \"${MSG}\" with title \"${TITLE}\""
}
I use it like:bin/start-unit-tests; notifyme
* mailing something to todo@mydomain will put it in my todo list (i.e automatically forward actionable emails, jira tickets etc)
* mailing a link to videodl@mydomain will run youtube-dl on the link and then upload the video to onedrive. I also have a companion apple shortcut that does this from the share sheet without even opening the mail client.
* sending a pdf to pdf@mydomain will send it to my ereader
* article@mydomain will parse the link, remove ads and reply with the html contents of the article
For the backend i run an instance of n8n.io which can listen for emails via imap and run custom scripts based on the email address
As a data scientist I often run code that takes hours, and getting a slack message when it finishes is super helpful, and it has often helped me catch when a script finishes too early due to some error.
- Play a chime/alert over my Sonos system if a door gets left open for longer than a minute (https://labzilla.io/blog/homeassistant-door-chime).
- Turn off my window air conditioners when I leave my apartment for more than 15 minutes, and turn them back on again when I'm within a block of my apartment (or if it gets above 80 degrees).
- Automatically turn on lights when I come home.
- Play a chime/alert over the Sonos when laundry is finished (I use a SmartThings button to trigger a timer; one tap = 30 minutes wash, double tap = 45 minute dry.)
I also have a few cron jobs to move automatic backup files from my colo server to my NAS at home. I use healthchecks.io to automatically alert me if the job fails to run.
- BBC4 (UK) from 12.45am ~ 1am
- KZOO (US) from 1am~6am
- RDB (Madagascar) at 6~8am
- FM Miki (Japan) on weekdays or BBC2 (UK) on weekends from 8am~12pm
- RDB (Madagascar) from 12pm~2pm
- Radio Vaovao Mahasoa (Madagascar) from 2pm~4pm
- BBC4 from 4pm~7pm
- ABC Radio (Honduras) from 7pm~9pm
- FM Miki (Japan) on Mon,Wed,Fri or FM PiPi (Tue,Thu,Sat) from 9pm~12.45am
That, in addition to scraping the news of the day from various sources and versioning it in a git repository:
- Yomiuri Shinbun (Japan)
- La Gazette de la Grande Ile (Madagascar)
- Madagascar Tribune (Madagascar)
- The Guardian (UK)
With this, I can listen to my favorite English, Japanese, Malagasy and Hondurian radio without turning any button. The programs being easily recognizable, I effectively no longer need an alarm clock or even a clock to know the time of day provided that I am within the transmission range (yes I have built a very low-power FM radio to overcome bluetooth range limitations).
Getting that sort of system sorted out is maybe the most productive thing you can do because it is meta-productive.
Other than that, just some bespoke Tasker automations and some hotkeys on my computer. Reading through this thread makes me feel like a rookie, though.
During a friendly weight loss challenge I wrote a script that pulled my weight from a smart scale and inserted a rolling weekly average into my column in our shared spreadsheet.
I made a website that scrapes motogp to build my own No Spoilers website with absolutely no Javascript and a far better layout than their silly horizontal scrolling cards layout.
I wrote a script to pull data from John's Hopkins and give me daily coronavirus updates in a more digestible way (since deprecated because I'm in NZ and would rather put it behind me).
Probably a bunch more I'm forgetting about.
This resulted in an application called Cleave, that lets users persist OS state as a "context" - saving and loading open applications, their windows, tabs, open files/documents and so on.
Started because of frequent multitasking heavy work with limited resources. Made it because I wanted to switch between studying, working, reading, looking for an apartment, etc. without manually managing all states or consuming all resources.
As a person that used to have multiple virtual desktop, each with multiple apps with multiple windows, which had multiple tabs, etc. it has certainly made it easier to focus on one task at a time, knowing that I can resume another task from just where I was.
Open Beta (macOS) as soon as I finish license verification and updates, but I keep getting sidetracked...
https://github.com/adnanh/webhook
And someone used it to automate their robot vacuum cleaner when they press the amazon dash button :)
For examples I have automated visual creation for social media using https://bruzu.com and IFTTT/Zapier.
So I can just type a word/phrase in English, and then it will automatically fill in the target language translation, pronunciation, audio recording, and word-by-word breakdown to show what every word in a phrase means.
Before I would have to use Anki, and switch back and forth between Anki and various dictionaries, and have to create my own audio recording. Just removes a bit of friction myself learning (Chinese).
E.g. double-clicking pause/play removes the currently-playing song from a playlist, while letting the song finish adds it to my "liked" playlist
(I also have an IFTTT trigger that continuously pulls songs from r/listentothis into a Spotify playlist, so I can use that curator to save any interesting songs I hear on my drive)
inb4 "just use GitHub"
#!/bin/bash
# On the computer
MYHOME=$HOME
MYDESKTOP=$HOME/Desktop
DEST_DIR="Voice Recordings `date "+%Y-%m-%d"`"
# On the phone
VOICE_RECORDER_SOURCE_DIR="/sdcard/EasyVoiceRecorder"
# 1. make the dest dir and cd into it
cd $MYDESKTOP
mkdir "$DEST_DIR"
cd "$DEST_DIR"
# list files that will be downloaded:
echo "The following files will be adb-pulled, converted, and saved to $DEST_DIR"
adb shell ls "$VOICE_RECORDER_SOURCE_DIR"
# 2. PULL
adb shell "cd $VOICE_RECORDER_SOURCE_DIR; tar -cf allwavs.tar *wav"
adb pull $VOICE_RECORDER_SOURCE_DIR/allwavs.tar allwavs.tar
# 3. PROCESS
tar -xf allwavs.tar
for f in *.wav; do
echo "Converting $f to mp3...";
ffmpeg -hide_banner -loglevel panic -i "$f" "${f%.wav}.mp3";
done
# set timestamp to match what was on the original .wav files
for f in *.wav; do
gtouch -d "$(date -R -r "$f")" "${f%.wav}.mp3";
done
# 4. cleanup
rm *wav
adb shell "rm $VOICE_RECORDER_SOURCE_DIR/allwavs.tar"
rm allwavs.tar
echo "Deleting all .wav files from phone..."
adb shell "rm $VOICE_RECORDER_SOURCE_DIR/*wav"
It's part of a general authoring workflow: whenever I want to write something in a conversational tone (as opposed to dry/technical/academic tone), I go for a walk-and-talk, then transcribe the dictated text + edit. Works really well for intros and conclusions in particular, and blog posts.
for i in raw-* ; do cat $i | expand | egrep '[A-Z]{3} +[0-9]{4}|/2021' | sed -r -e 's!08/(..)/2021!aug\1!g' -e 's!09/(..)/2021!sep\1!g' -e 's!10/(..)/2021!oct\1!g' -e 's!12/(..)/2021!dec\1!g' -e 's!01/(..)/2021!jan\1!g' -e 's!05/(..)/2021!may\1!g' -e 's!03/(..)/2021!mar\1!g' -e 's!02/(..)/2021!feb\1!g' -e 's!06/(..)/2021!jun\1!g' -e 's!04/(..)/2021!apr\1!g' -e 's!07/(..)/2021!jul\1!g' -e 's/([a-z]{3}[0-9]{2}) - ([a-z]{3}[0-9]{2})/\1\2/' -e 's!([a-z]{3}[0-9]{2}[a-z]{3}[0-9]{2}) +([0-9]{2}:[0-9]{2} [AP]M)!\1 N/A \2!' -e 's!Live Online!Lve!' -e 's!Online Course!Onl!' -e 's!Hybrid Course!Hyb!' -e 's!Face-to-Face!f2f!' -e 's!Directed Study!dir!' -e 's/(..):(..) ([AP])M - (..):(..) ([AP])M/\1\2\3\4\5\6/' -e 's/Palm Bay/PalmBay /' | while read where crn c1 c2 c3 type name ; read dates days time ; do printf "%s %-4s %s %s %-4s %-5s %s %s %s\n" $dates $days $time $type $c1 $c2 $c3 $crn "$name" ; done | sort | uniq | sort -k 5 > not-$i ; done
It chews on the results of a class schedule search:
https://www.easternflorida.edu/academics/class-schedule-sear...The problem being solved is that I have had as many as 4 kids taking classes at once, and that becomes impractical without coordinated schedules. Getting the data into plain text, with exactly one line per class, makes it easy to use grep for picking out possibilities.
I've found that a lot of personal automation stuff on the computer just isn't worth it. I try to keep things simple and that reduces the need for automation altogether.
#!/bin/bash
function command() {
CMD="$1"
xdotool type "$1"
xdotool key Return
}
function key() {
KEY="$1"
xdotool key $KEY
}
function clear() {
for n in {1..10}; do
key BackSpace
done
}
function name_panel() {
NAME="$1"
key ctrl+a
key comma
clear
command $NAME
}
name_panel 'cmd'
key ctrl+a
key c
name_panel 'srv'
key ctrl+a
key c
name_panel 'make'
key ctrl+a
key n
echo "Now type ssh-add to log in..."
ssh-agent bash
Not really automation now with WFH but I had it hooked to a cron or tasker to turn the kettle on 5 minutes before the morning alarm goes off. Am quite proud of my ingenuity solving for my laziness :)
- A site which has an RSS feed of my Twitter feed. On entry per day.
- Automated backups of Notion and Dropbox to Backblaze
- Notification for likely missing data in my Spotify logging app. (I download all my play data from the recent plays api)
- GitHub actions to download each new Instagram post.
- Scripts to process my personal finance data into a database which backs a grafana dashboard
Building simple apps that track anything (workouts, personal things, baby health things). It's super easy to connect my data and actions to practically anything I want.
It beats the pants off having to wait for company X and company Y to integrate their services.
It connects to both laptops through bluetooth and has a LiPo battery making it completely wireless. I 3d printed an enclosure that lets me mount it out of sight underneath my desktop (think up-down controls for a standing desk).
This lets me easily switch between computers through the day without plugging in/re-pairing/etc.
It's still needs a bit of refinement but overall, it's quite nice and makes switching devices painless.
My main one (using Integromat) loops through my unfinished Todoist tasks at each day at 00:01 and then:
- If the task doesn't have a due date it adds one. For each task without a due date it adds (i + 1) days. It's a crude method but I don't often have a huge amount of tasks without due dates.
- If the task is overdue it sets the due date to today and adds a "+" to the end of the task name so I can easily see how long I've put it off
[1]: Screenshot of this @ https://twitter.com/CohanRobinson/status/1337125370399690753
I've set up similar automations to dim the nightlight after 10pm and automatically switch off during the day time.
[1] https://www.amazon.com/Gro-Company-Gro-Clock-Sleep-Trainer/d...
Recently I've made another script that looks at all the new posts from my RSS reader (Miniflux) over the last 24 hours and sends them to me in an email. Just the title and site name so its easy to parse/glance over.
If you have someone you'd like to get interested in IoT and/or programming, it's probably the best feedback loop between effort and reward you can find -- up there with learning to program HTML/CSS/JavaScript and refreshing a web app on local
Automatic monthly purchases of low-cost index funds.
This way I don't have to worry (too much) about over-spending on other items as I've taken care of future-me.
I built a tool earlier this year that streams comments from those forums, analyzes them, and pings me when a relevant conversation is found. I generally keep it running throughout the day in my local Terminal.
I have a script that compares the new links to the old links (last week), then I check those sites if they are real or spam. The new list is added to the disavow list.
The script makes life easier, because instead of going through all links I can only go through the new links.
Very useful to launch just the programs I need in the morning from the bathroom and closing them when I'm finished.
In that way I can easily keep work and private workflow separated. I plan to release it next year, check out RemoteMeow on twitter or reddit.
why? I have to deal with a bunch of files at $job. easier when they're all at one place, and I have a clean slate everyday.
I receive the top 100 HN links by email every week.
It reduces the amount of time I visit HN. Of course this time is an exception.
a=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
if [ -n "$a" ]; then
echo " [$a]"
else
echo ""
fi
}PS1="\u@\h:\w\$(brname)$ "
credit: daniel.haxx.se, https://news.ycombinator.com/item?id=25043731