Auto-lock your Mac, and pause your music when you leave your desk.

Auto-lock your Mac, and pause your music when you leave your desk.

I’m horrible at locking my workstation at work, and I work in an environment of practical jokers who love to play games with unattented workstations.

My solution? EventScrips and a bit of AppleScripting. The event we are going to watch for is a bluetooth device leaving the area.

I’ve configured the scripts to work with ether Radium or iTunes. whichever is running will get pause and play commands.

Here is the setup:

EventScripts

And here are the AppleScripts, The Last one DisableScreensaverPassword is optional I dont like entering my password every time the screensaver is activated. and when my applescript enables the screensaver it sets the passwrod to wake to true first. So when I’m away a password is required to disable to screensaver. I tried disabling the password and screensaver when the bluetoothe device is recognized again but it turns out OS X gets a bit cranky when you try and adjust security settings while the screensaver is activated.

Lock&Pause:

tell application "System Events"
    tell security preferences
        set require password to wake to true
    end tell
end tell

delay 1

if application "Radium" is running then
    tell application "Radium" to pause
end if

if application "iTunes" is running then
    tell application "iTunes" to pause
end if

Play:

if application "Radium" is running then
    tell application "Radium" to play
end if

if application "iTunes" is running then
    tell application "iTunes" to play
end if

DisableScreensaverPassword

tell application "System Events"
    tell security preferences
        set require password to wake to false
    end tell
end tell
No tips yet.
Be the first to tip!

Like this post? Tip with bitcoin!

1PAb9s4iJcTv89MppCfmrknca5d4EcCzKR

If you enjoyed reading this post, please consider tipping me using Bitcoin. Each post gets its own unique Bitcoin address so by tipping you're not only making my continued efforts possible but telling me what you liked.

limera1n verified on 4.1

