Tech bytes
Remote syslog using python
This is quite handy way of sending informative or debug level message to a remote syslog server. And it is quite easy. Here is the basic code
Starting with Mongodb
Installation and configuation Download following mongodb packages from https://repo.mongodb.org/yum/redhat/ Install packages: Edit /etc/mongod.conf and amend systemLog->path to desired log location and storage->dbPath to desired database location. For eg, if storage->dbPath is set to /mongodb/data, then also change owner of this directory as following: Start mongodb service and tail logs in parallel View logs: Once package […]
Python pandas dataframe to Influxdb with column and other tags
Python pandas is very powerful data processing library. It can take large data from variety of sources (CSVs, databases, excel etc) and process it in memory. After processing the data you may have to dump it in influxdb. In influxdb each measurement has tags and fields. While writing pandas dataframe to influxdb we can define […]
Nested variables in Grafana
Quite often you want to use one variable of Grafana as input in query to derive next variable value set. Think of a typical example, you have 10 host machines and each host has several network interfaces. And you want to display stats of each interface of selected host. Now, when you select “host” variable […]
Mass network connection tracker
At times, you want to keep track of network connections between multiple hosts on different TCP ports. For example, if you have a medium or large scale infra comprising of many applications, databases, devices etc. All these mutually connect with each other on TCP ports. And in case there is an unannounced change in routing […]
Login and parse ASP.NET sites with Python
I am using web scraping on several sites to get information like prices from e-commerce sites and meter readings, balance amount etc from my apartment service provider portal. This is fairly simple to do in python using “requests” and “beautifulsoup” modules. Recently, my apartment service provider revamped their website in ASP.NET. I thought it was […]
Automated bulk command execution on SSH enabled hosts and devices
In the lockdown period, during pandemic, there is nothing much to do over weekend 😏. Was just thinking of writing ✍️ something, something useful…. then came up with an idea to address a common problem that many sysadmins and netadmins come across. At times, we want to run set of commands on many devices, hosts […]
IoT switch using relay operated by micropython based NodeMCU
IoT is gaining market rapidly. In recent years, many appliance, automobile manufactures have started adding “connected” features in their product line. Most basic IoT implementation you can think of is, switching on|off an appliance over internet. Let us see how this works and how you can build a IoT switch under 7 USD. You need […]
Multi topic IoT subscriber model
In a typical IoT model, you have many IoT sensors publishing data to IoT broker. You may want to collect data from all these IoT nodes in a database for visualization and further analytics. I have couple of IoT nodes installed in two houses in two different cities. And I collect data from all IoT […]
Air quality monitor using GP2Y1010AU0F sensor on micropython based NodeMCU
I had purchased GP2Y1010AU0F sensor about 6 months back. Finally, found time to hook it with NodeMCU controller. Firstly, let me list things you need. NodeMCU (ESP8266) controller (~300₹). GP2Y1010AU0F dust/smoke sensor(~450₹). 150k ohm resistor. 220 µF capacitor. breadboard with some connecting wires. Here is the connection schema of circuit. Since solution is based on […]