So you want to do something on a mapped network drive using PHP, but it simply tells you it couldn’t find the drive? Worry not.

What’s going wrong?

The problem is that PHP runs under the SYSTEM account, and the SYSTEM account can’t access mapped drives.

The solution:

So, we need to map the drive from the SYSTEM account. You can do this from your PHP script, but if you need persistent access, we can do this:

1. Download the Windows Sysinternals Suite and unzip it somewhere you can easily get to from a command prompt.

2. Open an elevated command prompt. (Search for “cmd.exe” from the Start ball, and then right-click on it, and choose Run as Administrator.)

3. Using the command prompt, navigate to wherever you put Sysinternals.

4. Elevate yourself once again to supreme power by using:

psexec -i -s cmd.exe

A new command prompt window will open that is running as the SYSTEM account.

5. Map the network drive:

net use z: \\[IP ADDRESS HERE]\[FOLDER NAME HERE] /persistent:yes

And you’re done!

Warnings:

You can only remove this mapping the same way you created it, from the SYSTEM account. If you need to remove it, follow steps 1 -4 but change the command on step 5 to: net use z: /delete.

The newly created mapped drive will now appear for ALL users of this system but they will see it displayed as “Disconnected Network Drive (W:)”. Don’t worry though! It displays as disconnected, but will work for any user.


iStock_000003225418XSmall

And FROM_UNIXTIME(), too!

Maybe you’re like me, and you’re migrating something from MySQL over to PostgreSQL. Maybe, like me, you’re swearing a great deal and experiencing high blood pressure, too.
(Or maybe not.)

I’ve seen numerous threads that just tell you how you can change all your code to use Postgres’s epoch_something_something_aint_nobody_got_time_fo_dat() function instead, but epic hero Janusz Slota has a better way. He shows you how to, rather easily, make it possible to run those functions in PG without having to change a thing.

Check out his solution right on over here.

(Just change LANGUAGE ‘SQL’ to LANGUAGE ‘sql’ if you’re using PG 9.2+)


Skipping tracks with repeat on? Preposterous!In iTunes 10, you could skip to the next/previous track when Repeat One was turned on. In 11 & 12, they assume that by “skip ahead”, you somehow mean “rewind this track”.

This really bothers some people.
Do not judge us, we have our reasons!

And here’s one way to fix it.

It took some work, but I finally came up with some AppleScript to handle this. Basically, we’re checking to see if Repeat One is on. If it is, we quickly disable it, skip to the next (or previous) track, and then turn it back on. Apple borked the old way of doing this (same with shuffle), so we’re using menu bar items instead.

-- This script lets you skip songs in iTunes 11/12 even if repeat one is on

tell application "System Events"
	tell process "iTunes"

		-- Find out if repeat one is on
		-- This finds out if the menu item is checked
		set isRepeatOneOn to (value of attribute "AXMenuItemMarkChar" of menu item 3 of menu 1 of menu item "Repeat" of menu 1 of menu bar item "Controls" of menu bar 1 as string) ≠ ""

		if isRepeatOneOn is true then

			-- Set repeat to ALL
			click menu item 2 of menu 1 of menu item "Repeat" of menu 1 of menu bar item "Controls" of menu bar 1

			-- Skip to previous track...
			click menu item "Previous" of menu 1 of menu bar item "Controls" of menu bar 1

			-- Need this, or the next step happens too fast
			delay 0.1

			-- Reactivate Repeat One
			click menu item 3 of menu 1 of menu item "Repeat" of menu 1 of menu bar item "Controls" of menu bar 1

		else
			-- Just skip to previous track
			click menu item "Previous" of menu 1 of menu bar item "Controls" of menu bar 1
		end if

	end tell
end tell

You can copy/paste that, or you can just download the script files here.
There’s one script for skip ahead, and one for skip back.

Wait—how do I use these?

Valid question. They’re not all that useful, really—unless you assign them to hotkeys.

Head on over here to Mac OS X Tips for ways and examples to set hotkeys to run AppleScripts.

Personally, I used Quicksilver to control iTunes for years, but now I use Alfred 2 (with Powerpack.)

