Skip to content

Instantly share code, notes, and snippets.

@CroneKorkN
CroneKorkN / gist:cc01547adb72e4447828
Created July 14, 2015 10:15
HTACCESS to redirect virtual ".dev"-domains to corresponding subfolder
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} .*\.dev$ [NC]
RewriteCond %{ENV:REDIRECT_STATUS} !200
RewriteRule ^.*$ %{HTTP_HOST}%{REQUEST_URI} [L]
@CroneKorkN
CroneKorkN / gist:1d245c2d99ce56b5188d
Created July 14, 2015 11:04
Wildcard apache-vhosts for local web developement
<VirtualHost *:80>
ServerName a.dev
ServerAlias *.dev
VirtualDocumentRoot "/var/www/%1"
UseCanonicalName Off
php_admin_flag safe_mode Off
</VirtualHost>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
@CroneKorkN
CroneKorkN / git-autodeploy
Last active August 29, 2015 14:25
autodeploy a git repo on commit
#!/bin/bash
# ==============
# git autodeploy
# ==============
#
# makes a bare git repo deploying a specific branch on every commit.
# creates repo if cwd is not the root of a bare repo. Requirements:
# - `git`
# - `ssh-copy-id`
// init
#include <elapsedMillis.h>
#include <ESP8266WiFi.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <ESP8266HTTPClient.h>
#include <elapsedMillis.h>
#define WATTS_PER_SIGNAL 0.5
#define RESETBUTTON_DELAY 1500
@CroneKorkN
CroneKorkN / gist:759768c5a3f76bf3826285e308d9b386
Created March 5, 2017 22:54
BetterTouchTool Touchbar Widget rx
return do shell script "nettop -cdm route -L 1 -k time,bytes_out,rx_dupe,rx_ooo,re-tx,conn_att,conn_est,rtt_avg | head -2 | tail -1 | cut -d, -f2- | cut -f1 -d\",\""
http://unix.derkeiler.com/Mailing-Lists/FreeBSD/stable/2012-02/msg00157.html
http://docs.oracle.com/cd/E19253-01/819-5461/6n7ht6r2s/index.html#gcfgr
get stats: cat /proc/spl/kstat/zfs/arcstats
@ruegand
zpool create \
-o compression=on \
-o primarycache=metadat \ # (only metadata in L1ARC)
-o secondarycache=all \
-o compression=on \
apt install libapache2-mod-php7.0 php7.0-gd php7.0-json php7.0-mysql php7.0-curl php7.0-mbstring \
php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip php7.0-apcu php7.0-redis
phpenmod apcu redis
@CroneKorkN
CroneKorkN / gist:476778bb669dcb7610ba7f8ac5a930bb
Last active February 24, 2024 13:31
zfs arc hit ratio monitor
#!/bin/bash
# author: louwrentius
# source: http://louwrentius.com/zfs-on-linux-monitor-cache-hit-ratio.html
INTERVAL="$1"
if [ -z $INTERVAL ]
then
INTERVAL=5
return do shell script "echo cpu $(ps axo %cpu | awk '{s+=$1}END{print s}' | cut -f 1 -d '.')%"
@CroneKorkN
CroneKorkN / gist:b0d67026383ea1a972a74cbaac4f38ce
Last active May 17, 2017 06:37
bettertochtool cpu usage
return do shell script "echo cpu $(ps axo %cpu | awk '{s+=$1}END{print s}' | cut -f 1 -d '.')%"