aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-03-16 18:44:21 +0000
committerMatthew Lemon <y@yulqen.org>2023-03-16 18:44:21 +0000
commitf4b25c6cec4b543d256c18f1507065940e201659 (patch)
tree7e6ed89bdec31eeeb91a878a51f662f60db9b350
parent2191e2ad9d6086dfb403b480c8ab3ffdfc072d8c (diff)
parent281ffa2e971c7607b998394b49eedd1a9b38fe1b (diff)
Merge branch 'master' of git.sr.ht:~yulqen/bash-scripts
-rw-r--r--reset_x201_wifi_controller.sh6
-rwxr-xr-xtj-alternate.sh21
-rwxr-xr-xtjclip-alternate.sh21
3 files changed, 48 insertions, 0 deletions
diff --git a/reset_x201_wifi_controller.sh b/reset_x201_wifi_controller.sh
new file mode 100644
index 0000000..4884c43
--- /dev/null
+++ b/reset_x201_wifi_controller.sh
@@ -0,0 +1,6 @@
+sudo echo "1" > /sys/bus/pci/devices/0000:02:00.0/remove # remove pci device, you might have to change the 03:00.0 part to yours
+sleep 3
+sudo echo "1" > /sys/bus/pci/rescan # rescan for devices
+
+# find pci device reference with lspci | grep Centrino
+
diff --git a/tj-alternate.sh b/tj-alternate.sh
new file mode 100755
index 0000000..1ae03f4
--- /dev/null
+++ b/tj-alternate.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+# This script replaces the _tj as the main functionality of the tj fish function, as wash. We don't need
+# the fish function any more - this does the job.
+
+# Our target file
+TODAY_JOURNAL=~/Documents/Notes/journal/$(date +\%Y-\%m-\%d).md
+
+# Test whether it already exisits or not
+if [[ -a $TODAY_JOURNAL ]]
+then
+ JLINE="- $(date +'%H:%M'): $1"
+ echo "$JLINE" >> "$TODAY_JOURNAL"
+else
+ touch "$TODAY_JOURNAL"
+ header_date="$(date +'%A %d %b %Y')"
+ { echo -e "# $header_date\n"
+ } >> "$TODAY_JOURNAL"
+ JLINE="- $(date +'%H:%M'): $1"
+ echo "$JLINE" >> "$TODAY_JOURNAL"
+fi
diff --git a/tjclip-alternate.sh b/tjclip-alternate.sh
new file mode 100755
index 0000000..501edfe
--- /dev/null
+++ b/tjclip-alternate.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+# this script replaces tjclip fish function which relied on _tj.
+
+# Our target file
+TODAY_JOURNAL=~/Documents/Notes/journal/$(date +\%Y-\%m-\%d).md
+URL="$(xclip -o clipboard clipboard)"
+
+# Test whether it already exisits or not
+if [[ -a $TODAY_JOURNAL ]]
+then
+ JLINE="- $(date +'%H:%M'): $1"
+ echo "$JLINE: $URL." >> "$TODAY_JOURNAL"
+else
+ touch "$TODAY_JOURNAL"
+ header_date="$(date +'%A %d %b %Y')"
+ { echo -e "# $header_date\n"
+ } >> "$TODAY_JOURNAL"
+ JLINE="- $(date +'%H:%M'): $1"
+ echo "$JLINE: $URL." >> "$TODAY_JOURNAL"
+fi