» tagged pages
» logout

(Feed found, click Add Page to syndicate.) Error finding feed, please try again » Find feed title

A Blog Page allows you to add entries, for news or other time sensitive postings

(Login required to save to your tagged pages.)
(or Cancel)

Make further edits, (or Cancel)

(Login required to save to your tagged pages.)
(or Cancel)

(Editing anonymously: to be credited for your changes, login or register a new account)

Change Page Permissions? Changing these permissions will adjust who can modify this page.

Anonymous (change)
(change)
(or Cancel)
Upload an image from your computer:
or Copy an image from a URL:
or Erase the current icon:
Icon Preview:

or Cancel

Erase launchd? The contents of launchd page and all pages directly attached to launchd will be erased.

or Cancel

(Editing anonymously: to be credited for your changes, login or register a new account)

other page actions:
launchd

launchd

Tags Applied to launchd

No one has tagged this page.

launchd Wiki Pages

What is launchd? Edit this page and describe it here.

sorted by: recent | see : popular
Content Tagged launchd

Running GlassFish on Mac OS X using launchd - Low Bit

GlassFishをlaunchdで自動起動する

GlassFish: del.icio.us/tag/glassfish

Lingon by Peter Borg

Lingon is a graphical user interface for creating launchd configuration files for Mac OS X Leopard

XML: del.icio.us/tag/xml

Automating Rick Rolls with launchd

Lets face it: Your coworkers can be a real pain in the ass sometimes. What better way to remind them of this than automated Rick rolls? They’re likely to never know what hit them.

What is launchd?

According to the launchd guide on Apple’s website:

The launchd daemon takes over many tasks from cron, xinetd, mach_init, and init, which are UNIX programs that traditionally have handled system initialization, called systems scripts, run startup items, and generally prepared the system for the user

launchd stores tasks in plist format. You can find your agents in ~/Library/LaunchAgents. Here is a typical launcd file that will open iTunes every 60 seconds:


  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  <plist version="1.0">
  <dict>
    <key>Label</key>
    <string>com.alternateidea.article.test</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/open</string>
        <string>-b</string>
    <string>com.apple.iTunes</string>
    </array>
    <key>RunAtLoad</key>
    <false/>
    <key>StartInterval</key>
    <integer>60</integer>
  </dict>
  </plist>

Obviously this would be seriously annoying, but for the purpose of this demonstration, save this file as “com.alternateidea.article.test” in your ~/Library/LaunchAgents folder.

This script won’t run automatically, so we need to load it up first using the launchctl program:

launchctl load ~/Library/LaunchAgents/com.alternateidea.article.test.plist

Our agent is loaded up now. After 60 seconds, you should see iTunes.app open. Pretty nice, eh?

Ok, so we don’t want to keep running this agent. Lets unload it:

launchctl unload ~/Library/LaunchAgents/com.alternateidea.article.test.plist

Never gonna give you up. Never gonna automate your Mac.

So, here’s the trick: Wait until your coworker goes to lunch or you know they’ll be out of the office for 10 minutes or so. Then, let the mischief begin.

The first thing we need to do is create our agent:


  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  <plist version="1.0">
  <dict>
    <key>Label</key>
    <string>com.youtube.rickroll</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/bin/open</string>
        <string>-b</string>
            <string>com.apple.Safari</string>
            <string>http://www.youtube.com/watch?v=eBGIQ7ZuuiU</string>
    </array>
    <key>RunAtLoad</key>
    <false/>
    <key>StartInterval</key>
    <integer>1800</integer>
  </dict>
  </plist>

Everything should be pretty obvious in this plist. The StartInterval is in seconds. I want to be an asshole every 30 minutes (1800) seconds. If you want to be a bigger asshole (or Son of a Bitch) you could set this to run in shorter intervals.

Now, we need to save this and load it up on your coworkers computer. Save this to ~/Library/USERNAME/LaunchAgents/com.youtube.rickroll. And load it up:


  launchctl load ~/Library/LaunchAgents/com.youtube.rickroll.plist

If you want to test and make sure everything is in working order, you can run:

launchctl start com.youtube.rickroll

Question: Did you just Rick Roll yourself?

Now, if your test ran successfully slip back to your desk and wait in anticipation for that awesome intro.

Disclaimer: If you destroy your coworkers computer or end up scrapping in the street, I’m not responsible.

Typo: Encytemedia

GlassFish on MacOS X - Using Launchd

Was on my TODO list. Yay procrastination

GlassFish: del.icio.us/tag/glassfish

Page 1 | Next >>
Username:
Password:
(or Cancel)