Tag Archives: apple

Immediate macOS Screen Lock

[Danger: Unix nerd stuff ahead]

While I work from home sometimes, often times, I find myself working at customer locations, in airports, train stations, Starbucks, my company’s field offices, conferences, or in some sort of environment that’s less than fully trusted. When I find myself working in such places, if I walk away from my Mac even for a moment, I’m a good boy and lock my screen. It’s really a best practices from a security perspective, you should do it too.

I also recently got an Apple Watch. One of the features I really love is that if my watch is unlocked, and I open up my Mac, as long as I’ve already logged in and it’s just simply locked, I can unlock with my watch. Open the lid, be in range, bang, unlocked.  Love it.

I also seem to often times have a terminal window open for something. By the way, can’t say enough good about iTerm 2. Conventional wisdom recommends that CLI-savvy folks who want a quick way to lock your Mac should have a bash alias that looks something like:

alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"

If you’re an Alfred user, that’s the same thing Alfred’s doing behind the scenes if you use the “lock” command with Alfred configured with its defaults.  The problem with this? When you’re using non-local accounts, like accounts hosted in Active Directory, instead of getting the “just have your watch on, or type your password” sort of lock screen, you get something more like a login window where you must type your username & password to get back in.  Ok, so why not use a hot corner to activate the screensaver?

This is where my problem kick in.  Our IT team has lock set to kick in 1 minute after the screensaver activates, and I can’t change it to “immediately”. So, even if I use a hot corner, that doesn’t do the job.  I want the lock to be instantaneous.  macOS has a standard app for Keychain management called Keychain Access.app. It has a preference to show Keychain status in the menu bar. This menu has an option called “Lock Screen”, which does exactly what I want, but now I need to mouse around, click, click again, as opposed to a quick Alfred command or a bash alias to invoke the magic.

I found a discussion on Stackexchange about this very topic. Some kind soul wrote a few lines of Objective-C code that works perfectly. It actually calls the same feature the Keychain menu uses. Figuring I can’t be the only person who wants this, I tidied up the code a touch and put it on GitHub for posterity’s sake. Out of a desire to make it easy for others to install this, I even submitted a Homebrew Formula. Sadly, the code didn’t meet the requirements the guys who maintain homebrew-core wanted, but they suggested I make a tap instead.  A tap gives anyone the ability to install the software without having it in the main repository.  Want to install this and give it a go? Assuming you’ve already got Homebrew installed, you can just run these commands:

brew tap jcostom/taps
brew install maclock

If you would like to see maclock end up in homebrew-core, star the repo, and better yet, fork the project, improve, and send a pull request back!  I know enough Objective-C to fill a small post-it note. Maybe you know more?

Printing from the iPad without buying a new printer

Ok, so you’ve got a snazzy new iPad, and would like to print.  Since iOS 4.2, Apple has had AirPrint, which only works with a small set of HP printers.  While yes, it’s super cool to be able to print from the iPad, how much will you really do this?  If it’s enough to warrant buying a new printer, good for you.  If you’re like me, and want to have the ability to do so, but probably will rarely do it.  Read on to find out more. Continue reading Printing from the iPad without buying a new printer

Tech Predictions for 2010

It’s that time of the year again kids.. For some reason, I didn’t do this last year.  Here we go, my 10 predictions for technology in 2010.

1. Netbooks – huge.

You thought 2009 was the year of the netbook?  You ain’t seen nothing yet, kid. 2010 will bring a whole new crop of them, this time with the Nvidia ION chipset, allowing you to watch HD content on your little netbook.  We’ve already started seeing better screen resolutions like 1366×768 (instead of the older 1024×600), giving you greater than 720p on the display.  This will continue, though I don’t think you’ll see 10″ screens grow much more in resolution.  Apple’s rumored to release something early in 2010, possibly called iSlate, which will be a hybrid netbook/tablet device.

2. Home Virtualization

In 2009, with VMware ESXi being free, geeks started doing bare-metal virtualization more and more, dumping host-os solutions like VMware Server in favor of better performance.  This trend will accelerate in 2010, and we’ll see someone introduce a virtualization product targeted at the so-called “pro-sumer”.  It will be interesting to see if it’s specifically marketed as such.  What’s it for?  Aggregation of lots of different home network services onto a single hardware platform.  Maybe it’s all a dream for us geeks, but I think something will pop in 2010.  Remember, everyone said the same thing about NAS, and now those are everywhere too.

3. Gigabit Ethernet for everyone

People will stop buying routers and switches for the home that are only 10/100 devices.  The driving forces?  NAS and 802.11n.  As people replace old computers with new, they come with shiny stuff like 802.11n wifi cards instead of crusty old 802.11g.  This means a jump from 54 Mbps to 300 Mbps.  Obviously, 300 Mbps > 100 Mbps, and nobody wants to have access to their data on the NAS to be that slow.

4. Android Cleans House

I admit it.  I like Google.  I love the idea of a common-source OS that’s open for mobile devices.  I’ve got serious technolust for something running Android right now.  I’m doing my best to be patient though.  I want to see the latest batch of devices, hopefully with 1 Ghz Snapdragon processors and Android 2.1 first.  After that, if it’s got AT&T 3G bands and wifi, I’m in.  I predict that people will finally start falling out of iLove with their iPhones, though certainly not in droves, and move to a more capable platform that does “more.”

5. Another new iPhone

As it’s older siblings before it, it will be buzzword compliant, but probably only with stuff that isn’t cutting edge.  You’ll get your 5MP camera (that I had on a phone 2 years ago), you’ll get HSPA – but won’t be able to use it.  What’s the big prediction here?  New headphones that use Bluetooth, sort of like the ones that Nokia sells.  They’ll be optional, and work with the 3GS, but I’d bet they won’t work with the 3G and certainly not the original iPhone.  Nothing earth shattering, but they’ll be Apple-branded, and tightly integrated with the device, so you’ll see stuff like song titles and caller id info on an OLED display, possibly color, using buddy icons from your address book.

6. Another iPod Shuffle down-size

Because they’re not small enough, right?  This time, it will be a single piece of hardware, integrated into the headphones.  It will also see a price cut to $49 for a 4GB model.  Just an incremental change in the end.

7. More gigantic technological misnomers

Like LED TVs.  I had a discussion with someone not long ago who insisted that these were not LCD TVs, and were in fact LED TVs.  He just couldn’t get past the idea that the display technology is largely the same, possibly some incremental changes, but the real change is in the backlight.  LCD TVs that were purchased a couple of years ago were certainly backlit using fluorescent bulbs.  These “LED” TVs use LED bulbs for the backlight.  That’s the limit of the changes.  These are not self-illuminating screens like OLED or AMOLED.  Now an AMOLED screen – that would be HUGE.  What will the misnomer be about?  Who knows?  It’s coming though.

8. A “major” newspaper will fail to make it to 2011

We’ve been talking for years about the impending death of the newspaper, in favor of Internet-based news channels.  I think back to our experience with the local paper earlier this year.  We subscribed purely for the reason of getting coupons.  We subscribed to the weekend package (so Friday – Sunday).  Total cost was about $10 a month.  The problem?  We only netted about $5-6 worth of coupons per month.  After 2 months, we canceled the subscription.  Ad revenues are already in the toilet for newspapers, and will only continue to decline.  Ask not for whom the bell tolls, it tolls for thee, Mr. Newspaper Man.

9. Compressed hydrogen will start moving.

Sure, Honda’s got their prototype Accord going in California.  But, we’re going to start seeing a real compressed hydrogen delivery network being built.  Hydrogen is arguably one of the most abundantly available elements on Earth.  The vehicles emit water vapor as their exhaust.  Not so bad, eh?  Please, don’t confuse me with a climate change fruit loop.  I don’t subscribe to cooking the books in order to support my points, as is the case in the climate change circle these days.  But surely a car that emits water vapor can only be a good thing, when compared to a gas or diesel vehicle.

10. A usable water-based fuel cell

This thing is the big dream.  You fill it up with water, and the hydrogen is used to power the device.  It’s completely sustainable, and free to “recharge.”