From a313b122abc72d4f382850bb2cb7fd03998d8cea Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Thu, 12 Sep 2019 21:30:29 +0100 Subject: [PATCH] Tidies bin folder and adds open-ports script --- bin/.bin/{ => dmenu}/rofi-print | 0 bin/.bin/nmap/open-ports | 11 +++++++++ bin/.bin/showI3Help_ | 40 --------------------------------- bin/.bin/weather | 2 +- bin/.bin/xkcd | 2 +- 5 files changed, 13 insertions(+), 42 deletions(-) rename bin/.bin/{ => dmenu}/rofi-print (100%) create mode 100755 bin/.bin/nmap/open-ports delete mode 100755 bin/.bin/showI3Help_ diff --git a/bin/.bin/rofi-print b/bin/.bin/dmenu/rofi-print similarity index 100% rename from bin/.bin/rofi-print rename to bin/.bin/dmenu/rofi-print diff --git a/bin/.bin/nmap/open-ports b/bin/.bin/nmap/open-ports new file mode 100755 index 00000000..f876ac36 --- /dev/null +++ b/bin/.bin/nmap/open-ports @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +IP="$1" + +if [ -n "$IP" ]; then + nmap $IP -p0- | # Get the nmap output + cut -d '/' -f1 | # + sed -n '/^[0-9]/p' +else + echo "Print an ip address" +fi diff --git a/bin/.bin/showI3Help_ b/bin/.bin/showI3Help_ deleted file mode 100755 index 332d114a..00000000 --- a/bin/.bin/showI3Help_ +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env sh - -function format0to9 { - cat - | - sed -E '/\$mod(\+Shift)?\+[1-9]/d' |\ - #sed -nE '/\$mod(\+Shift)?\+0/p' |\ - sed -E '/\$mod(\+Shift)?\+0/ { s/0/[1-9,0]/; s/10/[1-10]/g}' -} - -function formatLine { - while read line; do - if echo "$line" | grep -q "exec"; then - echo "$line" |\ - awk '{print "# "$1 "\n"; $1=$2=""; print " Runs the shell command: \n\n```bash\n" $0 "\n```\n" }' - else - echo "$line" | awk '{print "# "$1 "\n"; $1=""; print $0 "\n" }' - fi - done; -} - -cat $HOME/.dotfiles/i3/configWork |\ - #Gets lines that start with bindsym - sed -e "/^#/d" -ne "/^bindsym/p" | \ - #Remove things we dont want to show - sed 's/\(bindsym \|--whole-window \|--no-startup-id \|--release \)//g' | \ - #Hopefully self explanitory - sort |\ - #Makes Formats [0-9] - format0to9 |\ - #Goes through each line and turns it into simple markdown - formatLine |\ - #Converts markdown to groff ms - #pandoc -f markdown -t ms |\ - pandoc -f markdown -t latex -o ~/test.pdf - #Converts groff to pdf - #groff -ms - -T pdf > ~/test.pdf - #groff -ms - -T pdf |\ - #Opens PDF - #zathura - - diff --git a/bin/.bin/weather b/bin/.bin/weather index 5f99fbc0..2ed211a6 100755 --- a/bin/.bin/weather +++ b/bin/.bin/weather @@ -2,6 +2,6 @@ initial=$@ place=${initial// /+} if [[ "$place" == "" ]]; then - place="Bury+St+Edmunds" + place="Cheltenham" fi curl "wttr.in/$place" 2> /dev/null | head -n -2 diff --git a/bin/.bin/xkcd b/bin/.bin/xkcd index fd663042..4844f48e 100755 --- a/bin/.bin/xkcd +++ b/bin/.bin/xkcd @@ -10,4 +10,4 @@ else json=$(curl https://xkcd.com/$comic/info.0.json 2> /dev/null) fi echo $json | /usr/bin/jq -C -echo $json | /usr/bin/jq ".img" | xargs feh +echo $json | /usr/bin/jq ".img" | xargs sxiv