-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
204 additions
and
41 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,7 @@ export HISTSIZE=30000 | |
export HISTTIMEFORMAT='%F %T ' | ||
|
||
PROMPT_COMMAND="history -a;$PROMPT_COMMAND" | ||
#export TERM=xterm-256color | ||
export TERM=screen-256color | ||
export TERM=xterm-256color | ||
|
||
|
||
## for when ssh agent gets screwy | ||
|
@@ -25,14 +24,23 @@ if [[ -n $TMUX ]]; then | |
fi | ||
} | ||
|
||
function vpndocker() { | ||
if [[ `stat -c '%a' /dev/net/tun` == '660' ]]; then | ||
docker "$@" | ||
else | ||
echo 'lxc config device add penguin tun unix-char path=/dev/net/tun' | xclip -selection c | ||
echo 'no access to /dev/net/tun' | ||
fi | ||
} | ||
|
||
ec2-info() { | ||
IP=169.254.169.254 | ||
ssh $1 "curl -q http://$IP/latest/meta-data/$2" 2>/dev/null | ||
echo -ne "\n" | ||
} | ||
export EDITOR=vim | ||
export GOPATH=$HOME/code/go | ||
export PATH=$HOME/bin:$HOME/bin/fzf/bin/:$HOME/gobin/go/bin/:/usr/local/go/bin:$HOME/perl5/bin:/usr/sbin/:$GOPATH/bin:$HOME/Library/Python/2.7/bin:$HOME/bin/vim/vim-8.0.1481/bin/bin/:$PATH | ||
export PATH=$HOME/bin:$HOME/bin/fzf/bin/:$HOME/gobin/go/bin/:/usr/local/go/bin:$HOME/perl5/bin:/usr/sbin/:$GOPATH/bin:$HOME/Library/Python/2.7/bin:$HOME/bin/vim/vim-8.0.1481/bin/bin/:/usr/local/MacGPG2/bin/:/usr/local/bin/::$HOME/dotfiles/bin/:$PATH | ||
[ -f $HOME/perl5/lib/perl5/Devel/Local.pm ] && source `which devel-local.sh` | ||
function github() { | ||
git clone [email protected]:SocialFlowDev/$1.git | ||
|
@@ -73,7 +81,7 @@ elif command -v ack-grep >/dev/null 2>&1; then | |
fi | ||
[ -f /home/joe/dotfiles/additional_options ] && . /home/joe/dotfiles/additional_options | ||
export GOPATH=$HOME/code/go | ||
export PATH=$PATH:$GOPATH/bin | ||
export PATH=$PATH:$GOPATH/bin:$HOME/.local/bin | ||
export PERLBREW_ROOT=$HOME/perlbrew | ||
function refresh_gpga() { | ||
if [ -f "${HOME}/.gpg-agent-info" ]; then | ||
|
@@ -99,15 +107,15 @@ fd() { | |
cd "$dir" | ||
} | ||
|
||
if [ -x "$(command -v gpg-agent)" ]; then | ||
if pgrep -x "gpg-agent" > /dev/null | ||
then | ||
export SSH_AUTH_SOCK=${HOME}/.gnupg/S.gpg-agent.ssh | ||
else | ||
eval $(gpg-agent --daemon --enable-ssh-support --sh) | ||
fi | ||
fi | ||
|
||
#if [ -x "$(command -v gpg-agent)" ]; then | ||
# if pgrep -x "gpg-agent" > /dev/null | ||
# then | ||
# export SSH_AUTH_SOCK=${HOME}/.gnupg/S.gpg-agent.ssh | ||
# else | ||
# eval $(gpg-agent --daemon --enable-ssh-support --sh) | ||
# fi | ||
#fi | ||
# | ||
|
||
|
||
function toggle-agent { | ||
|
@@ -121,3 +129,33 @@ function toggle-agent { | |
|
||
} | ||
export GO111MODULE=auto | ||
|
||
qq() { | ||
clear | ||
|
||
logpath="$TMPDIR/q" | ||
if [[ -z "$TMPDIR" ]]; then | ||
logpath="/tmp/q" | ||
fi | ||
|
||
if [[ ! -f "$logpath" ]]; then | ||
echo 'Q LOG' > "$logpath" | ||
fi | ||
|
||
tail -100f -- "$logpath" | ||
} | ||
|
||
rmqq() { | ||
logpath="$TMPDIR/q" | ||
if [[ -z "$TMPDIR" ]]; then | ||
logpath="/tmp/q" | ||
fi | ||
if [[ -f "$logpath" ]]; then | ||
rm "$logpath" | ||
fi | ||
} | ||
function vpnotp() { | ||
echo -n 'Enter keepass pw: '; | ||
~/tmp/squashfs-root/usr/bin/keepassxc-cli show ~/dropbox/keepass/keepass2.kdbx $1 -q -t -a Password | tr -d '\n' | xclip -selection c | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env perl | ||
use strict; | ||
use warnings; | ||
|
||
my $a = $ARGV[0]; | ||
my ($host,$port) = split(/:/,$a); | ||
warn $host; | ||
my $vpn = ($host =~ /mars.sfsrv.net/) ? 'marsvpn' : 'saturnvpn'; | ||
`socat TCP-LISTEN:$port,reuseaddr,fork 'EXEC:docker exec -i $vpn "nc $host $port"'`; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env perl | ||
use IPC::System::Simple qw(system systemx capture capturex); | ||
use JSON::XS; | ||
use DateTime::Format::ISO8601; | ||
use File::Path qw(make_path); | ||
my $json = JSON::XS->new; | ||
my @remotes = qw/remote gdrive/; | ||
|
||
sub get_modified { | ||
my $file = shift; | ||
my $output = capture( "rclone", "lsjson", $file ); | ||
my $decoded = $json->decode($output); | ||
my $modified = $decoded->[0]->{ModTime}; | ||
my $dt = DateTime::Format::ISO8601->parse_datetime($modified); | ||
return $dt; | ||
} | ||
|
||
sub copy_file { | ||
my ( $src, $dest ) = @_; | ||
return capturex( "rclone", "-v", "copy", $src, $dest ); | ||
} | ||
|
||
my $local_dir = $ENV{HOME} . "/dropbox/keepass"; | ||
my $backup_dir = "$local_dir/bak"; | ||
my $local_path = "$local_dir/keepass2.kdbx"; | ||
my $local_mod = get_modified($local_path); | ||
|
||
for my $remote (@remotes) { | ||
my $remote_dir = sprintf( "%s:keepass", $remote ); | ||
my $remote_path = sprintf( "%s/keepass2.kdbx", $remote_dir ); | ||
my $remote_mod = get_modified($remote_path); | ||
my $diff = $remote_mod->epoch - $local_mod->epoch; | ||
|
||
next unless (abs($diff) > 5); | ||
if ( $diff >= 0 ) { | ||
my $datestamp = capturex( "date", "+%F-%H%M%S" ); | ||
chomp($datestamp); | ||
my $conflict_path = | ||
$backup_dir . "/" . join( '-', $remote, $datestamp ); | ||
make_path($conflict_path); | ||
warn | ||
"[$remote] WARNING: Remote file is newer than local file by $diff seconds, copying from remote to $conflict_path"; | ||
warn "See if there were any local modifications after $remote_mod"; | ||
my $out = copy_file( $remote_dir, $conflict_path ); | ||
print $out . "\n"; | ||
next; | ||
} | ||
warn sprintf( "[$remote] Local file is newer by %d seconds", abs($diff) ); | ||
my $out = copy_file( $local_path, $remote_dir ); | ||
print $out . "\n"; | ||
} | ||
|
||
exit 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
enable-ssh-support | ||
pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac | ||
pinentry-program /usr/bin/pinentry-qt | ||
default-cache-ttl 86400 | ||
max-cache-ttl 86400 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[user] | ||
email = [email protected] | ||
name = Joe Papperello | ||
email = [email protected] | ||
[color] | ||
diff = auto | ||
ui = true | ||
|
@@ -9,9 +9,9 @@ | |
taghistory = log --tags --simplify-by-decoration --pretty=format:'%ai %d %an' | ||
uncommit = reset --soft HEAD^ | ||
onstage = diff --staged | ||
url =! bash -c 'git config --get remote.origin.url | sed -E "s/.+:\\(.+\\)\\.git$/https:\\\\/\\\\/github\\\\.com\\\\/\\\\1/g"' | ||
currentbranch = rev-parse --abbrev-ref HEAD | ||
tagrelease = !git tag -a v$(date -u +%y.%m.%d.%H%M%S) -m 'release tag' | ||
[rerere] | ||
enabled = true | ||
[url "[email protected]:"] | ||
[url "ssh://[email protected]/"] | ||
insteadOf = https://github.com/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
enable-ssh-support | ||
pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac | ||
default-cache-ttl 86400 | ||
max-cache-ttl 86400 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"\e\e[D": backward-word | ||
"\e\e[C": forward-word |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/sh | ||
DIR="$(pwd)" | ||
echo "[ -f $DIR/bashrc ] && . $DIR/bashrc" >> ~/.bashrc | ||
echo "[ -f $DIR/bashrc ] && . $DIR/bashrc" >> ~/.bash_profile |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,8 @@ set -g status-right '#[fg=colour245] %R %d %b #[fg=colour235,bg=colour252,bold] | |
|
||
set -g default-terminal "screen-256color" | ||
setw -g mode-keys vi | ||
bind-key -t vi-copy 'v' begin-selection | ||
bind-key -t vi-copy 'y' copy-selection | ||
#bind-key -t vi-copy 'v' begin-selection | ||
#bind-key -t vi-copy 'y' copy-selection | ||
setw -g monitor-activity on | ||
|
||
## Mouse stuff | ||
|
@@ -37,7 +37,7 @@ setw -g monitor-activity on | |
|
||
|
||
# Decrease the timeout when moving between windows using arrow keys | ||
set-option repeat-time 100 | ||
#set-option repeat-time 100 | ||
|
||
|
||
# force a reload of the config file | ||
|
@@ -58,11 +58,10 @@ bind - split-window -v | |
bind h split-window -h | ||
bind v split-window -v | ||
unbind C-p | ||
unbind C-P | ||
bind C-p run " tmux show-buffer | nopaste --private" | ||
bind N run " tmux show-buffer | nopaste --private" | ||
#bind C-P run " tmux show-buffer | ssh -p 12344 [email protected] 'pbcopy' " | ||
bind P run " tmux show-buffer | ssh -p 12344 [email protected] 'pbcopy' " | ||
bind C-p run " tmux show-buffer | xclip -selection clipboard -i >/dev/null" | ||
#bind-key -t vi-copy y copy-pipe 'xclip -selection clipboard >/dev/null' | ||
|
||
|
||
|
||
### Trying maximize functionality.. | ||
unbind + | ||
|
@@ -89,7 +88,7 @@ bind k next-window | |
|
||
unbind @ | ||
bind @ command-prompt -p "join pane to:" "join-pane -t '%%'" | ||
if-shell "uname | grep -q Darwin" "set-option -g default-command \"reattach-to-user-namespace -l bash\"" | ||
#if-shell "uname | grep -q Darwin" "set-option -g default-command \"reattach-to-user-namespace -l bash\"" | ||
|
||
|
||
## Nested tmux | ||
|
Oops, something went wrong.