How to lock the screen in Mac OS X

One of the things I missed when I switched to this MacBook was the easy ability to lock my screen. When I leave my desk at work, I desperately do not want some hooligan sitting down to write the president of our university an email, asking for a pony while using my account. Gnome, the user interface I prefer with Linux, has screen locking available from the logout window pretty easily, and in Windows I just have to perform the three-finger-salute (alt+ctrl+del) to get a Lock Screen button. But there was nothing obvious in OS X to mimic this functionality.

Rob at work showed me how to lock the screen on OS X server, though, which is identical to OS X for the desktop, so I thought I’d share.

Step 1: Opening the Keychain Access utility

Keychain Access can be reached through the Utilities folder or by typing "keychain" in Spotlight.
Keychain Access can be reached through the Utilities folder or by typing "keychain" in Spotlight.

First, open up the Utilities folder. You can get to this by either hitting Command+Shift+U with the desktop (Finder) selected, or by opening Finder, browsing to the Applications folder, then double clicking on the Utilities folder.

Step 2: Opening the Keychain Access Preferences

Reach the preferences window through the menu bar at the top of your screen.
Reach the preferences window through the menu bar at the top of your screen.

Once you have Keychain Access opened up, you’ll see the Keychain Access window on your screen. You can ignore this, because what we really want to get into are the Keychain Access preferences. To reach these preferences, click on the words Keychain Access at the top left of your screen and then select Preferences from the drop-down menu.

Step 3: Modify Keychain Access Preferences

Check the box labeled Show Status in Menu Bar.
Check the box labeled Show Status in Menu Bar.

All we need to do in this window is check the box labeled Show Status in Menu Bar. Once completed, go ahead and hit the red button (X) at the top left of this window to close it. You can also close the main Keychain Access window.

Step 4: Lock Screen (if so desired)

You can now lock the screen by clicking on the padlock icon at the top right of you screen.
You can now lock the screen by clicking on the padlock icon at the top right of you screen.

You can now lock your screen by using the padlock icon at the top right of you screen, located on the menu bar to the left of the clock and other icons.

Lightbox

Just a quick post about my foray into Lightbox. I started messing with this while writing about Flickr the other day, and after a bit of tweaking, I got it working.

You could just follow the steps on this page, but installing the plugin for WordPress is probably easier. The first, however, will allow you to use Lightbox wherever and however you like, while the latter will only work inside WP.

I, of course, followed the steps to do it manually (mostly because I didn’t find the plugin until after I was done and had it working *sigh* ). Something I discovered that might be of interest to you is that, while the instructions technically allow Lightbox to work, it 1) doesn’t tell you everything you need to do and 2) doesn’t necessarily work right on blogs.

First, when you upload and extract the files, it is assumed that you’re putting those in the root of your web server. I had put them elsewhere, and subsequently it wasn’t working.

