Text

pushd and popd

onethingwell:

A pair of very useful commands, pushd saves the current directory and (optionally) changes to a different one; popd returns you to the saved directory:

$ pwd
/home/you/directory
$ pushd /somewhere/far/away/in/the/filesystem
$ pwd
/somewhere/far/away/in/the/filesystem
$ cd /somewhere/else
$ cd /yet/another/place
$ popd
$ pwd
/home/you/directory
Text

How to use xmacro on Ubuntu

I just had a situation where I had to do the same copy and paste job in a browser a few hundred times, so it was the perfect opportunity to look into a desktop macro recorder/player. I came across xmacro which records X11 events and lets you play them back later, and it worked perfectly after I figured out how to use it.

First, just install it with:

sudo apt-get install xmacro

Then you’re going to record your macro to a text file. Do this using:

xmacrorec2 > yourfile.txt

This will bring up a prompt that will let you tell xmacro a key to use to “exit” or stop recording. Just hit any key that you know that you will not be hitting during recording itself (I used esc).

Now you’re recording, so do whatever it is that you want to automate, and then hit your exit key (in my case, esc).

To play it back, just run it using the text file like so:

xmacroplay "$DISPLAY" < yourfile.txt

The "$DISPLAY" argument just tells xmacro to use your current display. This is not an optional argument, and if you leave it out, you’ll get errors.

Video

From Monument To Masses - Deafening

Tags: Music
Video
Video
[Flash 10 is required to watch video]
Text

Django: passing request.user to a form

So you need access to request.user in your form for some reason, but you can’t just pass random objects to forms, and only the views have access to request. Here’s how it’s done:

Add an __init__() function to the form which looks like this:

Then, when you call the form from the view, add a new user parameter, so it looks like this:

Now you can access self.user anywhere in the form.

Text

Command-T for Vim on Fedora (missing ruby.h errors)

I just spent like an hour with this nonsense. If you’re getting all kinds of errors about how ruby.h can’t be found no matter what you do, then you probably need to install freaking gcc

sudo yum install gcc

Thanks for the helpful error messages. Not.

Link

thechangelog:

Wynn sat down with three Vim users and experts to talk about tips and tricks for using and pimping the popular text editor.

Download MP3

screencap of MacVim

Photo
Scootin&#8217; around now

Scootin’ around now

Tags: Charlie