<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-174826081985683121</id><updated>2024-09-21T14:09:22.502-07:00</updated><category term="programing"/><category term="ldap"/><category term="rsync"/><title type='text'>PyCenter</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-555229537989749913</id><published>2013-05-14T21:25:00.001-07:00</published><updated>2013-05-14T21:32:34.793-07:00</updated><title type='text'>Traer uids iguales en un directorio ldap</title><content type='html'>Desde un ordenador unix conectado a un servidor ldap&lt;br /&gt;
&lt;br /&gt;
#getent passwd | awk -F: &#39;{ print $1}&#39; | sort -n | uniq -d | xargs getent passwd</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/555229537989749913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2013/05/traer-uids-iguales-en-un-directorio-ldap.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/555229537989749913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/555229537989749913'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2013/05/traer-uids-iguales-en-un-directorio-ldap.html' title='Traer uids iguales en un directorio ldap'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00250607210803846155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-2659820659197929278</id><published>2012-01-20T18:51:00.000-08:00</published><updated>2012-01-20T18:52:57.491-08:00</updated><title type='text'>Clarion sorter with python - dosemu</title><content type='html'>This is my one of my first i write in python. This program do a sorter for a clarion system, interact with dosemu. Here is the code&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://pastebin.com/Nvperv1J&quot;&gt;sorter_clarion&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://pastebin.com/download.php?i=Nvperv1J&quot;&gt;Download&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/2659820659197929278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/clarion-sorte-with-python-dosemu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/2659820659197929278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/2659820659197929278'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/clarion-sorte-with-python-dosemu.html' title='Clarion sorter with python - dosemu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00250607210803846155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-2978428399099344880</id><published>2012-01-15T00:08:00.000-08:00</published><updated>2012-01-15T00:12:18.727-08:00</updated><title type='text'>Megaflooder</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
This script will flood a target with LOADs of requests:&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;http://pastebin.com/XN7Gwh0J&quot;&gt;http://pastebin.com/XN7Gwh0J&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;http://www.mediafire.com/?9eswkis49vqgxa8&quot;&gt;Download&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/2978428399099344880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/megaflooder.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/2978428399099344880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/2978428399099344880'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/megaflooder.html' title='Megaflooder'/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-7256330840274506656</id><published>2012-01-14T21:49:00.000-08:00</published><updated>2012-01-15T00:06:04.082-08:00</updated><title type='text'>ssha hash generator</title><content type='html'>&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt;
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script language=&quot;javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
&lt;/script&gt;
A typical script, that generate ssha hash.&lt;br /&gt;
Thanks to the openldap project &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;#!/usr/bin/env python
import hashlib
import os
from base64 import encodestring as encode
from base64 import decodestring as decode
import getpass

def makeSecret(password):
    salt = os.urandom(4)
    h = hashlib.sha1(password)
    h.update(salt)
    return &quot;{SSHA}&quot; + encode(h.digest() + salt)

def checkPassword(challenge_password, password):
    challenge_bytes = decode(challenge_password[6:])
    digest = challenge_bytes[:20]
    salt = challenge_bytes[20:]
    hr = hashlib.sha1(password)
    hr.update(salt)
    return digest == hr.digest()

if __name__ == &quot;__main__&quot;:
   pass1 = getpass.getpass()
   pass2 = getpass.getpass()
   if pass1 == pass2:
      ver = makeSecret(pass1)
      print ver
      bol = checkPassword(ver,pass1)
      print bol
   else:
      print &quot;pass are not equals&quot;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/7256330840274506656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/ssha-hash-generator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/7256330840274506656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/7256330840274506656'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/ssha-hash-generator.html' title='ssha hash generator'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00250607210803846155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-8142343385575376894</id><published>2012-01-14T19:55:00.000-08:00</published><updated>2012-01-14T20:18:03.259-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programing"/><title type='text'>Connect to a zk clock</title><content type='html'>&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt;
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;script language=&quot;javascript&quot;&gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
&lt;/script&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-JhadfEkh2B73jX4wQrRrY2AwsonRPMYRGUaNoemFDpzOrPCpOGm6yumn6Q83TlJ1SUnFZjWZJcEh_fHU8j_NuDHz91UNcBKT35yxWFrs2LO07sgmw2afGaHEP_o33_B2p38UpJ8dJEGZ/+digital03.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;291&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-JhadfEkh2B73jX4wQrRrY2AwsonRPMYRGUaNoemFDpzOrPCpOGm6yumn6Q83TlJ1SUnFZjWZJcEh_fHU8j_NuDHz91UNcBKT35yxWFrs2LO07sgmw2afGaHEP_o33_B2p38UpJ8dJEGZ/+digital03.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
I&#39;m spent a half week try to connect this clock. I use reverse engineering to create a network script that read network packages and do some black magic, but i don&#39;t have good result. When i give up, Found this wonderful page that&#39;s show me how to dispatch the dll of the clock (The sdk only works in windows, is &lt;a href=&quot;http://usa.zksoftware.com/view.do?id=38&quot;&gt;here&lt;/a&gt;). !!!Bingo :) !!Boom goes the dynamite :).&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;I study the sdk a weekend. Now i&#39;m proud of my code. &lt;br /&gt;
&lt;br /&gt;
This are the methods of the sdk in the code.&lt;br /&gt;
&lt;br /&gt;
Connect_Net(ip, port) # connect to devie&lt;br /&gt;
ReadAllUser(machineNumber) #read all user data and put into a buffer&lt;br /&gt;
SSR_GetAllUserInfo(machineNumber, EnrrollNumber, Name, Password, Privilege, Enable)&amp;nbsp; #get all the user data from the buffer&lt;br /&gt;
ReadGeneralLogData(machineNumber) # read all the attendance data of the clock in put into a buffer&lt;br /&gt;
SSR_GetGeneralLogData&lt;br /&gt;
EnableDevice(machinenumber, state) # enabled or disabled the clock &lt;br /&gt;
&lt;br /&gt;
For more information read the TFT manual that comes with the sdk&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: python&quot;&gt;#!/usr/bin/env python 
#coding:utf-8 
# Author:  peter --&amp;lt;pjl@hpc.com.py&amp;gt; 
# Purpose: manage the dll of the zk software, thanks to sy, for the prototype code 
# Created: 06/12/2011 
# Todo 
# 2012/01/06 
# we add a ldap proxy to diferrent the user company 

