more convenience functions
authorIan Kelling <ian@iankelling.org>
Sun, 5 Feb 2017 04:04:34 +0000 (20:04 -0800)
committerIan Kelling <ian@iankelling.org>
Thu, 4 May 2017 23:42:08 +0000 (16:42 -0700)
brc

diff --git a/brc b/brc
index a71a7c763ec31cbbc6dbf51c8209ffbe097f88f9..67a113f7a2a4839f515cd61909d0b453dcb74ea2 100644 (file)
--- a/brc
+++ b/brc
@@ -736,7 +736,8 @@ idea() {
 ifn() {
     # insensitive find
     find -L . -not \( -name .svn -prune -o -name .git -prune \
-         -o -name .hg -prune \) -iname "*$**" 2>/dev/null
+         -o -name .hg -prune -o -name .editor-backups -prune \
+    -o -name .undo-tree-history -prune \) -iname "*$**" 2>/dev/null
 }
 
 
@@ -812,7 +813,7 @@ lower() { # make first letter of filenames lowercase.
 
 
 k() { # history search
-    grep -P --binary-files=text "$@" ${HISTFILE:-~/.bash_history}  | tail -n 40;
+    grep -P --binary-files=text "$@" ${HISTFILE:-~/.bash_history}  | tail -n 80;
 }
 
 
@@ -909,6 +910,13 @@ pwgen() {
     apg -m 12 -x 16 -t
 }
 
+pwlong() {
+    # -M CLN = use Caps, Lowercase, Numbers
+    # -n 1 = 1 password
+    # -a 1 = use random instead of pronounceable algorithm
+    apg -m 50 -x 70 -n 1 -a 1 -M CLN
+}
+
 
 q() { # start / launch a program in the backround and redir output to null
     "$@" &> /dev/null &
@@ -1205,11 +1213,15 @@ psnetns() {
 
 m() { printf "%s\n" "$*";  "$@"; }
 
+
+vpncmd() {
+    m s nsenter -t $(pgrep -f "/usr/sbin/openvpn --suppress-timestamps --nobind --config /etc/openvpn/client/client.conf") -n -m "$@"
+}
+vpnf() {
+    vpncmd gksudo -u ian firefox &r
+}
 vpnbash() {
-    m s nsenter -t $(pgrep openvpn) -n -m bash
-    # note, if we wanted to run a graphical program,
-    # instead of bash, we could use
-    # gksudo -u ${SUDO_USER:-$USER} "$@"
+    vpncmd bash
 }