Posts

Home Assistant in Docker on MacOs BigSur

  Install brew. Follow instructions on https://brew.sh/ Install virtualbox # brew install virtualbox Install docker-machine # brew install docker-machine # brew services start docker-machine If you want the machine to run at boot (rather than at login) Move your launchd configuration file homebrew.mxcl.docker-machine.plist from $USER/Library/LaunchAgents to /Library/LaunchDaemons Add a user directive:  <key>UserName</key> <string>robcos</string> Make sure the permissions are right: # sudo chmod root.wheel homebrew.mxcl.docker-machine.plist Install docker # brew install docker Create a virtual machine # docker-machine create --driver=virtualbox default Setup docker environment (you will need this every time you open a new shell) # eval $(docker-machine env default) Setup your “default” virtualbox to forward any relevant port.  Settings -> Network -> Adapter 1 -> Nat -> Advanced In my case I forward 1880 for NodeRed, 8123 for HomeAssistan...

Installing Box Backup on a ReadyNas NV+ (sparc)

Image
I'm jetlagged so what do I do? I install Box Backup on my NetGear ReadyNas NV+. A while ago I have in fact built my own little datacenter in my loft. There I store all my music and most importantly the backup for all the pictures that I take. It is a raid 5 so if one of the disks breaks down, I can still recover 100% of the data. But what happens if it gets stolen or something really bad happens? I will loose everything so I need to have another backup copy of my data somewhere else. Meet www.boxbackup.org : The backup daemon,  bbackupd , runs on all machines to be backed up. The store server daemon,  bbstored  runs on a central server. Data is sent to the store server, which stores all data on local filesystems, that is, only on local hard drives. Tape or other archive media is not used. The ReadyNas NV+ has a Sparc CPU and at the moment there are no official builds for this platform so I had to build it myself. It took a while to find the right setup so l...

The little yellow book of vaccinations

Image
I have almost filled my yellow book with vaccinations. You get it when you contact NHS and make an appointment with your closest travel clinic. I went to my usual surgery Sterndale in Hammersmith. The nurse recommended to get Hepatitis A and B, Typhoid, Rabies and the compulsory Yellow Fever. Some of them require more than one shot so make sure to start your treatment at least 3 weeks before you leave. I am also going to get an anti malaria treatment but for that I need another appointment. The injection are almost harmless so don't be scared. Be scared of the bill though as some of those vaccines are not free and cost up to 40£ per short. And yes, you can also use private clinics as Nomad (STA Travel) but it will cost you more.

South America & Greece: a strange combination

Image
I finally booked all the flights to my adventurous journey to South America. My wife and I will be there for two weeks. On our return to Europe we'll head to Greece for a week. Crazy? Maybe, but we really need to spend some time in the sun to recharge from the rainy London winter (can you believe it is summer?) and there was nothing compatible with our timing. In fact, to fly from Brazil to the Caribbean islands, the only option was to fly to Miami and back! This is the detailed plan: * Buenos Aires - got family down there * Iguazu/Iguassu - need to visit the falls and the world's largest dam * Manaus - we'll stay in the Amazon forest for a few days. I want to see the sloth! * Rio de Janeiro - Corcovado & co at least! * London - unpack and pack * Corfu - battery recharging

Citibank

Image
Today I went to a branch, withdrawn all my funds and ended my short relationship with Citibank. I wanted to open an account to better manage my trips to the us and the euro zone. I was attracted by their free USD and EUR so after consulting with some colleagues that gave me ok feedback, I submitted an online application. Few weeks later I received a letter in the mail asking to provide some proof of address. Once I sent it back, took few days to receive a letter saying that they were processing my application. Finally, a letter saying that the application was rejected. I phoned them up and they told it was because I spent less then 3 years in the UK. Knowing that this was not the real reason (colleagues of mine have been in the UK only for few months and have successfully opened an account) I kept pushing, asked to talk to a manager which eventually said the there was absolutely no problem and the accounts where opened. Funny that the phone clerk suggested to wait the 4 extra month...

