Skip to content

Instantly share code, notes, and snippets.

View forestbaker's full-sized avatar

input - process - output forestbaker

View GitHub Profile
@forestbaker
forestbaker / fgbg16
Created September 14, 2015 21:26
displays 16 colors
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
@forestbaker
forestbaker / fgbg256
Created September 14, 2015 21:24
Displays 256 colors
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
@forestbaker
forestbaker / asteriskExtract
Last active November 20, 2015 05:16
extract all extensions, usernames and passwords from the asterisk sip.conf file
# 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
@forestbaker
forestbaker / apache2_reminders
Last active November 20, 2015 06:30
Apache2 reminders
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/