View exim4_dc_relay_nets_example
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
Telling Exim4 to allow users on external networks to use the mail server as a relay: | |
So, for example your mail server has local ip: | |
192.168.1.1 | |
In that case, if you only wish let you local users use the mail server to send mail, then configure the relay host as this: | |
In `/etc/exim4/update-exim4.conf.conf`, set the relay network to only allow local machines for example (probably filter with a Class C mask) |
View Python_Imaging_Bug_on_Debian-711343.py
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
>>> import Image | |
>>> Image.open("file.png") | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 2020, in open | |
raise IOError("cannot identify image file") | |
IOError: cannot identify image file | |
>>> from PIL import Image | |
>>> Image.open("file.png") | |
<PngImagePlugin.PngImageFile image mode=RGB size=40x40 at 0x25690E0> |
View troublesomw_import_django-stdimage.py
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
try: | |
import Image, ImageOps | |
except ImportError: | |
from PIL import Image, ImageOps |
View the_fix.py
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
try: | |
from PIL import Image, ImageOps | |
except ImportError: | |
import Image, ImageOps |
View trace_debug_azure_website.ps1
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
azure account import PATH_TO_YOUR_AZURE_PUBLISH_SETTINGS_FILE | |
azure site log tail YOUR_AZURE_WEBSITE_NAME |
View upgrade_wordpress_wpcli.sh
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 | |
#requires: wp-cli installed | |
# run all the following commands inside your wordpress root directory | |
wp core update #updates wp itself | |
wp plugin update --all #update all plugins | |
wp theme update -all #update all themes |
View Use AutoPep8 in your Python projects via Vim
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
- ensure to have the `~/.vim/plugin` directory | |
- clone the vim-autopep8 plugin git repo into your .vim: | |
git clone https://github.com/tell-k/vim-autopep8.git | |
- symlink the plugin file into your vim plugins directory | |
ln -s $(realpath -f vim-autopep8/ftplugin/python_autopep8.vim) plugin | |
- open your python file using vim |
View df_mail_alert.sh
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
df -h | grep -e "/home$" | awk '{print $5}' | tr '%' ' ' | xargs -n 1 -I{} echo {} | xargs -n1 -I_percent -- sh -c '[ _percent -ge 70 ] && echo "Low Space on server:/home (_percent% full)" | mail -s "Disk Space Alert" johndoe@site.com' |
View pg_col_resize.sh
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/sh | |
if [ -z "$1" ] | |
then | |
echo "Usage: "$0" DBUSER DB TABLE COL NEWSIZE" | |
else | |
USER=$1 | |
DB=$2 | |
TABLE=$3 | |
COL=$4 | |
SIZE=$5 |
View wsgi.py
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
import os, sys | |
base = os.path.dirname(os.path.dirname(__file__)) | |
base_parent = os.path.dirname(base) | |
sys.path.append(base) | |
sys.path.append(base_parent) | |
os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % os.path.basename( os.path.dirname(__file__) ) |
OlderNewer