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 | |
# Usage: | |
# optionally you can provide .csv file as parameter | |
# if GLABELS3TEMPLATESDIR= is pointing to directory with glabels-3-templates, then it's copied from there | |
orig_dir="$PWD" | |
tmpdir="$(mktemp -d)" | |
if [ -r "$1" ]; 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
#!/bin/bash | |
echo Current active: "$(uname -r)" | |
echo Remove rest: | |
set -x | |
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')") |
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 | |
# based on tutorial : | |
# "How To: Use Your Raspberry Pi as a Proxy for Google Chrome" https://mpacewriting.wordpress.com/2014/01/09/how-to-use-your-raspberry-pi-as-a-proxy-for-google-chrome/ | |
# Notes in : https://docs.google.com/document/d/1NZ1o6HiyqVCgAiScDd0SDJIGR-aon13e6ojh9AjwOa8 | |
select cfg in no_proxy via_p; do break; done | |
case "$cfg" in | |
no_proxy) | |
exec chromium --user-data-dir=/home/${user?}/.config/chromium_p | |
;; | |
via_p) |
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
id | name | description | |
---|---|---|---|
33 | Music CDs | Box with "Music CDs" | |
44 | Movies "Box" | Box with Movies | |
55 | Toys | Toys |
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
id | name | |
---|---|---|
23 | Toy T | |
44 | Movie M2 | |
68 | Music CD 2 |
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 | |
# http://tex.stackexchange.com/a/1417/7128 | |
TMPDIR=$(mktemp -d /tmp/git-latexdiff.XXXXXX) | |
latexdiff "$1" "$2" > $TMPDIR/diff.tex | |
pdflatex -interaction nonstopmode -output-directory $TMPDIR $TMPDIR/diff.tex | |
okular $TMPDIR/diff.pdf | |
rm -rf $TMPDIR | |
# Add to ~/.gitconfig |
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
echo 'Current hour' | |
hour=$(date +%H); | |
if [ $hour -gt 9 -a $hour -lt 23 ]; then echo -n '*'; else echo -n '#'; fi; echo ' '$hour; | |
echo 'Test around the clock:' | |
for hour in {0..23} {0..23}; do | |
if [ $hour -gt 9 -a $hour -lt 23 ]; then echo -n '*'; else echo -n '#'; fi; echo ' '$hour; | |
done | |
echo 'If you need to depend on UTC, just add `-u` flag to `date` command' |
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 | |
# Generate .csv formatted basic metadata, fast to obtain, but allowing heuristics for syncing files or initial eastimation of backup/sync coverage. | |
fullpath="${1:-$PWD}" | |
dest="${2:-"$fullpath"/basic_files_metadata.csv.gz}" | |
hostname="${3:-"$(hostname)"}" | |
echo "find \"${fullpath}\" -type f -exec stat --format=\"%i,%Y,%s,%m,%n\" \"{}\" \\; > \"${dest}\"" | |
echo "Progress in lines generated:" | |
(echo "inode,modification_ts,size,hostname,mount,path"; | |
find "${fullpath}" -type f -exec stat --format="%i,%Y,%s,${hostname},%m,%n" "{}" \; |
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
alias ls='ls --color=auto' | |
#export PS1='[\u@\h \W]\$ ' | |
#export PS1='\W\$ ' | |
#export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$' | |
#export PS1='\[\033[01;34m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$' | |
#export PS1='\[\033[01;34m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[01;37m\]\$\[\033[00m\]' | |
PROMPT_RED="\[$(tput setaf 1)\]" | |
PROMPT_GREEN="\[$(tput setaf 2)\]" | |
PROMPT_ORANGE="\[$(tput setaf 3)\]" | |
PROMPT_NAVY="\[$(tput setaf 4)\]" |
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 | |
tmpdir="$(mktemp -d)" | |
function cleanup { | |
echo '@ cleanup {' | |
set -x | |
rm -r "$tmpdir" | |
set +x | |
echo '@ } end of cleanup' | |
} |