Skip to content

Instantly share code, notes, and snippets.

View technocake's full-sized avatar

Robin Garen Aaberg technocake

View GitHub Profile
@technocake
technocake / pyclean.sh
Last active May 9, 2025 09:45
Clear all python cache in directory
# pyclean command to clear all python cache in a directory
# source: https://stackoverflow.com/questions/28991015/python3-project-remove-pycache-folders-and-pyc-files
# in .bash_profile / .bash_rc etc put:
pyclean () {
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
}
@technocake
technocake / copyignoredfiles.sh
Last active October 16, 2018 11:13
Copy all ignored files from a git repo
#!/bin/bash
# Copy all ignored files from a git repo to $FOLDER
FOLDER= "/path/to/folder"
for file in $(git ls-files --others -i --exclude-standard); do
cp --parents "$file" "$FOLDER"
done
@technocake
technocake / ssl-check.py
Created February 7, 2018 13:53 — forked from gdamjan/ssl-check.py
Python script to check on SSL certificates
# -*- encoding: utf-8 -*-
# requires a recent enough python with idna support in socket
# pyopenssl, cryptography and idna
from OpenSSL import SSL
from cryptography import x509
from cryptography.x509.oid import NameOID
import idna
from socket import socket
@technocake
technocake / budsjett.py
Last active March 11, 2016 18:22
kompilert budsjett
#!/usr/bin/env python
#coding: utf-8
inntekter = {
'kontigent': 50.00 * 10
}
utgifter = {
'domeneavgift': 110,
@technocake
technocake / webcam-in-browser.html
Created December 31, 2015 08:59
HTML5 webcam from getUserMedia()
<!DOCTYPE html>
<html>
<head>
<title>Webcam test</title>
<script type="text/javascript">
function loadstream(stream) {
console.log(stream);
video = document.getElementById("webcam");
video.src = window.URL.createObjectURL(stream);
@technocake
technocake / mac_adduser.sh
Created November 24, 2012 21:09
A script to add a user from cli on mac osx.
#!/bin/sh
#
# Adds a user to a mac.
#
# based on this article: http://osxdaily.com/2007/10/29/how-to-add-a-user-from-the-os-x-command-line-works-with-leopard/
#
# Usage: ./mac_adduser.sh <username> <uid> <gid>
#
username=$1