This file contains hidden or 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
The /etc/apache2/httpd.conf is empty in Ubuntu, because it is there for historic reasons | |
Apache2 user options should go into a new *.conf-file inside /etc/apache2/conf.d/ | |
httpd.conf or apache2.conf may get overwritten during an update | |
To make sure the above works, check that /etc/apache2/apache2.conf contains the following lines: | |
Include conf.d/ | |
In Apache 2.4+ the user configuration directory is /etc/apache2/conf-available/ | |
Use a2enconf FILENAME_WITHOUT_SUFFIX to enable the new configuration file, or manually create a symlink in /etc/apache2/conf-enabled/ |
This file contains hidden or 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 will extract all extensions, usernames and passwords from the asterisk sip.conf file | |
# Remove the -- from egrep to see the relation of username to pass | |
egrep -B2 'username=....' /etc/asterisk/sip.conf | egrep -v 'host|vmexten|--' | wc -l |
This file contains hidden or 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
for fgbg in 38 48 ; do #Foreground/Background | |
for color in {0..256} ; do #Colors | |
#Display the color | |
echo -en "\e[${fgbg};5;${color}m ${color}\t\e[0m" | |
#Display 10 colors per lines | |
if [ $((($color + 1) % 10)) == 0 ] ; then | |
echo #New line | |
fi | |
done | |
echo #New line |
This file contains hidden or 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
for clbg in {40..47} {100..107} 49 ; do | |
#Foreground | |
for clfg in {30..37} {90..97} 39 ; do | |
#Formatting | |
for attr in 0 1 2 4 5 7 ; do | |
#Print the result | |
echo -en "\e[${attr};${clbg};${clfg}m ^[${attr};${clbg};${clfg}m \e[0m" | |
done | |
echo #Newline | |
done |
This file contains hidden or 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
# The first method opens file.txt, writes one line, then closes file.txt. Then repeats those three steps 100 times | |
# The second method opens file.txt, writes 100 lines and closes file.txt | |
#!/usr/bin/sh | |
# typical use of a while loop - | |
# while $count is less than or equal to 100. | |
# append the value of $count to file.txt | |
count=1 |
This file contains hidden or 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
service mysql stop | |
mysqld_safe --skip-grant-tables > /dev/null 2>&1 & | |
# wait for previous command to complete | |
mysql -u root -e "use mysql; update user set password=PASSWORD('NEW-PASSWORD') where user='root'; flush privileges;" | |
service mysql start |
This file contains hidden or 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
# original - this is all bad logins - ever! | |
lastb -i | grep -Po '\b(?!255)(?:\d{1,3}\.){3}(?!255)\d{1,3}\b' | sort | uniq -c | awk '{ if ($1 >= 5) print $2; }' | |
# early prototype - this works - but returns words | |
lastb -i | awk '{ print $3 }' | sort | uniq -c | awk '{ if ($1 >= 5) print $2; }' | |
# ah ha! this filters out the blank line and date/time stamp that was causing the words to appear | |
lastb -i | egrep -v '^$|btmp' | awk '{ print $3 }' | sort | uniq -c | awk '{ if ($1 >= 5) print $2; }' |
This file contains hidden or 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
# removes stuff I didn't want to read | |
apache2ctl status | grep -v '\.\.' | grep -v '^\"' | grep -v 'Scoreboard' | |
This file contains hidden or 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
# captures packets on bond0 interface containing "REGISTER" for 60 seconds | |
timeout 60 tshark -i bond0 -R sip.CSeq.method=="REGISTER" | |
# more tuning |
This file contains hidden or 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
# # Includes perfect date perfected. The uses go beyond backups, beyond space and time ... ok not time. | |
# # Creates a directory structure of ./YYYY/mm/dd/HH/MM/SS | |
mkdir -p "$(date '+%Y/%m/%d/%H/%M/%S')" | |
# enDIRing elegant epoch | |
# # -p is optional - unless co-processing! | |
# # the " and ' are also optional, but "'safer'" | |
# # for scripting, do set the epoch in a variable, reference that variable - write once read many and yer done! | |
mkdir -p "$(date '+%s')" |
OlderNewer