Monday, 16 September 2019

I learned GCP basics by mistake


I’m using openHAB for my home automation. I have been using it for a few years, it’s been pretty stable and good. I was postponing upgrade to openHAB 2.x for a year or so, but an impulsive decision to buy Google Home earlier this year and few Yeelight smart bulbs finally pushed me. 

It took couple evenings for me to do the upgrade of openHAB software and adjust config and code. Then I went into connecting Google Home to openHAB. Obviously, I googled for instructions. Instruction I pursued can be found here. Excited as I was I did not look around and went right into it. What I got out of it was more than a day of learning by doing:
  • Learned very basics of Google Cloud Platform, how it’s organised
  • What are tools like google-cloud-sdk and web console
  • Tried out couple helloworldish examples, namely, deployed a Google Cloud app and a microservice (Google Cloud Function)
  • Tool a very brief look at Google Go programming language

You can imagine my surprise when I found out that all of the effort was not needed for practical use šŸ˜‚ Actually, I should have followed this other instruction. Is shows you how to connect Google Home to openHAB in 10 minutes for practical purposes.

We make mistakes, we learn. This time, small mistake, learned a lot. Irrelevant to the problem at hand šŸ˜‚ but a lot!

PS Now I'll understand better what I mean when I use word "microservices" šŸ™‚

PPS System development is worse than alcohol. I can call it a day with latter more easy.

Friday, 24 October 2014

installed ubuntu on my mac

I came to the problem that I needed to test native linux/unix virtualisation recently. First, I tried to think of the new test box I have to procure, but then I got the idea that I'm not using my current resources to the full: my MacBook Pro i5 8GB RAM. Found this (see a copy in my Google Drive). It was really easy!

All you need is to do reEFInd bot manager and install Ubuntu afterwards. Worked like a charm! And it is very nice performance of Ubuntu on this metal :)

The only annoyance was that my computer stopped to do sleep normally (from OS X perspective). It needed hard reboot every time after a few hours of sleep. Fortunately, upgrade to Yosemite solved this, probably just a fresh reinstall of anything would have helped.

Enjoy!


Saturday, 27 September 2014

shellshock on my systems - no real worries

To determine if your Linux or Unix system is vulnerable, from a command line, type something like this:

env x=’() { :;}; echo vulnerable’ bash -c “echo this is a test”

If the system is vulnerable, the output will be:

vulnerable
this is a test

An unaffected (or patched) system will output:

