dimzon541

21 4

?

 -

 -

 - e-mail

 
.

 -

, , ,
   dimzon541

 -

.net ajax c# development fallout futurama java javascript nightwish o/r mapping rpg sci-fi vbscript web 2.0 windows communication foundation windows presentation foundation xaml xml /

 -

 LiveInternet.ru:
: 17.03.2006
: 454
: 622
: 3339
:
   dimzon541
: [19] 18 17 ..
.. 1 RSS -     ...

(0)

Linux - GreedyTorrent Python

, 03 2011 . 20:33 () +
microproxy, upload- ...

  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. """
  5. pyGreedTorrent
  6. This code is based on code based on microproxy.py written by ubershmekel in 2006.
  7.  
  8.  
  9. """
  10.  
  11. PORT = 8080
  12. UP_MULT = 5.53
  13. DN_MULT = 0
  14.  
  15. ACTUAL_PROXY_HOST_PORT = ()
  16. # Uncomment and modify line below to use chain proxy
  17. #ACTUAL_PROXY_HOST_PORT = '127.0.0.1', 3128
  18.  
  19. import re, socket, threading
  20.  
  21. reUP =  re.compile(r"(?<=\Wuploaded=)\d+", re.UNICODE )
  22. reDOWN =  re.compile(r"(?<=\Wdownloaded=)\d+", re.UNICODE )
  23.  
  24. err403 = 'HTTP/1.0 403 Forbidden\r\n' \
  25.     +'Server: nginx/0.7.65\r\n' \
  26.     +'Date: Tue, 16 Nov 2010 14:20:07 GMT\r\n' \
  27.     +'Content-Type: text/html; charset=windows-1251\r\n' \
  28.     +'Content-Length: 169\r\n' \
  29.     +'Connection: close\r\n' \
  30.     +'<html> <head><title>403 Forbidden</title></head>' \
  31.     +'<body></body></html>'
  32.  
  33. regex = re.compile(r'http://(.*?)/', re.IGNORECASE)
  34.  
  35. def cheat_url( s ):
  36.     m = reUP.search( s )
  37.     m2 = reDOWN.search( s )
  38.     if m and m2 :
  39.         up = int( round( UP_MULT * int( m.group() ) ) )
  40.         down = int( round( DN_MULT * int( m2.group() ) ) )
  41.         return s[:m.start()] + str(up + down) + s[m.end():]
  42.     else:
  43.         return s
  44.    
  45.  
  46. class ConnectionThread(threading.Thread):
  47.     def __init__(self, (conn,addr)):
  48.         self.conn = conn
  49.         self.addr = addr
  50.         threading.Thread.__init__(self)
  51.    
  52.     def run(self):
  53.  
  54.         data = self.conn.recv(1024*1024)
  55.         #print data
  56.         #print 11
  57.  
  58.         host = regex.search(data).groups()[0]
  59.  
  60.         data = cheat_url( data )
  61.        
  62.         request = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  63.         #request.settimeout(6)
  64.        
  65.         if ACTUAL_PROXY_HOST_PORT:
  66.             host = ACTUAL_PROXY_HOST_PORT
  67.         else:
  68.             i = host.find(':')
  69.             if i >= 0:
  70.                 host = host[:i], int(host[i+1:])
  71.             else:
  72.                 host = host, 80
  73.         try:        
  74.             request.connect( host )
  75.                
  76.             request.send( data )
  77.      
  78.             reply = ''
  79.      
  80.             while 1:
  81.                 temp = request.recv(1024)
  82.      
  83.                 if ('' == temp):
  84.                     break
  85.                    
  86.                 self.conn.send(temp)
  87.         except:
  88.             self.conn.send( err403 )
  89.         self.conn.close()
  90.  
  91. class ProxyThread(threading.Thread):
  92.     def __init__(self, port):
  93.         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  94.         self.sock.bind(('localhost', port))
  95.         threading.Thread.__init__(self)
  96.    
  97.     def run(self):
  98.         self.sock.listen(10)
  99.         while 1:
  100.             temp = ConnectionThread(self.sock.accept())
  101.             temp.daemon = True
  102.             temp.start()
  103.  
  104. if __name__ == "__main__":
  105.     proxy = ProxyThread(PORT)
  106.     #proxy.daemon = True
  107.     #proxy.start()
  108.     print "Started a proxy on port", PORT
  109.     proxy.run()
  110.    
  111.  



(1)

Linux -

