Skip to content

Instantly share code, notes, and snippets.

View mattfoster's full-sized avatar

Matt Foster mattfoster

View GitHub Profile
[
{
"name": "SofleKeyboard",
"author": "Josef Adamcik",
"switchMount": "cherry"
},
[
{
"y": 0.2,
"x": 3,
#! /bin/bash
COL_NC='\e[0m' # No Color
COL_LIGHT_GREEN='\e[1;32m'
COL_LIGHT_RED='\e[1;31m'
TICK="[${COL_LIGHT_GREEN}✓${COL_NC}]"
CROSS="[${COL_LIGHT_RED}✗${COL_NC}]"
INFO="[i]"
# shellcheck disable=SC2034
DONE="${COL_LIGHT_GREEN} done!${COL_NC}"
#! /usr/bin/env perl
use warnings;
use strict;
use File::Spec::Functions qw( catfile );
use Getopt::Long;
use Pod::Usage;
use Time::Piece;
# Default options
#! /usr/bin/env python3
import fileinput
for line in fileinput.input():
pass
for char in list(line.lower().rstrip()):
if not char.isspace():
print(":" + char + char + ": ", end = '')
else:
#! /bin/sh
if [[ -x $(which apt 2>&1) ]]; then
exec apt install -y $@
elif [[ -x $(which apk 2>&1) ]]; then
exec apk add $@
elif [[ -x $(which dnf 2>&1) ]]; then
exec dnf install -y $@
elif [[ -x $(which yum 2>&1) ]]; then
exec yum install -y $@
@mattfoster
mattfoster / network.zsh
Last active September 24, 2019 08:34
Some functions for network fun
# sort -V can also work
function ipsort {
sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n
}
function grep4 {
grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b"
}
function grep6 {
#!/bin/bash
#
# This script runs a given command over all git tags. Note that it
# will check past revisions out! Exercise caution if there are important
# untracked files in your working tree.
#
# This is a modified version of run-command-on-git-revisions, from:
# https://github.com/garybernhardt/dotfiles
#
# Example usage:
@mattfoster
mattfoster / ssh-audit
Created April 23, 2017 15:48
ssh-audit scan-me.nmap.org
% ssh-audit scan-me.nmap.org
# general
(gen) banner: SSH-2.0-OpenSSH_6.6.1
(gen) software: OpenSSH 6.6.1
(gen) compatibility: OpenSSH 6.5-6.6, Dropbear SSH 2013.62+ (some functionality from 0.52)
(gen) compression: enabled (zlib@openssh.com)
# key exchange algorithms
(kex) curve25519-sha256@libssh.org -- [info] available since OpenSSH 6.5, Dropbear SSH 2013.62
(kex) ecdh-sha2-nistp256 -- [fail] using weak elliptic curves
package main
import (
"crypto/tls"
"fmt"
"log"
"net/http"
"net/http/httptrace"
)
-- Config
SSID = "ssid_name"
PASS = "ssid_pass"
MQTT_TEMP_TOPIC = "/sensors/study/temperature"
MQTT_HOST = "server IP"
MQTT_PORT = 1883
MQTT_CLIENT_ID = "esp2866_study"
MQTT_USER = ""
MQTT_PASS = ""