Skip to content

Instantly share code, notes, and snippets.

@mkgin
mkgin / .gitignore
Last active June 27, 2023 20:33 — forked from nhasbun/.gitignore
Git ignore file for quartus II projects
# Seen first here: https://gist.github.com/nhasbun/71918796044b7ba89d6662133495f754
#
#
# Working with Altera Quartus II (Q2) and do proper versioning is not that easy
# but if you follow some rules it can be accomplished. :)
# This file should be placed into the main directory where the .qpf file is
# found. Generally Q2 throws all entities and so on in the main directory, but
# you can place all stuff also in separate folders. This approach is followed
# here. So when you create a new design create one or more folders where your
# entities will be located and put a .gitignore in there that overrides the
@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 / 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 / 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 / lisp notes.md
Last active November 20, 2017 13:10
Handy things that I need to remember
@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 / 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
@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 / 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