ReadyNas NV+ and rsync

Setting up an account to backup a windows machine to my Nas I discovered an issue with the rsync setup. I first enabled the rsync protocol in the readynas admin interface. I then added a new user account and when I was testing I got the following error: rsync -av myidr/ newuser@mynas: newuser@mynas's password: Connection closed by 192.168.1.100 rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: unexplained error (code 255) at /SourceCache/rsync/rsync-35.2/rsync/io.c(452) [sender=2.6.9] I tracked down the problem to not having a ssh key on the nas for the new user: su - newuser Password: newuser@mynas:~$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/c/home/newuser/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in . Your public key has been saved in .pub. The key fingerprint is: c1:25:12:5b:21:18:31:23:73:58:45:99:2c:0b:0e:7c newuser...

Un italiano a Londra

Banca : Aprire un conto in banca è un casino in Inghilterra. Ti chiedono una "proof of address" che è in genere difficile da avere se sei appena arrivato in città. Se il tuo datore di lavoro ti fornisce una lettera di raccomandazione è molto più facile. Le banche consigliate sono CITI e HSBC. Io ho un contro HSBC perché era la banca della mia ragazza e forse ci sono piu' filiali in giro. Proof of address In inghilterra non esiste l'anagrafe e pertanto, per fare qualsiasi cosa ti viene richiesta una "proof of address". In genere va bene o un estratto conto della banca oppure una bolletta del telefono o dell'elettricità (Non basta il passaporto). La cosa si fa interessante quando per avere un conto in banca ti chiedono una proof of address che ancora non hai... (Vedi sezione su come aprire il conto in banca, è la chiave di tutto) Cellulare In generale, la copertura cellulare a Londra è pessima, probabilmente dovuto al numero elevato di persone. Io...

Connecto to a IRC channel on Adium startup

To make the script execute when Adium starts up: Create and save an AppleScript with the following code: tell application "Adium" GetURL ("irc://myircserver.com#myircchannel") end tell Edit appropriately and save it wherever you like. With Adium in as the frontmost application, choose Adium > Preferences... Select the "Events" toolbar item in the Preferences window. Find and select the "New email notification" event in the list of events. Click the "+" button to add a new action to the "You connect" event. From the Action popup menu, choose "Run an AppleScript". Click the "Browse" button and choose the script you just saved. Click OK. Restart Adium and see if it works

How I spent a long weekend in Mountain View

As it was my first time in California, I did some research to find out how to spend my long 3 days long weekend (labour day on Monday). I got a lo of suggestions which I summarized on my previous post and here I will narrate what I have actually done do that it can be a reference to anyone in my same situation. Friday: Computer History Museum and running along Steven's creek trail [fa:p:id=3891382528,j=l,s=s,l=p] After a lunch at the Mongolian Barbecue in Castro street downtown Mountain View, I took my bike to the Computer History Museum, on the way to the Google campus, 15 minutes away from downtown. The museum has a free entrance and guided tours are also available for free. Don't miss it! The guides are so nice and make the visit a nice experience for anybody, even for non-computer people. I stayed at the museum for about 2 and half hours. HIGHLY RECOMMENDED! Among the funny things you can see there there is the first Mac ever built, with a wood chassy and the signature ...

Things to do in Mountain View

I'm in Mountain View for a couple of weeks and since it happens to be also labour day I asked people around on what to do during the week-end. I put the summary here so that other visitors in the San Francisco area can take a look at it. By bike Bike the Golden Gate Bridge (It's about 15-20 km and may take a couple of hours). You can rent a bike in San Francisco , bike to Sausalito or all the way to Tiburon, spend some time there and then take the ferry back to SF Bike or walk along the waterfront in San Francisco is nice. You may even combine this with the Golden Gate Bridge bike ride Bike (but beware of the many annoying hills and cars everywhere!) You can take a bike on CalTrain to San Francisco. The bike car is the last car on the train. Bike on a road bike along the east bay with http://www.oaklandyellowjackets.org/ Walking Visit Alcatraz (tickets must be reserved in advance) Walk around in San Francisco with a guided tour: http://www.goldstar.com/events/sa...

