Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

August 12, 2016

Room temperature logging with data visualization

So this is what nerds do in their spare time...

A while ago I've started thinking about creating my own intelligent room thermostat with a Raspberry Pi, because Nest just wasn't there, and I believe you can save a lot with a learning thermostat, and my experience with a couple of them supports this idea.

Had to start somewhere, so first I wanted to measure room temperature, and see what exactly happening depending on the weather, sunlight, etc. Purchased a USB thermometer called TEMPer2 on e-bay, and put together a small system. This is the result, the current state of things:


Will go into the details later, for now these are the basics:

  1. A small ruby script reads the temperature from the USB thermometer, and a cronjob saves the JSON output of it into a log file.
  2. The log file is monitored with a local instance of fluentd, which forwards the data read to my VPS also running fluentd.
  3. On the VPS, fluentd stores the data in ElasticSearch.
  4. The data in ElasticSearch is visualized by running Kibana on the VPS.

February 18, 2012

OpenLDAP after upgrading debian


Long story short: my friend upgraded his debian server, and asked me to help him upgrading OpenLDAP (slapd), because it didn't start. Not that I was a big expert of slapd - on the contrary - but I was the one who configured it for the first time, maybe I could make it fly again.

Started restarting slapd (/etc/init.d/slapd restart), no success. Let's read the logs. Syslog entry:

bdb(dc=future,dc=neologik,dc=hu): Program version 4.8 doesn't match environment version 0.66

OK, let's Google. Found a couple of posts of I need to upgrade the database (quite funny, the "environment version" refers to the database version, duh?), but all the dbX.X_upgrade tools said the same as slapd, about the not matching versions.

OK, let's Google, round 2. Finally found a post(1) talking about bumping into the same issues, and found no other solution than re-importing the LDAP data from an .ldif file. Fortunately, the good guys at debian made the upgrade script so it creates a backup .ldif file in /var/backups.

So, I've purged slapd to have a clean start, reconfigured the domain and the admin password (not going into the details, if you are reading this post, you know how to install/purge a package in debian ;) and tried to run:
ldapadd -h localhost -x -W -D "cn=admin,dc=example,dc=com" -c -f backup.ldif

Asked me for the admin password, gave it, then it said a couple times:

adding new entry "dc=host,dc=example,dc=com"
ldap_add: Constraint violation (19)
additional info: structuralObjectClass: no user modification allowed

What the heck? OK, Google.... finally found a post(2) explaining that certain entries must be removed from the ldif file before import. Thanks to the poster, there's even a command provided I didn't have to spend time with search & replace:

$ cat > ldapadd.sed <<EOF
/^creatorsName:/d
/^createTimestamp:/d
/^modifiersName:/d
/^modifyTimestamp:/d
/^structuralObjectClass:/d
/^entryUUID:/d
/^entryCSN:/d
EOF

$ cat backup.ldif | sed -f ldapadd.sed > bacon.ldif

After this, running ldapadd with bacon.ldif instead of backup.ldif did the trick and imported all the entries into LDAP.

ldapadd -h localhost -x -W -D "cn=admin,dc=example,dc=com" -c -f bacon.ldif

Thanks to the authors of the original posts, and the authors of debian and OpenLDAP.


Links:


January 31, 2012

Fonts in Eclipse Project Explorer

First of all thanks to all the developers of Eclipse and related projects, I've been using it for years now, it's hard to imagine working on a software project without it.
In the previous post, I've described how I created a desktop shortcut for Eclipse. After successfully running it I've found the font used in the Project Explorer looking beautiful, but way too big.
Here's a couple possible solutions - I've successfully tested overwriting the theme settings for Eclipse:

http://techtavern.wordpress.com/2008/09/24/smaller-font-sizes-for-eclipse-on-linux/

January 30, 2012

Desktop Icons in Ubuntu 11.10

Here's a good one:
I wanted to create an application 'Shortcut' on my desktop to fire up Eclipse.
Coming from the (shame on me) m$ windows desktop world, I couldn't figure it out how, then after some google search, found this article, and guess what, it works :)

http://www.ubuntugeek.com/how-to-create-desktop-launchers-in-ubuntu-11-10oneiric.html