Skip to content

Instantly share code, notes, and snippets.

View WaaromZoMoeilijk's full-sized avatar

Aziz WaaromZoMoeilijk

View GitHub Profile
<VirtualHost *:80>
#header add Strict-Transport-Security: "max-age=15768000;includeSubdomains"
# SSLEngine on
### YOUR SERVER ADDRESS ###
ServerAdmin ich@dwgadf.de
ServerName example.com
ServerAlias www.example.com
### SETTINGS ###
@WaaromZoMoeilijk
WaaromZoMoeilijk / lussh
Last active April 6, 2016 07:40 — forked from sbleon/lussh
lussh - script to authorize your SSH key on a server
#!/bin/bash
# make sure to run this with /bin/bash, NOT /bin/sh
echo
echo This script will help you setup ssh public key authentication.
host=dummy
function ask_yes_or_no() {
read -p "$1 ([y]es or [N]o): "
case $(echo $REPLY | tr '[A-Z]' '[a-z]') in
y|yes) echo "yes" ;;
*) echo "no" ;;
esac
}
if [[ "yes" == $(ask_yes_or_no "Do you have an external Harddisk plugged in? (Recommended, SSD, powered external drive) ALL DATA WILL BE LOST AFTER THE FORMAT") ]]
then
echo
#!/bin/bash
#
## Tech and Me ## - ©2016, https://www.techandme.se/
#
# Tested on Ubuntu Server 14.04.
#
SCRIPTS=/var/scripts
HTML=/var/www
OCPATH=$HTML/owncloud
DATA=$OCPATH/data
#!/bin/sh
NAMECRT='Pi.crt'
NAMEKEY='Pi.key'
IP='192.168.1.109'
DNS='8.26.56.26'
IFACE=$(/sbin/ip -o link show | awk '{print $2,$9}' | grep "UP" | cut -d ":" -f 1)
# Check if root
if [ "$(whoami)" != "root" ]; then
echo
#!/bin/sh
IP='techandme.nl'
# Check if root
if [ "$(whoami)" != "root" ]; then
echo
echo -e "\e[31mSorry, you are not root.\n\e[0mYou must type: \e[36msudo \e[0mbash vpnserver2.sh"
echo
exit 1
fi
# Check if the user ncadmin exists, if not create it. This option for installs other then the pre-configured VM
ret=false
getent passwd $UNIXUSER >/dev/null 2>&1 && ret=true
if $ret; then
echo
echo "User $UNIXUSER exists..."
echo
else
adduser --gecos GECOS $UNIXUSER << EOF
$UNIXPASS
VirtualBox Setup with Autostart on boot
I wanted to post how I to setup Oracle VirtualBox with VM (Virtual Machine) Autostart, Resolved Screen Resolutions Issues, etc. This is all being done on the Ubuntu 14.04.1 Linux OS.
1. Install Oracle Virtualbox
2. Install Guest Plugins

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2015-09-24-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

#!/bin/bash
ROUTER="192.168.1.1"
IP=$(hostname -I | cut -d ' ' -f 1)
IF="/sbin/ip"
IFACE=$($IF -o link show | awk '{print $2,$9}' | grep "UP" | cut -d ":" -f 1)
DOMAIN="vpn.waaromzomoeilijk.nl"
# Check if root
if [ "$(whoami)" != "root" ]; then
echo