Today I learned you can watch the NetBeans memory utilisation by: View -> Toolbars -> Performance.
Category Archives: Sys Admin
Disable middle mouse button (paste) on Debian KDE
Every now and again I will accidentally click the middle mouse button when I go to grab my mouse, and KDE will dump my clipboard buffer into a BASH shell. Not good. Could run something damaging if I’m unlucky. So see here for the solution. Basically run this to get the mouse device ID:
xinput list | grep 'id='
Then to edit e.g. device 10 to disable middle mouse button:
xinput set-button-map 10 1 0 3
To persist the changes add the set-button-map command to e.g. ~/.xstartup.
Or you can add a pointer configuration to ~/.Xmodmap like this:
pointer = 1 0 3 4 5 6 7 8 9 10
And make sure xmodmap is applied at start-up with an autostart file like e.g. ~/.config/autostart/mouse-config.desktop:
[Desktop Entry] Type=Application Name=mouse-config Comment=Disables middle mouse button. Exec=xmodmap /home/jj5/.Xmodmap
Disabling F6 ‘Run Main Project’ hot key in NetBeans because of G15 keyboard
I have a G15 keyboard, and I love it (but not as much as the old model!), but it occasionally causes a problem for me when I’m programming in NetBeans on Debian GNU/Linux.
The issue is that on a newer G15 the G6 key is right near the Ctrl key, and from time to time my pinky hits the G6 key which seems to be by default programmed to be the F6 key.
By default in NetBeans the F6 key is the ‘Run Main Project’ hot key, so when I accidentally press it, it fires up a Firefox window and tries to run my web app! I never configure my web apps in NetBeans, but even if I did, I don’t want to accidentally run anything due to an accidental key press.
So my solution was to disable F6 in NetBeans, and for that:
Tools -> Options -> Keymap -> Click ‘Search in Shortcuts’ -> Press F6 -> Click on the ‘…’ in the Shortcut cell for ‘Run Main Project’ (should be F6) -> Clear -> Apply -> And you’re done!
Everything is easy when you know how!
How to allow a restricted port in Firefox
By default Firefox complains about access to non-standard ports and blocks access. You can override this behaviour by following these instructions. Basically add the comma separated list of allowed ports to the network.security.ports.banned.override string via about:config.
Using ssh-add with ssh-agent for unattended ssh
Easypeasy:
eval "$(ssh-agent)" ssh-add ~/.ssh/id_rsa
Apache HTTP Proxy Header Manipulation
Found this:
<Location /jira> RequestHeader unset Authorization ProxyPreserveHost On ProxyPass http://jiraserver/jira ProxyPassReverse http://jiraserver/jira </Location>
Over here. Wanted to keep a note of those settings.
What to do if you accidentally press Ctrl+S in Vim
If you press Ctrl+S in Vim (i.e. because that’s hard-wired for ‘save’) your terminal may lockup, depending on how it’s configured.
If you want to know why, have a read here. If you just want to get on with life, press Ctrl+Q!
Everything is easy when you know how.
WinKey+R in KDE
So I found this:
Go into “Global Keyboard Shortcuts”. Under “Run Command Interface” you’ll find ‘Run Command’. Under “KWin” you’ll find a ‘Show Desktop’ entry which is the equivalent of minimize all.
Preserving file modification time in Subversion (svn)
Today I found this thread from which I learned:
svn co --config-option config:miscellany:use-commit-times=yes https://example.com/svn/repo/proj
You can also set the option in your svn config, but you probably don’t want to do that.
Comments per page in WordPress
Today I wanted to change the number of comments per page from 20 to 200 but I didn’t know how. Turns out you can adjust this by clicking ‘Screen Options’ (top right) and picking a new value.