Below you will find pages that utilize the taxonomy term “Note to Self”
Creating validator password files
Teku requires a password file for each individual keystore, with the same relative path as the keystore but a .txt
extension. If all the keystores have the same password, you can copy a single password.txt
file for all the keystores with the command below:
for keyFile in keys/*; do cp password.txt "secrets/$(echo "$keyFile" | sed -e 's/keys\/\(.*\)\.json/\1/').txt"; done
Note that the keys
directory is specified twice in that command so if the keys are in a different directory name, make sure to update both places.
ArchUnit
Stumbled across ArchUnit today which looks useful. In particular I think there’s power in being able to assert that certain packages really never depend on each other. Although gradle/maven modules would probably be a better level to assert at. It’s depressingly common for code bases to be split into separate modules with the intention that they be a clear separation of concerns only for a web of dependencies to be added because someone wanted to reuse some class and didn’t refactor to a common module.
Adding a DCO Signed-off-by to every commit in a git repo
If you’re switching from a CLA model to a DCO model you may want to add a Signed-off-by line to every existing commit so that you can run automated DCO checks over the entire repository. Doing this obviously assumes that your CLA sets things up so that you are actually in a position to provide a DCO sign-off.
Once you’re happy with all the legalities, the change is a single command using git filter-branch:
Fun with Nvidia Drivers and Fedora Upgrades
After any major Fedora upgrade my system loses the proprietary nvidia drivers that make X actually work (I’ve never successfully gotten the nouveau drivers to handle my card and multi-monitor setup) so the system reboots and simply presents an “oops, something went wrong” screen.
The issue seems to be that the nvidia driver doesn’t recompile for the new kernel, despite the fact that I’m using akmod packages which should in theory automatically recompile for new kernels.
Make –rebase The Default For git pull
So I can find this again easily in the future, to avoid introducing merge commits git pull –rebase is a great idea and you can make it the default behaviour with:
git config --global pull.rebase true
Found on Coderwall which has some further details.
Miller – Command Line CSV Tool
Miller is like sed, awk, cut, join, and sort for name-indexed data such as CSV. Leaving this here for the next time I have to work with CSV files on the command line. It can do a lot more than just CSVs of course, but that’s likely to be the most useful to me.
Display Port Monitor Wakes Up a Few Seconds After Being Suspending on Linux
I have a dual monitor setup with Linux where one display is connected via DisplayPort and the other via DVI, both from an Nvidia graphics card. When the screen is locked both displays go black, the DVI monitor says it’s entering power save mode and the DisplayPort monitor says “No input” at which point both monitors turn back on displaying the unlock screen.
Playing with xset dpms force standby|suspend|off gave a variety of effects, sometimes the DisplayPort stayed off but the DVI turned back on, sometimes the DisplayPort went black but didn’t turn off etc.
Emoji One – Open source emoji designed for the web.
Mostly so I can find this again later when I inevitably need it, Emoji One is a creative commons licensed collection of Emoji and related tools for the web.
Mounting a Time Capsule Drive In Linux
Lots of articles out there that have almost the right solution here but nearly all of them miss one critical component, so for my future sanity, here’s what works for me:
sudo mount.cifs //timecapsule.local/Data/ /mnt/directory/ -o “pass=password,sec=ntlm”
If you don’t have zeroconf working in your Linux install you’ll have to use the time capsule’s IP instead of it’s .local name. The “Data” part is the name of the disk you want to mount as shown in Airport Utility (make sure you escape any spaces with backslash.
Combining Output of Multiple Bash Commands Into One Line
I wanted to create a CSV file showing the number of JUnit tests in our codebase vs the number of Spock tests over time. I can count the number of tests, along with the revision pretty easily with:
git svn find-rev HEAD
find src/test -name '*Test.java' | wc -l
find src/test -name '*Spec.groovy' | wc -l
But that outputs the results on three separate lines and I really want them on one line with some separator (comma, space or tab). The simplest way to achieve that is:
“Proper” Scrolling Direction in Linux on MacBook Pro
If you’ve gotten used to your trackpad scrolling the same way as on iOS and (by default) OS X but you’re using Linux you’ll want to go to the “Mouse & Touchpad” settings panel and tick “Content sticks to fingers”.
Yeah I know,shockingly simple but for whatever reason I had assumed “Content sticks to fingers” related to some weird drag and drop system…
Why Are My JUnit Tests Running So Slow?
This is mostly a note to myself, but often when I setup a new Linux install, I find that JUnit tests run significantly slower than usual. The CPU is nearly entirely idle and there’s almost no IO-wait making it hard to work out what’s going on.
The problem is that JUnit (or something in our tests or test runner) is doing a DNS lookup on the machine’s hostname. That lookup should be really fast, but if you’re connected to a VPN it may search the remote DNS server which takes time and makes the tests take much longer than they should.
Uglify/Uglify2, Rickshaw, Requirejs and Minification
If you have:
- A javascript project using require.js
- Which is optimised using r.js
- Includes Rickshaw or any other library that uses the prototype class system
Then you are very likely here because you’re trying to enable JavaScript optimization (minification) and finding that suddenly stuff breaks.
The problem is that the prototype class system allows overriding methods to call the original method by adding a $super as the first parameter to the function. From the prototype docs:
JavaScript Drag and Drop Events
Note to self: when you next need to handle drag and drop events in javascript, just use jquery.event.drag from ThreeDubMedia. Simple jquery based API and automatically handles the most annoying part of javascript drag handlers – dealing with cases where the user starts dragging inside an element, drags right out of the element and then releases the mouse.
Ignoring Changes to Tracked Files in Git
I’m going to want to remember this one day, so here’s a pointer to Rob Wilderson’s Ignore Changes to Tracked Files in Git.
I’m especially going to want to remember the bit about how to find which files I’ve ignored in this way.
How To Round-Trip Data Via SSH
I keep forgetting this so for the record, you can use SSH to round trip data out to a remote server and back to your own box. This is most useful for adding latency and bandwidth limitations to a connection when doing website testing. The trick is to use both local and remote port forwards:
ssh -L 9090:localhost:9091 -R 9091:localhost:80 remote.server.com
The -L argument starts listening on port 9090 locally and sends all that traffic to port 9091 on the remote server (the domain name, localhost, is resolved by the remote server so it refers to the remote server, not your local machine). Then the -R argument listens on port 9091 of the remote server and forwards all that traffic back to your machine’s port 80 (here localhost is resolved on your local machine).
Who’s Committed in my Git Repository?
Note to self: if you ever want to get a simple list of people who have committed to a git repository, the command you want is:
git log --format='%aN <%ae>' | sort -u | uniq
Or for just the e-mail address:
git log --format='%ae' | sort -u | uniq
Or for just the name:
git log --format='%aN' | sort -u | uniq
This is in the help manual but it’s way down the bottom so takes ages to read through to find it.
RightScale AWS Amazon EC2 Library for Ruby
I’ve always known you could do a lot of programmatic stuff with Amazon but I’ve simultaneously been too lazy to actually look into it in detail and never really needed to. However, I’ve stumbled across instructions for auto-mounting an EBS volume which turns out to be very handy, and leads on to the particularly awesome right_aws ruby gem.
Lots of useful looking stuff for working with EC2, S3 and EBS volumes that I can see me taking a lot more advantage of in the future.
Stuff I Might Need Someday
A few things I’ve discovered today that look potentially useful in the future:
- Antenna House Formatter V5 – converts HTML and CSS to PDF, including support for MathML. Heck, supporting CSS well is a plus – most HTML to PDF conversions don’t. Hat tip to one of our clients for finding that.
- jQuery Tools – there are plenty of JavaScript UI libraries around, but this one looks better componentized than most. It’s also a good, small set of components that normal web pages are likely to want, rather than being more specifically useful in web applications, though it could be used there too.
- FlowPlayer – actually I knew about this one but only just got around to looking at the details. Handy looking open source flash video player. They’ve somehow converted the GPL into a license that requires attribution which is really odd, most likely to keep their commercial licensing option open. It’s their license so they can do what they want with it but I would have thought there’d be a better fitting license.
XmlSerializer Class for SAX Events
Note to self: the nu.validator has a really handy looking SAX handler that serializes the XML.
Hat tip to Henri Sivonen for pointing this out along with a bunch of other useful XML generating tips.
Installing IBM Portal on Linux
When installing most if not all versions of IBM Portal on Linux, to get the installer to run you need to install a couple of extra packages:
- openmotif
- compat-libstdc++
Depending on the options you chose when first installing Linux there may be more – the easiest way to find them is to know that the graphical installer sends it’s error messages to /tmp/wpinstalllog.txt. It’s usually fairly easy to match the error messages up to the package you need to install to fix it.
Useful Link Roundup
I have far more tabs open in NetNewsWire than I can handle, so here’s all the stuff that’s open more so I can find them again if I need them than because I actually want to comment on them or do something with them right now:
When Can I Use? – Useful page for getting a rough idea of the current state of support for web stuff in browsers. Not perfect but definitely a very good starting point.
VMWare Web Access Can’t Login After Upgrading to Debian Lenny
This one should be obvious but well, it wasn’t… When you upgrade to the latest Debian stable (Lenny at time of writing which was released 14 Feb 2009), it will upgrade PAM and a few other really important login-type modules. At the time it will tell you that you have to restart any services that use PAM or they mightn’t authenticate properly and offer to restart a number of services for you so everything seems happy.
Useful WCM iFix – NullPointerException in CmpntUtils.setSourceIDAndName
If you happen to try and import a WCM library and have it fail, then later find that some HTML components trigger errors in the WCM interface when you try to view or edit them – you need iFix 6.0.1.3-WCM-PK60048.
Gradient Buttons and HSL
For future reference, James Tauber has a very useful article on using the HSL color scheme to create shiny gradient buttons. It’s worth knowing that in Java HSL is actually called HSB (brightness instead of luminosity) and there are various methods on the java.awt.Color class for converting between HSB and RGB as well as creating color objects directly from HSB.
“New” Dutch Accessibility Laws
They aren’t really new anymore, but I just discovered them. Apparently the Dutch accessibility laws go beyond just the WCAG standard and require a whole range of best practices for web sites. Good stuff.
Loading PICT Images In Java
Since the search function for Apple’s mailing lists is pretty much useless, I’m making a note of the Reading PICT Images thread which contains numerous options for rendering PICT images in Java on OS X.
Name Your Intranet
Having a catchy and memorable intranet name is a great way of promoting the intranet.
A name can help build an identity, even give the intranet a personality, removing that ‘techy’ edge. This is useful when trying to build staff awareness and engagement with a new or relaunched intranet.
It is an opportunity to leverage off the organisation’s brand or simply to differentiate the intranet from the organisation’s internet site.
java.net.URL Timeouts
If your application uses java.net.URL, and chances it does are very high, and you are using Sun’s JVM (since 1.4.2), you should set the
sun.net.client.defaultConnectTimeout
andsun.net.client.defaultReadTimeout
system properties to a reasonable value. Otherwise, if a remote site hangs, your application or server will also hang. Useful to know…
Exporting and Importing a Portal WCM Library
I’m going to need this soon and I’ll never find the link again in the IBM forums so I’m putting it here.
Exporting and Importing a Web Content Library
It should let you move web content (minus drafts and previous versions unfortunately) from one IWWCM server to another.
Neat Looking iPhone HTML UI Framework
iUI looks like a promising library for making the development of iPhone webapps much simpler. Worth keeping an eye on since there’s no barrier to entry for iPhone webapps unlike with native iPhone apps.
HTML 5 Differences From HTML 4
More a bookmark for myself than anything – the W3C has published a preliminary guide to differences between HTML 5 and HTML 4. Quite useful for anyone planning to update their products for HTML 5.
Tomcat, OS X, Safari and GoDaddy SSL Certificates
There’s already a lot of stuff written on the internet about how GoDaddy SSL certificates aren’t recognized by Mac but are by Windows, all of it pointing to “a configuration problem”. I’m not sure how we got such special treatment but none of the instructions I’ve seen work in our particular case.
In case you’re not familiar with it, the problem is that on Mac OS X connecting to the site displays a dialog saying that the certificate could not be validated for an unknown reason. Thanks a heap for that OS X… On Windows it works just fine. The problem turns out to be that the server isn’t configured to provide the full issuing certificate chain all the way back to the root SSL certificate (which is in OS X’s set of trusted roots by default). All around the internet you’ll get instructions saying to make sure that the SSLCertificateChainFile is set to point at gd_bundle.crt (available from GoDaddy’s repository). This doesn’t work with our certificate, not sure why.
Mac Adoption Stats
Something I’m sure I’ll want to find again in the future: the OmniGroup provide statistics from their update app showing what OS, CPU, Graphics and various other hardware stats their user base has. Very useful for getting a rough guide of adoption rates.
RSS Feed For Product Pages
I’ve noticed something I’ve been doing with some consistency lately – when I come across a product that I have some interest in, but can’t or don’t want to start using straight away, I try to add the product page to my RSS feeds. With the proliferation of RSS support in browsers these days it seems to me that every product page should include a link tag pointing to the product updates feed. Ephox doesn’t currently do this, but its something that we should fix pretty quickly to help people find the Releases Blog and stay up to date with all the latest features and fixes.
Remember To Turn On Antialiasing
If you’re doing some graphic work in Java that you want to look pretty (as opposed to most UI stuff where this doesn’t make any real difference), you probably want to make sure antialiasing is on for the graphics object. By default Java usually honors the OS settings for antialiasing, particularly for text, but you can get much smoother antialiasing by setting the appropriate rendering hint.
For example, originally the new progress bar I added last week didn’t have antialiasing on, but in the tweaks I’ve done this morning (now live on our internal systems) antialiasing is on and it looks much better. It’s also changed to be more dots than lines since the last post too. However, setting the antialias rendering hint for all the components in the editor simply slows everything down (rather dramatically) and doesn’t actually improve the appearance anyway. Definitely a setting to be aware of but be cautious in its use.
Moving WordPress To A New URL
Every so often I want to play around with something new on my blog without trashing the public site. I have a local instance of WordPress that I do most of my playing around on but it generally doesn’t have the some database configuration as symphonious.net so I can’t be sure that things I develop there will work here.
It is however simple to completely clone a WordPress instance to a new URL – but I never remember precisely how, so this is a note to myself so that next time I’ll remember.
Setting Up A Fallback Font
This seems to be the simplest description of setting up a fallback font I’ve found: http://weblogs.java.net/blog/joconner/archive/2006/09/internationaliz.html
We occasionally come across clients with the problem of fonts not rendering correctly in the JRE so in future I’ll be able to point them to this article. Fortunately, with Java 1.5 a pretty good fallback font is already provided so it’s pretty rare that you need to do this these days.
Smooth JList DnD Animation
The Rabbit Hole: Smooth JList Target Animation
There’s a JTree animation in the next post too. Cool, but the code is awful so it’s probably better to just reimplement the generic technique.
Performance Tests
Useful tool for writing performance tests: Japex. Must remember to use that when we do our next round of profiling. Doug’s suggestion is that once we identify a bottleneck in the code, we write a performance test for it with Japex then try to optimize it until we reach the desired performance level. I’m not sure that our codebase is likely to see performance regressions in the same area again (I can’t ever recall having to reoptimize the same section of code), however having the test would be able to quantify how much of a performance benefit we get which would be a useful metric to know.
Delta Web
Note to self: I must read up on Andy Roberts’ Delta Web proposal and get involved. It looks decidedly useful.
Chuq On Tagging
Chuq Von Rospach has some interesting thoughts on tagging – must come back to this and have more of a think about it.