, 03 2011 . 05:09 () +
Python...
  1. #!/usr/bin/env python
  2. #encoding: UTF-8
  3.  
  4. ## [CONFIG] ############################################
  5. duplicateFilePath = u"/home/dimzon/!test/duplicates.txt"
  6. locationFileName = u"ku-ku.txt"
  7. folderPathAll = u"/home/dimzon/!test/all"
  8. folderPathByFirstLetter = u"/home/dimzon/!test/by_letter"
  9. folderPathByYear = u"/home/dimzon/!test/by_year"
  10. sourceFolders = [\
  11.     u"/home/dimzon/!test/drives/1", \
  12.     u"/home/dimzon/!test/drives/2", \
  13.     u"/home/dimzon/!test/drives/3" ]
  14. ## [/CONFIG] ###########################################
  15.  
  16.  
  17. import os,re
  18.  
  19. def get_first_letter( fileName ):
  20.     ltr = fileName[0].upper()
  21.     if "0123456789.,!@#$_()[]{}-".count(ltr):
  22.         return "(0-9)"
  23.     return ltr
  24.  
  25. reYear = re.compile(r"(?<=\D)(?:19|20)\d{2}(?=\D)", re.UNICODE )
  26.  
  27. def get_years(fileName):
  28.     return reYear.findall( fileName )
  29.    
  30.  
  31. def clean_symlinks( folderPath ):
  32.     for i in os.listdir( folderPath ):
  33.         j = os.path.join( folderPath, i )
  34.         if os.path.islink( j ):
  35.             os.unlink( j )
  36.         elif os.path.isdir( j ):
  37.             clean_symlinks( j )
  38.             if len( os.listdir( j ) ) == 0 :
  39.                 print 11
  40.                 os.rmdir( j )
  41.            
  42. print 'Processing...'
  43.  
  44. clean_symlinks( folderPathAll )
  45. clean_symlinks( folderPathByFirstLetter )
  46. clean_symlinks( folderPathByYear )
  47.  
  48. knownFilms = {}
  49. for f in sourceFolders:
  50.     print f
  51.     for i in os.listdir( f ):
  52.         j = os.path.join( f, i )
  53.         if os.path.isdir( j ):
  54.             with open( os.path.join( j, locationFileName ) , 'w' ) as loc:
  55.                 loc.write( j.encode('utf-8') )
  56.             key = i.upper( )
  57.             if key in knownFilms :
  58.                 knownFilms[key][1].append( j )
  59.             else:
  60.                 knownFilms[key]=( i.strip() , [ j ] )
  61.  
  62. with open( duplicateFilePath , 'w' ) as loc:
  63.     for i in knownFilms.values():
  64.         if len(i[1]) != 1 :
  65.             loc.write( ('### ' + i[0] + '\n\r').encode('utf-8') )
  66.             for j in i[1] :
  67.                 loc.write( (j + '\n\r').encode('utf-8') )
  68.             loc.write( '\n\r\n\r' )
  69.  
  70. for i in knownFilms.values():
  71.     os.symlink( i[1][0] , os.path.join( folderPathAll , i[0] ) )
  72.     f = os.path.join( folderPathByFirstLetter , get_first_letter( i[0] ) )
  73.     if not os.path.exists( f ) :
  74.         os.mkdir( f )
  75.     os.symlink( i[1][0] , os.path.join( f , i[0] ) )
  76.     dt = get_years( i[0] )
  77.     for y in dt :
  78.         f = os.path.join( folderPathByYear , y )
  79.         if not os.path.exists( f ) :
  80.             os.mkdir( f )
  81.         os.symlink( i[1][0] , os.path.join( f , i[0] ) )
  82.  
  83. print 'Done!'




(0)

Linux - /nas

, 02 2011 . 21:08 () +

/nas/01_Incoming
(- )

/nas/01_Incoming/00_to_Sort
( ). avi- . ( ). /VIDEO ( ).

