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
#include <stdio.h> | |
#include <stdlib.h> | |
#define safeFree(p) saferFree((void**)&(p)) | |
void saferFree(void **pp) { | |
if (pp != NULL && *pp != NULL) { | |
free(*pp); | |
*pp = NULL; | |
} | |
} |
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/sh | |
_csv () { | |
cat /dev/stdin <<EOF | |
"text/html","gzip","en;q=0.5","close","httpbin.org","1","curl","20" | |
"text/html","gzip","en;q=0.5","close","httpbin.org","1","curl","20" | |
"text/html","gzip","en;q=0.5","close","httpbin.org","1","curl","20" | |
"text/html","gzip","en;q=0.5","close","httpbin.org","1","curl","20" | |
"text/html","gzip","en;q=0.5","close","httpbin.org","1","curl","20" | |
EOF |
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/sh | |
_json_valid(){ | |
local _STD_OUT_ERR | |
_STD_OUT_ERR=$( { jq type /dev/stdin <<< "${1}"; } 2>&1 ) | |
} | |
read -d '' -r _JSON <<EOB | |
{"widget": { | |
"debug": "on", |
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/sh | |
HOSTNAME=$(hostname) | |
BUCKET="walterve-devops" | |
PREFIX="backups/${HOSTNAME}" | |
duplicity full \ | |
--verbosity info \ | |
--s3-use-new-style \ | |
--s3-use-multiprocessing \ |
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
import Data.Char | |
positions :: Eq a => a -> [a] -> [Int] | |
positions x xs = [i | (x', i) <- zip xs [0..], x==x'] | |
lowers :: String -> Int | |
lowers xs = length [x | x <- xs, x >= 'a' && x <= 'z'] | |
count :: Char -> String -> Int | |
count x xs = length [x' | x' <- xs, x == x'] |
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
Surfi.prototype.start_tunnel = function () { | |
var socks5 = this.config.socks5; | |
var ssh_conf = { | |
host: this.config.proxy.host, | |
port: this.config.proxy.port, | |
username: this.config.proxy.user, | |
privateKey: this.config.proxy.key | |
//debug: function (e) { console.log(e)} | |
}; | |
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
❯ pactl list | |
Module #0 | |
Name: module-device-restore | |
Argument: | |
Usage counter: n/a | |
Properties: | |
module.author = "Lennart Poettering" | |
module.description = "Automatically restore the volume/mute state of devices" | |
module.version = "10.0" |
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
brew install git | |
brew install zsh | |
brew install tmux --HEAD | |
brew cask install iterm2 | |
brew install node | |
brew install jq | |
brew install gpg | |
brew install opensc | |
brew install ccze # colorize logs: tail -f .msmtp.log | ccze -A | |
brew cask install spectacle # manage windows |
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
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Jenkins Bootstrapping Template | |
Metadata: | |
Version: '0.0.1' | |
Stack: 0 | |
AWS::CloudFormation::Interface: | |
ParameterGroups: | |
- Parameters: | |
- StackPrefix |
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
autoload colors; colors | |
rc=$reset_color | |
EDITOR=ec | |
export WALTERBIO_PATH=$HOME/git/walter.bio | |
function init { | |
cd $HOME/git/walter.bio | |
print -- $fg[magenta]\❁ $fg[yellow]"Initializing walter.bio" $rc |