Tidies bin folder and adds open-ports script

Jonathan Hodgson 5 years ago
parent 4e40323a73
commit d31f54eea8
  1. 0
      bin/.bin/dmenu/rofi-print
  2. 11
      bin/.bin/nmap/open-ports
  3. 40
      bin/.bin/showI3Help_
  4. 2
      bin/.bin/weather
  5. 2
      bin/.bin/xkcd

@ -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

@ -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 -

@ -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

@ -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

Loading…
Cancel
Save