However, because they assume root (once you get them moved there), going to a specific blog entry will prevent Lightbox from working. Essentially, all the code in the JS and CSS files point to root or ../images for everything. Which is great, and works just fine on my main page (http://mstublefield.com), but when I go to a blog post (for instance, https://mstublefield.com/blog/2008/09/24/why-i-dont-use-flikr/), going to ../images actually points at https://mstublefield.com/blog/2008/09/24/images (the ../ being “go up one level”).

So, I went through the JS files and the CSS file and changed the links from dynamic to static. Therefore, instead of ../images/close.png, it became https://mstublefield.com/images/close.png. Instead of js/whatever, it became https://mstublefield.com/js/whatever. This allows Lightbox to work inside specific blog posts, as well as on the main page. The only files that need edited are the lightbox.js and the CSS file.

Secondly, the CSS file wasn’t quite working for me. The instructions say to put it somewhere and their files will point to it. Instead, I had to manually copy/paste the CSS and append it to my main stylesheet. This seemed to work a lot better for some reason. Maybe it’s that I didn’t have the CSS in the right place, but regardless, it was easier just to copy the code over.

Between adding ZenphotoPress and Lightbox, I’m pretty excited about adding more pictures to my blog 🙂

WordPress Advanced Editor

Because I’m so content-focused with my blog (focusing largely on writing), I really love the advanced editor in WordPress, especially as of version 2.3. I do the vast majority of my writing live inside WordPress, where it saves every 30 seconds and I have a character map at the click of a button in the toolbar if I need to accent something. Links are easy to insert, I can pull pictures in easily, and it fits my purposes.

But a friend of mine is an actual web designer, and as such, he does a lot more on the visual and code side of things. The advanced editor in WordPress gives him quite a bit of grief, particularly when he switches over to the Code tab and enters some custom HTML, then goes to the Visual tab and sees that WordPress has “cleaned” his code, effectively breaking what he intended his post to look like.

The code cleaning feature in WordPress’s TinyMCE advanced editor is there to help users protect their theme. By ensuring that code is encapsulated and formatted “correctly,” it keeps WordPress pages from breaking. Unfortunately, it also often makes changes to one’s intended code, frustrating the user.

Stephen at Scratch99 has a great article about how to address this problem, and I suspect that Ryan will take the simple method of editing the TinyMCE javascript file and just turn off the “clean code” feature.

Turning the Advance Editor Cleanup Off

If you often enter your own HTML, but still want to use the Advanced Editor, then you might want to consider turning it’s cleanup option off. I stumbled upon how to do this on Thu Tu’s Smacking WordPress Editor.

Note: if you do this, the Advanced Editor will not do any cleanup. If you make errors in your HTML that break the theme, you’re on your own! If this happens you may not be able to edit the post anymore – the only solution may be to close the browser, go to the manage posts page again and delete the offending post.

To summarize how to turn off the advance editor cleanup:

Download the wp-includes/js/tinymce/tiny_mce.js file using an FTP program and use a text editor to change the following (near line 167) from:

this._def(“cleanup”, true);
to
this._def(“cleanup”, false);

Save the file, then ftp it back up to the server, overwriting the original.

Note: you need to delete your browser cache before this takes effect. For Internet Explorer, click Tools on the menu, then Internet Options, then Delete Files. For Firefox, simply press Ctrl+F5. For other browsers, sorry you’re on your own, but it should be straightforward to do.

As for me, I’m going to keep writing just like I always do. Now, if I could just find a decent way to format poetry correctly in WordPress…

Ubuntu 8.04 on the Asus EEE PC

A couple of weeks ago, a faculty member brought her Asus EEE PC (pink, as she often pointed out) to our Help Desk, asking that we connect it to our university’s wireless network connection. I fiddled with it for a few minutes before coming to the conclusion that, quite simply, making it work on our wireless wasn’t worth the time it would take right then. The version of Xandros that ships on the EEE is very stripped down, to the extent that I couldn’t find a tool with which to acquire and install software. Not only could I not get the Madwifi drivers I’d need to make the Atheros card handle the level of security we require, but even if I could, there were no tools to compile the drivers.

There were two solutions open to me. The first was to get the drivers and recompile the kernel with them (after somehow getting the kernel build files onto the EEE), which would probably have taken 2-4 hours, all just to get wifi to work. The second option was to install a different distribution of Linux on the device. This solution might take equally long, but it was more guaranteed, might take less time, and would probably only have to be done this once. For future installations, a procedure would be codified and setup would therefore take a lot less time.

Thus, we begin. The Asus EEE doesn’t have a CD-ROM drive, so we could either do a netboot installation, pulling the ISO from a network drive, or we could do the installation off a USB jumpdrive. The EEE’s BIOS handles booting from removable devices, so I decided to give that a go.

Crucial Stats:

Asus EEE PC 4G (4gb SSD) with webcam
Lexar 1gb JumpDrive
Ubuntu 8.04 Desktop Edition for x86, 32-bit edition
Linux Kernel: 2.6.24

Instructions originally from the Ubuntu Community Wiki:

Converting an Ubuntu ISO to a Jumpdrive

The first key to this process is having a computer with the version of Ubuntu on it that you want to install to your target machine. This can be particularly troublesome if you are beginning your first ever installation of Linux on the EEE, and therefore don’t have another machine to use as your base. If that’s the case, my sympathies; I don’t have a solution for you. You can try to download the image to your EEE and do this process from there, but it probably won’t work. I initially attempted the ISO-to-Stick process from OpenSUSE and it failed. The instructions recommend using Ubuntu if you want to turn your jumpdrive into an installation of Ubuntu, so that’s what I recommend as well.

I was intending to put Ubuntu 8.04 on my laptop anyways, so I downloaded the ISO last Thursday and burned it, then installed the operating system on my HP zv5000. Now that I had a working install of Ubuntu, I could proceed to make my jumpdrive an installation device.

The first step is to install syslinux

sudo aptitude install syslinux

Insert the USB device you want to use for the installer. A few seconds after plugging in the USB device run the dmesg command or sudo fdisk -l (I prefer this method, myself) to find device it was assigned. The rest of the instructions refer to /dev/sdX1, remember to replace X with your device location. This changes from distro to distro, so don’t assume that your device is named the same as it has been in the past.

Preparing the Flash Drive using isotostick.sh

The easiest way, which also works with the Desktop installer, is to use the isotostick.sh script from http://www.startx.ro/sugar/. To make things as easy as possible, place the ISO and the script in the same folder. Use the following commands to download the script, make it executable, and run the script.

wget http://www.startx.ro/sugar/isotostick.sh

chmod u+x isotostick.sh

sudo ./isotostick.sh ubuntu-8.04-desktop-i386.iso  /dev/sdX1

Be sure to replace /dev/sdX1 with the partition name of your USB stick found in the previous section. You will see some “operation not permitted” errors when the script tries to copy the symlinks for /dists/stable and /dists/unstable. This is because fat16 file systems do not handle symlinks, but it will not cause any problems. This process will take some time and it won’t look like anything is happening, but be patient. If you desire feedback, open up Nautilus and browse to your removable device. You can refresh the view to see how much free space is left, which should shrink rapidly as the script runs.

Now you can boot from the USB stick and install Ubuntu just like if you had booted from the Desktop CD. I prefer to partition the hard drive to have /home on a separate partition, and chose to do so in this case. With only a 4gb drive, you don’t have a lot to work with, so I looked at my laptop to see how it had turned out. The root files had used approximately 2.9gb of space, so I gave 3.3gb to root and 600mb to /home. This left about 400mb for the installation of programs and about 90mb of swap space. That’s less swap then is recommended, but with 512mb of RAM, I figured it’d be OK. The device has reportedly been working fine for the last week and, when doing nothing more than checking email or running Skype, I think it will continue to work fine.

Instructions originally from the EEEUser Wiki:

Ethernet and Wifi

While it doesn’t always occur, you may notice that your Ethernet connection does not work on first boot. I’m not sure why this is, but the solution is simple: unplug the device, turn the device off, remove the battery for about thirty seconds, plug the battery back in, and turn the device back on. I imagine this resets something in the BIOS (maybe there’s not a separate BIOS battery?) that was keyed specifically to Xandros, and after resetting it works in a more default manner. Probably how it should have to begin with.

For wireless internet, we still have to install the Madwifi drivers, it’s just a lot easier than with Xandros. Enter the following commands in order, waiting for each step to finish before continuing (of course):

sudo apt-get install build-essential
wget 'http://snapshots.madwifi.org/special/madwifi-ng-r2756+ar5007.tar.gz'
tar zxvf madwifi-ng-r2756+ar5007.tar.gz
cd madwifi-ng-r2756+ar5007
make clean
make
sudo make install
reboot

Your wifi should now work as advertised, even with more advanced forms of PEAP authentication. Be aware that, due to the low power spec of the EEE, its wifi antenna is not very strong. Using the same operating system, sitting side-by-side, I had my laptop and the EEE. My laptop had a connection of 90% to our wireless while the EEE was hovering between 40% and 55%. Not twenty yards away, it was barely 35%.

Built-in Camera

The built-in camera (in the versions of the EEE that have one) works right out of the box with Ubuntu. The strange thing is that, despite the fact that Ubuntu 8.04 has the drivers necessary for the camera, it is not turned on in BIOS. At some point, slip into BIOS (I think it’s F12, but my memory’s hazy on that one; just keep an eye on the splash screen when you reboot sometime) and turn it on. It’s easy to find and easy to change. After that, you can test the camera by installing Cheese and playing around with it.

I was pretty impressed with this little camera. Good picture quality, and it picked up motion pretty well. If you move too fast, though, it overwhelms the tiny processor (900mhz usually) in the machine, so be careful or you’ll lock it into processing for a few seconds before it can catch up. Ubuntu’s stable enough that we never crashed it with the processing, but we did have it freeze a few times while it churned away at drawing the images.

Conclusion

Ubuntu 8.04 runs very well out of the box on the EEE PC, but you will often run into window-size issues. Some of the menus and windows don’t scale down well, and you’ll have them spanning down below what the EEE displays. For instance, when we setup the WPA2Enterprise connection for our wireless, the button to connect was way below the bottom of the screen and only accessible via hotkey (alt+o).

However, the EEE works surprisingly well when connected to peripheral devices, and I used a USB keyboard, mouse, and a VGA monitor on it with great success. With a 19″ LCD monitor, the EEE was able to push a resolution of 1280×1024. My memory’s hazy on the matter, but I seem to recall that the advanced graphics did not work on it (like wobbly windows or cube turning) but other, standard operations ran just fine. OpenOffice.org was usable in Web view (print view extended the document off the screen to the right), Firefox was perfect, and Skype fit on the screen without a problem.

The faculty member reported getting right over three hours of battery life with Ubuntu 8.04 installed.

It’s not a device I would likely buy due to the tiny keyboard (I use my laptop mostly for writing), but it’s certainly handy, sleek, and can get the job done. And yes, it does run Linux.

USB Mouse on FreeBSD

Since I’ve been getting a surprising amount of search hits on this topic, I thought I’d provide a general update on my FreeBSD status. First, like I said before, FreeBSD doesn’t like USB because, apparently, USB sucks. To get around the issues I was having, I simply had to move the USB devices to a different line than what the Ethernet port was on.

I’ve always defaulted to plugging the keyboard and mouse, in that order, right next to the Ethernet port because of some Dell machines we received a couple of years ago. There was a bug in their USB implementation that prevented mice and keyboards from working if they weren’t plugged in that order, but FreeBSD specifically would not load (during boot time) devices plugged in alongside the Ethernet port. Moving the keyboard and mouse to different USB ports did the trick.

More updates on FreeBSD when I get the time; right now I’m wholly consumed by my desire to get Confluence working right with our Active Directory server, and after providing me a glimmer of hope, it has taken a turn for the worst.