Basterd Marcus - a London flat odyssey

As today I've not yet moved into my flat although I've been paying the rent for almost three weeks. When I checked in, on the 11th of August, the flat was in disgusting conditions. It had not been cleaned at all and stuff of the previous tenant was still inside. Luckily enough we had insisted that a list of works to be done had to be put in writing in the contract. None of the works had been done, although contractually the landlord had a few more days to comply with his duty. But not the cleaning. The cleaning had to be done before I moved in and they had had an extra week to do it properly. After a first immediate solicitation nothing happened. At some point somebody went in and vacuum cleaned the carpet in one of the rooms: ridiculous! I felt like they were making fun of me. I escalated the problem to my relocation company and to Google HR which had helped me getting the contract. I just wanted to break the lease and live the landlord to the next victim. Unfortunately there ...

Springframework 3.0.0 M3 build and maven 2 repo

I built the latest version of spring 3.0 and deployed in my maven repo . Feel free to use it but don't make assumptions that it will be online in any future

Disable Skype's mood message chat

It was driving me nuts!! After installing the latest 2.8 beta for mac I was getting one of those red notifications every time any of my contacts was changing his mood message. Luckily you can disable it in the Preferences->Advanced->Enable Mood Message Chat.

Why debuggers are bad

Debuggers are useful They make you run an application and inspect variables while you a running the real thing They make you debug code and quickly find bugs You set a breakpoint somewhere, you run your application, it stops where you want and let you inspect variables and more. Debuggers are bad They make you debug code instead of writing unit tests They make you debug code instead of writing proper log statements Conclusion: Debuggers are good when you search for bugs and not as a development practice Log statements are there forever and let you for instance trace code in a production environment where a debugger is usually not available. Unit tests are there forever and let you run the same tests that you run in your debugger on and on. Again: Debuggers are useful but don't abuse them.

Respect for JavaScript

Surfing around I found this cool video of Doug Crockford, the man behind JSLint and JSON. He surely is a funny guy

Internet Explorer 6 is still there....

Image
Tonight I was looking at my blogs awstats and realized that IE6 is still the most used browser (at least in Windows). Given the fact that my blog is quite technical and my readers have a tendency to use open source software as Firefox, this is pretty scary!!! Internet Explorer 6 is bad and full of bugs! It makes us programmers to do a lot of unnecessary work to make pages look nice. Please download firefox .... Msie 7.0 No 11703 12.7 % Msie 6.0 No 13168 14.3 % Firefox 3.0.8 No 3450 3.7 % Firefox 3.0.7 No 7044 7.6 % Firefox 3.0.6 No 9078 9.8 % Firefox 3.0.5 No 10922 11.8 %

REST and validation errors

REST advocates to use HTTP for CRUD fully exploiting the verbs defined in the protocol specification: POST to C reate GET to R ead PUT to U pdate DELETE to D elete Nothing strange about that. But how do we handle server-side data validation ? Server-side validation cannot be replaced by client-side but it complements it. Client-side we can f.i. verify if an E-mail address is compliant with the SMTP rules but we cannot verify if the address is already registered in our database. HTTP provides the error codes 4xx to indicate that something has happened: 400 Bad Request The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications. and specifically: 409 Conflict The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The res...

OnTheFly

I Just published on github  a tool to concatenate JavaScript and CSS files on the fly to speed up the development process when using large code base. Check the project page

Maven: The Definitive Guide

I have been looking for you for ages. I wanted to know all of your secrets, not just guess them from the POM reference or from the maven official documentation, which is very poor in same cases. Where have you been? Finally I found you, Maven Definitive Guide !

Corsair memory upgrade for ReadyNas NV+

Image
I just got my Corsair Value Select  1GB DDR1 400Mhz PC3200 (VS1GSDS400/EU) memory module and installed on my ReadyNas NV+. I've run the memory test twice and it works like a charm. Unfortunately my SqueezeCenter is not much faster..., but this is an other story :-(