Skip to content

Instantly share code, notes, and snippets.

View tomasinouk's full-sized avatar

Tomas Blaha tomasinouk

View GitHub Profile
@tomasinouk
tomasinouk / snat_dnat_advantech.md
Last active April 11, 2024 03:50
examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot).

Some examples of SNAT, DNAT with iptables with comments

mainly used in start-up script

How to test 'safely'

When we play with iptables aka firewall we might end up in situation, where we execute rule, which has unforseen impact - lock yourself out. Recovering from this situation is necessity.

How to:

  • Enable reboot via SMS.
  • Test all commands in shell first before putting them into Start-up script. This way the command will be wiped out, when unit is rebooted.

masquarade all outgoing packets to be WLAN0 IP

@tomasinouk
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 Arduino.cc forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
@tomasinouk
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 192.168.0.0/16 IP subnet:
Host 192.168.*.*
StrictHostKeyChecking no