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
diff i3status-2.11/src/print_cpu_usage.c i3status-2.11_modified/src/print_cpu_usage.c | |
120c120 | |
< outwalk += sprintf(outwalk, "%02d%s", diff_usage, pct_mark); | |
--- | |
> outwalk += sprintf(outwalk, "%2d%s", diff_usage, pct_mark); | |
diff i3status-2.11/src/print_disk_info.c i3status-2.11_modified/src/print_disk_info.c | |
42c42 | |
< return sprintf(outwalk, "%.1f %sB", size, symbols[exponent]); | |
--- | |
> return sprintf(outwalk, "%.f %sB", size, symbols[exponent]); |
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 | |
HOST=$* | |
until nc -vzw 2 "$HOST" 22; do sleep 2; done |
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 | |
HOST=$* | |
while true; do ping -c1 "$HOST" > /dev/null && break; sleep 3 ; done |
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
git config --global alias.today '!git --no-pager log --pretty=format:"%ad - %s" --date=iso --date-order --reverse --all --since=6:00 --author=bpeter' | |
git config --global alias.yesterday '!git --no-pager log --pretty=format:"%ad - %s" --date=iso --date-order --reverse --all --since="yesterday 6:00" --until=6:00 --author=bpeter' |
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
if [[ -e $HOME/.zsh/chpwd_profiles.zsh ]]; then | |
source $HOME/.zsh/chpwd_profiles.zsh | |
zstyle ":chpwd:profiles:/home/${USER}/projects(|/|/*)" profile projects | |
zstyle ":chpwd:profiles:(|/|/*)" profile default | |
# configuration for profile 'projects': | |
chpwd_profile_projects() { | |
[[ ${profile} == ${CHPWD_PROFILE} ]] && return 1 | |
print "chpwd(): Switching to profile: $profile" |
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/perl | |
# | |
# Run on unix like Systems | |
# | |
# Execute this from the directory where your "tsconfig.json" and "app" resides as following: | |
# | |
# find . -name "*.ts" | xargs -n 1 perl convert.pl | |
# | |
# Add this to tslint.json 'compilerOptions' | |
# |
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
list-phony: | |
@perl -ne 'push @a, $$1 if m/^([\w\d-]+):\s/; END { print ".PHONY: ", join(" ", sort @a), "\n" }' Makefile |
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
#!/usr/bin/env bash | |
SERVICE="postgres" | |
DBNAME="mydb" | |
PORT="$1" | |
USER="$2" | |
PASS="$3" | |
MAX=30 | |
IT=0 | |
SLEEP_SECONDS=2 |
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
cat /proc/modules | cut -f 1 -d " " | while read module; do \ | |
echo "Module: $module"; \ | |
if [ -d "/sys/module/$module/parameters" ]; then \ | |
ls /sys/module/$module/parameters/ | while read parameter; do \ | |
echo -n "Parameter: $parameter --> "; \ | |
cat /sys/module/$module/parameters/$parameter; \ | |
done; \ | |
fi; \ | |
echo; \ | |
done |
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
use_nfs = ! RUBY_PLATFORM.downcase.include?("linux") | |
if (use_nfs) | |
node.vm.synced_folder ".", "/vagrant", type: "nfs" | |
else | |
node.vm.synced_folder ".", "/vagrant" | |
owner: "www-data", group: "www-data" | |
end |