Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

While looking around one of the servers at work I noticed that the application account I was logged into had an odd file in its home directory. The file was named "-rw-r-----.". This was obviously something that went wrong and I decided to remove it. However when doing the naive thing and simply running the following command results in an error...
$ rm "-rw-r-----."
rm: invalid option -- 'w'
Try `rm ./-rw-r-----.' to remove the file `-rw-r-----.'.
Try `rm --help' for more information.


The issue arises because the file name starts with a dash character. The correct (and error free) way to remove such files is to use the -- command line argument with rm first like so...
$ rm -- -rw-r-----.


No errors!

Continue reading...  

, ,

One of the tools that I maintain has recently been updated with new functionality and as a result we had to update its MANIFEST.MF file to reference additional jar files in its classpath. Unfortunately the number of referenced jar files went over a limit and during Maven build the following error started to crop up...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.6:jar (default-jar) on project MyProject: Error assembling JAR: Unable to read manifest file (line too long) -> [Help 1]

The official documentation had the following note:
Line length:
No line may be longer than 72 bytes (not characters), in its UTF8-encoded form. If a value would make the initial line longer than this, it should be continued on extra lines (each starting with a single SPACE).

In my case, the line length was definitely over 72 bytes, so I proceeded to split each of the jar file dependencies out into its own line. My initial cut of the change had each new jar starting on a new line with a single space character at the beginning of the line. Unfortunately that produced garbage results - it appears that the single space character at the start of a line is a line continuation marker and is stripped when the full line is put together. This results in something like "dep-jar-1.jardep-jar-2.jardep-jar-3.jar..." being created.

Since we want each jar to be separate, a double space is required at the beginning of each line! This looks like the following...
Manifest-Version: 1.0
Main-Class: net.igorkromin.MainClass
Class-Path: dep-jar-1.jar

With double spaces in place, everything worked as expected!

Continue reading...  

, ,

You probably have heard of or seen the original Heng Balance Lamp. It had a very successful Kickstarter campaign because it was quite a novel design for a lamp. It was so simple and elegant and very much geeky - using two mid-air balancing magnetised balls as a way of switching the lamp on/off was just so very cool!

The original lamp came in a number of shapes, ranging in size from 27cm (square and round) to 40cm for the iconic oval shape. Now there is a new version of the oval lamp, a 25cm tall 'mini' HENG lamp and we've been sent one by GearBest to review.

So lets check it out. As usual the packaging comes first. Our box had a couple of dents on it from transit but nothing major. Overall the box quality was quite nice. The rear of the box had instructions on how to use the lamp, three simple steps that illustrated how the lamp can be switched on - this was a very cool touch.

IMG_6176.jpg IMG_6177.jpg

Inside the box was a foam insert that held the lamp and its USB cord. A simple muli-language manual was also included.

IMG_6178.jpg IMG_6179.jpg

Continue reading...  

, ,

Recently we moved house and that meant changing internet service providers. We went with Telstra because I though it would be an easy way to get onto NBN (it's not, but that's another blog post). Since we moved from an apartment to a house I thought that I'd set my network up properly - network cabinet, patch panel, switch - the works. After getting some basic networking set up it was time to play around with settings and I though that it would be nice to check out how well Telstra's Federal Court blocking is implemented.

I went ahead and changed DNS Provider settings (Advanced options > Local Network) to 'Google' like so...

Then I went to a well known blocked website and to my surprise received this warning page telling me about Federal Court of Australia copyright infringement blocking...

Well that should not have happened since this blocking is implemented at DNS level and the Telstra Smart Modem 2 (by Arcadyan) DNS settings were just changed. At first I thought that maybe Telstra is doing something funny with DNS by not really going to Google DNS servers first, until I noticed this in my Mac's network configuration...

Continue reading...  

, , ,