Skip to content

Instantly share code, notes, and snippets.

View dalbertom's full-sized avatar

David Alberto dalbertom

  • Seattle, WA
View GitHub Profile
@dalbertom
dalbertom / tmux-pgrep.sh
Created October 19, 2017 23:40
tmux pgrep
#!/usr/bin/env bash
pattern=${1?pattern}
grep -f <(ps -o tty= -p $(pgrep $pattern)) <(tmux list-panes -a -F "#{pane_tty} #S #W")
@dalbertom
dalbertom / Vagrantfile
Last active April 29, 2020 12:24
pairing vm
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@dalbertom
dalbertom / .tmux.conf
Last active May 3, 2025 08:11
tmux save
set-hook -g session-created 'run-shell "~/.tmux/scripts/SaveTmuxSession"'
set-hook -g session-renamed 'run-shell "~/.tmux/scripts/SaveTmuxSession"'
set-hook -g session-closed 'run-shell "~/.tmux/scripts/SaveTmuxSession"'
set-hook -g window-linked 'run-shell "~/.tmux/scripts/SaveTmuxSession"'
set-hook -g window-renamed 'run-shell "~/.tmux/scripts/SaveTmuxSession"'
set-hook -g window-unlinked 'run-shell "~/.tmux/scripts/SaveTmuxSession"'
set-hook -g window-layout-changed 'run-shell "~/.tmux/scripts/SaveTmuxSession"'
@dalbertom
dalbertom / keybase.md
Created October 27, 2016 02:18
keybase.md

Keybase proof

I hereby claim:

  • I am dalbertom on github.
  • I am dalbertom (https://keybase.io/dalbertom) on keybase.
  • I have a public key ASAPWrF_V0G50u9VqgZxI2o0ZaDwzlQuRFAPZKJxkGQlsAo

To claim this, I am signing this object:

@dalbertom
dalbertom / keyring.bat
Created May 29, 2012 22:09
save ssh passphrase for 8 hours.
@echo off
set /a TTL=8*60*60
ssh-add -l
if ERRORLEVEL 2 for /f "delims=;" %%a in ('ssh-agent -t %TTL%') do set %%a 2> nul
set TTL=
ssh-add
if ERRORLEVEL 1 ssh-add -d
@dalbertom
dalbertom / delete-long-name-dirs
Created November 1, 2010 18:36
in windows, deleting a very long path of directories fails. This can help deleting them.
dir /s/b/ad > dirs.txt
sort /r dirs.txt > sorteddirs.txt
for /f %a in (sorteddirs.txt) do (
subst x: /d
subst x: "%a" && rd /s/q x:
)