Ask HN: What's are your personal automations?
31–40 of 159 posts
Re: Ask HN: What's are your personal automations?
#32 #!/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 bashRe: Ask HN: What's are your personal automations?
#33 [ $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.Re: Ask HN: What's are your personal automations?
#34If 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
Re: Ask HN: What's are your personal automations?
#35 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
Re: Ask HN: What's are your personal automations?
#36Re: Ask HN: What's are your personal automations?
#37https://github.com/adnanh/webhook
And someone used it to automate their robot vacuum cleaner when they press the amazon dash button :)
Re: Ask HN: What's are your personal automations?
#38One of my favorite automations is a slack bot I made to send me a message when a process finishes: https://github.com/spohngellert-o/SlackProcessTrackerBot 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.
I do the same thing, but I use the Twilio CLI to send me a text so that I can get up and walk around if the process is blocking other work. (:
Re: Ask HN: What's are your personal automations?
#39Twitter 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.
Re: Ask HN: What's are your personal automations?
#40I automated my desktop environment configuration using Docker containers. I'm able to go from a headless tty to perfectly tailored desktop environment in ~2.5 seconds. First time start requires a ~40 min build, byut thereafter ~2.5s to start afresh. https://github.com/sabrehagen/desktop-environment I did the same think for my production application environment. One command to go from no infrastructure to production g…