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
#!/usr/bin/env bash | |
# Based on "How to know when formatting disk has finsihed - Ubuntu 16.04?" AskUbuntu post: | |
# https://askubuntu.com/questions/962866/how-to-know-when-formatting-disk-has-finsihed-ubuntu-16-04 | |
device=sdb | |
device_path=/dev/$device | |
disk_sectors=`sudo fdisk -l $device_path | grep [D]isk | awk '{print $7}'` | |
disk_progress=`sudo cat /sys/block/$device/stat | awk '{print $7}'` | |
progress_percent=`echo "scale=4; ($disk_progress/$disk_sectors)*100"| bc` |
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
# cat << EOF > /dev/null | |
# https://github.com/gpakosz/.tmux | |
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license, | |
# without any warranty. | |
# Copyright 2012— Gregory Pakosz (@gpakosz). | |
# /!\ do not edit this file | |
# instead, override settings in ~/.tmux.conf.local, see README.md | |
# -- general ------------------------------------------------------------------- |
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
# https://github.com/gpakosz/.tmux | |
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license, | |
# without any warranty. | |
# Copyright 2012— Gregory Pakosz (@gpakosz). | |
# -- navigation ---------------------------------------------------------------- | |
# if you're running tmux within iTerm2 | |
# - and tmux is 1.9 or 1.9a |
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
call plug#begin('~/.config/nvim/plugged') | |
" Plugins will go here in the middle. | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
Plug 'junegunn/fzf.vim' | |
Plug 'rking/ag.vim' | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
Plug 'PProvost/vim-ps1' | |
Plug 'vim-ruby/vim-ruby' | |
Plug 'WolfgangMehner/vim-plugins' |
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
#custom functions | |
declare -x PS1="\\[\\e[00;32m\\]\\u\\[\\e[0m\\]\\[\\e[00;37m\\]@\\[\\e[0m\\]\\[\\e[00;33m\\]\\h\\[\\e[0m\\]\\[\\e[00;37m\\] \\[\\e[0m\\]\\[\\e[00;36m\\]2020\\[\\e[0m\\]\\[\\e[00;37m\\]-\\[\\e[0m\\]\\[\\e[00;36m\\]Feb\\[\\e[0m\\]\\[\\e[00;37m\\]-\\[\\e[0m\\]\\[\\e[00;36m\\]28\\[\\e[0m\\]\\[\\e[00;37m\\] \\[\\e[0m\\]\\[\\e[00;36m\\](Friday)\\[\\e[0m\\]\\[\\e[00;37m\\] \\[\\e[0m\\]\\[\\e[00;36m\\]09:22:57 AM\\[\\e[0m\\]\\[\\e[00;37m\\] \\[\\e[0m\\]\\[\\e[00;33m\\]\$(parse_git_branch)\\[\\e[0m\\]\\[\\e[00;37m\\] \\n \\[\\e[0m\\]\\[\\e[00;35m\\][\\w]\\[\\e[0m\\]\\[\\e[00;37m\\] \\n \\\$ \\[\\e[0m\\] " | |
parse_git_branch () | |
{ | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
viewcsv () | |
{ | |
column -s, -t < $1 | less -#2 -N -S | |
} |
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 "Building extended du reports for $1 in $2 ..."; | |
cd $1 | |
du -sh $1/* $1/.[a-zA-Z0-9]* $1/. > $2/du-output.txt | |
cat $2/du-output.txt | egrep '([0-9]M)' > $2/du-output-MB.txt | |
cat $2/du-output.txt | egrep '[0-9]G'> $2/du-output-GB.txt | |
cat $2/du-output-MB.txt | sort -hr > $2/du-output-MB-sorted.txt | |
cat $2/du-output-GB.txt | sort -hr > $2/du-output-GB-sorted.txt | |
echo "" | |
echo '[du extended report]:'; |
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
--- | |
# ^^^ YAML documents must begin with the document separator "---" | |
# | |
#### Example docblock, I like to put a descriptive comment at the top of my | |
#### playbooks. | |
# | |
# Overview: Playbook to bootstrap a new host for configuration management. | |
# Applies to: production | |
# Description: | |
# Ensures that a host is configured for management with Ansible. |
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
jbl@yoga2:~$ cat ~/.screenrc | |
#split | |
caption always | |
shelltitle '' | |
defscrollback 2048 | |
startup_message off | |
# My regular hardstatus line | |
hardstatus alwayslastline | |
hardstatus string '%{= ck} %H: %{= gk}%-Lw%{= kY}%50>%n%f* %t%{= gk}%+Lw%< %{= kY}%-=%D %d %M %Y %c:%s%{-}' |
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
vmap <C-c> :<Esc>`>a<CR><Esc>mx`<i<CR><Esc>my'xk$v'y!xclip -selection clipboard<CR>u<CR>k^ | |
map <C-i> :set paste<CR>i<CR><Esc>ko<Esc>:.!xclip -selection clipboard -o<CR>kJJ^ |
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
#!/usr/bin/env perl | |
# Just a little code to test for prime numbers | |
# Originally posted to my blog at www.jbldata.com | |
use strict; | |
use warnings; | |
use 5.010; | |
$DB::deep = 500; | |
$DB::deep = $DB::deep; # Avoids silly 'used only once' warning |