Skip to content

Instantly share code, notes, and snippets.

@mikeyhill
mikeyhill / arch-linux-install
Created October 2, 2015 22:37 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@mikeyhill
mikeyhill / slack.conf
Created December 22, 2015 05:44 — forked from Nihisil/jail.local
Send notifications to the Slack from fail2ban
[Definition]
actioncheck=
actionstart =
actionstop =
actionban = /bin/bash /etc/fail2ban/slack_notify.sh "Banned _country_ <ip> in the jail <name> after <failures> attempts" "<ip>" > /dev/null 2>&1
actionunban = /bin/bash /etc/fail2ban/slack_notify.sh "Unbanned _country_ <ip> in the jail <name>" "<ip>" > /dev/null 2>&1
server {
listen 80;
server_name domain.com;
rewrite ^(.*)$ $scheme://www.domain.com$1;
}
server {
listen 80 default_server;
server {
listen 80;
server_name domain.com;
rewrite ^(.*)$ $scheme://www.domain.com$1;
}
server {
listen 80 default_server;
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}$1 [R=301,L]
#
## rewrite non www -> www
#
server {
listen 80;
server_name domain.com;
@mikeyhill
mikeyhill / gist:0e046ab9a3a5216944c9
Created December 10, 2015 08:11
Javascript, PHP and .htaccess redirect for mobile users
This is a simple way to redirect based on screen size. This redirect would go at the bottom of your template for the landing page.
<br />
&lt;script&gt;// &lt;![CDATA[<br />
if (screen.width &lt;= 800) {<br />
document.location = &quot;http://subdomain.domain.com&quot;;<br />
}<br />
// ]]&gt;&lt;/script&gt;<br />
OR
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon