Influxdb 2.0 lessons learned

I played a bit with influxdb version 2.0.0, telegraf client and two of my raspberry pies.
On my oldest pi  a 1 B+ the telegraf client caused too much performance issues on that light weight single CPU and 480 MB of usable RAM. So I chose a simple bash script with curl to send the CPU temperature to influxdb.

#!/bin/bash
timestamp=$(date +%s)
temp=$(vcgencmd measure_temp)
curl -XPOST \
"https://flux.example.com/api/v2/write?org=none&bucket=pihole&precision=s" \
--header "Authorization: Token asas==" \
--data-raw "cpu-temperature,host=pihole ${temp//\'C/} ${timestamp}"

At first I was running influxdbd by hand. But I didn’t want the usual port of 9999 of the alpha version and I also wanted SSL encryption when I log into the backend. Pretty easy with the already running apache on that server.

<VirtualHost *:443>
	ServerName flux.example.com
	DocumentRoot /var/www/empty

	<Directory /var/www/empty>
		Options Indexes FollowSymLinks
		AllowOverride None
		Require all granted
	</Directory>

	ProxyPass / http://localhost:9999/
	ProxyPassReverse / http://localhost:9999/

	SSLEngine on
	SSLCertificateFile  fullchain.pem
	SSLCertificateKeyFile privkey.pem
</VirtualHost>

so far so good. Starting the influxdb by hand after a reboot or failing isn’t an option.  So I created by on systemd service file

sudo $EDITOR /lib/systemd/system/influxdb2.service

[Unit]
Description=InfluxDB 2.0 service file.
Documentation=https://v2.docs.influxdata.com/v2.0/get-started/
After=network-online.target

[Service]
User=influx
Group=influx
ExecStart=/usr/local/bin/influxd
Restart=on-failure

[Install]
WantedBy=multi-user.target

Do not forget to enable it :D sudo systemctl enable influxdb2

 

So far I made one observation. The telegraf client is doing a lot of DNS requests through the network. If I’m not wrong it does it for every request. If you look at the graphic you see that the bottom a big blue line. That is the DNS requests from telegraf. At some point around 20:00 You see a drop. Well there I change the flush interval to 120 seconds. Later at round 7:30 I wrote the IP and host name into /etc/hosts and the “noise” was gone. That is something you maybe want to do in your devices, too to save some bandwidth and energy.

Zucchini sweet and sour

What you need:
paprika
salt
pepper
white Vinegar
sugar
crème fraiche (if not available use sour cream / heavy cream with at least 50% fat)

500g aka 1 pound minced meat.

1 red bell peper
1 Zucchini
1 white onion

——

Start with bell pepper, zucchini, white onion. Cut them into pieces of your choise.
Braise one after the other in a saucepan.
Season with salt, pepper, paprika, 2 – 3 tablespoons of vinegar and half a teaspoon of sugar. Peel off a 1/4 liter (one cup) of water and cook for 15 minutes with the lid on.

Fry 500g mince in a pan. Season with salt, pepper and paprika.

Then add the mince to the pot. Mix in one tablespoon of crème fraiche.

Traveling through time isn’t enough

Some people think traveling through time is easy. It might look that way. But they don’t consider that you need to travel space, too. Wait, why space, too?
Let’s start easy. If you want to meet me at work you need 4 dimension. You might think it is just an address, but it isn’t. The first dimension is the street. To make is easy the street goes from east to west in a straight line. Well the street is very long. In order to find me you need the house number. That is like drawing another line from north to south (second dimension). If you think that you are able to meet me yet, you are WRONG! I work in a skyscraper. You need to also the number of the have the number of the floor. Now you can meet me!? WRONG! You might show but at the correct place, but at the wrong time. You might be there in the night or during my lunch break. So you need also the fourth dimension the time.
When it comes to GPS navigation you need those information twice, because you need to know from where and when you are coming.

Now with time travel it is even worse. You are standing on the earth. It rotates with about ~ 464 m/s. If you try time traveling while visiting me, and miss the correct time only by a split second you might fall down a long way down from the height of the skyscraper. But it doesn’t end there. The earth orbits the sun. That is 29.85 m/s additional movement to the earth’s rotation. Our solar system rotates in in our galaxy the milky way. The milky way rotates, too. The galaxy is moving through the universe / space. Plus the universe is expanding. And it the expanding speed is increasing. Good luck with time traveling!. Do the math and meet me in my skyscraper, yesterday! I think this the point most science fiction authors didn’t tell you. So next time you travel through time and space and you are very good. Don’t forget your parachute. If you are not so good in math don’t forget your space suite, just in case…

Remember:

  1. The earth rotates
  2. The earth orbits around the sun
  3. The solar system orbits around the in a rotating galaxy
  4. The galaxy is moving in the universe
  5. The universe is ever expanding. Faster and faster.

CISCO router password recovery

– Attach a terminal or PC with terminal emulation to the console port of the router.
Use these terminal settings:

* 9600 baud rate
* No parity
* 8 data bits
* 1 stop bit
* No flow control
– If you can access the router, type show version at the prompt, and record the configuration register setting. See Example of Password Recovery Procedure in order to view the output of a show version command
Note: The configuration register is usually set to 0x2102 or 0x102. If you can no longer access the router (because of a lost login or TACACS password), you can safely assume that your configuration register is set to 0x2102.

 

