Skip to content

Instantly share code, notes, and snippets.

//set the default æøå keys
#define DA_OE KC_QUOT // ø
#define DA_AE KC_SCLN // æ
#define DA_AA KC_LBRC // å
//default keybindings (english vs. da keys)
#define DA_PLUS KC_MINUS // + => - (plus key on DK is minus on EN)
//single quote (nordic style)
#define DA_QUOT KC_NONUS_HASH // '
@eyJhb
eyJhb / php-doc.el
Last active March 10, 2017 13:40 — forked from stesie/php-doc.el
php doc block generator/extractor for emacs
;;; php-doc.el --- doc block generator/extractor for php
;; Copyright (C) 2010, 2013 Stefan Siegl <stesie@brokenpipe.de>
;; Maintainer: Stefan Siegl <stesie@brokenpipe.de>
;; Author: Stefan Siegl <stesie@brokenpipe.de>
;; Keywords: php docblock
;; Created: 2010
;; Modified: 2013-09-14
;; X-URL: https://gist.github.com/stesie
@eyJhb
eyJhb / vagrant.log
Last active July 13, 2018 16:32
Logfile showing vagrant choosing the wrong adapter by choosing it by the ip, instead of only using the name.
INFO interface: info: Matching MAC address for NAT networking...
INFO interface: info: ==> web: Matching MAC address for NAT networking...
==> web: Matching MAC address for NAT networking...
INFO interface: info: Clearing any previously set network interfaces...
INFO interface: info: ==> web: Clearing any previously set network interfaces...
==> web: Clearing any previously set network interfaces...
DEBUG network: Available slots for high-level adapters: #<Set: {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36}>
INFO network: Determining network adapters required for high-level configuration...
INFO network: -- Slot 2: hostonly
INFO network: Determining adapters and compiling network configuration...
@eyJhb
eyJhb / eurojackpot-getnumbers.py
Created February 19, 2018 09:01
grap eurojackpot numbers from danskespil
import requests
class eurojackpot(object):
def __init__(self):
self.s = requests.session()
self.url_base = 'https://danskespil.dk/scapi/danskespil/numbergames/eurojackpot/'
def get_dates(self):
url = self.url_base+"completedDrawDates"
@eyJhb
eyJhb / base64.php
Created May 2, 2018 06:37
Simple php script to base64 encode file
<?php
if(count($argv) < 3) {
die("php base64 <input filename> <output filename>\n");
}
$input = $argv[1];
$output = $argv[2];
$file_content = file_get_contents($input);
$encoded = base64_encode($file_content);
return file_put_contents($output, $encoded);
@eyJhb
eyJhb / drdk_extractor.py
Created May 4, 2018 20:29
DR OnDemand Akamai gather
import requests
import re
import string
import asyncio
from aiohttp import ClientSession
class drdk_extractor(object):
def __init__(self):
self.url = 'https://www.dr.dk/mu/programcard'
self.url = 'https://www.dr.dk/mu/search/programcard?Title='
@eyJhb
eyJhb / backup.sh
Last active July 13, 2018 16:29
Simple backup script that uses GPG to encrypt backups with public key before transferring backup to a SCP server
#!/bin/bash
# Linux SCP Backup Script
# how it works
# -
#date string
d=$(date --iso)
@eyJhb
eyJhb / pfsense-backup.sh
Last active July 13, 2018 16:30
Simple bash script to login on a pfsense router to download the configuration and save it as a file for backups
#!/bin/bash
username="backup"
password="password"
router_ip="https://192.168.1.1"
backup_location="/tmp"
csrf=$(wget -qO- --keep-session-cookies --save-cookies cookies.txt \
--no-check-certificate $router_ip/diag_backup.php \
| grep "name='__csrf_magic'" | sed 's/.*value="\(.*\)".*/\1/')
@eyJhb
eyJhb / flask-shutdown-restart.py
Created July 22, 2018 19:13
Simple flask web server to shutdown and restart a server
from flask import Flask
import subprocess
app = Flask(__name__)
@app.route("/")
def index():
return "Please visit /shutdown or /restart"
@app.route("/restart")
def restart():
@eyJhb
eyJhb / debug-inserter.py
Created July 27, 2018 19:37
Quick script for inserting debug statements in smali code.. Somewhat works!
import os
import re
class debug_inserter(object):
def __init__(self, path_to_files, prefix):
self.path_to_files = path_to_files
self.debug_prefix = prefix
self.debug_statement = """const-string {0}, \"{1} - {2}\"
invoke-static {{0}, {0}}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I"""
self.re_filename = re.compile("\.smali$")