aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrssfeeds3
-rwxr-xr-xshenanigans.sh76
2 files changed, 77 insertions, 2 deletions
diff --git a/rssfeeds b/rssfeeds
index d81968d..503daaa 100755
--- a/rssfeeds
+++ b/rssfeeds
@@ -18,8 +18,6 @@ https://szymonkaliski.com/feed.xml
18https://world.hey.com/dhh/feed.atom 18https://world.hey.com/dhh/feed.atom
19https://mitchellh.com/feed.xml 19https://mitchellh.com/feed.xml
20https://matt-rickard.com/rss 20https://matt-rickard.com/rss
21https://solar.lowtechmagazine.com/posts/index.xml
22https://utcc.utoronto.ca/~cks/space/blog/?atom
23https://neil.computer/rss/ 21https://neil.computer/rss/
24https://matduggan.com/rss/ 22https://matduggan.com/rss/
25https://michael.stapelberg.ch/feed.xml 23https://michael.stapelberg.ch/feed.xml
@@ -29,6 +27,7 @@ https://mirzapandzo.com/rss.xml
29https://mitjafelicijan.com/feed.xml 27https://mitjafelicijan.com/feed.xml
30https://crawl.develz.org/wordpress/feed 28https://crawl.develz.org/wordpress/feed
31https://go.dev/blog/feed.atom 29https://go.dev/blog/feed.atom
30https://www.youtube.com/feeds/videos.xml?channel_id=UCUSck1dOH7VKmG4lRW7tZXg
32https://www.youtube.com/feeds/videos.xml?channel_id=UCkK9UDm_ZNrq_rIXCz3xCGA 31https://www.youtube.com/feeds/videos.xml?channel_id=UCkK9UDm_ZNrq_rIXCz3xCGA
33https://www.youtube.com/feeds/videos.xml?channel_id=UCwgKmJM4ZJQRJ-U5NjvR2dg 32https://www.youtube.com/feeds/videos.xml?channel_id=UCwgKmJM4ZJQRJ-U5NjvR2dg
34https://www.youtube.com/feeds/videos.xml?channel_id=UC8DntJ-sBtgC-jA0yEjxqjw 33https://www.youtube.com/feeds/videos.xml?channel_id=UC8DntJ-sBtgC-jA0yEjxqjw
diff --git a/shenanigans.sh b/shenanigans.sh
index 29dbf0a..ce71021 100755
--- a/shenanigans.sh
+++ b/shenanigans.sh
@@ -44,6 +44,9 @@ export PATH=$HOME/Applications:$PATH
44export PATH=$HOME/go/bin:$PATH 44export PATH=$HOME/go/bin:$PATH
45export PATH=/usr/local/go/bin:$PATH 45export PATH=/usr/local/go/bin:$PATH
46 46
47# Other paths.
48export PATH=$HOME/.local/bin/odin-linux-amd64-dev-2024-1:$PATH
49
47# History and search. Stolen from J. 50# History and search. Stolen from J.
48HISTCONTROL=ignoreboth 51HISTCONTROL=ignoreboth
49shopt -s histappend 52shopt -s histappend
@@ -95,3 +98,76 @@ backup() {
95 cd $CWD 98 cd $CWD
96} 99}
97 100
101export TICKETS=~/Vault/tickets
102tt() { # https://github.com/mitjafelicijan/ticket
103 if [ "$(uname -s)" != "Linux" ]; then
104 printf "Currently only Linux is supported.\n"
105 return 1
106 fi
107
108 if [ -z "$TICKETS" ]; then
109 TICKETS="$HOME/tickets"
110 fi
111
112 mkdir -p $TICKETS
113
114 # Display open tickets if no argument provided.
115 if [ -z "$1" ]; then
116 echo "`tt -o`"
117 return 0
118 fi
119
120 case $1 in
121 -n|-new)
122 ticket_id=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 10 | head -n 1)
123 ticket_file=$TICKETS/$ticket_id
124 printf "id: %s\n" $ticket_id > $ticket_file
125 printf "responsible: %s\n" `whoami`@`hostname` >> $ticket_file
126 printf "created: %s\n" "`date`" >> $ticket_file
127 printf "status: open\n" >> $ticket_file
128 printf "title: ?\n" >> $ticket_file
129 printf "====\n" >> $ticket_file
130 printf "Describe your problem here\n" >> $ticket_file
131 $EDITOR $ticket_file
132 ;;
133 -o|-open)
134 printf "%-12s %-21s %s\n" "Ticket ID" "Created at" "Title"
135 printf "%0.s-" {1..100}
136 printf "\n"
137 grep --color=never -l 'status: open' $TICKETS/* | while read file; do
138 id=$(head -n 1 "$file" | tail -n 1 | awk '{ print $2 }')
139 title=$(head -n 5 "$file" | tail -n 1 | awk '{$1=""; print $0}')
140 cdate=$(head -n 3 "$file" | tail -n 1 | awk '{$1=""; print $0}')
141 cdate_fmt=$(date -d "$cdate" "+%Y-%m-%d %H:%M:%S")
142 printf "%-12s %-20s %.66s\n" "$id" "$cdate_fmt" "$title"
143 done
144 ;;
145 -c|-closed)
146 printf "%-12s %-21s %s\n" "Ticket ID" "Created at" "Title"
147 printf "%0.s-" {1..100}
148 printf "\n"
149 grep --color=never -l 'status: closed' $TICKETS/* | while read file; do
150 id=$(head -n 1 "$file" | tail -n 1 | awk '{ print $2 }')
151 title=$(head -n 5 "$file" | tail -n 1 | awk '{$1=""; print $0}')
152 cdate=$(head -n 3 "$file" | tail -n 1 | awk '{$1=""; print $0}')
153 cdate_fmt=$(date -d "$cdate" "+%Y-%m-%d %H:%M:%S")
154 printf "%-12s %-20s %.66s\n" "$id" "$cdate_fmt" "$title"
155 done
156 ;;
157 -h|-help)
158 printf "Usage: ticket [option]\n"
159 printf " -n, -new creates a new ticket\n"
160 printf " -o, -open lists open tickets\n"
161 printf " -c, -closed lists closed tickets\n"
162 printf " -h, -help shows this help\n"
163 ;;
164 *)
165 if [ -e "$TICKETS/$1" ] && [ -f "$TICKETS/$1" ]; then
166 $EDITOR "$TICKETS/$1"
167 else
168 printf "Ticket not found: $TICKETS/$1\n"
169 fi
170 ;;
171 esac
172}
173