bash: warning: x: ignoring function definition attempt
bash: error importing function definition for `x’
this is a test

or it will say that bash is not present or something else, you figure it out :)

So what about my systems? Here's the list:

  • pfSense firewall 2.1.4-RELEASE (amd64), built on Fri Jun 20 12:59:50 EDT 2014, FreeBSD 8.3-RELEASE-p16 : not vulnerable, bash is not there by default :) check /etc/shells if you have it installed
  • FreeNAS home server FreeNAS-9.2.1.7-RELEASE-x64 (fdbe9a0), FreeBSD 9.2-RELEASE-p10 #0 r262572+4fb5adc: Wed Aug  6 17:07:16 PDT 2014 : bash present by defeult, system vulnerable, checked jails, bash not present, will wait for the fix in next version, there's good comment on this at the end of this discussion :)
  • Mac Darwin Kernel Version 13.3.0: Tue Jun  3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64 : vulnerable, (I think) I haven't played with enabling/opening things, so will be waiting on Apple :)
  • Hackintosh Darwin Kernel Version 13.3.0: Tue Jun  3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64 : vulnerable, (I know) I haven't played with enabling/opening things, so will be waiting on Apple
  • XBMC based HTPC on Ubuntu 14.04.1 LTS, Linux ___ 3.11.0-13-generic #20-Ubuntu SMP Wed Oct 23 07:38:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux : not vulnerable
  • I haven't hacked into my TV and I won't :)

Good luck to you all!


Thursday, 12 June 2014

moved my htpc to raspberry pi... and back to "normal" pc

After using Raspberry Pi based HTPC with Raspbian for a while (see my previous posts) it was obvious that it hasn't made it for me. A few reasons:

  • Trying to watch browser-based internet TV or just videos in the browser is too much hustle. It was much easier to connect my Mac and watch it.
  • AirPlay is lagging on videos.
  • Small one - for some reason it kept changing IP address on every reboot / power loss. There were more than a few. Btw, if you have your Raspberry Pi unstable, the first move definitely is to take a look at your PSU. It got much better for me when I changed PSU from a noname to iPhone charger. Google it before you buy.
  • For me personally the combination with my receiver was not good: Pi supports HDMI starting version 2, but my receiver's "old" one from year 2008 and supports just 1.1 :D Sorry, no 5.1 sound with those beautiful Dolby Digitals, DTS's etc for me. I was thinking of buying external sound card, but, you know, why should I when I have some PC boards laying around the house having sound built-in with more "usual" connectors, like optical S/PDIF maybe?
  • And, the most annoying one which was the final killer: user interface is too slow / lagging. I can't imagine why the distro can decode 1080p normally and can't do smooth user interface :| Especially, if you have a list of multimedia longer than one screen you wait for each next one, and next, and next...


I definitely could try to tune the thing or try other distros. Maybe I hoped that it will be more out-of-the-box initially. Maybe I'm not that much enthusiast or just too lazy :)

It definitely has the future, it just isn't here for me yet.

So, I'm back on my old good ASUS AT5IONT-I motherboard with pico-psu, 4GB of RAM, SSD for system disk. Good Ubuntu plus XBMC.

Some pics for the dessert.


Top view while still open

Open side view, wires

Top-front, open

Before attaching front grille

Assembled, with "monster" fan

Charger

Whole thing

Installed and running :)

Wednesday, 26 March 2014

moved my htpc to raspberry pi - couple of my answers to my own questions

Basically, there is no _practical_ WoL for the Raspberry Pi. It seem technically possible, at least they say that the NIC+USB chip HW supports it, but nobody f...ing needs it, so no project cares to make it. Everybody seem so happy about having a device consuming 5W max that leaving it on all the time seem more than normal even if it does productive work just a fraction of the time. Ok, let the time solve this, I'm happy too :)

Btw, there is WoL functionality for XBMC and their mobile remote. So, guys using it on the HW consuming tens of watts of energy, I encourage to try and to use it!

Cool feature of XBMC, Apple's AirPlay protocol, doesn't seem to work stable on Raspbmc. First, I was surprised by the functionality, you can't put the screen on the screen, you can just share photos, videos, music. Second, video is _very_ unstable and there are screen stretching issues which doesn't seem trivial to solve, you need to really dig into configuring the thing. I do not recommend it for now.

Btw, I had 1 Raspbmc crash since start, it just stopped to play internet radio once without obvious reason.

Otherwise, I'm still very happy with it.

Monday, 24 March 2014

moved my htpc to raspberry pi

Today I unwillingly decided to change my HTPC. It happened by the combination of two events.

First, I was thinking to add a Raspberry Pi to my multi-room audio system for some time already in order to stream saved music and internet radio and manage it by the mobile devices.

Second, I mixed up PSU's between above mentioned multi-room audio system and current HTPC after dusting them. Bad thing, multi-room has higher voltage (24V instead of 12-17V) than HTPC, so HTPC decided to get to be offended. I don't know what exactly broke, still need to find what got burned there. Good thing, I had urgent need for a new HTPC on my hands, thus motivation to act immediately.

NB It's a pity that you actually can't rely on all those different PSU and charger producers that plugs doesn't match...

So, XBMC on Raspberry Pi it is. Quickly googled and decided on Raspbmc. Very simple setup, just download it, dd it to flash card, plug it in and let it setup itself. After that you get your usual XBMC interface.

XBMC official iPhone app is even easier. And it's interface is better than XBMC's default one. Just easiness of the search function tells.

Btw, if you connect your Raspbmc to the network server for the media, be aware that XBMC may not be very efficient in the networking by default. My config stuttered HD videos by default via Samba and NFS. This helped my thinking, optimised it to flawless playback :) 

Now, some observations and, unfortunately, pitfalls, even thou hopefully short-term:

  • Major one for me for now. If you take a look at the Raspberry Pi specs you will NOT notice that it supports HDMI revisions 1.3 and 1.4. My audio-video receiver (AVR) which I bought in 2008 supports 1.1 and back. Sorry guys, no backwards compatibility, it won't work, at least it doesn't for me. I noticed that HDMI is up to 2.0 now. So, now I'm thinking about changing the AVR, but those versions...
  • Btw, talking HDMI revisions, my TV, bought the same year, is using HDMI revision 1.3. Conclusion: Philips was ahead of Marantz back in 2008 :D
  • Annoyances. So, I can't put HDMI through AVR. It IS a pity because of the sound. Video I can put directly to TV. Of course, I could use just TV sound, but my Marantz's sound is sooooo much better. Fortunately, Raspberry Pi has a simple analog audio 3.5mm jack, so I can have a good sound. And you can switch on audio output to both HDMI and analog ports in XBMC. The annoyance: not all those digital wonders of nowadays like Dolby Digital or DTS, just a plain simple stereo. So, it works. The annoyance: I need one more analog audio output for the multi-room, which I haven't. And one more for the headphones... And I couldn't use my AVR for switching even if HDMI revisions were OK, because my AVR doesn't convert digital sound to analog (ask for this when buying an AVR).
  • One of the best things happened. I'm going to save some electricity definitely: Raspberry Pi can't go much over 5W :) Previous HTPC's PSU was at 110W max and I'm quite sure it used 50W to max.
  • There is no power-on button on Raspberry Pi :D You can switch it OFF from software. What about ON? WoL you say? WoL is much, much more sophisticated... And my children are so used to use a power button. For switching on, at least, because switching something off is what older people do, isn't it?


So, todo for me now is to:

  • find a soundcard for my Raspberry Pi, that would solve my DD-and-DTS-like "problems", plus offload the processor of decoding those, I hope 
  • buy 3.5mm audio jack splitter
  • change my AVR
  • invent a power button for Raspberry Pi or configure WoL (from iPhone app should it work)
  • or all of those options...


Guys, if anybody wants to buy used medium-class AVR in a good condition, just let me know. It's a Marantz SR4001, just looked inside, there is minimal dust and capacitors look good.

Monday, 17 March 2014

retired my cisco linksys e3000 as router/firewall, moved to pfSense

For some time I felt like my home Cisco Linksys e3000 wireless router was not able to perform according to requirements of today's traffic at home. There are four of us, everybody use Internet, we have 20+ devices with IP address, so it could be quite normal that signs of overload appeared more and more often. Slowness sometimes, sometimes router even hung.

Historically, I tried out dd-wrt project, which has great functionality, but stability of the router brought me back to default Cisco firmware. Recently even default firmware was not good enough.

One of the steps I've taken already was switching DHCP and DNS servers off and giving those functions to a Raspberry Pi. But that was more because I wanted to try out Pi :)

I've been thinking about a change to more powerful router, but somehow took a look at my "server room" wall, where one of two Intel Atom D525MW boards hung without a proper job and decided to take a look at what opensource is doing in router / firewall space.

Does this wiring look ok? No way...

I found very nice review by David Pavlina which led me to choose between pfSense and Sophos UTM Home Edition (scroll down a bit). pfSense looked better to me just for one reason: it's not limited version of commercial SW like Sophos. So let's try it.

First of all I was quite excited because it was first time I was going to try something that is based on FreeBSD project. And I have to say that first impression - install - was very good. I'll see later what it takes to do basic OS things there.

Install of pfSense is quite straightforward and easy.

Initially I tried to put it on USB stick, but I gave it up after several iterations of failed formatting and partitioning... Or should I say: slicing? :D As I had spare SSD on shelf I decided that USB I will try some other time.

Initial config is trivial. Basically, you just need to notice NIC names and feed those back to pfSense as you decide on WAN and LAN side. Autodiscovery didn't work for me, but who cares when manual one is so easy, right?

Connected to webConfigurator interface, nice one. I took a look at menu and saw there all I could imagine I would need from home firewall/router. Except for QoS, but then googled that this is named Traffic Shaping here and and decided to go further with it.

I put in basic things like hostname, domain, etc, switched off DHCP and DNS for now, checked that firewall is on (I have to say "once more", because during install pfSense told that it will be on) and get to putting actual wires into NIC's. 

NB It is always interesting to come up with a new hostname. I will not publish actual one, but my thinking came out of this terrible animal, watch out for:

Regal horned lizard (Phrynosoma solare)

It took me some time to redo wiring, now it looks even more terrible than previously, but this absolutely is a matter of the another project :) Plus, switching my e3000 to "just wireless access point" also took a few hard resets because it kept becoming unavailable after I assigned it a "normal" IP to it. Obviously, didn't want to give up being router and firewall :D

So, here I am, typing this blog in the new network :)

Now, just switch DHCP and DNS servers from Raspberry Pi to new server. DHCP works like out-of-the-box :) DNS forwarder (the same dnsmasq actually) doesn't want to resolve FDQN for some reason :( But this shouldn't be a big problem, I just need to get to be used to the new one. And DNS is one of the most weird-built things in IT as you all know - already or just now.