(Since it’s not super obvious, let me know in the comments if you’d like help setting up either of these scripts using Alfred 2.)

 



iTunes 11 is out, and most people seem to think it’s great. You and I are different, however. We hate it, and we have our reasons. (Mine happens to be the inability to skip tracks while Repeat One is on. Yup, deal-breaker for me. UPDATE: Fixed that!) So let’s make things right again.

First, you’ll need a backup of your iTunes Library.itl file, found under ~/Music/iTunes. Fortunately, I backed my library up right before installing iTunes 11. Note that any new songs, apps, etc. that you may have added since installing 11 will need to be replaced. In my case, I used the “Date Added” feature in iTunes to find which files I had added since November 28, and copied those out into a separate folder. When the downgrade was complete, I simply copied them back in.

Let’s get started:

1. Back up your iTunes Library.itl file, found under ~/Music/iTunes

2. Now you need an iTunes 10.7 dmg file. Download it from Apple here.

3. Delete iTunes 11. There are different ways to do this. One is to use an app called AppZapper. The method that worked for me was this: Open Terminal.app and run these commands, one at a time:

killall iTunes
killall "iTunes Helper"
sudo rm -rf /Applications/iTunes.app/

That last one will need your password and will probably take a minute or so.

4. Now we have to reinstall iTunes 10.7 using an app called Pacifist (shareware, free). Download Pacifist and run it. (Mavericks: download Pacifist from the link at the bottom of the post instead.)

5. Choose the Open Package option. Browse to the iTunes 10.7 dmg file.

6. You’ll get a list of files. Select “Contents of Install iTunes.pkg”, and from the top left corner of the app, choose Install.

7. Be careful here! Every time Pacifist tells you a file already exists, make sure you check the “always” box and choose Replace (not update). This should happen around three or four times.

8. You’re almost done. Before running iTunes again, make sure you have recovered your “iTunes Library.itl” from a pre-iTunes-11 backup. After that, you should be good to go. But as ever, your mileage may vary.

Mavericks (10.9) Update

I was dreading Mavericks because it automatically updates iTunes to 11, and this is frankly unacceptable for some. Thank goodness this method worked like a charm this morning! I had 10.7 back in about 5 minutes.

There was only one hiccup: Use this version of Pacifist (3.0.10)! For some reason, the latest version (3.2 as of this writing) would not install the package.

Also, if you just installed Mavericks, don’t open iTunes! If you do, it’ll update your iTunes library files, and you’ll have to restore your old ones from a backup after you install iTunes 10.7. But if you never open iTunes 11, they won’t be changed, and you won’t have to restore a thing.

*Mavericks Update #2

So it appears that after downgrading to iTunes 10.7, the Mac App Store may become borked in the process — apps will neither update nor download from it. I’m not sure if this is just because Mavericks is fresh and will get updated by Apple or what. I use the Mac App Store just about never, so I don’t really care, but you might! More details as they become available.

If you’ve already installed 10.7 and want the app store back, installing iTunes 11 again fixes the problem.


The full quote comes from Sebastian Thrun, the tenured Stanford Professor who left in order to begin exploring new teaching methods online.

During the era when universities were born, “the lecture was the most effective way to convey information. We had the industrialization, we had the invention of celluloid, of digital media, and, miraculously, professors today teach exactly the same way they taught a thousand years ago.”

You can find the full story at The Chronicle of Higher Education.

 


Threw this together on Thanksgiving. Because it’s true.

Feel free to take and use. (Click for bigger version.)


So, among other productivity methods I’ve been trying this month, I also tried the Hipster PDA method, where essentially you use a small stack of index cards with a big clip to keep track of what you need to get done. (Optionally also with the Getting Things Done and 43 Folders philosophies.)

Most people react to this by saying something like, “Seriously? Index cards.” Yes, seriously. You should probably try it out. And I know several people for whom this PDA works very well!

Dispense justice tomorrow at 3:21am. It's like they say, if someone's going to kill you, wake up early and kill them instead. Just like they say.
Like this.

But I’m not one of them.

