├── LICENSE ├── README.md ├── getcert.sh ├── livehost.sh ├── mov2gif.sh ├── removepaths.sh └── srstring.sh /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bash-hacks 2 | little scripts of bash stuff that i've found handy. 3 | -------------------------------------------------------------------------------- /getcert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # outputs the servers SSL cert 3 | # getcert.sh 8.8.8.8:443 4 | openssl s_client -connect $1 < /dev/null | openssl x509 -text -noout 5 | -------------------------------------------------------------------------------- /livehost.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | For i on `seq 1 1 254`; do ping -c 1 192.168.0.$i >/dev/null; if [ $? == 0 ]; echo 2$i alive"; done 3 | -------------------------------------------------------------------------------- /mov2gif.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Take a movie and convert to gif 3 | # mov2gif.sh input.mov meme.gif 4 | ffmpeg -i $1 -s 600x600 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $2.gif 5 | -------------------------------------------------------------------------------- /removepaths.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # got a list of urls where is like something.com/en/gb/ this will remove everything after .com so its just something.com 3 | # removepaths.sh input.txt output.txt 4 | cat $1 | cut -d/ -f1-3 >> $2 5 | -------------------------------------------------------------------------------- /srstring.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | grep -ril '$SEARCH_PATTERN' src | sed -i 's/$FIND_PATTERN/$REPLACE_PATTERN/g' 3 | --------------------------------------------------------------------------------