Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris van Marle qistoph

View GitHub Profile
@qistoph
qistoph / awk_netstat.sh
Created Aug 6, 2020
AWK to get details from /proc/net/tcp and /proc/net/udp when netstat and lsof are not available
View awk_netstat.sh
# 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 Nov 9, 2019
Premature termination JSON output
View Temp.ino
#include <OneWire.h>
OneWire ds(D7);
byte addr[8];
byte type_s;
unsigned long readTempAfter;
float celcius = 90;
bool findTemperatureSensor() {
View mock.json
[{"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
Character table generator
View chartable.md
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
Simple IMAP server for testing purposes. Copied from bamthomas. Added SSL
View imapserver.py
#!/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 Aug 4, 2017
Search a list of hashes for your KeePass stored passwords
View kpfind.pl
#!/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 Jul 21, 2017
Use SSH agent from other client
View ssh-auth-caret.sh
#!/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
View keybase.md

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:

View en.json
{
"GENERAL": {
"LOADING": "Loading &hellip;"
},
"CALENDAR": {
"TODAY": "Today",
"TOMORROW": "Tomorrow",
"DAYAFTERTOMORROW": "The day after tomorrow",
"RUNNING": "Ends in",