Nice small serial port client – picocom

The picocom client is a tiny serial port client which is very easy to work with:

sudo picocom -b 115200 -r -l /dev/ttyUSB0

http://askubuntu.com/questions/638378/minicom-doesnt-work

Easy way to set keyboard layout in Ubuntu

This command can be used to set the keyboard layout in the terminal:

setxkbmap dk

Enable LaTeX to find files in multiple folders

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

\makeatletter

\def\input@path{{./}{../../../some-other-folder/}}

\makeatother

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

 

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.

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

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:

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.

 

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

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

https://dl.bintray.com/lausdahl/generic/

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

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

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

SET MyPath=%PATH%
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!

 

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:

LocalVpnNetOverview

 

Network Description

  • Modem: 10.10.10.1/255.255.255.0
  • R1: Gateway
    • WAN: 10.10.10.1/255.255.255.0
    • LAN: 192.168.1.1/255.255.255.0
  • R2: VPN Router
    • WAN: 192.168.1.100/255.255.255.0
    • LAN: 192.168.2.1/255.255.255.0

 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
192.168.1.0     *               255.255.255.0   U     0      0        0 vlan1
default         Rl              0.0.0.0         UG    0      0        0 vlan1

I stripped the other entries from route.

The command for adding are:

route add -net 192.168.1.0 gw 192.168.1.1 netmask 255.255.255.0 dev vlan1
route add default gw 192.168.1.1 netmask 255.255.255.0 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
192.168.2.0     R2         255.255.255.0         UG    0      0        0 br0
default         Modem      0.0.0.0               UG    0      0        0 eth1

The commands are:

route add -net 192.168.2.0 gw 192.168.1.100 netmask 255.255.255.0 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

 

Tagged with: ,
Top