This file contains 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
-- Tit Petric, Monotek d.o.o., Tue 03 Jan 2017 06:54:56 PM CET | |
-- | |
-- Delete nginx cached assets with a PURGE request against an endpoint | |
-- supports extended regular expression PURGE requests (/upload/.*) | |
-- | |
function file_exists(name) | |
local f = io.open(name, "r") | |
if f~=nil then io.close(f) return true else return false end | |
end |
This file contains 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 | |
OUTPUT="/dev/shm/fakenet/"; | |
if [ ! -d "$OUTPUT" ]; then | |
mkdir -p $OUTPUT/{rpc,stat,ip_vs} | |
fi | |
SOURCES="/proc/net/dev | |
/proc/net/ip_vs_stats | |
/proc/net/ip_vs/stats |
This file contains 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
-- Tit Petric, Monotek d.o.o., Thu 27 Oct 2016 10:43:38 AM CEST | |
-- | |
-- Delete nginx cached assets with a PURGE request against an endpoint | |
-- | |
local md5 = require 'md5' | |
function file_exists(name) | |
local f = io.open(name, "r") | |
if f~=nil then io.close(f) return true else return false end |
This file contains 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
package main | |
import "os" | |
import "io/ioutil" | |
import "time" | |
type GPIO struct{} | |
func (r GPIO) Pin(name string) GPIO_Pin { | |
pin := GPIO_Pin{name} |
This file contains 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 | |
function docker_run_shell { | |
NAME=$1 | |
DOCKERFILE=$2 | |
# docker needs a few libraries, but not all - essential libs here | |
BIND_LIBS=`ldd /usr/bin/docker | grep /lib/ | awk '{print $3}' | egrep '(apparmor|libseccomp|libdevmap|libsystemd-journal|libcgmanager.so.0|libnih.so.1|libnih-dbus.so.1|libdbus-1.so.3|libgcrypt.so.11)'` | |
ARGS="" | |
for LIB in $BIND_LIBS; do | |
ARGS="$ARGS -v $LIB:$LIB:ro" |
This file contains 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 | |
function usage { | |
echo Usage: $0 logfile.log logfile.log.1 [name] | |
exit | |
} | |
if [ -z $1 ]; then | |
usage | |
fi | |
if [ -z $2 ]; then |
This file contains 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
<?php | |
namespace AnimalDependencies; | |
trait Dog { | |
private $dog = false; | |
function setDog(\Animals\Dog $dog) { | |
$this->dog = $dog; | |
} | |
function getDog() { |
NewerOlder