From dc27ebf0b38c0ae27894ccb7c306317bea87bd86 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 10 Jan 2023 12:13:54 +0000 Subject: added script to reset Centrino wifi controller on x201 --- reset_x201_wifi_controller.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 reset_x201_wifi_controller.sh 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 + -- cgit v1.2.3 From c637e3f03013d4010434c21eef7d7a95280810fe Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 16 Mar 2023 16:51:54 +0000 Subject: This is a replacement for _tj script The _tj script relied on passing a string of text as standard input. This replaces the old tj.fish function which used _tj to do the job of "tj 'a message for the journal'. --- tj-alternate.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tj-alternate.sh 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 -- cgit v1.2.3 From 281ffa2e971c7607b998394b49eedd1a9b38fe1b Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 16 Mar 2023 17:13:26 +0000 Subject: new bash script to replace tjclip fish funtion which relied on _tj --- tjclip-alternate.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tjclip-alternate.sh 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 -- cgit v1.2.3