Skip to content

Instantly share code, notes, and snippets.

@mkgin
mkgin / zabbix dummy.c
Created January 15, 2017 18:30
Zabbix module
zabbix modules
need configured zabbix sources to build.
```
$ git clone -b '3.2.3' --single-branch --depth 1 https://github.com/zabbix/zabbix.git
$ cd zabbix
$ ./bootstrap.sh
$ ./configure
$ cd src/modules/
```
@mkgin
mkgin / authorized_keys
Created February 7, 2017 13:39
SSH authorized keys tunnel only
# .ssh/authorized_keys
# use the -T and -N options.... "ssh -T -N ......"
no-pty,no-X11-forwarding,command="/bin/echo tunnel only" ssh-rsa AAA......... abc@def
@mkgin
mkgin / gist:8e0e752e3814970e87d671536416b1fc
Last active August 30, 2017 12:56
Create a new ansible role template (not in galaxy)
# connect a galaxy role to a git repo example
#
cd roles.galaxy jorti.fail2ban
git remote add -f remote git@github.com:mkgin/ansible-fail2ban.git
# Create template for role Rolename
# and comment out the galaxy info tag
# so the new role is not listed with ones that were installed from galaxy
@mkgin
mkgin / lisp notes.md
Last active November 20, 2017 13:10
Handy things that I need to remember
@mkgin
mkgin / prusa gcodes
Last active March 21, 2019 18:29
Some GCODE to remember. Some PRUSA firmware specific
; src/Marlin_main.cpp has a list in the comments...
PRUSA FAN ; returns fan speeds...
M861 ! ; restore pinda table from Eprom
M861 ? ; query pinda table
M860 S35 ; wait until PINDA is 35C ( dependings on if temp is increasing or decreasing)
; should check if R is supported
@mkgin
mkgin / gist:77189c3722af9251775422e207beaf15
Last active March 29, 2020 19:44
laptop resumes right after suspend
# Check USB... this worked well for my Lenovo Twist, I think...
#
https://askubuntu.com/questions/144932/why-does-my-laptop-resume-immediately-after-suspend
Basically.
# find USB PCI interfaces
lspci |grep -i usb
@mkgin
mkgin / midi_note_list.c
Created May 14, 2020 10:27
Calculate and print table of notes and frequencies for MIDI note numbers
#include <stdio.h>
#include <math.h>
/***********
* Calculate and print note names, octaves and frequency for MIDI notes
*
* gcc -lm -o midi_note_list midi_note_list.c
*
* UNLICENCE (see end)
*
@mkgin
mkgin / syslog-ng_suricata_ntopng.conf
Created August 4, 2020 00:02
send suricata logs to ntopng using syslog-ng
# send suricata logs to ntopng with syslog-ng
#
# this is just one part of the puzzle...
# - suricata needs to be configured (extra eve log) in one yaml.conf
# - ntop in a few places, plus knowing where to look to see that it works...
# - once configured:
# - select the syslog interface.
# - click flows
# - select status drop-down and click external alert to see what suricata is reporting
@mkgin
mkgin / gist:6763914a9f1a54ad374898e4f9e51a48
Created June 18, 2017 15:46
du for dotfiles and dirs too
du -sch .[!.]* * |sort -h
https://askubuntu.com/questions/356902/why-doesnt-this-show-the-hidden-files-folders