# -*- coding: utf-8 -*-   
from win32com.client import Dispatch   
import sys   
from datetime import datetime   
import sys, logging 
import qrclock 
from proxy import PrLdap 


######################################################################## 
class ZkDispatch(object): 
    &quot;&quot;&quot;Manage the windows enviroment for the zk connections to the iclock 2000&quot;&quot;&quot; 
    __doc__ = &#39;Manage the operations on the biometric clock&#39; 
    __userdata = [] 
    __logdata = [] 
    __clock = &quot;&quot; 
    __today = datetime.today().strftime(&#39;%Y-%m-%d&#39;)     
    __proxyldap = PrLdap.ProxyLdap()         

    #---------------------------------------------------------------------- 
    def __init__(self): 
        &quot;&quot;&quot; 
        Instance the database class, and distpatch the windows dll of the zk sdk 
        &quot;&quot;&quot; 
        self.dbmanag = qrclock.QuerysClock(host=&quot;XXX.XXX.XXX.XXX&quot;, user=&quot;XXX&quot;, passwd=&quot;XXXX&quot;, db=&quot;XXXXX&quot;) 
        self.zk = Dispatch(&quot;zkemkeeper.ZKEM&quot;) 
        logging.basicConfig(format=&#39;%(asctime)s %(message)s&#39;,filename=&quot;c:\\iclock.log&quot;,level=logging.DEBUG)                            

    #----------------------------------------------------------------------         
    def Connect(self, ip, port, mn): 
        &quot;&quot;&quot; 
        first connections to the clock, and retrieve the initialize data 
        Connect_Net(ip, port) 
        &quot;&quot;&quot; 
        self.__clock = ip 
        logging.info(&quot;conectando al reloj %s&quot; % ip) 

        #devPort = 4370   
        #devIPAddr = ’192.168.30.198′   

        flag = self.zk.Connect_Net(ip,port)   
        if flag:   
            logging.info(&quot;Conexion exitosa al reloj&quot;) 

        else: 
            logging.info(&quot;Error de conexion, verifique el dispositivo&quot;)             

        if self.zk.ReadAllUserID(mn): 
            #print self.zk.GetAllUserInfo(mn, 0, &quot;&quot;, &quot;&quot;, 0, False) 

            while True:   
                #s= self.zk.GetAllUserInfo(mn, 0, &quot;&quot;, &quot;&quot;, 0, False) 
                s= self.zk.SSR_GetAllUserInfo(mn, 0, &quot;&quot;, &quot;&quot;, 0, False)                 
                #s= self.zk.GetAllUserID(mn, 0, None, 0, False)                 
                if s[0]:   
                    #print type(s[3]) 
                    #print s 
                    self.__userdata.append((s[1], s[2])) 

                else:   
                    break               

    #---------------------------------------------------------------------- 
    def QueryAttendanceDb(self, dateb=__today, datee=__today, mn=1):                 
        &quot;&quot;&quot; 
        Read all the log data by the given date, . 
        we use here the SSR_GetGeneralLogData function of the sdk that use the following parameters 
        machinenumber, enrollnumber, verifymode, outmode, year, month, day, hour, minute, second 
        &quot;&quot;&quot; 
        tmpstore = [] 
        if self.zk.ReadGeneralLogData(mn): 
            while True:
        #i don&#39;t why, but no matters if you give a specific date, the method get all the records from the beginning 
                att = self.zk.SSR_GetGeneralLogData(mn, &quot;&quot;, 0, 0,2011, 12, 4, 0, 0, 0, 0) 
                #att = self.zk.SSR_GetGeneralLogData(mn, &quot;&quot;, None, None, 2011, 5, 13, None, None, None, None) 
                if att[0]: 
                    tmpstore.append(att) 
                    #print att 
                else: 
                    break 

        for v in tmpstore: 
            for u in self.__userdata: 
                if v[1] == u[0]: 
                    dtlog = datetime(v[4], v[5], v[6], v[7], v[8], v[9]) 
                    dlog = dtlog.strftime(&quot;%Y-%m-%d&quot;) 
                    tlog = dtlog.strftime(&quot;%H:%M:%S&quot;) 
                    ta = self.ChangeAuthType(v[2])             
                    tc = self.ChangeCheckType(v[3]) 
                    user = u[1].replace(&quot;,&quot;,&quot; &quot;) 
                    self.__logdata.append((v[1], user, ta, tc, dlog, tlog)) 

        for rl in self.__logdata: 
            dcheck = (rl[0], rl[4], rl[5], rl[3]) 
            if self.dbmanag.CheckFirstTime(dcheck): 
                #proxy ldap 
                r = self.__proxyldap.FormatUserCompany(rl[0]) 
               
                if r: 
                    empresa = r[0][1][&quot;Empresa&quot;][0] 
                else: 
                    empresa = &quot;NULL&quot; 
                try: 
                    dcinser = (rl[0], rl[1].split()[-1].strip(), rl[1].split()[0].strip(), rl[4], rl[5], self.__clock, rl[2], rl[3], empresa)             
                    self.dbmanag.InsertData(dcinser) 
                except: 
                    logging.info(&quot;Error al insertar el dato %s&quot; % rl[0]) 

    #---------------------------------------------------------------------- 
    def ClearLog(self, mn=1): 
        &quot;&quot;&quot;Clear all the log attendance of the lock&quot;&quot;&quot; 
        logging.info(&quot;Borrando logs de registros&quot;) 
        self.zk.ClearGLog(mn) 
        logging.info(&quot;Borrando logs de registros Exito&quot;)    

    #---------------------------------------------------------------------- 
    def Enabled(self, mn=1, state=1): 
        &quot;&quot;&quot;Enalbed or disable the device&quot;&quot;&quot; 
        if state == 0: 
            logging.info(&quot;Desactivando dispositivo&quot;)    
        else: 
            logging.info(&quot;Activando dispositivo&quot;)                     
        self.zk.EnableDevice(mn, state) 


    #---------------------------------------------------------------------- 
    def ChangeCheckType(self, ctyp): 
        &quot;&quot;&quot;change the check type for a human data&quot;&quot;&quot; 

        if ctyp == 0: 
            return &quot;Entrada&quot; 

        if ctyp == 1: 
            return &quot;Salida&quot; 

        if ctyp == 2: 
            return &quot;Salida Intermedia&quot; 

        if ctyp == 3: 
            return &quot;Entrada Intermedia&quot;    

        if ctyp == 4: 
            return &quot;Entrada Almuerzo&quot;        

        if ctyp == 5: 
            return &quot;Salida Almuerzo&quot;            

    #---------------------------------------------------------------------- 
    def ChangeAuthType(self, atyp): 
        &quot;&quot;&quot;change the auth type for a human data&quot;&quot;&quot; 

        if atyp == 0: 
            return &quot;Clave&quot; 

        if atyp == 1: 
            return &quot;Huella&quot;    

        if atyp == 2: 
            return &quot;Tarjeta&quot;        

        if atyp == 3: 
            return &quot;Clave&quot;            

        if atyp == 4: 
            return &quot;Clave&quot;                

        if atyp == 5: 
            return &quot;Clave&quot;                    

        if atyp == 6: 
            return &quot;Clave&quot;    
     
    #---------------------------------------------------------------------- 
    def CalculeTime(self, times): 
        &quot;&quot;&quot; 
        calculate how long take the transactions 
        &quot;&quot;&quot; 
        ini = times[0] 
        end = times[1] 
        horai, minutoi, segundoi = ini.split(&quot;:&quot;) 
        horai = int(horai) 
        minutoi = int(minutoi) 
        segundoi = int(segundoi) 
         
        valor0 = (horai*60)+(minutoi*60)+segundoi 
        horae, minutoe, segundoe = end.split(&quot;:&quot;) 
        horae = int(horae) 
        minutoe = int(minutoe) 
        segundoe = int(segundoe) 
        valor1 = (horae*60)+(minutoe*60)+segundoe 
        dur = valor1 - valor0 
         
        logging.info(&quot;Duracion de la conexion %s segundos&quot; % str(dur)) 
         

if __name__ == &#39;__main__&#39;:   
    clock = ZkDispatch() 
    ini = datetime.today() 
    ini = ini.strftime(&quot;%H:%M:%S&quot;)     
    clock.Connect(&#39;192.168.0.50&#39;, 4370, 1) 
    clock.Enabled(1, 0) 
    clock.QueryAttendanceDb() 
    clock.ClearLog(mn=1) 
    clock.Enabled(1, 1)     
    end = datetime.today() 
    end = end.strftime(&quot;%H:%M:%S&quot;) 
    clock.CalculeTime((ini, end)) 
 
 
 &lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/8142343385575376894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/connect-to-zk-clock.html#comment-form' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/8142343385575376894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/8142343385575376894'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/connect-to-zk-clock.html' title='Connect to a zk clock'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00250607210803846155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-7588417357838314012</id><published>2012-01-14T03:38:00.000-08:00</published><updated>2012-01-14T03:51:48.354-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ldap"/><category scheme="http://www.blogger.com/atom/ns#" term="programing"/><title type='text'>Convert a xls file to a ldif file</title><content type='html'>I create this script to convert this xls file: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;style&gt;
  &lt;!-- 
  BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:&quot;Arial&quot;; font-size:x-small }
   --&gt;
 
&lt;/style&gt;
 



&lt;br /&gt;
&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cols=&quot;3&quot; frame=&quot;VOID&quot; rules=&quot;NONE&quot;&gt;
 &lt;colgroup&gt;&lt;col width=&quot;86&quot;&gt;&lt;/col&gt;&lt;col width=&quot;206&quot;&gt;&lt;/col&gt;&lt;col width=&quot;291&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;
 &lt;tbody&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;17&quot; width=&quot;86&quot;&gt;15545345078&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot; width=&quot;206&quot;&gt;Cabral, Marcos&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot; width=&quot;291&quot;&gt;MARKETANDSENSE_DISTRIBUCION&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;17&quot;&gt;23121234725&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;Almada, Hector&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;MARKETANDSENSE_DISTRIBUCION&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;17&quot;&gt;354534573458&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;Samudio, Adan&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;MARKETANDSENSE_DISTRIBUCION&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;17&quot;&gt;37293884549&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;Portillo, Oscar&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;MARKETANDSENSE_DISTRIBUCION&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;17&quot;&gt;42453241647&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;Portillo, Juan&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;MARKETANDSENSE_DISTRIBUCION&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;17&quot;&gt;42810425450&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;Duarte, Osvaldo&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;MARKETANDSENSE_DISTRIBUCION&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;17&quot;&gt;44845045455&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;Mario Sarabia&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;MARKETANDSENSE_DISTRIBUCION&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;17&quot;&gt;43731232548&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;Galeano, Cesar&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;MARKETANDSENSE_DISTRIBUCION&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;17&quot;&gt;47459844808&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;Cabrera, Víctor&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;MARKETANDSENSE_DISTRIBUCION&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;17&quot;&gt;48244324525&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;Perez, Carlos&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;MARKETANDSENSE_DISTRIBUCION&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td align=&quot;LEFT&quot; height=&quot;17&quot;&gt;51032456441&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;Anibal Barreto&lt;/td&gt;
   &lt;td align=&quot;LEFT&quot;&gt;MARKETANDSENSE_DISTRIBUCION&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
I interesting in the first and second column. The first columns is the NumeroDocumentoIdentidad attribute in the ldap and the second columns is the uid, cn attribute.&lt;br /&gt;
&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
#-*- coding: utf-8 -*-&lt;br /&gt;
# Author:&amp;nbsp; peter --&amp;lt;pjl@hpc.com.py&amp;gt;&lt;br /&gt;
# Purpose: Insert users info from a xls file&lt;br /&gt;
# Created: 22/12/11&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# this is the module that help me with the xls file&lt;br /&gt;
#http://pypi.python.org/pypi/xlrd&lt;br /&gt;
import xlrd&lt;br /&gt;
import codecs&lt;br /&gt;
import re&lt;br /&gt;
&lt;br /&gt;
coma = re.compile(&quot;,&quot;)&lt;br /&gt;
enie = re.compile(&quot;ñ&quot;)&lt;br /&gt;
&lt;br /&gt;
#----------------------------------------------------------------------&lt;br /&gt;
def InsertFromods(filename):&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;&quot;&quot;make a ldap entry from a ods file&quot;&quot;&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; wb = xlrd.open_workbook(filename)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; sh = wb.sheet_by_index(0)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; #for every entry we make a ldif&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; filen = codecs.open(&quot;entries.ldif&quot;, &quot;a+&quot;, &quot;utf-8&quot;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; #the last uidNumber attribute in the ldap directory&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; val = 2435 &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; for rownum in range(sh.nrows):&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row = sh.row_values(rownum)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = sh.row_values(rownum)[1].lower()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = value.replace(u&quot;ñ&quot;, u&quot;n&quot;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #try to organizate the second column values&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&amp;nbsp; coma.search(value):&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ape = value.split(&quot;,&quot;)[0].strip()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nom = value.split(&quot;,&quot;)[-1].strip()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ape = value.split()[0].strip()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nom = value.split()[-1].strip()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #pass&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;dn: uid=%s%s,ou=usuarios,dc=rkf,dc=org\n&quot; % (nom, ape))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;Empresa: Market and Sense\n&quot;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;NumeroDocumentoIdentidad: %s\n&quot; % row[0])&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;cn: %s %s\n&quot;&amp;nbsp; % (nom, ape))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;sn: %s\n&quot;&amp;nbsp; % ape)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;objectClass: posixAccount\n&quot;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;objectClass: top\n&quot;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;objectClass: inetOrgPerson\n&quot;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val = val + 1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;uid: %s%s\n&quot; % (nom, ape))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;uidNumber: %s\n&quot;&amp;nbsp; % str(val))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;gidNumber: %s\n&quot;&amp;nbsp; % str(val))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;homeDirectory: /homedirs/%s%s\n&quot; % (nom, ape))&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;\n&quot;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.write(&quot;\n&quot;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; filen.close()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
#----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
if __name__==&#39;__main__&#39;:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; InsertFromods(&#39;marketandsensetablada.xls&#39;)&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/7588417357838314012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/convert-xls-file-to-ldif-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/7588417357838314012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/7588417357838314012'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/convert-xls-file-to-ldif-file.html' title='Convert a xls file to a ldif file'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00250607210803846155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-8979333263554280981</id><published>2012-01-13T15:31:00.000-08:00</published><updated>2012-01-13T15:31:21.917-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programing"/><category scheme="http://www.blogger.com/atom/ns#" term="rsync"/><title type='text'>Embed python with rsync</title><content type='html'>&lt;pre&gt;This is a nice way to control the backup in our company. I just Embed python with rsync &lt;/pre&gt;
&lt;pre&gt;This is a basci scheme.&lt;/pre&gt;
&lt;pre&gt;&#39;a&#39; copy to &#39;b&#39;, files in production are copy to &#39;a&#39; and &#39;b&#39; copy to &#39;c&#39; &lt;/pre&gt;
--------------------------&lt;br /&gt;

A—-&amp;gt; &amp;nbsp;B —&amp;gt; C&lt;br /&gt;
------------------------- &lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;#!/usr/bin/env python
#better backup, made in python
#Autor: peter pjl@hpc.com.py&lt;/pre&gt;
&lt;pre&gt;from subprocess import call
import sys
import time
import datetime

def bkp()&lt;/pre&gt;
&lt;pre&gt;    for bkp in [0, 1, 2]:
 if bkp == 0:
 #B to C
    sync(&quot;/mnt/company/&quot;,&quot;192.168.1.16:/mnt/companybckall&quot;,&quot;company&quot;)
    sync(&quot;/mnt/company1/&quot;,&quot;192.168.1.16:/mnt/company1bckall&quot;,&quot;company1&quot;)
    sync(&quot;/mnt/company2/&quot;,&quot;192.168.1.16:/mnt/company2bckall&quot;,&quot;company2&quot;)
    sync(&quot;/mnt/company3/&quot;,&quot;192.168.1.16:/mnt/company3bckall&quot;,&quot;company3&quot;)
     elif bkp == 1:
     #files in production to A
    sync(&quot;/media/company/&quot;,&quot;/mnt/companybckall&quot;,&quot;company&quot;)
    sync(&quot;192.168.12.2:/media/users/company/&quot;,&quot;/mnt/companybckall&quot;,&quot;company1&quot;)
    sync(&quot;192.168.13.2:/media/users/company/&quot;,&quot;/mnt/companybckall&quot;,&quot;company2&quot;)
    sync(&quot;192.168.10.8:/media/company/&quot;,&quot;/mnt/companybckall&quot;,&quot;company3&quot;)
     elif bkp == 2:
     #A to B
    sync(&quot;/mnt/comanybckall/&quot;,&quot;192.168.10.8:/mnt/companybckall&quot;,&quot;company&quot;)
    sync(&quot;/mnt/company1bckall/&quot;,&quot;192.168.10.8:/mnt/company1bckall&quot;,&quot;company1&quot;)
    sync(&quot;/mnt/company2bckall/&quot;,&quot;192.168.10.8:/mnt/company2bckall&quot;,&quot;company2&quot;)
    sync(&quot;/mnt/company3bckall/&quot;,&quot;192.168.10.8:/mnt/company3bckall&quot;,&quot;company3&quot;)

def sync(sources, destins, logs):
    fecha = datetime.date.today()
    fechastr = fecha.strftime(&quot;%Y-%m-%d&quot;)
    lognom = destins + &quot;/&quot; + fechastr + &quot;-&quot; + logs + &quot;.log&quot;
    logerror = destins + &quot;/&quot; + fechastr + &quot;-&quot; + logs + &quot;err&quot; + &quot;.log&quot;
    rsync = &quot;rsync&quot;
    # the arguments of the ssh must be in this way to work with crontab :)
    argum = &quot;-agEvvz --exclude-from=/root/excluir -e \&quot;ssh -i /home/peter/.ssh/id_rsa\&quot;&quot;
    cmd = &quot;%s %s %s %s&quot; % (rsync, argum, sources, destins)
    while True:
 ret = call(cmd, shell=True, stdout=open(lognom, &quot;a+&quot;), stderr=open(logerror, &quot;a+&quot;))
 if ret != 0:
    time.sleep(30)
 else:
    sys.exit(0)

if __name__ == &quot;__main__&quot;:
   bkp()&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;short_text&quot; id=&quot;result_box&quot; lang=&quot;en&quot;&gt;&lt;span class=&quot;hps&quot;&gt;this is just a&lt;/span&gt; &lt;span class=&quot;hps&quot;&gt;basic use&lt;/span&gt;&lt;/span&gt; &lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/8979333263554280981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/embed-python-with-rsync.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/8979333263554280981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/8979333263554280981'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/embed-python-with-rsync.html' title='Embed python with rsync'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00250607210803846155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-3114378954991785881</id><published>2012-01-08T23:28:00.000-08:00</published><updated>2012-01-08T23:28:01.672-08:00</updated><title type='text'></title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;span style=&quot;color: cyan;&quot;&gt;Compile python in linux&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/hOXLjTDb5jQ?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Download freeze: &lt;a class=&quot;yt-uix-redirect-link&quot; dir=&quot;ltr&quot; href=&quot;http://www.codepanel.net/showthread.php?tid=700&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;http://www.codepanel.net/showthread.php?tid=700&quot;&gt;http://www.codepanel.net/showthread.php?tid=700&lt;/a&gt;&lt;br /&gt;Visit my python blog: &lt;a class=&quot;yt-uix-redirect-link&quot; dir=&quot;ltr&quot; href=&quot;http://pycenter.blogspot.com/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot; title=&quot;http://pycenter.blogspot.com/&quot;&gt;http://pycenter.blogspot.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;usage:&lt;br /&gt;python freeze.py -o output-folder/ helloworld.py&lt;br /&gt;cd output-folder &lt;br /&gt;make&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/3114378954991785881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/compile-python-in-linux-download-freeze.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/3114378954991785881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/3114378954991785881'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/compile-python-in-linux-download-freeze.html' title=''/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-8334002527277825147</id><published>2012-01-07T15:10:00.000-08:00</published><updated>2012-01-07T15:10:35.674-08:00</updated><title type='text'></title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #6aa84f; font-size: x-large;&quot;&gt;&lt;u&gt;Solve any Captcha&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
This method is: &lt;span&gt; &lt;b&gt;95.9% &lt;/b&gt;accurate(last time I checked)&lt;b&gt;. &lt;/b&gt;This program uses the site &lt;a href=&quot;http://captchatrader.com/users/refer/xander345/%20&quot;&gt;captchatrader.com&lt;/a&gt; and you&#39;ll need an account there.&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;span&gt;import urllib, urllib2, sys&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;if len(sys.argv )&amp;lt;2:&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.exit(&quot;the first argument should be the captcha file&quot;)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;url = &quot;http://api.captchatrader.com/submit&quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;api_key = &quot;API_KEY&quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;passwd = &quot;PASSWORD&quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;user = &quot;USERNAME&quot;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;img = base64.b64encode(open(sys.argv[1]).read())&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;values = {&#39;api_key&#39; : api_key,&#39;password&#39; : passwd,&#39;username&#39; : user, &#39;value&#39;:img}&lt;/span&gt;&lt;br /&gt;&lt;span&gt;data = urllib.urlencode(values)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;req = urllib2.Request(url, data)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;response = urllib2.urlopen(req)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;the_page = response.read().split(&quot;,&quot;)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;the_page = the_page.replace(&quot;\&quot;&quot;, &quot;&quot;)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;the_page = the_page.replace(&quot;]&quot;, &quot;&quot;)&lt;/span&gt;&lt;br /&gt;&lt;span&gt;print the_page[1]&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span&gt;Just change the variables the top to your credentials then run it using these arguments:&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span&gt;python captcha.py &#39;/image/location/image.jpg&#39;&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/8334002527277825147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/solve-any-captcha-this-method-is-95.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/8334002527277825147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/8334002527277825147'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/solve-any-captcha-this-method-is-95.html' title=''/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-3476494106669244290</id><published>2012-01-07T07:38:00.000-08:00</published><updated>2012-01-07T07:38:19.397-08:00</updated><title type='text'></title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;u style=&quot;background-color: white; color: #990000;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;My Def for clicking and controlling the mouse in windows mac and linux&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;background-color: white; color: #990000;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
If you are in windows you&#39;ll need to install pywin32 and if you are in linux or OSX then you&#39;ll need to install xdotool&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
def click(x, y):&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if os.name == &quot;posix&quot;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; os.system(&quot;xdotool mousemove &quot; + str(x) + &quot; &quot; + str(y))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; os.system(&quot;xdotool click 1&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; win32api.SetCursorPos((x,y))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)&lt;/blockquote&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
in the code it&#39;s basically saying if the operating system is posix (linux/mac) then run the nesseary terminal commands the move the mouse to x,y then click it. but if the operating system is not Linux or windows then use win32api (part of pywin32) to move the mouse then click it.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
in windows you must:&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
import win32api, win32con&lt;/div&gt;
&lt;/blockquote&gt;
in Linux/Mac you must:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
 import os&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/3476494106669244290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/my-def-for-clicking-and-controlling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/3476494106669244290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/3476494106669244290'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/my-def-for-clicking-and-controlling.html' title=''/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-191964596296541735</id><published>2012-01-06T08:14:00.000-08:00</published><updated>2012-01-06T08:14:12.503-08:00</updated><title type='text'></title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;u&gt;&lt;span style=&quot;color: red; font-size: large;&quot;&gt;Generate real random urls in python&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
This will create a random ip address using random.randint(0, 255) like this:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ip0 = str(random.randint(0, 255))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ip1 = str(random.randint(0, 255))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ip2 = str(random.randint(0, 255))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ip3 = str(random.randint(0, 255))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; url = ip0 + &#39;.&#39; + ip1 + &#39;.&#39;+ ip2 + &#39;.&#39;+ ip3&lt;/div&gt;
&lt;/blockquote&gt;
It will then try to get the hosts address by using socket.gethostbyaddr(url) and if it&#39;s good/real it will print the address and write it to the file links.txt&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
import random, urllib2, os, socket, time&lt;br /&gt;from threading import Thread, active_count&lt;br /&gt;&lt;br /&gt;f=open(&quot;links.txt&quot;, &#39;w&#39;)&lt;br /&gt;global p&lt;br /&gt;global done&lt;br /&gt;global alinks&lt;br /&gt;alinks = []&lt;br /&gt;maxurls = 100&lt;br /&gt;p=0&lt;br /&gt;def main():&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; global alinks&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; global done&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; global p&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while p != maxurls:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ip0 = str(random.randint(0, 255))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ip1 = str(random.randint(0, 255))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ip2 = str(random.randint(0, 255))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ip3 = str(random.randint(0, 255))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; url = ip0 + &#39;.&#39; + ip1 + &#39;.&#39;+ ip2 + &#39;.&#39;+ ip3&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; try:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; link = socket.gethostbyaddr(url)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; print link[0]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(link[0])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(&quot;\n&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; p=p+1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; try:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; urlContent = urllib2.urlopen(url).read()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if urlContent.find(&#39;&amp;lt;html&#39;) &amp;gt; -1 or urlContent.find(&#39;&amp;lt;HTML&#39;) &amp;gt; -1:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; break&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; except:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; except:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; done = done - 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;maxi = 55&lt;br /&gt;done = maxi&lt;br /&gt;hhh = 0&lt;br /&gt;while hhh != maxi:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hhh=hhh+1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread(target=main, args=()).start()&lt;br /&gt;&lt;br /&gt;while done != 0 or done &amp;gt; 0:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; time.sleep(1.2)&lt;br /&gt;&lt;br /&gt;print &quot;Writing to File&quot;&lt;br /&gt;alinks.tofile(f)&lt;br /&gt;print &quot;Done exiting&quot;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?w7npwp7m2y3b5c6&quot;&gt;Download&lt;/a&gt; - mediafire.com&lt;br /&gt;
&lt;a href=&quot;http://www.codepanel.net/showthread.php?tid=758&quot;&gt;Download&lt;/a&gt; - codepanel.net</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/191964596296541735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/generate-real-random-urls-in-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/191964596296541735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/191964596296541735'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/generate-real-random-urls-in-python.html' title=''/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-7811905502667424681</id><published>2012-01-04T10:21:00.001-08:00</published><updated>2012-01-04T10:29:28.845-08:00</updated><title type='text'></title><content type='html'>&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;Bruteforce dictionary creator&lt;/u&gt;&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
Need a dictionary file but don&#39;t want to download 36GB? Just use the script to create of for your self.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;a href=&quot;http://www.mediafire.com/?55l5uak1662in0k&quot;&gt;Download&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
it takes no arguments, it will ask you for the specs in program.</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/7811905502667424681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/bruteforce-dictionary-creator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/7811905502667424681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/7811905502667424681'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/bruteforce-dictionary-creator.html' title=''/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-2175731526241141360</id><published>2012-01-04T10:18:00.000-08:00</published><updated>2012-01-04T10:18:45.947-08:00</updated><title type='text'></title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u&gt;How to compile python in linux&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
In this tutorial we&#39;ll be using &lt;a href=&quot;http://www.mediafire.com/?q698msjccb8dcnb&quot;&gt;freeze&lt;/a&gt; ,&amp;nbsp; just use your python script as the first argument see:&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
python freeze.py yourfile.py &lt;/div&gt;
&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/2175731526241141360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/how-to-compile-python-in-linux-in-this.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/2175731526241141360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/2175731526241141360'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/how-to-compile-python-in-linux-in-this.html' title=''/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-6445547441568301377</id><published>2012-01-03T04:10:00.000-08:00</published><updated>2012-01-03T04:10:15.173-08:00</updated><title type='text'></title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Convert Images to text and text back to images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
When we convert images to/from text we use base64 and import python you can use base64 by&amp;nbsp;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
import base64&lt;/div&gt;
&lt;/blockquote&gt;
&amp;nbsp;So this script will open the image from the first argument and save to readable text version as output.txt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
import sys, base64&lt;br /&gt;&lt;br /&gt;img = open(sys.argv[1], &#39;r&#39;)&lt;br /&gt;txt = img.read()&lt;br /&gt;txt2 = base64.b64encode(txt)&lt;br /&gt;txtfile = open(&quot;output.txt&quot;, &#39;w&#39;)&lt;br /&gt;txtfile.write(txt2)&lt;br /&gt;#print txt2&lt;/blockquote&gt;
&lt;br /&gt;
If you uncomment the last line by removing the &#39;#&#39; it will print out the text value of the image.&lt;br /&gt;
&lt;br /&gt;
And this&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
import sys, base64&lt;br /&gt;&lt;br /&gt;img = open(sys.argv[1], &#39;r&#39;)&lt;br /&gt;txt = img.read()&lt;br /&gt;txt2 = base64.b64decode(txt)&lt;br /&gt;txtfile = open(&quot;output.png&quot;, &#39;w&#39;)&lt;br /&gt;txtfile.write(txt2)&lt;/blockquote&gt;
Will open the text file as the first argument and output the image to &#39;output.png&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.codepanel.net/showthread.php?tid=753&amp;amp;pid=1801#pid1801&quot;&gt;Download&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/6445547441568301377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/convert-images-to-text-and-text-back-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/6445547441568301377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/6445547441568301377'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/convert-images-to-text-and-text-back-to.html' title=''/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-8292281571081888846</id><published>2012-01-02T17:21:00.000-08:00</published><updated>2012-01-02T17:21:08.544-08:00</updated><title type='text'></title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Controlling the CD/DVD drive in python&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
This program requires pygame to be installed&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
import pygame.cdrom as cdrom&lt;br /&gt;cdrom.init()&lt;br /&gt;cd = cdrom.CD(0) # 0 = first cdrom device&lt;br /&gt;cd.init()&lt;br /&gt;cd.eject()&lt;br /&gt;cd.quit()&lt;br /&gt;cdrom.quit()&lt;/blockquote&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/8292281571081888846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/controlling-cddvd-drive-in-python-this.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/8292281571081888846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/8292281571081888846'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/controlling-cddvd-drive-in-python-this.html' title=''/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-2071052429338978133</id><published>2012-01-02T02:05:00.000-08:00</published><updated>2012-01-02T02:05:18.555-08:00</updated><title type='text'></title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;u style=&quot;color: red;&quot;&gt;&amp;nbsp;Hide my ass proxy grabber&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
This program will grabber all the proxies from this page &lt;a href=&quot;http://hidemyass.com/proxy-list/&quot;&gt;http://hidemyass.com/proxy-list/&lt;/a&gt;&lt;br /&gt;And will print out each http or https and and will write them to a file if you specify -o in the arguments but it will keep the proxies that are already in the file and will not write the same on twice.&lt;br /&gt;
&lt;a href=&quot;http://www.codepanel.net/showthread.php?tid=743&quot;&gt;Download&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/2071052429338978133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2012/01/my-ass-proxy-grabber-this-program-will.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/2071052429338978133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/2071052429338978133'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2012/01/my-ass-proxy-grabber-this-program-will.html' title=''/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-1291017087056088878</id><published>2011-12-31T01:51:00.000-08:00</published><updated>2011-12-31T01:51:18.697-08:00</updated><title type='text'></title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #38761d; font-size: large;&quot;&gt;&lt;u&gt;Bruteforce MD5&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;

     This script i provide with can bruteforce MD5 hashes using a 
wordslist. I composed the wordlists from a collection of names 
dictionary words (not just english) and common password then i run a 
program to filter out duplicates. &lt;br /&gt;
&lt;br /&gt;
The python script is actually pretty simple but can pull it&#39;s weight in cracking hashes.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;u&gt;Usage:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
 &lt;br /&gt;
&lt;/div&gt;
&lt;div class=&quot;body&quot; dir=&quot;ltr&quot;&gt;
&lt;code&gt;python bruteMD5.py -f wordslist.txt&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;body&quot; dir=&quot;ltr&quot;&gt;
&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;body&quot; dir=&quot;ltr&quot;&gt;
&lt;br /&gt;
Also to change the hashes you want to crack change the variable &quot;ciph&quot;&lt;code&gt; &lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;body&quot; dir=&quot;ltr&quot;&gt;
&lt;a href=&quot;http://www.codepanel.net/showthread.php?tid=729&quot;&gt;&lt;code&gt;Download&lt;/code&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;body&quot; dir=&quot;ltr&quot;&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;body&quot; dir=&quot;ltr&quot;&gt;
&lt;code&gt;&lt;a href=&quot;http://www.mediafire.com/?q1rugbu828bq36b&quot;&gt;Wordslist&lt;/a&gt;&lt;/code&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/1291017087056088878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2011/12/bruteforce-md5-this-script-i-provide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/1291017087056088878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/1291017087056088878'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2011/12/bruteforce-md5-this-script-i-provide.html' title=''/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-174826081985683121.post-2189267614324011325</id><published>2011-12-31T01:06:00.000-08:00</published><updated>2011-12-31T01:08:53.982-08:00</updated><title type='text'></title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #38761d; font-size: large;&quot;&gt;Admin page finder&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
This python script can find the administrative page on almost any website. I&#39;ve tested it a few times and it&#39;s worked 100%. It has a huge collection of possible paths making it almost impossible for sites to escape.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Usage:&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;blockquote&gt;
python filename.py http://example.org &lt;/blockquote&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;http://www.mediafire.com/?n12sn8198j8vlip&quot;&gt;Download &lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pycenter.blogspot.com/feeds/2189267614324011325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pycenter.blogspot.com/2011/12/admin-page-finder-this-python-script.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/2189267614324011325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/174826081985683121/posts/default/2189267614324011325'/><link rel='alternate' type='text/html' href='http://pycenter.blogspot.com/2011/12/admin-page-finder-this-python-script.html' title=''/><author><name>xander345</name><uri>http://www.blogger.com/profile/00165128417600540797</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>