Skip to content

Instantly share code, notes, and snippets.

@dirkakrid
dirkakrid / command.sh
Created December 6, 2016 07:16 — forked from mikemackintosh/command.sh
openssl_speed.sh
openssl speed rsa
PID=$(ps aux |\
grep `w | \
grep -E "\s(tty.*?|console.*?)\s" | \
awk '{print $2}'` | \
grep -v "grep" | \
awk '{print $2}')
@dirkakrid
dirkakrid / check.sh
Created December 6, 2016 07:10 — forked from mikemackintosh/check.sh
Validate x509 (SSL) Certs and Keys using Modulus
for i in `ls -1 *.key`; do
cert=`echo $i |sed -e 's/\.key//'`;
c=$((\
openssl x509 -noout -modulus -in "${cert}.crt" 2>/dev/null| \
openssl md5; \
openssl rsa -noout -modulus -in "${cert}.key" 2>/dev/null| \
openssl md5)\
|uniq \
|wc -l);
test $c -gt 1 && \
@dirkakrid
dirkakrid / create_keys
Created December 6, 2016 07:08 — forked from mikemackintosh/create_keys
Used to generate max-length SSH keys for TMate
#!/bin/bash
gen_key() {
bits=4096
keytype=$1
ks="${keytype}_"
key="keys/ssh_host_${ks}key"
if [ ! -e "${key}" ] ; then
if [ "${keytype}" = 'dsa' ] ; then
bits=1024
elif [ "${keytype}" = 'ecdsa' ] ; then
#!/bin/bash
set -e
IMAGESIZE="990" # in Megabytes
USERNAME="bill"
PASSWORD="b0ard"
PACKAGES="wireless-tools xinit consolekit net-tools fonts-freefont-ttf ifplugd ifupdown hostname fontconfig-config fontconfig iputils-ping wpasupplicant curl binutils locales sudo openssh-server ntp usbmount patch less rsync sudo raspi-config matchbox chromium x11-xserver-utils xwit sqlite3 libnss3 vim"
PI_HOSTNAME=${PI_HOSTNAME-"dashboard${RANDOM:0:3}"}
# Print some configurations
@dirkakrid
dirkakrid / uncipher.py
Created November 25, 2016 06:15 — forked from jayswan/uncipher.py
Python: reverse Cisco type 7 passwords with input from argument
"""
Uncipher Cisco type 7 ciphered passwords
Usage: python uncipher.py <pass> where <pass> is the text of the type 7 password
Example:
$ python uncipher.py 094F4F1D1A0403
catcat
"""
import sys
#!/bin/sh
systemctl stop docker.service
rm $(which docker)
rm /var/run/docker.pid
curl -fsSL https://github.com/armhf-docker-library/binaries/releases/download/1.10.1/docker-1.10.1 \
-o /usr/bin/docker
chmod u+x /usr/bin/docker
@dirkakrid
dirkakrid / parse_logfile
Created October 31, 2016 07:31 — forked from arnobroekhof/parse_logfile
Parsing log file
#!/usr/bin/env python
#
# log_format traffic '$http_host|$status|$bytes_sent|$msec|$remote_addr|$request_uri';
import sys
import itertools, operator
from datetime import datetime
access_log = '/var/log/nginx/access.log'
@dirkakrid
dirkakrid / syslog_server.py
Created October 31, 2016 07:26 — forked from arnobroekhof/syslog_server.py
syslog_server.py
#!/usr/bin/env python
##
## This is a syslog server that is able to receive UDP based syslog
LOG = 'thelogfile.log'
HOST, PORT = "0.0.0.0", 514
import logging
@dirkakrid
dirkakrid / pyside_webkit_javascript.py
Created October 31, 2016 04:16 — forked from webwurst/pyside_webkit_javascript.py
PySide/WebKit/Javascript
import sys
from PySide.QtCore import QObject, Slot
from PySide.QtGui import QApplication
from PySide.QtWebKit import QWebView
html = """
<html>
<body>
<h1>Hello!</h1><br>