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.
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.
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.