Skip to content

Instantly share code, notes, and snippets.

View qistoph's full-sized avatar

Chris van Marle qistoph

  • The Netherlands
View GitHub Profile
Example 1:
>>> print(pins2ascii({
1: 'Rst',
2: 'RX',
4: 'Gnd', #'⏚',
5: 'SDA',
6: 'SCL',
8: '5V', #'↑'
}))
@qistoph
qistoph / awk_netstat.sh
Created August 6, 2020 07:55
AWK to get details from /proc/net/tcp and /proc/net/udp when netstat and lsof are not available
# Based on gist https://gist.github.com/staaldraad/4c4c80800ce15b6bef1c1186eaa8da9f
# - added TCP states
awk 'BEGIN{states["01"]="TCP_ESTABLISHED"
states["02"]="TCP_SYN_SENT"
states["03"]="TCP_SYN_RECV"
states["04"]="TCP_FIN_WAIT1"
states["05"]="TCP_FIN_WAIT2"
states["06"]="TCP_TIME_WAIT"
states["07"]="TCP_CLOSE"
@qistoph
qistoph / Temp.ino
Created November 9, 2019 11:40
Premature termination JSON output
#include <OneWire.h>
OneWire ds(D7);
byte addr[8];
byte type_s;
unsigned long readTempAfter;
float celcius = 90;
bool findTemperatureSensor() {
[{"id":1,"first_name":"Hubie","last_name":"Decreuze","email":"hdecreuze0@ehow.com","gender":"Male","devices":[{"ip":"87.36.171.108","mac":"F2-66-EC-80-8F-91","online":true}]},{"id":2,"first_name":"Barbi","last_name":"Wrout","email":"bwrout1@ocn.ne.jp","gender":"Female","devices":[{"ip":"1.224.156.208","mac":"58-E2-87-6E-7B-52","online":true},{"ip":"201.123.160.129","mac":"14-83-DE-1D-27-86","online":true},{"ip":"95.171.216.151","mac":"6F-A5-B3-5D-31-54","online":false}]},{"id":3,"first_name":"Tiffy","last_name":"Hoy","email":"thoy2@blog.com","gender":"Female","devices":[{"ip":"102.91.53.51","mac":"D9-0E-01-35-F3-91","online":true},{"ip":"118.185.135.17","mac":"4C-22-C8-98-81-14","online":false}]},{"id":4,"first_name":"Rhett","last_name":"Ryall","email":"rryall3@amazonaws.com","gender":"Male","devices":[{"ip":"211.230.8.252","mac":"7A-EB-3D-97-E6-91","online":false},{"ip":"212.23.168.207","mac":"45-74-78-22-48-4D","online":false},{"ip":"93.251.89.14","mac":"6C-AB-5B-17-A1-42","online":true}]},{"id":5,"first_na
@qistoph
qistoph / chartable.md
Last active May 3, 2019 09:29
Character table generator
encodings = ['cp437', 'iso-8859-15', 'windows-1252']
def chr_str(ch, show_class = False, name = ''):
    outstr = ""
    if ch == '':
        outstr += " NA "
@qistoph
qistoph / imapserver.py
Created May 1, 2019 13:26
Simple IMAP server for testing purposes. Copied from bamthomas. Added SSL
#!/usr/bin/python3
# https://raw.githubusercontent.com/bamthomas/aioimaplib/master/aioimaplib/tests/imapserver.py
# aioimaplib : an IMAPrev4 lib using python asyncio
# Copyright (C) 2016 Bruno Thomas
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@qistoph
qistoph / kpfind.pl
Created August 4, 2017 07:45
Search a list of hashes for your KeePass stored passwords
#!/usr/bin/perl
# Search a list of hashes for your KeePass stored passwords
# e.g. https://haveibeenpwned.com/Passwords
# Chris van Marle 2017
# License: GNU GPLv3
use strict;
use warnings;
use Data::Dumper;
@qistoph
qistoph / ssh-auth-caret.sh
Created July 21, 2017 08:43
Use SSH agent from other client
#!/bin/bash
# See blog for more details:
# https://qistoph.blogspot.nl/2017/07/use-ssh-agent-socket-from-remote-host.html
# Exit if undeclared variables are used
set -o nounset
# Exit if any command exits with error
set -o errexit
@qistoph
qistoph / keybase.md
Created July 11, 2017 13:05
Keybase proof

Keybase proof

I hereby claim:

  • I am qistoph on github.
  • I am qistoph (https://keybase.io/qistoph) on keybase.
  • I have a public key whose fingerprint is B37C 3DFB 59C7 C15A D215 6B97 611D 9327 CF1A A8F6

To claim this, I am signing this object:

@qistoph
qistoph / en.json
Last active February 12, 2017 11:06
{
"GENERAL": {
"LOADING": "Loading &hellip;"
},
"CALENDAR": {
"TODAY": "Today",
"TOMORROW": "Tomorrow",
"DAYAFTERTOMORROW": "The day after tomorrow",
"RUNNING": "Ends in",