]> git.armaanb.net Git - bin.git/commitdiff
Update
authorArmaan Bhojwani <armaa@frost.bhojwani.org>
Tue, 13 Oct 2020 17:27:07 +0000 (13:27 -0400)
committerArmaan Bhojwani <armaa@frost.bhojwani.org>
Tue, 13 Oct 2020 17:27:07 +0000 (13:27 -0400)
apt-history [new file with mode: 0755]
ex [deleted file]
extractor [new file with mode: 0755]
status

diff --git a/apt-history b/apt-history
new file mode 100755 (executable)
index 0000000..9498eff
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+# https://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
+
+### pars for fun: install | remove | rollback
+function apt-history(){
+
+      case "$1" in
+        install)
+              grep 'install ' /var/log/dpkg.log
+              ;;
+        upgrade|remove)
+              grep $1 /var/log/dpkg.log
+              ;;
+        rollback)
+              grep upgrade /var/log/dpkg.log | \
+                  grep "$2" -A10000000 | \
+                  grep "$3" -B10000000 | \
+                  awk '{print $4"="$5}'
+              ;;
+        *)
+              cat /var/log/dpkg.log
+              ;;
+      esac
+}
+
diff --git a/ex b/ex
deleted file mode 100755 (executable)
index 111943d..0000000
--- a/ex
+++ /dev/null
@@ -1,27 +0,0 @@
-# General purpose extraction function, from Ubuntu bashrc
-#!/usr/bin/env sh
-
-ex() {
-  if [ -f $1 ] ; then
-    case $1 in
-      *.tar.bz2)   tar xjf $1   ;;
-      *.tar.gz)    tar xzf $1   ;;
-      *.bz2)       bunzip2 $1   ;;
-      *.rar)       unrar x $1   ;;
-      *.gz)        gunzip $1    ;;
-      *.tar)       tar xf $1    ;;
-      *.tbz2)      tar xjf $1   ;;
-      *.tgz)       tar xzf $1   ;;
-      *.zip)       unzip $1     ;;
-      *.Z)         uncompress $1;;
-      *.7z)        7z x $1      ;;
-      *.deb)       ar x $1      ;;
-      *.tar.xz)    tar xf $1    ;;
-      *.tar.zst)   unzstd $1    ;;      
-      *)           echo ''$1' cannot be extracted via ex()' ;;
-    esac
-  else
-    echo ''$1' is not a valid file'
-  fi
-}
-
diff --git a/extractor b/extractor
new file mode 100755 (executable)
index 0000000..111943d
--- /dev/null
+++ b/extractor
@@ -0,0 +1,27 @@
+# General purpose extraction function, from Ubuntu bashrc
+#!/usr/bin/env sh
+
+ex() {
+  if [ -f $1 ] ; then
+    case $1 in
+      *.tar.bz2)   tar xjf $1   ;;
+      *.tar.gz)    tar xzf $1   ;;
+      *.bz2)       bunzip2 $1   ;;
+      *.rar)       unrar x $1   ;;
+      *.gz)        gunzip $1    ;;
+      *.tar)       tar xf $1    ;;
+      *.tbz2)      tar xjf $1   ;;
+      *.tgz)       tar xzf $1   ;;
+      *.zip)       unzip $1     ;;
+      *.Z)         uncompress $1;;
+      *.7z)        7z x $1      ;;
+      *.deb)       ar x $1      ;;
+      *.tar.xz)    tar xf $1    ;;
+      *.tar.zst)   unzstd $1    ;;      
+      *)           echo ''$1' cannot be extracted via ex()' ;;
+    esac
+  else
+    echo ''$1' is not a valid file'
+  fi
+}
+
diff --git a/status b/status
index 7f3843a45c47d6eb8a635cde27720124b50a0685..8c7c08090b08b66e34c7ba985e1ae408f779f6df 100755 (executable)
--- a/status
+++ b/status
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/usr/bin/env bash
  
 function time_set() {
   date +%A" "%B" "%e" | "%1l:%M:%S
@@ -14,5 +14,3 @@ export TIME=$(time_set)
 export POWER=$(power_set)
 
 notify-send -i "clock" "`echo $TIME`" "`echo $POWER`"
-
-