I hereby claim:
- I am amiraliakbari on github.
- I am amirali (https://keybase.io/amirali) on keybase.
- I have a public key ASAt67tVKyA6SZOfPurVv0F7SS0j9Qo7kQlOhmfcNiPv9go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# Initial version forked from: https://github.com/jayrambhia/Install-OpenCV/blob/master/Ubuntu/2.4/opencv2_4_9.sh | |
arch=$(uname -m) | |
if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o "$arch" == "i586" ]; then | |
flag=1 | |
else | |
flag=0 | |
fi | |
echo "Installing OpenCV 2.4.9" |
#!/usr/bin/env python | |
import os | |
import glob | |
import shutil | |
def main(): | |
class_name = raw_input('Which class do you want to import? ') | |
dir_path = raw_input('Enter the path for directory containing JAR files: [.] ') or os.getcwd() | |
# -*- coding: utf-8 -*- | |
""" | |
SMS Service Module | |
==================== | |
Utilities to easily send sms using any service provider | |
usage: | |
>>> from commons.sms.sms_service import Sms, SmsService | |
>>> sms_ir = SmsService('sms.ir', '30000958', 'username', 'pass') | |
>>> sms_ir.send_sms(Sms(to='09122132796', message=u'Hello World!')) |
void addSlice(IWorkbenchWindow workbench) { | |
IEditorPart editor = null; | |
for (IWorkbenchPage p : workbench.getPages()) { | |
editor = p.getActiveEditor(); | |
if (editor != null) { | |
System.out.println("ED " + p.getLabel()); | |
} | |
} | |
if (editor == null) { | |
System.err.println("Can not find any editors, skipped."); |
package livedoc.utils; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.io.PrintWriter; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
public class Logger { |
#!/bin/bash | |
VPN="Sharif ID" | |
trap "exit 0" SIGINT SIGTERM | |
while true; do | |
if ! nmcli con status | grep "$VPN" &>/dev/null; then | |
echo "[`date -R`] Trying to re-connect..." | |
nmcli -p con up id "$VPN" |
#!/usr/bin/env python | |
import ConfigParser | |
import os | |
import time,sys | |
DB_NAME = 'PNAME' | |
PATH = '/www/PNAME/src/backup/' | |
DAY_LIMIT_FOR_KEEPING_BACKUPS = 60 | |
# On Debian, /etc/mysql/debian.cnf contains 'root' a like login and password. | |
config = ConfigParser.ConfigParser() | |
config.read("/etc/mysql/debian.cnf") |
import os | |
import subprocess | |
for dirpath, dirnames, filenames in os.walk(os.getcwd()): | |
for each_file in filenames: | |
if each_file.endswith('.pyc'): | |
if os.path.exists(os.path.join(dirpath, each_file)): | |
os.remove(os.path.join(dirpath, each_file)) |
class Member(AbstractUser): | |
GENDER = Choices((1, 'male', u"مرد"), (2, 'female', u"زن")) | |
image = models.ImageField(verbose_name=u"عکس", null=True, blank=True) | |
city = models.ForeignKey(City, null=True, blank=True, verbose_name=u"شهر") | |
gender = models.PositiveSmallIntegerField(verbose_name=u"جنسیت", choices=GENDER, null=True, blank=True) | |
default_page = models.ForeignKey('network.Page', null=True, blank=True, verbose_name=u"صفحه پیش فرض", | |
related_name="member_default_page") | |
settings = models.ForeignKey('MemberSettings', name='settings', null=True, blank=True) | |
birth_date = models.DateField(null=True, blank=True, verbose_name=u'تولد') |