Welcome to my scratch pad of technical things I don't feel like forgetting.
18 May 2013: I just discovered a cool new programme that lets you control your window manager from the command-line: wmctrl. My favourite feature is using it to change the current terminal window title:
wmctrl -r :ACTIVE: -N "psql session on foohost"
Sweet!
24 April 2013: I have added a best JDBC default transaction isolation level note to my PostgreSQL JDBC Section. I have started adding "set -e" and "set -u" to all of my sample bash scripts (not done yet!). In my PostgreSQL section, I have added a handy function to extract the extension from a filename. More good stuff to come!
How to get your NEW R.A.T. 7 mouse to work with X:
Make a file called /etc/X11/xorg.conf (newer versions of X won't even have this file anymore) and put this in it:
Section "InputClass"
Identifier "Mouse Remap"
MatchDevicePath "/dev/input/event*"
MatchProduct "Mad Catz Mad Catz R.A.T.7 Mouse"
Option "AutoReleaseButtons" "13 14 15"
Option "Buttons" "17"
Option "YAxisMapping" "10 11"
Option "ZAxisMapping" "4 5 6 7"
Option "Emulate3Buttons" "no"
Option "Resolution" "3200"
Option "ButtonMapping" "1 2 3 4 5 0 0 8 9 7 6 12 0 0 0 16 17"
EndSection
This will make one of the mouse buttons, which never sends a release event to X, play nice by being reassigned/ignored. It will also make the side-to-side scrolly button work, if that is your thing. :-)
NEW! 28 March 2013, I have updated my PostgreSQL/Bash section with the updated syntax for getting the output of commands, $() instead of ``, and I have also shown a spiffy use of bash's <<< operator for getting one multi-line row from psql into bash vars using read.
23 Feb 2013, I have put my .bashrc script in the new "Bash stuff" section (I finally hacked one together myself to get exactly what I wanted in my PS1 prompt). I have also updated my .psqlrc script with some new goodies.
21 Feb 2013, consolidated Tomcat stuff in a Tomcat section.
16 Feb 2013, added a Redis section.
New section! How to custom-compile and install PostgreSQL from scratch!
New in Shell Tricks! How to send e-mail automatically from a dying/exiting shell script!
Hello! I continue to expand my PostgreSQL Stuff section. I may have to start breaking it down into subsections!
Mount options for ssd:
/dev/sda / ext4 discard,noatime,errors=remount-ro 0 1
It's been a while, but I have added yet more stuff to my growing page of psql tips and tricks. I spend a lot of quality time with PostgreSQL, so I may as well capture stuff whose syntax I want to look up. I particular, look at the stuff on copying data between databases, creating new databases with flags to specify character sets and locales (or explicit lack thereof), and fun uses of psql's --single-transaction flag. Here's the link.
New! My new firewall section shows how to set up a firewall on any computer/device that has two ethernet ports. (I used an AOpen DE2700.)
How to get your R.A.T. 7 mouse to work with X:
Make a file called /etc/X11/xorg.conf (newer versions of X won't even have this file anymore) and put this in it:
Section "InputClass"
Identifier "Mouse Remap"
MatchProduct "Saitek Cyborg R.A.T.7 Mouse"
MatchDevicePath "/dev/input/event*"
Option "ButtonMapping" "1 2 3 4 5 6 7 2 9 10 11 12 0 0 0"
EndSection
This will make one of the mouse buttons, which never sends a release event to X, play nice by being reassigned/ignored.
The PostgreSQL section now lists three handy built-in functions for getting database object sizes.
The new log4j section explains how to get different threads to log to different log files.
There is not the best documentation out there on how to get a java process to listen to jconsole connection requests from other hosts. Check out my java section for notes on that.
Also: how to get server error messages from PostgreSQL JDBC driver: see the PostgreSQL JDBC section for more details.
If you are looking for my open-source Python take on iBATIS called Pybatis (now MyBATIS), Look here.
Things C.J. Date recommends.
Ubuntu Firewall setup explains how to set up a firewall on Ubuntu 8.04 server edition.
How to make your crappy PC keyboard act like a Unix keyboard, including an updated keydump for Fedora 10 (as well as the older goodness for F9 and lower).
updated notes on getting key-based ssh authentication working, especially with a fix on home directory permissions for Fedora!
updated version of PostgreSQL syntax highlighting file for vim.
A brief guide on starting a new project using Git, including notes on bare remote repositories, which are not super-obvious from the Git documentation.