Verified limera1n Jailbreak works with iOS 4.1 today, I’ve been running 4.0.1 for some time, and I decided tonight to upgrade to 4.1 to get HDR Photographs and GameCenter on my device.  I was a tad worried about trying the upgrade but fairly confident I could revert to 4.0.1 since I took the time to store my SHSH keys with Cydia (http://www.saurik.com/).

So if your currently running 4.1 on your iPhone and want to jailbreak it for any reason at all feel free to use limera1n (http://limera1n.com/). Its extreamly easy to use simply run the application plug in your phone and click the “Make it rain” button. then follow the instructions on the app until it tells you its finished.

After the app tells you its done, your iPhone will be off. Turn it back on, and run the limera1n app, you can then install Cydia and uninstall limera1n from your iPhone. Happy Iphone hacking =)

No tips yet.
Be the first to tip!

Like this post? Tip with bitcoin!

1FHxVQU4ztxLt1yDrBEZdFgUtGrpXj2qQ8

If you enjoyed reading this post, please consider tipping me using Bitcoin. Each post gets its own unique Bitcoin address so by tipping you're not only making my continued efforts possible but telling me what you liked.

Hide WordPress Stats Smilie

If you use the WordPress Stats plugin, you may have noticed the smilie added at the bottom of the page. The plugin itself offers no way to remove the smilie, and is actually required for the plugin to function properly. I myself use the service to keep tabs on traffic to my site.

However not all users myself included like seeing the little graphic in the bottom corner of the page, but just because its needed doesn’t mean you have to see it. Using a little CSS trickery we can hide the graphic from the user. Simply toss the following line in the bottom of your stylesheet and while the image will still be loaded it will be hidden from view, keeping the plugin functioning as it should.

img#wpstats{width:0px;height:0px;padding:0px;border:none;overflow:hidden}

No tips yet.
Be the first to tip!

Like this post? Tip with bitcoin!

1H8WRv8WQDQs712dyAqYToT8tT7HKmrYbJ

If you enjoyed reading this post, please consider tipping me using Bitcoin. Each post gets its own unique Bitcoin address so by tipping you're not only making my continued efforts possible but telling me what you liked.

Flickr Photostream In WordPress

flickr-logoPerhaps you noticed in the top right of the page I’ve added my flickr photos. This is auto-updating, as soon as I upload new images to flickr they appear here on my site as well. And its super easy.
flickrstep1

First head over to http://www.flickr.com/badge.gne, We are going to use the HTML Badge for this. On the next step we have a few options about the type of content you’d like to display. You can choose to display all of your public photos and video or perhaps just your content with a specific tag associated with it. You can even limit it to only display content within a specific flickr set. You even have the option to display all public content from everyones uploads, and yes you can specify specific tags for this as well.

To get the layout I use, select not to display your portrait, leave the number of images to display at 3 (4 isn’t an option we will override this in the next step anyway). Choose to display your most recent images, (or you can opt to display random images) Select Square for the size and for orientation select None (Because you want to style it yourself).

flickrstep5Go ahead and skip the Colors step because we are going to style this ourselves with a bit of CSS. Don’t worry what it looks like at this step, in fact we only care about one thing on the next step, the bit of code I highlighted in the image. However we need to change this code just a bit to load 4 images instead of 3 and to make the code Valid. First lets replace all the & with & and then we need to adjust count=3 to count=4 your end code will look somewhat like this (This will pull MY 4 images not yours be sure to get the code from the flickr page to pull your images).

appearance_widgetsNow that we have the little bit of code we need, lets get it ready to place in the WordPress sidebar. WordPress Widgets are also known as “sidebar accessories” which are WordPress Plugins or add-ons to your WordPress blog sidebar. Developed by Automattic for WordPress and WordPress.com blogs, WordPress Widgets allow the easy addition of design elements, gadgets, content, images, and more to your WordPress sidebar to personalize your blog without knowing HTML, PHP, or any code. Many WordPress Plugins now come with a Widget version to allow easy addition to the sidebar. One Widget type is Text which allows us to input our own HTML or Plane text, We are going to use this Widget type.



appearance_widgetseditor2Now that we have the Basic code put together, we need to style it, so we need to add some CSS to the WordPress CSS file, Don’t worry its not as hard as you think, WordPress has a built in editor for doing this. (The following Instruction’s assume your running the latest and greatest Version of WordPress, If your not UPGRADE! if you don’t know how, Use the Contact link at the top of the page or leave a comment to get ahold of me, I offer WordPress Upgrades as a service, contact me for more details)

Select Appearance from the Left Sidebar, then select Editor, okay we are going to edit the Style-Sheet at the bottom. Once the editor is up scroll all the way to the bottom and Paste the following code in.

#flickr {
width:165px;
height:150px;
margin-left:12px;
}
#flickr a img {
float:left;
margin:0 0px 8px 8px;
background:#3f4e4e;
padding:4px;
width:62px;
height:62px;
}

No tips yet.
Be the first to tip!

Like this post? Tip with bitcoin!

12KaHGyJ8gN2wWF9BHZfJSWLH3zCfp1vGo

If you enjoyed reading this post, please consider tipping me using Bitcoin. Each post gets its own unique Bitcoin address so by tipping you're not only making my continued efforts possible but telling me what you liked.

Changing the default MOTD for Ubuntu

so you have your fresh new Ubuntu system and you log in via ssh to be greeted with

“Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

bla bal bla”

so you fire up vim and change the good ol /etc/motd to sometime a little more along the lines of threating anyone who misuses the system with the wrath of IT.

super your new MOTD works great untill you reboot the system. heres a little secret about Ubuntu notice the first line of the MOTD when you logd in the first time? The line about the kernel version and other system information? Well thats all there because Ubuntu generates the /etc/MOTD file during system startup so any changes you make to this file will be lost on the next reboot. Solution? Ubuntu generates the first line then appends the conents of /etc/MOTD.tail to the end and saves it as /etc/MOTD.

so to use your new MOTD you need to save your message to /etc/MOTD.tail

No tips yet.
Be the first to tip!

Like this post? Tip with bitcoin!

14wFmzChUVoBa77QgvGLv79nA5G7SrZmQk

If you enjoyed reading this post, please consider tipping me using Bitcoin. Each post gets its own unique Bitcoin address so by tipping you're not only making my continued efforts possible but telling me what you liked.