A few days ago there was a story on HackerNews about a guy who made a funky script to take a photo of himself every time he opened his computer. The original story was here.
I immediately liked the idea, but wanted to do something more with it. The only natural step was to take a photo and instead of storing it locally, just uploading it to some url and tweeting it. So last night I sat down for an hour of hacking and patched together a bunch of scripts and voila #TweetAWakeup was born.
You can view the photos live on twitter via the #TweetAWakeup hashtag.
If you want to make something like this, here's a quick howto of as many steps as I remember. I guess someone could make a simple script to do this, but then it would lose some of its geeky appeal.
Ok here's what you do:
-
Install Sleepwatcher
-
Install iSight CLI Image Capture
-
Download and install twurl (you might have to update RubyGems with "gem update --system")
-
Download my helper scripts
-
Authorize twurl as per instructions on github (twurl authorize ...)
-
run "sudo launchctl load -w /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist" (this makes sleepwatcher work)
-
Edit ~/.wakeup and make it look something like this, obviously you should modify the path to suit your setup
-
#!/bin/bash
/bin/bash ~/Documents/random-coding/TweetAWakeup/TweetAWakeup.sh
-
Go into TweetAWakeup/update.py and edit line 8 to match your imgur API key from step 2
-
Go into TweetAWakeup/TweetAWakeup.sh and edit the paths to suit your setup
-
You can change what the tweet will look like on line 6 ... would be nice if you leave the hashtag :)
-
Run "twurl alias tweet /1/statuses/update.xml"
And you're done! Every time your mac wakes up from sleep it will take a photo with iSight, then wait 10 seconds and post it on twitter. The wait is there to give your computer supple time to connect to an internet.
Obviously this whole thing is rather pointless, but I find it interesting. Maybe something awesome falls out over time and I get a neato introspection into my daily life ... or better yet, a hawt sexy girl with no top will forget about this and accidentally post her boobies all over the internet then much funs will ensue.
PS: hopefully I didn't miss a step :)
Continue reading about Tweet a photo every time your mac wakes up with a simple hack
Semantically similar articles hand-picked by GPT-4
- This is how I connected my Canon DSLR as a webcam
- Build a Chrome extension from idea to launch in an afternoon
- Livecoding recap #42: HackerNews app where people are nice
- Livecoding Recap 47: Webpack build progress indicator for Mac Touchbar
- Reality?
Learned something new?
Read more Software Engineering Lessons from Production
I write articles with real insight into the career and skills of a modern software engineer. "Raw and honest from the heart!" as one reader described them. Fueled by lessons learned over 20 years of building production code for side-projects, small businesses, and hyper growth startups. Both successful and not.
Subscribe below 👇
Software Engineering Lessons from Production
Join Swizec's Newsletter and get insightful emails 💌 on mindsets, tactics, and technical skills for your career. Real lessons from building production software. No bullshit.
"Man, love your simple writing! Yours is the only newsletter I open and only blog that I give a fuck to read & scroll till the end. And wow always take away lessons with me. Inspiring! And very relatable. 👌"
Have a burning question that you think I can answer? Hit me up on twitter and I'll do my best.
Who am I and who do I help? I'm Swizec Teller and I turn coders into engineers with "Raw and honest from the heart!" writing. No bullshit. Real insights into the career and skills of a modern software engineer.
Want to become a true senior engineer? Take ownership, have autonomy, and be a force multiplier on your team. The Senior Engineer Mindset ebook can help 👉 swizec.com/senior-mindset. These are the shifts in mindset that unlocked my career.
Curious about Serverless and the modern backend? Check out Serverless Handbook, for frontend engineers 👉 ServerlessHandbook.dev
Want to Stop copy pasting D3 examples and create data visualizations of your own? Learn how to build scalable dataviz React components your whole team can understand with React for Data Visualization
Want to get my best emails on JavaScript, React, Serverless, Fullstack Web, or Indie Hacking? Check out swizec.com/collections
Did someone amazing share this letter with you? Wonderful! You can sign up for my weekly letters for software engineers on their path to greatness, here: swizec.com/blog
Want to brush up on your modern JavaScript syntax? Check out my interactive cheatsheet: es6cheatsheet.com
By the way, just in case no one has told you it yet today: I love and appreciate you for who you are ❤️