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 f in *.*; do echo "video file $f is under fucking processing"; ffmpeg -i $f $f.mkv"; 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
*filter | |
# Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0 | |
-A INPUT -i lo -j ACCEPT | |
-A INPUT -i lo -d 127.0.0.0/8 -j REJECT | |
# Accept all established inbound connections | |
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
# Allow all outbound traffic - you can modify this to only allow certain traffic |
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
sudo ip link set wlan0 down | |
sudo iwconfig wlan0 channel auto | |
sudo ip link set wlan0 up | |
sudo rm /var/run/wpa_supplicant/wlan0 | |
sudo rm -rf /run/dhcpcd-wlan0.pid | |
sudo wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf | |
#sleep 20 | |
sudo dhcpcd wlan0 |
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
import pip | |
from subprocess import call | |
for dist in pip.get_installed_distributions(): | |
print 'Upgrading %s' % dist.project_name | |
call("pip2 install --upgrade " + dist.project_name, shell=True) |
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
# Note | |
# mounting vmail | |
mount.s3ql --allow-other s3://archi-vmail /home/vmail/ | |
# Chown to vmail:vmail | |
chown -R vmail:vmail /home/vmail/ | |
# bring the ubuntu up ;) | |
passwd | |
adduser alireza |
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
#!/bin/bash | |
# Author Alireza Savand | |
# CopyRight 2012 Alireza Savand | |
# Back up | |
echo "===========================================" | |
echo "Start to get /home/vmail dir backup" | |
echo "===========================================" | |
echo "" | |
echo "Compressing format gzip2" |
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
# server { | |
# listen 80; | |
# server_name exampl.io www.exampl.io; | |
# access_log /srv/http/exampl.io/orgia/logs/access.log; | |
# error_log /srv/http/exampl.io/orgia/logs/error.log; | |
# | |
# #ssl on; | |
# #ssl_session_timeout 5m; | |
# #ssl_certificate /etc/ssl/certs/www.exampl.io.crt; | |
# #ssl_certificate_key /etc/ssl/private/www.exampl.io.key; |
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
class Formio(ModelForm): | |
def __init__(self, user=None, *args, **kwrags): | |
""" | |
Override the init to pass the current user | |
to the model form. | |
Then the current user will be passed to the form at | |
initializing time in views or any other situation where | |
``request`` is available. | |
""" |
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
def utf8ify(value): | |
if not value: return | |
# remove some characters altogether | |
value = re.sub(r'[?.,;/:"\'\|!@#~`+=$%^&\\*()\[\]{}<>]','',value, re.UNICODE) | |
return value | |
def utf8ify_slugify(value): | |
value = utf8ify(value) | |
value = value.replace(" ", "-") |
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
find: direct_to_template, \{'template': ('[a-z/.\w-]+')} | |
replace: TemplateView.as_view(template_name=$1) |