Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
Assorted whitespace & decruft
  • Loading branch information
grawity committed Oct 12, 2015
1 parent d4118d4 commit 674a879
Show file tree
Hide file tree
Showing 23 changed files with 159 additions and 303 deletions.
16 changes: 8 additions & 8 deletions bashrc-frost
Expand Up @@ -2,28 +2,28 @@

[[ $- != *i* ]] && return

. ~/lib/dotfiles/bashrc-rain

wlan=wlan0

iwps() {
if [[ $* ]]; then
sudo iw ${WLAN_DEV:-wlan0} set power_save "$@"
sudo iw $wlan set power_save "$@"
fi
iw ${WLAN_DEV:-wlan0} get power_save
iw $wlan get power_save
}

unison() {
if [[ -t 1 ]]; then
if [[ $DISPLAY ]] && [[ -t 1 ]]; then
run unison-x11 "$@"
else
unison-text "$@"
fi
}

usb() {
sudo: modprobe $* -v xhci_pci
}
usb() { sudo: modprobe $* -v xhci_pci; }

alias 'usb?'='lsmod | grep xhci'
alias '?usb'='usb?'
alias 'usb+'='sudo: modprobe -v xhci_pci'
alias 'usb-'='sudo: modprobe -r -v xhci_pci'

. ~/lib/dotfiles/bashrc-rain
32 changes: 13 additions & 19 deletions bashrc-rain
Expand Up @@ -8,7 +8,6 @@ fi

## Aliases

alias @='_sshfs'
alias clock='tty-clock -c'
alias eof='IGNOREEOF=3'
alias fumount='fusermount -u'
Expand All @@ -17,17 +16,18 @@ alias gmm='run google-musicmanager'
alias RM='/bin/rm -I'
alias unrm='trash --restore'

b64() { printf "%s" "$*" | base64 | tr -dc "A-Za-z0-9+/="; }
alias eris='ssh wolke -t tmux attach -t eris'
alias gale='ssh wolke -t tmux attach -t gale'

eris() { ssh wolke -t tmux attach -t eris; }
gale() { ssh wolke -t tmux attach -t gale; }
b64() { printf "%s" "$*" | base64 | tr -dc "A-Za-z0-9+/="; }

gensid() {
local a=$(perl -e 'print int rand 0xFFFFFFFF')
local b=$(perl -e 'print int rand 0xFFFFFFFF')
local c=$(perl -e 'print int rand 0xFFFFFFFF')
echo "S-1-5-21-$a-$b-$c"
}

rand() { perl -e "print int rand $1"; }