/nas/02_Video/03_All
. /video/* /nas/02_Video/03_All

/nas/02_Video/01_ByLetter
/video/* , /nas/02_Video/01_ByLetter,

/nas/02_Video/02_ByYear
,

" " Windows7 ( .. Junction Points). - : http://dl.dropbox.com/u/2718637/jtool.zip
notepad- jtool.exe.config
() . ( /nas/03_Audio/*

/nas/02_Video/02_Drives
HDD



(0)

Linux - NFS, SAMBA, VSFTP

, 02 2011 . 12:51 () +
( /) . 2 - SSH uTorrent-.

1 /nas - symlink-

/etc/exports (NFS)
/nas           192.168.1.0/24(ro,no_subtree_check,insecure,all_squash)


/etc/samba/smb.conf (SAMBA)
[global]
guest account = nobody
map to guest = bad user

[nas]
comment = Public Shares
browsable = yes
path = /nas
public = yes
writable = yes
guest ok = yes


/etc/vsftpd.conf (VSFTP)
listen=YES
anonymous_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
anon_upload_enable=YES
anon_umask=0000
no_anon_password=YES
local_enable=NO
dirmessage_enable=YES
write_enable=YES
anon_root=/nas
chown_uploads=YES
chown_username=me
log_ftp_protocol=YES
dual_log_enable=YES


vsftpd /etc/rc.local
vsftpd &




(0)

Linux -

, 28 2011 . 21:12 () +
. - .
: , .

VBScript:
option explicit
 
const DIR = "D:\TorrentDownload\00-to sort"
const EXT = "  \avi\mkv\mp4\flv\wmv\asf\mov\ts\"
 
dim oFSO: set oFSO=CreateObject("Scripting.FileSystemObject")
dim oTargetDIR: set oTargetDIR = oFSO.GetFolder( DIR )
dim oFile
dim sExt
dim sDirName
for each oFile in oTargetDIR.Files
	sExt = LCase(oFSO.GetExtensionName(oFile.Name))
	if InStr( EXT,  "\" &  sExt & "\") > 0 Then
		sDirName = DIR & "\" & trim(oFSO.GetBaseName(oFile.Name))
		If Not (oFSO.FolderExists( sDirName ) or oFSO.FileExists( sDirName )) Then
			oFSO.CreateFolder sDirName
			oFile.Move sDirName & "\" & oFile.Name
		End If
	end if
next
MsgBox "Done"


Python:
#! /usr/bin/env python
 
import os, re
 
targetFolder = 'd:\!test' # CHANGE THIS!
 
 
ext = re.compile(r"^.+\.(?:avi|mov|mp4|mkv|wmv|asf|ts|m2ts|mpg|mpeg)$",re.IGNORECASE + re.UNICODE)
 
print 'Processing ' + targetFolder
 
for fileName in os.listdir(targetFolder):
    filePath =  os.path.join( targetFolder, fileName )
    if os.path.isfile( filePath ):
        if ext.match( fileName ):
            dirPath = os.path.join(targetFolder,(os.path.splitext(fileName)[0]).strip())
            if not os.path.exists( dirPath ):
                os.mkdir( dirPath )
                os.rename( filePath, os.path.join( dirPath, fileName ) )
 
print 'Done!'
 




(1)

Lubuntu 10.10 NAS ( )

, 27 2011 . 21:43 () +
, Lubuntu Win7 x64, ...
.

:

  • telnet/ssh " "
  • GUI " "
  • NAS/SMB/FTP
  • -

  • WEB- ( ) / NAS




1) NFS -
2) - - uTorrentServer uTorrent+WINE
3) - GreedyTorrent- ( http- )
4) telnet/ssh , GUI- , XRDP
5) NTFS , NTFS.
6) - , soft links




(1)

, 13 2010 . 19:05 () +
, , .
. , "" //. -. . - 6-12 ( / ) ( ), , . , , , " " . - ( ) . ( ) ...
sci-fi


(3)

- ?

, 19 2009 . 00:22 () +
"" .

"" , , ...




(1)

print2flash - - Flash

, 19 2009 . 04:57 () +
, . - ;)



(0)

...

, 11 2009 . 04:07 () +






(0)

, 08 2009 . 20:10 () +





(0)

Mr. Freeman

, 29 2009 . 04:57 () +


: , , Mr. Freeman 21 . - , . 3 :

, "Mr. Freeman, part 0", " , , ?".
"Mr. Freeman, part 64" " ...".
, "Mr. Freeman, part 63" - " !".
( )

:
: . . . (PilotMax)
, . ()
( ). (mi3ch)




(0)

, 25 2009 . 22:20 () +




(0)

, 25 2009 . 22:17 () +

(3)

&quot;&quot; Google Chrome &quot;&quot;

, 25 2009 . 22:00 () +
chrome.exe :
code:
--show-extensions-on-top --enable-extensions --bookmark-menu --enable-user-scripts --enable-local-storage
Google Chrome

(2)

2 + 1 = ?

, 24 2009 . 01:56 () +




(0)

&quot;&quot;

, 23 2009 . 01:54 () +





(0)

, 22 2009 . 03:21 () +





(0)

...

, 21 2009 . 05:46 () +
+ :




(0)

, !

, 21 2009 . 05:30 () +
, ! ( ) - ! , !
 (568x455, 38Kb)
- :
http://icqmoney.com/
http://soblazncity.ru/
http://bin-layer.ru/
http://usr.marketgid.com/
http://mg.dt00.net/
http://clicktorrent.info/phpadsnew/
http://banners.adultfriendfinder.com/
http://js.ru.redtram.com/
http://p.profitstat.biz/



   dimzon541
: [19] 18 17 ..
.. 1