Advertisement
mdriscoll93

bash_grifts.sh

Aug 2nd, 2023 (edited)
1,379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.86 KB | Source Code | 0 0
  1. #!/bin/env bash
  2. # ^ important people do it this way ^ #
  3.  
  4. #-------------------------------------------------------------------------------------------#
  5. # assorted bash grifts. probably related to pki,  insecurity, maybe other things l8er. idk. #
  6. # definitely should probably work on most distros - besides gameboy color and broken ones.  #
  7. #-------------------------------------------------------------------------------------------#
  8.  
  9. # wildcard, cert chain, & cats - hint: use this to h~a-ck my website if u want.
  10. /acme.sh/acme.sh --issue --dns dns_cf -d markdriscoll.xyz -d '*.dev.markdriscoll.xyz' --server letsencrypt
  11. cat fullchain.cer \*. dev.markdriscoll.xyz .key | tee full-certificate.pem
  12.  
  13. # scsi mode pages are inherently dishonest. do not blame innocent disks blame their capitalist manufacturers
  14. ls -al /dev/disk/by-id/ | grep "sd[a-z]" | grep ata | awk '{print $9'}
  15.  
  16. # oh ur gameboy color doesnt have telnet installed? shouldve gone w gameboy advance they come w python2
  17. python -c "import telnetlib; tel=telnetlib.Telnet('us-cloud.company.com','443',10);"
  18.  
  19. # acpi table surgery
  20. for i in /sys/firmware/acpi/tables/*; do sudo iasl -p $PWD/$(echo $i | cut -d\/ -f6) $i && sudo chown $USER $(echo $i | cut -d\/ -f6); done
  21.  
  22. # web server for when need a web server - note: localtunnel requires node
  23. python3 -m SimpleHTTPServer 8000 &; sudo localtunnel -k ~/.ssh/id_rsa.pub 8000
  24.  
  25. # git server for when u need a git server
  26. apt-get -y install git-core gitosis; adduser --home /home/git --gecos "git user" git; su git -c "ssh-keygen -t rsa -f /home/git/.ssh/id_rsa; gitosis-init < ~/.ssh/id_rsa"
  27.  
  28. # assign top-level JSON entries to Shell Variables
  29. json='{"a":42, "b":"s t r i n g", "c": []}' ; eval $(echo $json | jq -r 'to_entries | .[] | select(.value | scalars) | .key + "=\"" + (.value | tostring) + "\";"' | tee /dev/tty)
  30.  
  31. # mem suckers
  32. ps aux | sort -nk +4 | tail
Tags: BASH PKI grifts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement