Enable LaTeX to find files in multiple folders

To enable LaTeX to find files in other folder use this:




This is handy if including a TeX file from elsewhere that has file includes inside it self


Posted in Uncategorized

Eclipse CDT cannot debug using gdb on Mac

See this post for the problem description.

The main reason is that the debugger is not signed for mac. The page describes how to sign it.

Posted in Uncategorized

OSX Yosemite printing to HP enterprise printer over Windows spools

I discovered that setting up a HP Enterprise printer on OSX Yosemite was not trivial when it had to print through a Windows spools via smb.

So to get this to work follow the usual guides on windows spooler listed below. But first install the drivers, most of the guides indicates that Apple updates will download the correct drivers but that did not happen in my case. (Think this only works if OSX can talk directly to the printer).

So download the driver pack: HP Printer Drivers v3.1 for OS X

Guide to for installing windows spools printers via smb

Posted in Uncategorized Tagged with:

Creating plugins for Lightroom

Here’s a few useful links for creating plugins for Adobe Lightroom:

Other specific Lua stuff which might be useful:

Posted in Uncategorized

Managing free maps for Garmin BaseCamp – MacOS

You can download free OpenStreet Maps from here, see a guid here on how to select and download the map.

The downloaded maps can be installed using ManageMaps (a custom app from Garmin, not on the app store) or simply by copying the content of the zip to either:

  • /Users/YOUR_USERNAME/Library/Application Support/Garmin/Maps/
  • /Library/Application Support/Garmin/Maps/ (

See this for more info

While this makes the map available in BaseCamp it doesn’t really make it easy to download multiple maps and manage these. So download JaVaWa GMTK which is a utility tool to enable e.g. rename of the map making it easier to manage a set of different maps.


Posted in Uncategorized

Eclipse dev Utils — open project/foler/file in system

Here is a small tool for opening resources in Eclipse in system navigator:


The source is at: https://github.com/lausdahl/eclipsedevutils

Posted in Eclipse

Windows PATH too long

I recently discovered that Windows does something funny when the path variable gets too big. (Here I mean that PATH variable + the user PATH variable).

The funny thing is that it seems to permute the string somehow because after adding/removing an extra string Windows and all new cmd’s would loose all knowledge of the PATH variable until next reboot. Then after reboot it comes back to life again.

An interesting observation was to see how windows uses the path variable internally, and that is for opening the dialogue where you change the PATH variable :-(


systempropertiesadvance zoom


I found an approach that shortened the path enough for me here

Basically I converted the path to the short 8dot3 format with this script:

@echo off

echo %MyPath%
echo --

setlocal EnableDelayedExpansion

SET TempPath="%MyPath:;=";"%"
SET var=
FOR %%a IN (%TempPath%) DO (
    IF exist %%~sa (
        SET "var=!var!;%%~sa
    ) ELSE (
        echo %%a does not exist

echo --
echo !var:~1!


Posted in Windows 7 Tagged with: ,

Configuring two DD-WRT in a VPN setup

This setup attempts to configure a network where one subnet (192.168.2.x) uses a VPN connection as its default route where as another subnet (192.168.1.x) has a default route to the internet. The devices on each subnet should be able to see each other and communicate, this might be used for e.g. Apple TV (see).

Here is an overview of how the system could look like:



Network Description

  • Modem:
  • R1: Gateway
    • WAN:
    • LAN:
  • R2: VPN Router
    • WAN:
    • LAN:

 Configuration of R2: VPN Router

This router cannot use the default DD-WRT setup but needs to be configures as a “router” and not a gateway, because we don’t want NAT. We want to provide direct access between R1 and R2:

Configure the WAN side to obtain an ip from R1, we will declare this as a static entry such that it always gets the same ip (in R1):

Screen Shot 2014-10-26 at 23.03.10

The router mode must be changed in R2:

Screen Shot 2014-10-26 at 23.03.38

And finally we need to disable SPI Firewall to allow direct connection from R1 to R2:

Screen Shot 2014-10-26 at 23.08.31

To allow traffic form R2 to access the R1 network we need to add a route for it, but before we can do so we need to clarify which interface refers to which physical connection:

DdwrtlogicviewWe can see from the schematic of the WRT54GL which is used here that:

  • vlan0 is the local LAN
  • vlan1 is WAN
  • bro is the local LAN + WLAN

We then use this to add a route from 192.168.2.x to 192.168.1.x devices:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     *        U     0      0        0 vlan1
default         Rl             UG    0      0        0 vlan1

I stripped the other entries from route.

The command for adding are:

route add -net gw netmask dev vlan1
route add default gw netmask dev vlan1

The VPN connection can be made using standard OpenVPN configuration like provided by Hide My Ass.

 Configuration of R1: Gateway

The gateway may just use a default DD-WRT gateway configuration where it obtains an WAN ip through DHCP or whatever is required by the ISP.

The static ip of R2 can be configures under: Services->Services:

Screen Shot 2014-10-26 at 23.24.19


To make the 192.168.2.x network accessible from R1 a route to R2 must be added to the routing table (on this device eth1 is the WAN port and br0 is like above):

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     R2         UG    0      0        0 br0
default         Modem               UG    0      0        0 eth1

The commands are:

route add -net gw netmask dev br0

If any other known ip should be routed through the VPN when accessed from R1 clients then it should just be added here, since the default route of R2 would be configures to use the VPN connection once installed on R2.

VPN Connection:

A script is avaliable from e.g. Hide My Ass here but in case you have an account with them you can just login and get a command to place in the command box in the router to install it.

However, to detect if the public ip actually switched this shell script command can be used:

wget -qO- http://ipecho.net/plain ; echo


Posted in Linux Tagged with: ,

Using Amazon Glacier on Linux

Amazon Glacier

Amazon provides a low cost backup service called Amazon Glacier which a payment plan reflecting the amount of data that you store with a price in the range of $ 0.01 per GB. However beware of the other costs for requests and especially the fee related to requesting and downloading data from the remote storage.

It might not be strait forward to calculate the actual cost but with the Amazon calculator it is possible to give a pretty good estimate. It roughly seems like the cost of retrieving your data matched what you pay a month to store it.

The service is available through the Amazon Web Services interface where you can signup and joint the service.

Using Amazon Glacier on Linux

Using Amazon Glacier is pretty easy on Windows through e.g. FastGlacier or on Mac with Arq. However, if you are running Linux, in my case Gentoo, with no desktop then the number of clients to choose from is very limited when it comes to being able to sync folders without having to re-upload it all. I found a few options mainly on github.

I found the project mt-aws-glacier project which seemed to do the job.

Synchronisation can be done with a config file that contains the essentials like:


and then using it with mtglacier like:

mtglacier sync --delete-removed --replace-modified --new  --config=configs/photography.cfg &>logs/photography.log &

This will sync the /mnt/disk/Photography folder with vault ‘photography’ and store synchronisation data in the photography-journal.log file. This log file can be reconstructed but it may be easier (and cheaper) just to store it in e.g. amazon S3 since it is relatively small. This can be done with ‘s3cmd’ which also is able to sync one or more files. The following command syncs the journals folder to a remote vault in S3:

s3cmd sync /mnt/disk/journals/ s3://journals
Posted in Linux, Tools, Ubuntu

Enabling Apple AirPlay across subnets/networks

The Bonjour service that Apple AirPlay uses to discover devices is limited to only work on a single network (subnet). However, in a home network with  multiple subnets and or routers AirPlay wont work out of the box.

Here is an example of such a network:

  • router 1 ( – connected to the internet
  • router 2 ( – tunnels all traffic to the internet through a VPN (or other company related traffic)
    • router 2 is connected to router 1 through its wan port and runs as a router (no NAT)

The challenge is to get two apple devices to talk together when one is connected to router 1 and the other connected to router 2. To enable this one has to take a look at the mechanism that Bonjour uses for discovery namely multicast DNS (mDNS).

In my case the routers I used were installed with DD-WRT which is a custom firmware but it didn’t come with anything that could allow me to parse do multicast between my LAN (br0) and WAN (vlan1/[vlan2]).

But I can across this post by Darell that gave a good description of whats needed. Essentially he describes how to compile ‘mdns-repeater’ which is a small tool that can do mDNS between two interfaces in the DD-WRT router.

He also lists Tildesoft.com Bonjour Browser, a useful tool for inspecting Bonjour messages.

Putting the mDNS repreater to work on a DD-WRT device with no space avaliable for storing the program can be achieved through the startup or firewall scrips like:

wget -O /tmp/mdns-repeater && chmod +x /tmp/mdns-repeater && /tmp/mdns-repeater br0 vlan1

To speed up the process a precompied version does exist of mdns-repeater located in the this forum. But can also be downloaded from mdns-repeater.

Posted in Linux