This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "Total # of files available within your executable PATH: " | |
for i in `echo $PATH | sed 's/\:/\n/g'`; do ls -a $i; done | wc -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for i in `echo $PATH | sed 's/\:/\n/g'`; do ls -a $i; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo -e "Listing "established" network connections:\n" | |
netstat -punt | grep -i "udp\|tcp" | awk {'print $4"\t"$1 '} | sed s/.*:// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# The gist example here does not perform any sanity or error checking. It's just a gist. | |
# | |
# example: resize an image file to 150px width... | |
# ./convert.sh example.jpg 150 | |
# | |
$FILENAME=$1 | |
$WIDTH=$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# replace 'http:' w/ 'https:' in all files within the current directory. | |
sed -i 's/http:/https:/g' ./* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ./ *.php -exec perl -pi -e 's/\/old\/tree\/path/\/new\/path\/tree/' {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo perl -pi -e 's/Defaults requiretty//' /etc/sudoers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This assumes you're using the 192.168.0. class-C subnet. | |
# Modify according to your specific subnet. | |
# default http/https ports | |
nmap 192.168.0.0/24 -P0 -p 80,443 | grep -B 4 "open" | |
# commonly used http, proxy and other related ports | |
nmap 192.168.0.0/24 -P0 -p 80,443,8000,8080,9000,9090 | grep -B 4 "open" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo mkdir /mnt/iso | |
sudo mount -o loop disk.image.iso /mnt/iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -i 's/MyISAM/InnoDB/g' ./mydump.sql |
OlderNewer