Skip to content

Instantly share code, notes, and snippets.

View KevinRohn's full-sized avatar
🏃‍♂️

KevinRohn KevinRohn

🏃‍♂️
View GitHub Profile
@KevinRohn
KevinRohn / cleanhistory.sh
Last active June 7, 2021 09:58
Clean up shell history #commands
history -c
shred -u ~/.bash_history && touch ~/.bash_history
@KevinRohn
KevinRohn / remove-remote-git-tags.txt
Last active June 7, 2021 09:59 — forked from okunishinishi/Remove all git tags
Delete all git remote tags #commands
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@KevinRohn
KevinRohn / clear_logs.sh
Last active June 7, 2021 09:57
Clear all logs #commands
for CLEAN in $(find /var/log/ -type f)
do
cp /dev/null $CLEAN
done
3.5.18.3
@KevinRohn
KevinRohn / validate_ipv4.sh
Created November 3, 2023 15:06
validate IPv4
#!/bin/bash
IP=$1
result=`echo $IP | awk -F"\." ' $0 ~ /^([0-9]{1,3}\.){3}[0-9]{1,3}$/ && $1 <=255 && $2 <= 255 && $3 <= 255 && $4 <= 255 '` 2>/dev/null
if [ "$result" = "" ]; then
echo "IPv4 is invalid: $IP"
exit 1
fi
exit 0
@KevinRohn
KevinRohn / main.py
Last active November 24, 2023 08:53
Quick and Dirty modbus Python request
from pymodbus.client import ModbusTcpClient
import time
host = '192.168.20.203' # Replace with the IP address of your Modbus server
port = 502 # Replace with the port number of your Modbus server
start_address = 250 # Replace with the starting address of the register you want to read
count = 10 # Number of registers to read
slaves = [1] # List of Slave IDs of the Modbus servers
client = ModbusTcpClient(host, port)
@KevinRohn
KevinRohn / ap.sh
Last active December 19, 2023 10:30
setup ap
#!/bin/bash
# Check if running as root
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
ITF_NAME=$1
@KevinRohn
KevinRohn / aptinstall.sh
Created November 24, 2023 09:29
Install apt
#!/bin/bash
wget http://ftp.de.debian.org/debian/pool/main/a/apt/apt_1.8.2.3_armhf.deb
wget http://ftp.de.debian.org/debian/pool/main/a/apt/libapt-pkg5.0_1.8.2.3_armhf.deb
dpkg -i *.deb && rm *.deb
apt update

Flashed:

H1.M100 - 4.711: Bootloader version: 0.8-13901402610 Cmdline:

h1m100-h1m100-70b3d566c3e2$ ~# cat /proc/cmdline
coherent_pool=1M 8250.nr_uarts=1 root=/dev/mmcblk0p4 rootfstype=ext2 elevator=deadline vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 rootwait logo.nologo quiet console=/dev/null fsck.mode=force fsck.repair=yes