This file contains 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
#!/usr/bin/env python | |
# Copyright (c) Twisted Matrix Laboratories. | |
# See LICENSE for details. | |
""" | |
This example demonstrates how to make a simple http client. | |
Usage: | |
httpclient.py <url> |
This file contains 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
#!/usr/bin/env python | |
# -*- test-case-name: twisted.names.test.test_examples -*- | |
# Copyright (c) Twisted Matrix Laboratories. | |
# See LICENSE for details. | |
""" | |
Print the IP address for a given hostname. eg | |
python gethostbyname.py www.google.com |
This file contains 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 | |
#example of archiving 2013 year of directory /path/to/source/dir/subdir with 512k speed limit: | |
#>> ./archive_huge_dir.sh -S /path/to/source/dir -T /path/to/target/dir -L 512k -n subdir -y 2013 | |
#example of archiving december of 2013 year of directory /path/to/source/dir/millions_files_subdir with 512k speed limit: | |
#>> ./archive_huge_dir.sh -S /path/to/source/dir -T /path/to/target/dir -L 512k -n subdir -y 2013 -m 12 | |
#example of archiving several years with 512k speed limit: | |
#>> for year in `seq 2009 2013`; do ./archive_huge_dir.sh -S /path/to/source/dir -T /path/to/target/dir -L 512k -n subdir -y $year -Y ; done | |
function curtime { date +"%F %T"; } | |
function echotime { echo `curtime`" $@"; } |
This file contains 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 | |
#example of archiving 2013 year of directory /path/to/source/dir/millions_files_subdir with 512k speed limit: | |
#>> archive_millions_files_dir.sh 512k millions_files_subdir 2013 | |
#example of archiving december of 2013 year of directory /path/to/source/dir/millions_files_subdir with 512k speed limit: | |
#>> archive_millions_files_dir.sh 512k millions_files_subdir 2013 12 | |
#example of archiving several years with 512k speed limit: | |
#>> for year in `seq 2010 2013`; do for subdir in `ls /path/to/source/dir`; do archive_millions_files_dir.sh 512k $subdir $year; done; done | |
SOURCE_DIR=/path/to/source/dir | |
TARGET_DIR=/path/to/target/dir |