rm() {
Expand Down Expand Up @@ -102,16 +102,6 @@ scrape-reddit() {
done
}

_sshfs() {
local host=$1
local dir=~/@$host
if ! mountpoint -q "$dir"; then
mkdir -p "$dir" &&
sshfs "$host:" "$dir" -o reconnect -o transform_symlinks
fi &&
echo "mounted at $dir"
}

vnet() {
case $1 in
up) set -- start;;
Expand Down Expand Up @@ -173,6 +163,7 @@ run-dhcpcd() {
}

ecap() { sudo: tcpdump -n -i "${dev:-eth0}" "$@"; }

earp() { ecap -e "arp or (udp port 67 or 68)"; }

ecn() {
Expand All @@ -192,7 +183,6 @@ ukip() {
sudo: ip addr flush dev $dev
sudo: ip addr add 169.254.0.1/16 dev $dev scope link
sudo: ip addr add 10.128.0.42/16 dev $dev
sudo: ip addr add 172.16.0.42/12 dev $dev
sudo: ip addr add 192.168.0.42/24 dev $dev
sudo: ip addr add 192.168.1.42/24 dev $dev
}
Expand All @@ -203,12 +193,16 @@ uredboot() { do: telnet 192.168.1.20 9000; }

## Certificate hackery

c2p() for _f; {
openssl x509 -in "$_f" -inform DER -out "${_f%.*}.pem" -outform PEM
c2p() {
for file; do
openssl x509 -in "$file" -inform DER -out "${file%.*}.pem" -outform PEM
done
}

p2c() for _f; {
openssl x509 -in "$_f" -inform PEM -out "${_f%.*}.crt" -outform DER
p2c() {
for file; do
openssl x509 -in "$file" -inform PEM -out "${file%.*}.crt" -outform DER
done
}

nssdb="sql:$HOME/.pki/nssdb"
Expand Down
42 changes: 17 additions & 25 deletions environ
Expand Up @@ -7,17 +7,17 @@ setpath() {
set +a; IFS=$xIFS; unset xIFS; set -a
}

# basic environ
# basic

umask 022

[ "$UID" ] || UID=$(id -u)
[ "$USER" ] || USER=$(id -un)
[ "$HOSTNAME" ] || HOSTNAME=$(hostname)
test "$UID" || UID=$(id -u)
test "$USER" || USER=$(id -un)
test "$HOSTNAME" || HOSTNAME=$(hostname)

set -a

# paths/locations
# paths

# initially $PREFIX was just for my personal use, but apparently it is used by
# npm (which defaults to /usr) also other things that I forget; I think
Expand Down Expand Up @@ -60,28 +60,24 @@ test "$XDG_CONFIG_HOME" || XDG_CONFIG_HOME="$HOME/.config"
test "$XDG_DATA_HOME" || XDG_DATA_HOME="$HOME/.local/share"
test "$XDG_RUNTIME_DIR" || XDG_RUNTIME_DIR="$XDG_CACHE_HOME"

GNULIB_SRCDIR="$HOME/src/gnu/gnulib"

# identity
# identity, locale

NAME='Mantas Mikulėnas'
EMAIL="grawity@gmail.com"
TZ="Europe/Vilnius"

#case $LANG in
# en_*) ;;
# *) LANG="en_US.UTF-8";;
#esa

# preferred programs

BROWSER="web-browser"
EDITOR="vim"
unset VISUAL
PAGER="less"

# locale

#case $LANG in
# en_*) ;;
# *) LANG="en_US.UTF-8";;
#esac
LINGUAS="en lt"
unset VISUAL

# libdefaults

Expand All @@ -91,21 +87,22 @@ NCURSES_NO_UTF8_ACS="1"
# appdefaults

ABSROOT="$HOME/pkg"
GNULIB_SRCDIR="$HOME/src/gnu/gnulib"
PERL_CPANM_HOME="$XDG_CACHE_HOME/cpanminus"
RLWRAP_HOME="$XDG_CACHE_HOME/rlwrap"

IRBRC="$HOME/lib/dotfiles/irbrc"
PYTHONSTARTUP="$HOME/lib/dotfiles/pythonrc"

VIMINIT=":so ~/.vim/vimrc"
GVIMINIT=":so ~/.vim/gvimrc"

BZR_LOG="/dev/null"
GCC_COLORS="1"
GIT_MERGE_AUTOEDIT="no"
LESS="e M q R F X z -3"
LESS_TERMCAP_us='' # italic
LESS_TERMCAP_ue='' # no-italic
LESS_TERMCAP_us='' # change underline to italic
LESS_TERMCAP_ue='' # un-italic
LINGUAS="en lt" # install fewer nls translations
MAKEFLAGS="-j $(nproc)"
SUDO_PROMPT="sudo password for %p@%h: "

Expand All @@ -127,12 +124,7 @@ esac

# local

FQDN=$(LC_ALL="C" fqdn)

case $FQDN in
*.core)
. ~/lib/dotfiles/environ-vm.rain;;
esac
test "$FQDN" || FQDN=$(LC_ALL="C" fqdn)

if [ -f ~/lib/dotfiles/environ-$HOSTNAME ]; then
. ~/lib/dotfiles/environ-$HOSTNAME
Expand Down
12 changes: 4 additions & 8 deletions environ-rain
@@ -1,13 +1,11 @@
# host-specific additions to ~/.environ
# vim: ft=sh

# paths/locations
# paths

PATH="$(ruby -e 'puts Gem.user_dir')/bin:$PATH"

if [ ! "$SSH_AUTH_SOCK" ]; then
SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent"
fi
test "$SSH_AUTH_SOCK" || SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent"

# libdefaults

Expand All @@ -16,10 +14,8 @@ QT_IM_MODULE="ibus"
XMODIFIERS="@im=ibus"

LIBVA_DRIVER_NAME="gallium"
# force `gem install nokogiri` to use system libxml2
NOKOGIRI_USE_SYSTEM_LIBRARIES="1"
# LibreOffice -- use stable gtk2, not experimental gtk3
SAL_USE_VCLPLUGIN="gtk"
NOKOGIRI_USE_SYSTEM_LIBRARIES="1" # nokogiri gem - use system libxml2
SAL_USE_VCLPLUGIN="gtk" # LibreOffice - avoid unstable gtk3 VCL

# appdefaults

Expand Down
5 changes: 0 additions & 5 deletions environ-vm.rain

This file was deleted.

29 changes: 2 additions & 27 deletions git/config
Expand Up @@ -14,8 +14,6 @@
bra = branch -vv
ci = commit
ci-m = commit -m
cim = commit -m
#clone-svnsync = svn clone --use-svnsync-props --preserve-empty-dirs
clone-svnsync = svn clone --use-svnsync-props
co = checkout
di = diff
Expand All @@ -34,7 +32,6 @@
lsr = "!_() { [ \"$1\" ] || set -- HEAD; git ls-tree -r \"$@\"; }; _"
mend = commit --amend --reuse-message HEAD
mkobject = hash-object --stdin -w
mrproper = !git reset --hard HEAD && git clean -fdx
out = log --oneline --decorate @{upstream}..
rbc = rebase --continue
rbs = rebase -i
Expand All @@ -58,8 +55,6 @@
wshow = show --word-diff
ic = ci

# Everything else

[advice]
detachedHead = false
pushNonFastForward = false
Expand Down Expand Up @@ -90,26 +85,20 @@
linenumber = green

[column]
# option order matters, apparently?
ui = auto
branch = never
status = never
tag = auto dense

[core]
excludesfile = ~/.config/git/ignore
# never use an askpass even if $SSH_ASKPASS is set
# (uses "password" entry even for usernames, confusing)
askpass =
autocrlf = false
excludesfile = ~/.config/git/ignore
logAllRefUpdates = true
whitespace = trailing-space, space-before-tab, blank-at-eof

[credential]
helper = cache --socket $XDG_RUNTIME_DIR/git-credential-cache
#helper = lib gnomekeyring
#helper = lib windows
#helper = netrc
helper = store
useHttpPath = false

Expand Down Expand Up @@ -152,8 +141,8 @@
templateDir = ~/.config/git/template

[merge]
defaultToUpstream = true
conflictStyle = diff3
defaultToUpstream = true

[pack]
writebitmaps = true
Expand All @@ -177,16 +166,7 @@
smtpServerOption = --read-envelope-from

[tig]
# [v1 opts]
# show-date = relative
# #show-author = abbreviated
# author-width = 12
# show-filename = false
# show-rev-graph = true
# #vertical-split = true

# [v2 opts]
#main-view = id:no date:relative author:full,width=12 commit-title:graph=v1,refs,overflow=no
main-view = id:no date:relative author:full,width=12 commit-title:graph=yes,refs,overflow=no
# [v2.1 opts]
main-view-date = relative
Expand All @@ -195,7 +175,6 @@

# [global opts]
commit-order = topo
#diff-options = --patience
ignore-case = true
line-graphics = true
show-changes = no
Expand Down Expand Up @@ -244,10 +223,6 @@
[url "https://kernel.googlesource.com/"]
insteadOf = kernel.org::

# Local settings

[include]
path = ~/.config/git/config.local
path = ~/.gitconfig-local

# EOF
2 changes: 1 addition & 1 deletion gui/XCompose
Expand Up @@ -138,7 +138,7 @@ include "%L"
<Multi_key> <Multi_key> <KP_2> <KP_2> : "═"
<Multi_key> <Multi_key> <KP_3> <KP_3> : "╝"
<Multi_key> <Multi_key> <KP_4> <KP_4> : "║"
#<Multi_key> <Multi_key> <KP_5> <KP_5> : "?"
<Multi_key> <Multi_key> <KP_5> <KP_5> : ""
<Multi_key> <Multi_key> <KP_6> <KP_6> : "║"
<Multi_key> <Multi_key> <KP_7> <KP_7> : "╔"
<Multi_key> <Multi_key> <KP_8> <KP_8> : "═"
Expand Down

0 comments on commit 674a879

Please sign in to comment.