Skip to content

Instantly share code, notes, and snippets.

View mstaack's full-sized avatar
🎯
Focusing

Max mstaack

🎯
Focusing
View GitHub Profile
@mstaack
mstaack / gist:7adfbd09df70b65017547d80d7b38f54
Created August 11, 2018 18:37 — forked from krisnod/gist:56ff894f400cce7c742fb11fb2fde9cf
RancherOS on Hetzner using software RAID (RAID 1)
Install:
----------
* Activate Hetzner Rescue System (Debian)
* Connect to Hetzner Rescue System using SSH and live boot RancherOS
(thanks goes to William Fleurant for showing how this can be done: https://github.com/wfleurant/boot-rancheros-hetzner/)
* apt-get update
* apt-get install kexec-tools aria2
@mstaack
mstaack / gist:0a06afe3a72c7a168f5062861206aebc
Created August 11, 2018 14:34
hetzner proxmox all in one
#!/usr/bin/env bash
# Hetzner Disk Layout all LVM
# PART /boot ext4 512M
# PART lvm pve all
# LV pve swap swap swap 8G
# LV pve root / ext4 100G
# Basics
#!/bin/bash
# Stop rsyslog to clean up logs
service rsyslog stop
# Cleanup all logs
cat /dev/null > /var/log/audit/audit.log
cat /dev/null > /var/log/wtmp
cat /dev/null > /var/log/lastlog
#cleanup persistent udev rules
@mstaack
mstaack / nginxproxy.md
Created August 9, 2018 18:25 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

PART /boot ext4 512M
PART lvm pve all
LV pve swap swap swap 8G
LV pve root / ext4 100G
@mstaack
mstaack / hetzner-proxmox-docker.sh
Created August 8, 2018 21:40 — forked from rwenz3l/hetzner-proxmox-docker.sh
Hetzner Dedicated with Debian 9 (Stretch) and Proxmox 5 (LXC) + Docker-CE + Portainer [NAT]
#############################################
### Proxmox V & Docker-CE + Portainer #
#############################################
## Rescue System
# Erase other disks
dd if=/dev/zero of=/dev/sda bs=1M count=100
dd if=/dev/zero of=/dev/sdb bs=1M count=100
# You can install debian 9 via the guide:
@mstaack
mstaack / ImagineResizer.php
Created August 1, 2018 08:34 — forked from giorrrgio/ImagineResizer.php
best fit images
<?php
namespace Acme\MyBundle\Service;
use Symfony\Component\HttpFoundation\File\File;
use Imagine\Image\ImagineInterface;
use Imagine\Image\BoxInterface;
use Imagine\Image\Point;
use Imagine\Image\Box;
sudo apt-get install build-essential libxml2-dev libfftw3-dev \
gettext libgtk2.0-dev python-dev liblcms1-dev liboil-dev \
libmagickwand-dev libopenexr-dev libcfitsio3-dev \
gobject-introspection automake libtool swig gtk-doc-tools
git clone https://github.com/jcupitt/libvips.git
cd libvips
./autogen.sh
make
sudo make install
@mstaack
mstaack / linkify.php
Created July 31, 2018 09:06 — forked from jasny/linkify.php
PHP function to turn all URLs in clickable links
<?php
/**
* Turn all URLs in clickable links.
*
* @param string $value
* @param array $protocols http/https, ftp, mail, twitter
* @param array $attributes
* @param string $mode normal or all
* @return string
*/
# Git aliases
alias gs="git status"
alias ga="git add"
alias gaa="git add ."
alias gc="git commit"
alias gp="git push"
alias gpl="git pull"
alias gcm="git commit -m"
alias gl="git log"