– Press **Break** (**Ctrl-Break** Windows XP) on the terminal keyboard within 60 seconds of power up in order to put the router into ROMMON.
– Type **confreg 0x2142** at the rommon 1> prompt in order to boot from Flash. This step bypasses the startup configuration where the passwords are stored.
– Type **reset** at the rommon 2> prompt. The router reboots, but ignores the saved configuration.
– Type **no** after each setup question, or press **Ctrl-C** in order to skip the initial setup procedure.
– Type **enable** at the Router> prompt. You are in enable mode and should see the Router# prompt.
– Type **configure memory** or **copy startup-config running-config** in order to copy the nonvolatile RAM (NVRAM) into memory. **Important**: Do not type **copy running-config startup-config** or **write**. These commands erase your startup configuration.
– Type **show running-config**. The **show running-config** command shows the configuration of the router. In this configuration, the **shutdown** command appears under all interfaces, which indicates all interfaces are currently shut down. In addition, the passwords (enable password, enable secret, vty, console passwords) are in either an encrypted or unencrypted format. You can reuse unencrypted passwords. You must change encrypted passwords to a new password.
– Type **configure terminal**.
– The hostname(config)# prompt appears.
– Type **enable secret <password>** in order to change the enable secret password. For example: hostname(config)#**enable secret cisco**
– Issue the **no shutdown** command on every interface that you use. If you issue a **show ip interface brief** command, every interface that you want to use should display up up.
– Type **config-register <configuration_register_setting>**. Where **configuration_register_setting** is either the value you recorded in step 2 or **0x2102** . For example: hostname(config)#**config-register 0x2102**
– Press **Ctrl-z** or **end** in order to leave the configuration mode. The hostname# prompt appears.
– Type **write memory** or **copy running-config startup-config** in order to commit the changes.

Wild card domain to localhost because development matters

I have an A record for *.local at my test domain to 127.0.0.1

For web development it is often required to have a domain name rather than a subfolder in localhost. A vhost for a (sub)domain is easy to set up on my local apache instllation. I can have even a free, valid SSL certificate for that vhost. Wait, what? How can I have a valid certificate for free for a local domain? I use Let’s encrypt with DNS chalange. Sure every time I have to update the certifacte I have to change a DNS txt record, but that is easy.

Another reason why I have a wild card record to 127.0.0.1 is that I can add as many vhosts for testing to apache and don’t have to add or change the DNS settings. Also I can use it on every computer as long as it can query the DNS server on the internet. I can even give my co worker my vhost config and it works without changes.

So *.local.apachehaus.de is free for development. But you can’t have a SSL certificate. If you want that, you can do the same trick with your domain.  Happy development.

Die schwierige Arbeit in einer IT-Hotline…

Anfrage von Anwenderin:

Wenn ich ein Film auf meine Diskette speichern möchte, kommt die Meldung, dass auf der Diskette nicht genügend Speicherplatz vorhanden ist.

Dann versuche ich mit -speichern Verknüpfung und dann ist Platz genug und Film ist auf der Diskette.

Problem ist aber, wenn ich diesen Film auf der Diskette auf einem anderen PC anschauen möchte.

Da kommt die Meldung: -nicht gefunden. Aber auf meinem PC funktioniert es. Was kann es sein?

Antwort IT-Hotline:

Sehr geehrte Anwenderin,

in Ihre Handtasche passt Ihr Pelzmantel einfach nicht rein. Ein Zettel mit Vermerk, dass Ihr Pelzmantel im Schrank hängt, passt in Ihre Handtasche rein. Also solange Sie diesen Zettel daheim lesen, finden Sie Ihren Pelzmantel im Schrank.

Schwieriger wird es, wenn Sie Ihre Freundin besuchen und dort Ihren Zettel lesen und erfahren, dass Ihr Pelzmantel im Schrank hängt. In dem Schrank von Ihrer Freundin können Sie suchen, so lange Sie wollen, Ihren Pelzmantel finden Sie dort bestimmt nicht…

Noch eine Hilfe:

Handtasche = Diskette
Pelzmantel = Film
Zettel = Verknüpfung
Schrank = PC
Motten im Schrank = PC Virus
Nachbar im Schrank = Hacker

…alles klar?!

Wir haben Mircrosoft unsere Seele verkauft

me:Benutzt bei euch in der Firma auch jemand einen MAC?
PD:hallo?
Wir haben alle unsere Seele an Microsoft verkauft … Ein MAC als
Arbeitsgerät einsetzen zu wollen ist Grund genug für ne fristlose
Kündigung!! Ich werd ja schon wegen meinem *privaten* iPhone gemobbt …

11 reasons to date a female geek

1) She can fix your computer and make a website for your new startup.
2) She has friends who can fix your computer and design a database for you.
3) She can program your mother’s VCR and Tivo your favorite shows.
4) Her friends can program your mother’s VCR and Tivo your favorite shows
5) She can fix your friends’ computers.
6) She’ll make you shine wherever you go — how many of your friends are smart enough to date such a smart and useful woman?
7) She can pick out a the right cell phone/mp3 player/digital camera for you. Even better she can afford to buy it for you.
8) She’ll be so happy that someone appreciates her for her real talents, that she’ll adore you.
9) She won’t cheat either. Given a choice between George Clooney and the newest tech toy, she’ll take the toy.
10) Did I mention that she can fix your computer, make a website, design a database, install your cable modem and WiFi router, setup you iTunes for automatic download of your favorite artists, download your Outlook contacts onto the new cellphone/mp3 player/digital camera that she bought you?
11) And, she can cook dinner while doing all of the above.

Posts Tagged informatiker

Archives by Month: