Skip to content

Instantly share code, notes, and snippets.

View ErnHem's full-sized avatar
🌴
Awesome place!

ErnHem

🌴
Awesome place!
View GitHub Profile
@ErnHem
ErnHem / Ubuntu_AP.md
Created May 27, 2021 20:38 — forked from ExtremeGTX/Ubuntu_AP.md
Setup Ubuntu server as Access point

Introduction

This tutorial for setting up Ubuntu Server (RPi 3B) as Wifi access point

Overview:

The main steps can be listed as following:

  1. Install required packages
  2. Setup hostapd
  3. Setup DNSmasq
  4. Configure AP IP Address
@ErnHem
ErnHem / SimpleHTTPServerWithUpload.py
Last active March 14, 2021 11:11 — forked from smidgedy/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python3
########################################################################
#
# Simple HTTP server that supports file upload for moving data around
# between boxen on HTB. Based on a gist by bones7456, but mangled by me
# as I've tried (badly) to port it to Python 3, code golf it, and make
# It a little more robust. I was also able to strip out a lot of the
# code trivially because Python3 SimpleHTTPServer is a thing, and the
# cgi module handles multipart data nicely.
#
@ErnHem
ErnHem / .zshrc
Created February 22, 2021 19:45 — forked from dimitardanailov/.zshrc
My personal zsh and tmux configurations
# Path to your oh-my-zsh installation.
export ZSH=/Users/dimitar.danailov/.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="robbyrussell"
ZSH_THEME="agnoster"
@ErnHem
ErnHem / gist:dd43ffaef7d68aa68f44ff02549e497d
Created February 7, 2021 05:45 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
diff -puNr --no-dereference parallels-tools-15.1.2.47123.saved/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs_compat.h parallels-tools-15.1.2.47123/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs_compat.h
--- parallels-tools-15.1.2.47123.saved/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs_compat.h 2019-12-08 17:18:48.986636072 +1100
+++ parallels-tools-15.1.2.47123/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs_compat.h 2020-04-10 19:34:33.094299692 +1000
@@ -11,7 +11,11 @@
static struct proc_dir_entry *
prlfs_proc_create(char *name, umode_t mode, struct proc_dir_entry *parent,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
struct file_operations *fops)
+#else
@ErnHem
ErnHem / ReadMe.md
Last active February 16, 2025 10:52 — forked from jb510/ReadMe.md
Auto Update Brew: OS X Launchd job and script to automatically update homebrew
  1. Place homebrewupdate.sh where ever you like, I use ~/.bin/homebrewupdate.sh
  2. Place the .plist file in ~/Library/LaunchAgents and update the path to your bash script
  3. run launchctl load ~/Library/LaunchAgents/homebrew-upgrade.plist or whatever you've named your plist file.
  4. check launchctl list | grep homebrew to see that it's running

Note: You might need to chmod +x homebrewupdate.sh

Note 2: you can run this manually to test your script ~/.bin/homebrewupdate.sh

Future: Update this to also update casks https://github.com/buo/homebrew-cask-upgrade or using brew cask list | xargs brew cask reinstall

@ErnHem
ErnHem / wordpress-deployment.yaml
Created March 11, 2020 13:48
wordpress-deployment.yaml
apiVersion: v1
kind: Service
metadata:
name: wordpress
labels:
app: wordpress
spec:
ports:
- port: 80
selector:
@ErnHem
ErnHem / mysql-deployment.yaml
Created March 11, 2020 13:47
mysql-deployment.yaml
apiVersion: v1
kind: Service
metadata:
name: wordpress-mysql
labels:
app: wordpress
spec:
ports:
- port: 3306
selector:
@ErnHem
ErnHem / setup.sh
Created December 6, 2019 09:46 — forked from chris-sev/setup.sh
Mac Setup
#!/bin/bash
set -euo pipefail
# Display message 'Setting up your Mac...'
echo "Setting up your Mac..."
sudo -v
# Homebrew - Installation
echo "Installing Homebrew"