Skip to content

Instantly share code, notes, and snippets.

View tomasinouk's full-sized avatar

Tomas Blaha tomasinouk

View GitHub Profile
tomasinouk / Disable Stict host check OS X
Last active August 29, 2015 14:11
Disable strict host checking in OS X for IP subnet
# You will need to probably create ~/.ssh/config file or edit, and add the following lines:
# Host [IP Address]
# StrictHostKeyChecking no
# UserKnownHostsFile=/dev/null
# A example for whole IP subnet:
Host 192.168.*.*
StrictHostKeyChecking no
tomasinouk / I2C_scanner
Created March 30, 2015 05:36
I2C scanner from Arduino playground using **wire** library
// --------------------------------------
// i2c_scanner
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by user Krodal
tomasinouk / gist:1c59a99c82ed8df7c3f5
Last active August 29, 2015 14:21
logrotate and pm2 logs
# logrotate and pm2 logs
# file location
# /etc/logrotate.d/pm2
/root/.pm2/logs/*.log {
rotate 15
-- control 2 first neopixels via RGB
--ws2812.writergb(2, string.char(100,255,0,255,0,0))
-- control 8 neopixels with same RGB color
-- ws2812.writergb(2, string.char(100,255,0):rep(8))
-- -- control 8 neopixels with same RGB color - turn off
ws2812.writergb(2, string.char(0,0,0):rep(8))
tomasinouk /
Last active November 18, 2015 01:44

Speed of SHDSL(1):

IF-MIB::ifSpeed.4096 = Gauge32: 15288000

  • OID: snmptranslate -On IF-MIB::ifSpeed.4096 -> .


IF-MIB::ifInOctets.4096 = Counter32: 10923350

  • OID snmptranslate -On IF-MIB::ifInOctets.4096 -> .
tomasinouk /
Created January 31, 2016 22:02
Reconfigure BlueSolar solar charger to work with RDC

Modify setting of the Blue Solar regulator from Victron for smooth operation with RDC, if not already done by Madison Technologies.

Blue Solar - RDC charger

Detail instructions

How to connect to the regulator are here:

##Short version:

  1. Download the MMPTPREFS program here
tomasinouk /
Created May 4, 2016 01:06
Retrieve Tx, Rx metrics from cellular interface on Cybertec routers via SNMP and print out data.
from pysnmp.hlapi import *
import time
import datetime
# seconds between polls
interval = 60
# IP address of the Cybertec router
ip_address = ''
# while True:
tomasinouk /
Created June 23, 2016 06:17
recursively search for files in directories and copy them to new location with modified name
import shutil
import os
import re
source = os.walk("~/Downloads/camera/")
destination = "~/Downloads/mobotix-pic/"
# for files in source:
for root, dirs, files in source:
# print(files)
for _file in files:
tomasinouk / battery_capacity_nodemcu
Last active August 3, 2016 17:36
Reading battery capacity nodeMCU - lua
-- represent actually PIN on nodeMCU such as
-- D7 and D5 in this case
-- GND needs to be connected
sda=7 -- GPIO13
scl=5 -- GPIO14
-- initialize i2c, set pin1 as sda, set pin2 as scl

Script reads BIN0 (binary input 0) on the Conel, SmartWorkx router and displaying it in a console. Can be looged in systemlog as well. Little modification can be done to log it into the file, in CSV format.



while true