Here’s the thing — after literally years trying to get myself to use paper calendars/planners/notebooks/etc., I finally discovered that if my calendar / organizer can’t beep at me, it effectively doesn’t exist.

While trying out the Hipster PDA, I thought I’d finally give it one more shot. See if that was still true. It is.

Sure, I can carefully put everything I want to do today into a planner. I can schedule that appointment for 12:00. And then life will happen, the dean will have a critical project he needs done by tomorrow, I get deep into the zone working on that, and don’t realize until 5:32 pm that we had an appointment at 12:00. That’s pretty much how my life and my brain work.

Furthermore, when you ask me to bring you a document tonight, I’m filing that away in my memory with 32 other things I’m supposed to remember to do by then. 1-17 more are guaranteed to come along before then. Odds are, I’m not bringing your document tonight. Yes, the hPDA is supposed to remind me — if I’m not so absorbed in thinking about the next problem to give it a few minutes. Throughout my test, I only rarely managed to consult my stack of cards effectively. I’m both an easily distract-able and highly focused individual. (Yes, you can be both.)

My solution, the one I’ve been working on for a few years now since I got my first PDA, is to put everything into my digital calendar(s). Events and appointments are obvious, but I also add everything I need to remember later but probably won’t, like “Start walking to class now or you’ll be late”, “Look over the document that Sarah just handed you”, “Respond to Dana’s email”, etc. For things like that, I take my best guess as to when would be a good time to address that matter. 50% of the time I’m wrong, but the reminder brings it back into my consciousness when it would otherwise be lost. Also, it’s easy to tell the reminders to try again later.

Easy Calendar in Action!

I have two calendars: a Google Calendar for more personal and school things, and an Exchange calendar for work-related things. The beauty here is that both calendars live in the cloud — meaning they’re not saved on something I can drop into the sink and destroy forever. And both my phone and computer connect to them, so I’ll always be reminded.

To make things even easier, this month I started using Easy Calendar for the iPhone. I find it much quicker than the default calendar app to add new items, and to see what’s coming up in the next week. Easy Calendar lets you set a default alert for every new item you add, which is good since I add an alert to every single one.

On my computer, I use the aptly named Remind Me Later app (free), which lets me type in natural language, like “Turn in that awesome assignment tonight at 6” The app is smart enough to know that by “tonight” I mean October 25th, and that “6” means 6 p.m., and it automatically puts it into my calendar with a reminder.

Like I mentioned earlier, sometimes it’s enough only that the system bring an item back into my working memory after it’s been pushed out by any number of a dozen things.

Will this system work for you? Quite possibly. Is it the right one for you? Maybe. Hard to say. Could be that the Hipster PDA works better for you, for example. If my experiments with productivity techniques have done anything (besides give me some great ideas and tools), they’ve reminded me that I’m a cognitive bird of a somewhat different color. But then, aren’t we all in our own ways?


The Actiontec GT784WN is a pretty nice DSL modem/wireless N router. For most of you, it will work right out of the box — even auto-detecting all your settings.

If you’re on Qwest/CenturyLink, not so much. In fact, they’ll try to tell you that the modem isn’t even compatible. That isn’t quite true — it is compatible, it simply isn’t supported, meaning their customer service has no training for this model. And that’s okay!

But you got your Actiontec and you want Internets. Well, we may be able to help you with that! I’m going to repeat some of the normal setup steps here. If you know what you’re doing, skip to #7.

  1. Just do like the Quick Start Guide says, plug it into the phone line, then into the wall, then wait for the DSL light to turn solid.
  2. Connect to it via the Ethernet cable and use your browser to head on over to http://192.168.0.1.
  3. Skip the Quick Setup and hit the Advanced Setup link. Now find WAN IP Settings on the left.
  4. Set the ISP Protocol to PPPoE.
  5. Under #3, enter your Qwest/CenturyLink username and password. (The username will be some kind of email address. I got these directly from Qwest when I signed up.)
  6. Mash Apply at the bottom of the screen.
  7. Now, find Broadband Settings on the left menu. It can be easy to pass up because it looks like a section heading more than a link.
  8. This part is a little tricky. It changes depending on region. If you used to be in the Qwest service area before CenturyLink merged with them, set VCI to 32. If you used to be Embarq, try VPI 0, VCI = 32. If you used to be CenturyTel, try VPI = 0VCI = 35.

UPDATE: When I originally posted this, it was for the Qwest service area. CenturyLink has merged with a lot of companies since then, and other smaller areas may have different connection settings. So these settings may not apply to you!

Your mileage may vary! And good luck.

(Thanks, commenter Curtis for the regional settings update.)

IF YOU LIVE IN FLORIDA: Commenter Just Joe has supplied the settings for your area. Go to the comment. Thanks, Just Joe.

 


It’s been a month since I busted out with the Pomodoro Technique in a productivity boosting experiment. While I think it has improved thing somewhat, there are still some areas I find it a little lacking.

A quick overview in the (quite possible) event you haven’t heard of it. Basically, you:

  • Choose a task to be accomplished
  • Set the Pomodoro to 25 minutes (the Pomodoro is the timer)
  • Work on the task until the Pomodoro rings, then put a check on your task list. (You can have a lot of checks on a single item.)
  • Take a short break (5 minutes is OK)
  • If you get interrupted during a Pomodoro, put a different mark, like an “I”
  • Every 4 Pomodoros take a longer break
  • Walk like an Egyptian*

* Not actually part of the Pomodoro Technique

The Good

RECORDS

There’s a lot that’s great about the Pomodoro Technique, one of the main things being the record you end up having of your day. It’s easy to get to the end of a typical day and think or feel that you haven’t actually accomplished much. The PT leaves you with a record of what you’ve accomplished so you can feel, well, accomplished. For every Pomodoro you do (or 25-minute activity block) you write it down. Every check feels like giving yourself points for getting something done, even if it’s your 16th check on, say, “Update the Natural History Museum Observation Module.”

For my task list (or “activity inventory”), I use a text file in Dropbox, which I have easy access to on my phone via an app called Plaintext. That way I can keep it handy on any computer I have, or when I’m lacking one. I also sometimes list how many pomodoros I think something is going to take. If you’re like me, having time frames on unpleasant tasks of any magnitude help a lot.

My list. On my laptop (left) and on my phone (right). X means a completed pomodoro, U means I was interrupted or it wasn’t finished, and # means the task is complete.

FOCUS

This is a great aspect. When tempted to deviate to email or IMs, it’s helpful to remember that I’m on the clock here — I can get to that after this pomodoro is done. I have a simple timer in my menubar, so I can easily see how much time is left. While most Pomodoro apps will set you back a few bucks, there are a bunch of free ones. I use Menubar Countdown.

Menubar Countdown (near the left)

PLANNING

Another great thing about this method is the way it can help you challenge yourself. When starting a day, you can set a goal for yourself to beat your average pomodoros done in a day. That average is also a good indicator of how much you’re likely going to accomplish on a given a day, so you can gauge how much to take on.

The Less Good

Pomodoro isn’t perfect, but then, what is? That said, here are some possible drawbacks.

ALL OR NOTHING
Either you work for 25 minutes and get to mark an X, or you don’t get to complete it. I use a different mark than X, but it doesn’t feel the same. Also, sure you can ignore emails for half-an-hour, but when people drop by in person, you can’t really tell them to come back in 9.5 minutes. You also can’t show up late to meetings or train stops because you’re in the middle of one.

SOMETHING ELSE TO DO
As great as all the things I listed above are, sometimes creating a task list and checking it off is just one more thing to do, and when you already have forty-six-dozen deadlines coming, you don’t really want to have yet another thing to manage. Sure, managing it helps you manage other things, but if that logic always applied, our dentists would never be on our cases about flossing.

In a nutshell

Pomodoro is great stuff. Will I keep using it? Probably. But my implementation will likely morph into something else along the way as I adjust it for my own needs. I just can’t see myself managing an activity inventory, a to-do list, a chart sheet and an extended log like the book tells you to. If I’ve learned one thing about both interface design and myself, it’s that things have to be simple, or they won’t be sustainable.

Blog Pages