This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define your_class::user ( | |
$user = $name, | |
$ensure = 'present', | |
){ | |
# only call when user gets removed | |
if $ensure == 'absent' { | |
exec { | |
"killing ${user}": | |
command => "pkill -9 -u ${user}", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# global ssh arguments | |
SSHARG="-o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null" | |
TIMEOUT="$(uname | grep -q Darwin && echo gtimeout || echo timeout)" | |
# get IP address from hostname | |
getIP() { | |
# return with failure if no server given | |
test -z "$1" && return 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
# define things | |
orig="item0" | |
orig='["item1", "item2"]' | |
orig=["item3", "item4"] | |
# force ruby to make it an array | |
if ! orig.respond_to?('each') | |
var=orig.gsub(/(^\[|\]$)/, "").gsub(/\"/, "").gsub(/\ */, "").split(",") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
# Language detection (Fallback is en) | |
RewriteCond %{HTTP:Accept-Language} ^de [NC] | |
RewriteCond %{ENV:lang} ^$ | |
RewriteRule ^ - [E=lang:de] | |
RewriteCond %{HTTP:Accept-Language} ^fr [NC] | |
RewriteCond %{ENV:lang} ^$ | |
RewriteRule ^ - [E=lang:fr] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
red="$(tput setaf 1)" | |
green="$(tput setaf 2)" | |
yellow="$(tput setaf 3)" | |
blue="$(tput setaf 4)" | |
bold="$(tput bold)" | |
reset="$(tput sgr0)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# open gist for oneliner (or very short bash things) collection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## Prerequisites: | |
## - already resized disk on the VM host | |
## | |
## Notes: | |
## - I assume that we have three partitions (primary (root fs), extended, logical (swap)) | |
## - I assume that we move swap out of the extended partition and convert to a normal primary one | |
## - I also assume that we place swap at the end of the disk | |
## |
OlderNewer