Skip to content

Instantly share code, notes, and snippets.

View saper-2's full-sized avatar

saper-2

  • Poland
View GitHub Profile
@saper-2
saper-2 / README.md
Created January 8, 2018 17:26
Debian 9 nvidia-smi at boot from systemd
  1. Put 'nvload.service' into /etc/systemd/system
  2. chmod 664 nvload.service
  3. Put 'nvsmi-load.sh' script in e.g. /usr/local/nvsmi-load.sh
  4. chmod 744 nvsmi-load.sh
  5. Optionally correct path to the nvsmi-load.sh From root exec cmds:
  6. 'systemctl daemon-reload'
  7. 'systemctl enable nvload.service'
  8. To test if works exec: systemctl start nvload.service
  9. Check if /tmp/nvsmi-load.log exists and have expected contetn (output of nvidia-smi and if have current date & time at header).
@saper-2
saper-2 / slim-raspbian.sh
Created February 15, 2018 17:26 — forked from hyper3xpl0iter/slim-raspbian.sh
Script to remove bloatware from a fresh Raspbian Jessie install
#!/bin/bash
##############################################################################
#
# Filename: slim-raspbian.sh
# Description: Script to remove bloatware from fresh Raspbian Jessie install
# Source: https://github.com/hyper3xpl0iter/helper_scripts.git
# Author: Andre Mattie
# Email: devel@th3c1inic.org
# GPG: B9C0 3976 3CB4 794E D66C 8F75 8AA0 8470 3533 2EDD
@saper-2
saper-2 / main.c
Created January 30, 2019 20:07
Reset detection on ATMega8
/*
* resetevents.c
*
* Created: 2019-01-30 20:43:30
* Author : saper
*/
#include <avr/io.h>
#include <inttypes.h>
//#include <avr/interrupt.h>
@saper-2
saper-2 / main.c
Created January 30, 2019 20:40
mega8 MCUCSR (MCUSR for mega328) test
/*
* resetevents.c
*
* Created: 2019-01-30 20:43:30
* Author : saper
*/
#include <avr/io.h>
#include <inttypes.h>
//#include <avr/interrupt.h>
@saper-2
saper-2 / check_proc.sh
Last active August 1, 2019 20:49
Domoticz restarter script (or any service)
#!/bin/bash
# Author: Przemyslaw W. [saper_2]
# Date: 2019-08-01
# this script check for running process and (re)start it's service. After 4 failures it'll reboot system.
# use "-c" parameter for suppress console output messages if script will be run from cron.
# you can rename this script as you fit (e.g. check_domoticz.sh :P )
# You cat put this in crontab (run script every 5min):
# */5 * * * * /home/pi/check_proc.sh -c
@saper-2
saper-2 / test_tasmota_http_cmds.html
Created October 30, 2019 23:51
Jak sie dogadac z tasmota przez http
<html>
<head>
<meta charset="UTF-8"> <!-- kodowanie UTF-8 tego pliku teksotwego -->
<!-- sciągnij z https://jquery.com/download/ najnowszy "compressed, production jQuery x.y.z" ,
wrzuć sciągnięty plik 'jquery-x.y.z.min.js' do tego samego katalogu co ten plik html.
Ah, jak klikniesz "Download ...." to otworzy się strona z "tekstem" - po prostu uzyj Plik->Zapisz aby zapisać 'jquery-x.y.z.min.js' :)
Dla innych ludzi którzy dotrą do tego :) : popraw wersję jquery jak będziesz ściągał ("x.y.z" to będzie numer wersji) w tagu poniżej "script src=...."
-->
<script type="text/javascript" src="jquery-3.4.1.min.js"></script>
<script>
@saper-2
saper-2 / plugin.py
Last active November 1, 2019 19:05
Proof of concept plugin for domoticz to check if remote host is alive (needs some finshing)
# Remote IP Checker
#
# Author: saper_2, 2019
#
# version 0.0.1 : Initial release, based on 'Wan IP Checker v.1.2.5' by ycahome (https://www.domoticz.com/forum/viewtopic.php?t=16266)
#
#
#
"""
<plugin key="REMOTE-IP-CHECKER" name="Remote IP Checker" author="saper_2" version="0.1" externallink="">
@saper-2
saper-2 / links.txt
Created December 9, 2019 19:24
MODBUS RTU Software & tools & infos
@saper-2
saper-2 / mqtt_domoticz_sensors.yaml
Created December 9, 2019 21:06
Home Assistant configs
# *********************************************************
# Map sensors from domoticz MQTT:/domoticz/out into:
# MQTT:home/sensor/xxx/sensor : {json_data}
#
# Not advised by MQTT is to use this layout:
# MQTT:home/sensor/xxx/yyyy : value
# Because, many topics generates additional traffic.
#
# xxx - domoticz sensor id ,
# yyyy - sensor value type, e.g.:
@saper-2
saper-2 / client.ovpn
Created May 26, 2020 15:49
OpenVPN Mikrotik
#client, protocol TCP, set file name as you like - it'll be displayed in OpenVPN client as connection name.
proto tcp-client
remote domain.com 12345 # Remote OpenVPN Server DNS/IP and port
# tap allow to access LAN traffic without additional routing - not supported by ios and Android
dev tap
# 'tun' - require additional routing to access LAN resources, but works with android and ios
nobind
persist-key
persist-tun