Friday, March 10, 2023

Golang setup PATH

Quite recently we startet in the company to use and write some Go programs. I love Go. It's easy to learn, read and modify.

One of the most interesting programs, that (I did not start, but) I'm developing on is an HTTP-Tunnel, that I modified for our needs. Initially it was just because the original author did not work on it anymore, and did not accept any of my pull requests, but meanwhile I really like it.

However, the main reason for this blog post is to show my path configuration for go on mac

export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
# Homebrew
export GOROOT="$(brew --prefix golang)/libexec"
# Manual install
# export GOROOT=/usr/local/go
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin

Hope this helps you to Go :-P

Wednesday, March 8, 2023

Nginx to overcome Google WiFi limitations

Just recently I had to replace my old Wifi-Setup with a new system. After some investigation on the topic (and a good offer from amazon warehouse) I decided to give Google Wifi with 3 physical items a try.

I do have a lot of devices in my network that are accessible from the outside, so I set them all to bridged mode, so that they use another DHCP server in the network and use that address pool. Initially it all seemed fine, all my devices where able to keep their IP adresses and worked as before.

However, after some days I got a lot of connection issues, because it is not mesh in that way, so there was no handover between the wifi networks and especially in the areas between two of them I had frequent network switches which was quite annoying.

After a factory reset I set them up as mesh network and forwarded all the necessary traffic from the Internet gateway to the main Google Wifi IP. Devices got new IP addresses from a different pool now, but the network was working fine.

As initially said, I have devices that are visible from the outside (e.g. Home automation, NAS,...) which had set static IP addresses for simplicity. This is a problem currently for the Google Home App, which is used to setup the network, because it does show only devices that have IP addresses assigned by its DHCP. Even if the static IP is in the range of the subnet mask it will not show up.

What next? Most devices, like my Synology NAS is able to obtain an Address from the DHCP, which means that I had to assign a static address inside the Google Home App for that device to be able to access it reliably form outside.

However, some of my devices are not enabled for DHCP and then you're screwed, unless you have another device in the network that can do the job. In my case I use the Synology NAS which already runs a nginx which can be setup to forward traffic to other IPs. Its a bit tricky, but here is how it works:

  1. Install the Web-package on the NAS to have nginx in place
  2. enable (temporarily) SSH to be able to change the configuration files
  3. SSH into your NAS (you need to be. member of the admin group)
  4. cd /usr/syno/share/nginx/ (thanks to John Shine)
  5. create a new file named as you like with .mustache suffix and refer that file from the nginx.mustache file in this folder.
Now, in my case I did need random TCP traffic, so I had to refer my file outside the http block and I decided to add the reference as the very last line in the configuration. My mustache file than contains something like this

stream { upstream mytcpstream { server X.X.X.X:4321; } server { listen 1234; proxy_pass mytcpstream; } }

Now all that's left is to setup the firewall of the NAS accordingly and give it a try.

That's far from ideal I admit, but that said... PLEASE Google, add a possibility to add a random Port forward to your Home App, or show all devices in the network, not just the ones that your DHCP assigned. THANKS

Monday, July 23, 2018

Mobvoi TicWatch Pro

Even though I'm an iOS developer, in my daily life I'm currently using a Motorola G5+ and not an iPhone. There are several reasons for this choice, but the main one is probably that I'm often dropping my phone and iPhone screen replacements are way to expensive :-)

However I've been using a Motorola 360 2nd gen for about a year. Despite that I liked the look of it and the functions it offers, I've decided to sell it already about a year ago being without smartwatch since then. I my opinion wearOS (or Android Wear as it was called at that time) is still behind watchOS, but I'm a bit old school when it comes to watches so a rectangular watch was never a real option. Beside that the main weakness of all smartwatches is the battery life...

But nowadays there is a smartwatch that faces this problem. I know that the TicWatch Pro is not the first of its kind, but the first that got my attention so I've decided to buy one. The approach that has been taken by the Chinese company is to put an LCD on top of the OLED display which jumps in whenever there is no need for smart features. Basically it puts wearOS on sleep when you just wear it and fires it up when you look at your wrist or when you press a button. In theory that's what you need and when it helps you to charge the watch just once a week then it is a real game changer... if it can hold the promises in real life usage too.


Now I have it since last Friday (about 4 days) and I'm about to charge it the first time. I guess this first week is not representative, as it had to update all its contents, install all the apps and me constantly playing with it, so I'll update this post next week to provide some real numbers.

Friday, May 27, 2016

Update all Ruby Gems on your Mac

Usually I used the command I found here which is

sudo gem update `gem list | cut -d ' ' -f 1`

However sometimes, if you are on a VM that hasn't set the profile correctly you'll need to specify the right directory. So the effective command working everywhere (so far) is.

sudo gem update -n /usr/local/bin `gem list | cut -d ' ' -f 1`

Wednesday, March 30, 2016

GIT-LFS on Bitbucket Cloud

There are a lot of posts all over the internet on GIT-LFS and bitbucket. However most of those posts mention a setting that is not available on the Cloud version of Bitbucket.

So, to give a simple answer to the question "Can I still use GIT-LFS?" ... "Yes, but.."

Why but? Well, it does come with a cost. Actually there is no build-in solution to deal with large files if your repository is hosted on the bitbucket cloud, but the GIT-LFS in general is just a concept, that can be put on every GIT service. The problem is where to put that data?

The answer is any kind of web accessible blob- or file storage. Popular answers in this case are AWS S3 and Azure, but every MongoDB or even a file system is enough (This depends a bit on how reliable it needs to be and how much you are willing to spend).

Now I guess its time to look into what GIT-LFS really is. As we said earlier it is a concept, which is not entirely true, as it is also a protocol. Actually it is able to interfere a push command (with a pre-push hook) exchange the actual file that you'd push with a "link" (an OID basically) and push that to the repository. The real file is then sent to the "lfsurl" specified in the ".git/config" file.

Unfortunately storages like the ones mentioned above are not accepting this protocol calls directly, neither git-lfs can deal with their (complex) authentication mechanisms, so you'll need some sort of interface manager, which is likely to be some sort of server.

Lately I was working on an extension to an existing solution written in Node.JS which tries to give a solution to this problem. It has the ability to talk to those storages mentioned above and implements most of the git-lfs protocol in its current version. All you need to do is putting it on a server, configure it to accept your clients and access your storage and it will work.

As it is an open source project you can contribute in any form if you like.

Tuesday, November 3, 2015

Setup the new Apple TV

After unpacking and flashing it with the latest Beta I could finally set it up
It is going through all the languages in a row


There is the possibility to take the settings from an iPhone/iPad

Unfortunately none of my devices was already on iOS 9.1


Monday, November 2, 2015

Unpacking the new AppleTV Developer Kit

I guess you're not really interested in what I've to say about the unpacking, so just watch the pictures:








So and there it is :-D

Golang setup PATH

Quite recently we startet in the company to use and write some Go programs. I love Go. It's easy to learn, read and modify. One of the m...