Skip to content

Instantly share code, notes, and snippets.

View JorgenEvens's full-sized avatar

Jorgen Evens JorgenEvens

View GitHub Profile
@JorgenEvens
JorgenEvens / convert.sh
Last active April 1, 2023 09:15
Script to convert legacy boot debian to UEFI
#!/bin/bash
set -e
apt update
apt install lvm2 gparted
# Convert MBR to GPT
sgdisk -g /dev/xvda
partprobe
https://forwrd.it/or/eyJjYWxsYmFjayI6WyJodHRwczovL2hhbmR5bWFuLmFtYmFzc2lmeS5ldS9tYWlsLWRpZ2VzdC9ldmVudC9jbGljaz9wcm9wZXJ0eT1VQS0yMDM2MDY0NS0xMiZjb21tdW5pdHk9MTM0NjgmbWVtYmVyPTYzN2E1MTA5LTY3NzctNGRlMy1hMmExLTI5MjdiODFkNWZkNyZ0aW1lc3RhbXA9MTU1NDQ0MjU0NTM1OCJdLCJ1IjoiaHR0cHM6Ly9oYW5keW1hbi5hbWJhc3NpZnkuZXUvc2hhcmUvd2hhdHNhcHAvMTQ5NDk_dG9rZW49ZXlKaGJHY2lPaUpGVXpJMU5pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SnZjbWRKWkNJNk1qZ3lNaXdpYVdRaU9pSTJNemRoTlRFd09TMDJOemMzTFRSa1pUTXRZVEpoTVMweU9USTNZamd4WkRWbVpEY2lMQ0pwWVhRaU9qRTFOVFEwTkRJNU5USjkucFBIcFJXMXFUcEZvRzNpaENOUnFQZk5JVkgwd0l3c1hHNTVYS0hXaktOaHhTcmEybDR5bHlvblAyNVBGY3kydGFJWTJ4SG00VWRmQXNCcjVhREZkcXcifQ
@JorgenEvens
JorgenEvens / gen-dkim-key.sh
Created February 17, 2018 22:28
Generate DKIM key pair and entry for in your bind zones.
#!/bin/sh
DOMAIN=$1
SELECTOR=${2:-mail}
if [ -z "$DOMAIN" ]; then
echo "Usage: $0 domain"
exit 1;
fi

Keybase proof

I hereby claim:

  • I am jorgenevens on github.
  • I am jorgenevens (https://keybase.io/jorgenevens) on keybase.
  • I have a public key ASAdU32yjwLcW3h6Uc7ivx54k7KsHtLMBN0Q0zN2jY4bVAo

To claim this, I am signing this object:

@JorgenEvens
JorgenEvens / gpg-connect-agent
Created April 6, 2016 09:01
A fallback for gpg-connect-agent on OSX when using Oh-My-Zsh gpg-agent plugin and gnupg from Homebrew.
#!/bin/sh
GPG_ENV=$HOME/.gnupg/gpg-agent.env
if [ ! -f "${GPG_ENV}" ]; then
>&2 echo "GPG_ENV not found"
echo "GPG_ENV not found" >> /tmp/gpg-agent
exit 1
fi
@JorgenEvens
JorgenEvens / IR_Sensor.ino
Last active November 21, 2015 22:55
Code to read IR codes from a remote using 1838B sensor
#include <Arduino.h>
// Enable debug printing of signal
// #define DEBUG_SIGNAL
// Enable debug for HEX codes
// #define DEBUG_CODES
// Only store time that signal was up.
// #define STORE_DOWN
@JorgenEvens
JorgenEvens / nodeapp.js
Created November 4, 2015 21:13
Shared hosting nodejs application without providing shell access.
var path = require('path');
var chroot = require('chroot');
var CHROOT_DIR = '/www';
var CHROOT_WWW = '/vhost/domain/http/';
var CHROOT_NODE_BIN = '/vhost/bin/node';
var USER = 2000;
var GROUP = 2000;
var webDir = path.join(__dirname, '..', 'http');
@JorgenEvens
JorgenEvens / BaseAware.js
Created August 19, 2015 07:42
A React composite component that loads properties for us and prevents re-rendering until it changes.
import _ from 'lodash';
import React from 'react';
const debug = false;
const log = debug ? console.log.bind(console) : () => {};
const getPath = ( obj, path, defaultValue ) => {
_.each( path.split('.'), function( key ) {
if( _.isUndefined( obj ) )
return false;
@JorgenEvens
JorgenEvens / fix-indentation.sh
Created July 21, 2015 16:17
Script that converts indentation format
#!/bin/sh
set -e
# Convert indentation from $INDENT_CURRENT to $INDENT_TARGET
INDENT_CURRENT=" " # 1 Tab
INDENT_TARGET=" " # 4 Spaces
EXTENSION="*.php"
is_dirty() {
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"
# Example aliases