Skip to content

Instantly share code, notes, and snippets.

View tnibert's full-sized avatar

Timothy Nibert tnibert

View GitHub Profile
@tnibert
tnibert / getwinkey.ps
Created October 25, 2018 12:33
Get Windows key powershell script
# not made by me, but useful
$dpid = Get-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name "DigitalProductId"
# Get the range we are interested in
$id = $dpid.DigitalProductId[52..(52+14)]
# Character table
$chars = "BCDFGHJKMPQRTVWXY2346789"
# Variable for the final product key
@tnibert
tnibert / fixmouse.sh
Created October 15, 2018 23:53
Fix Mouse Lockup in Linux
#! /bin/bash
# this tends to occur when I unplug a usb mouse
# cursor locks up, can click, can't move it - Xubuntu 18.10
# the following commands just reload the mouse module in the kernel
# fixes issue for the instance, yay
sudo modprobe -r psmouse
sudo modprobe psmouse
@tnibert
tnibert / CreateEncryptedDisk.sh
Created July 22, 2018 04:29
Create encrypted automounting disk on Linux
# wipe the disk
wipefs –a /dev/sda
parted /dev/sda mklabel gpt
parted /dev/sda mkpart logical ext4 0% 100%
mkdir /mnt/usb
cryptsetup luksFormat /dev/sda1 # type YES and then enter a password
dd if=/dev/urandom of=/root/keyfile bs=1024 count=4
chmod 0400 /root/keyfile
cryptsetup luksAddKey /dev/sda1 /root/keyfile #Enter passphrase
cryptsetup open /dev/sda1 encrypted
@tnibert
tnibert / netcat.py
Created October 28, 2016 08:52 — forked from leonjza/netcat.py
Python Netcat
import socket
class Netcat:
""" Python 'netcat like' module """
def __init__(self, ip, port):
self.buff = ""
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)