Popular recipes tagged "meta:requires=getpass"http://code.activestate.com/recipes/tags/meta:requires=getpass/2013-02-20T22:07:27-08:00ActiveState Code RecipesStoring a Single Username and Encrypted Password to a File (Python)
2013-01-31T02:07:25-08:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578443-storing-a-single-username-and-encrypted-password-t/
<p style="color: grey">
Python
recipe 578443
by <a href="/recipes/users/4184772/">Captain DeadBones</a>
(<a href="/recipes/tags/encryption/">encryption</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>This script was written for an article I wrote to check user passwords. It stores data using SHA one-way function. For more information <a href="http://thelivingpearl.com/2013/01/29/authentication-of-users-and-passwords-in-python/">Authentication Of Users And Passwords In Python</a></p>
Code To Store Encrypted Password in a File (Python)
2013-01-19T04:07:50-08:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578430-code-to-store-encrypted-password-in-a-file/
<p style="color: grey">
Python
recipe 578430
by <a href="/recipes/users/4184772/">Captain DeadBones</a>
(<a href="/recipes/tags/encryption/">encryption</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>This snippet of code was written as part of an article - <a href="http://thelivingpearl.com/2013/01/18/password-protecting-your-python-application/">Password Protecting You Python Application</a></p>
Verify Username and Password Using a File for Storage (Python)
2013-01-31T02:11:24-08:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578446-verify-username-and-password-using-a-file-for-stor/
<p style="color: grey">
Python
recipe 578446
by <a href="/recipes/users/4184772/">Captain DeadBones</a>
(<a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/usernames/">usernames</a>).
</p>
<p>This script was written for an article I wrote to check user passwords. It stores data using SHA one-way function. For more information <a href="http://thelivingpearl.com/2013/01/29/authentication-of-users-and-passwords-in-python/">Authentication Of Users And Passwords In Python</a></p>
Verify a Single User Name and Password in Python (Python)
2013-01-31T02:09:58-08:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578445-verify-a-single-user-name-and-password-in-python/
<p style="color: grey">
Python
recipe 578445
by <a href="/recipes/users/4184772/">Captain DeadBones</a>
(<a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/usernames/">usernames</a>).
</p>
<p>This script was written for an article I wrote to check user passwords. It stores data using SHA one-way function. For more information <a href="http://thelivingpearl.com/2013/01/29/authentication-of-users-and-passwords-in-python/">Authentication Of Users And Passwords In Python</a></p>
Appending Encrypted Username and Passwords to a File (Python)
2013-01-31T02:08:20-08:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578444-appending-encrypted-username-and-passwords-to-a-fi/
<p style="color: grey">
Python
recipe 578444
by <a href="/recipes/users/4184772/">Captain DeadBones</a>
(<a href="/recipes/tags/encryption/">encryption</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>This script was written for an article I wrote to check user passwords. It stores data using SHA one-way function. For more information <a href="http://thelivingpearl.com/2013/01/29/authentication-of-users-and-passwords-in-python/">Authentication Of Users And Passwords In Python</a></p>
Promot & Verify Encrypted User Password (Python)
2013-01-19T04:10:13-08:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578431-promot-verify-encrypted-user-password/
<p style="color: grey">
Python
recipe 578431
by <a href="/recipes/users/4184772/">Captain DeadBones</a>
(<a href="/recipes/tags/encryption/">encryption</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/python/">python</a>).
</p>
<p>This snippet of code was written as part of an article - <a href="http://thelivingpearl.com/2013/01/18/password-protecting-your-python-application/">Password Protecting You Python Application</a>. The code requires a file with an encrypted password. The script to generate an encrypted file is <a href="http://code.activestate.com/recipes/578430-code-to-store-encrypted-password-in-a-file/">Code To Store Encrypted Password in a File</a>.</p>
Python reader + writer for spss sav files (Linux, Mac & Windows) (Python)
2013-02-20T22:07:27-08:00Albert-Jan Roskamhttp://code.activestate.com/recipes/users/4177640/http://code.activestate.com/recipes/577811-python-reader-writer-for-spss-sav-files-linux-mac-/
<p style="color: grey">
Python
recipe 577811
by <a href="/recipes/users/4177640/">Albert-Jan Roskam</a>
(<a href="/recipes/tags/reader/">reader</a>, <a href="/recipes/tags/sav/">sav</a>, <a href="/recipes/tags/spss/">spss</a>, <a href="/recipes/tags/writer/">writer</a>).
Revision 12.
</p>
<p><strong>Python Program to READ & WRITE Spss system files (.sav) (Linux,Mac or Windows)</strong></p>
<ul>
<li><em>Check <a href="https://pypi.python.org/pypi/savReaderWriter/" rel="nofollow">https://pypi.python.org/pypi/savReaderWriter/</a> for the latest version (including the libraries!)</em></li>
<li>Requires libspssdio.so.1 (LINUX) or libspssdio.dylib (MAC) or spssio32.dll (WINDOWS) plus associated libaries, which can be freely downloaded from:
<a href="https://www.ibm.com/developerworks/mydeveloperworks/wikis/home/wiki/We70df3195ec8_4f95_9773_42e448fa9029/page/Downloads%2520for%2520IBM%25C2%25AE%2520SPSS%25C2%25AE%2520Statistics?lang=en" rel="nofollow">https://www.ibm.com/developerworks/mydeveloperworks/wikis/home/wiki/We70df3195ec8_4f95_9773_42e448fa9029/page/Downloads%20for%20IBM%C2%AE%20SPSS%C2%AE%20Statistics?lang=en</a></li>
<li>It is recommended to download the v21 I/O files (required for writing zlib (.zsav) compressed files)</li>
<li>December 2012 (complete rewrite):</li>
<li>Added support for slicing, indexing, array slicing + other special methods</li>
<li>Added support for writing spss date fields</li>
<li>Added support for almost all meta data (missing values, sets, roles, etc.)</li>
<li>Added support for 64 bit Windows (tested with Win7) and other OSs
(z/Linux, Solaris, HP Linux, IBM AIX (untested though)</li>
<li>Added support for reading and writing zlib compressed (.zsav) files</li>
<li>Removed pesky segfault error when freeing memory</li>
<li>Removed errors related to encoding</li>
<li>Changed some Reader defaults (verbose=False, returnHeader=False)</li>
<li>Renamed SavDataDictionaryReader into SavHeaderReader</li>
</ul>
<p><strong>LINUX:</strong></p>
<p><em>Installation (tested on Linux Ubuntu 10):</em></p>
<ul>
<li>additional packages/files needed are: intel-icc8-libs_8.0-1_i386.deb,libicu32_3.2-3_i386.deb, libstdc++5_3.3.6-20_i386.deb, libirc.so.</li>
<li>Run the following commands in your terminal: sudo apt-get install intel-icc8-libs; sudo apt-get install libicu32; sudo apt-get install libstdc++5.</li>
<li>Then convert libirc.a (static) to libirc.so (dynamic), save in same location as libspssdio.so.1:
ar vx intel-icc8-libs_8.0-1_i386.deb; tar -xzvf data.tar.gz ./usr/lib/libirc.a; ar -x libirc.a.</li>
</ul>
<p><em>Calling the program:</em></p>
<ul>
<li>In the TERMINAL type: export LD_LIBRARY_PATH=/path/of/additional/sofiles; python /some/path/wrapperToProgram.py. You may also add ld_library_path to .bashrc</li>
<li>The wrapper starts with "from SavReaderWriter import *", followed by e.g. stuff from the if __name__ == '__main__' section</li>
</ul>
<p><strong>MAC OS:</strong></p>
<ul>
<li>you must put all the dylib files that come with the IBM
SPSS_Statistics_InputOutput_Modules_* package in the macos
directory somewhere that OS X can find them</li>
<li>one simple way to accomplish this is to copy them to /usr/lib</li>
</ul>
<p><strong>WINDOWS:</strong></p>
<ul>
<li>You can also find this dll in the installation directory of SPSS (although SPSS is _not_ needed!)</li>
<li>The .dll should be saved in the same location as this program.</li>
</ul>
<p><strong>USAGE:</strong>
See docstrings + __main__ section</p>
Calendar Maker (Python)
2012-07-03T05:23:57-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578187-calendar-maker/
<p style="color: grey">
Python
recipe 578187
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/archive/">archive</a>, <a href="/recipes/tags/calendar/">calendar</a>, <a href="/recipes/tags/cgi/">cgi</a>, <a href="/recipes/tags/old/">old</a>).
</p>
<p>This is an old program experimenting with CGI techniques in Python using <code>CGIHTTPServer</code> and designed for creating calendars. This is committed for archival to be run under Python 2.5 or later versions.</p>
Cosign Handler (Python)
2012-07-18T13:30:10-07:00Colin Higgshttp://code.activestate.com/recipes/users/4182866/http://code.activestate.com/recipes/578217-cosign-handler/
<p style="color: grey">
Python
recipe 578217
by <a href="/recipes/users/4182866/">Colin Higgs</a>
(<a href="/recipes/tags/authentication/">authentication</a>, <a href="/recipes/tags/cosign/">cosign</a>, <a href="/recipes/tags/handler/">handler</a>, <a href="/recipes/tags/urllib/">urllib</a>).
</p>
<p>Handler (python 3.x urllib.request style) for web pages where cosign authentication is required.</p>
<p>See <a href="http://weblogin.org/">http://weblogin.org/</a> for details of the cosign authentication system.</p>
Python Gmail script (smtp) (Python)
2011-06-08T20:15:01-07:00jrovegnohttp://code.activestate.com/recipes/users/4170207/http://code.activestate.com/recipes/577690-python-gmail-script-smtp/
<p style="color: grey">
Python
recipe 577690
by <a href="/recipes/users/4170207/">jrovegno</a>
(<a href="/recipes/tags/gmail/">gmail</a>, <a href="/recipes/tags/smtp/">smtp</a>).
Revision 4.
</p>
<p>Referencias:
<a href="http://ideaschile.wordpress.com/2011/05/12/python-gmail-script-smtp/">Python Gmail script (smtp)</a></p>
File Share Messenger 2.5 (Python)
2011-04-06T02:45:15-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577638-file-share-messenger-25/
<p style="color: grey">
Python
recipe 577638
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/file_io/">file_io</a>, <a href="/recipes/tags/file_share/">file_share</a>, <a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/messenger/">messenger</a>, <a href="/recipes/tags/network/">network</a>, <a href="/recipes/tags/workaround/">workaround</a>).
</p>
<p>After writing the limited program shown in <a href="http://code.activestate.com/recipes/577637/">recipe 577637</a>, the following program was written with a better yet incompatible I/O system designed not to fill up a file share with many, separate files. This program had five revisions as outlined within the source code. To access settings within this program, use the "F2" key. Documentation may be accessed via the "F1" key (with future plans cut).</p>
<p>If anyone wishes to comment or vote this recipe down, please provide your insight into the fault(s) of the program and provide a suggestion as to what solution you would implement to fix the problems.</p>
File Share Messenger 1.0 (Python)
2011-04-06T00:03:20-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577637-file-share-messenger-10/
<p style="color: grey">
Python
recipe 577637
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/file_io/">file_io</a>, <a href="/recipes/tags/file_share/">file_share</a>, <a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/messenger/">messenger</a>, <a href="/recipes/tags/network/">network</a>, <a href="/recipes/tags/workaround/">workaround</a>).
</p>
<p>File I/O has many potential uses, and in the case of network file shares, messaging can be conducted by creating files in a directory and scanning for new files to find new messages. In the case where there are restrictions within a network that prevent opening server sockets or creating and using client sockets, the technique in this recipe may be used with file shares instead. The program is simple and was written in about fifty minutes, so there are a great deal of enhancements that could be made to the recipe and its capabilities. Hopefully, this will provide inspiration for other program writers.</p>
<p>If you have any comments or wish to down-vote this recipe, please provide your insight as to what could be improved upon and how you would go about fixing any problems that you might find.</p>
user and root directory logfile (Python)
2011-03-22T10:00:49-07:00justin drakehttp://code.activestate.com/recipes/users/4177409/http://code.activestate.com/recipes/577619-user-and-root-directory-logfile/
<p style="color: grey">
Python
recipe 577619
by <a href="/recipes/users/4177409/">justin drake</a>
(<a href="/recipes/tags/directory/">directory</a>, <a href="/recipes/tags/log/">log</a>, <a href="/recipes/tags/time/">time</a>, <a href="/recipes/tags/user/">user</a>).
</p>
<p>script to retrieve time, current user, and root of directory
output to spam.txt</p>
<p>want to add more like windows version, bios info and other useful diagnostic information </p>
<p>free to use and modify
welcome any advice or corrections
learning python hope this turns into a script to create a organized personal report of customer's pc</p>
SPOJ backup script (Python)
2010-02-09T08:50:44-08:00Shashwat Anandhttp://code.activestate.com/recipes/users/4172995/http://code.activestate.com/recipes/577036-spoj-backup-script/
<p style="color: grey">
Python
recipe 577036
by <a href="/recipes/users/4172995/">Shashwat Anand</a>
(<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/algorithms/">algorithms</a>, <a href="/recipes/tags/spoj/">spoj</a>, <a href="/recipes/tags/tools/">tools</a>).
Revision 3.
</p>
<h4>Introduction</h4>
<p>At Sphere Online Judge (<a href="http://www.spoj.pl" rel="nofollow">http://www.spoj.pl</a>) you are given the capability of trying out the
challenging problems given. It also gives you the capability of viewing
and downloading your own solution.</p>
<p>The tool spojbackup tends to automatically backup all your Accepted
submissions and save them on the desired location of your computer. The
basic idea is to automate the process which can be used as a backup and
an offline reference tool of your own codes.</p>
<h4>Features</h4>
<ul>
<li><p>Resume downloads.
spojbackup currently supports resuming of the solutions if internet
connection is disrupted</p></li>
<li><p>Incremental backup facility
it'll not download the code already present on your machine. Only newer
code added in your signedlist will be downloaded</p></li>
<li><p>User-defined destination
all codes are saved at user-defined destination
if no option is given by user it saves in the folder from where command is
run</p></li>
<li><p>Proxy support
Proxy support is provided as SPOJ users are generally university students
and they are generally behind a proxy and university firewall.</p></li>
</ul>
<h4>Bugs</h4>
<p>In case of finding a bug please drop a mail to the authors. We will try to sort
out the problems.</p>
Delete all message older than a given date in a pop account (Python)
2009-10-05T12:56:13-07:00Benjamin Sergeanthttp://code.activestate.com/recipes/users/4039626/http://code.activestate.com/recipes/576922-delete-all-message-older-than-a-given-date-in-a-po/
<p style="color: grey">
Python
recipe 576922
by <a href="/recipes/users/4039626/">Benjamin Sergeant</a>
(<a href="/recipes/tags/delete/">delete</a>, <a href="/recipes/tags/email/">email</a>, <a href="/recipes/tags/pop/">pop</a>).
</p>
<p>I was using the keep option in fetchmail, so I had a huge number of emails that seems to slow down mails retrieval / pop connection. I wanted a way to </p>
send a multipart email via gmail's SMTP server (Python)
2009-12-21T14:29:41-08:00Trent Mickhttp://code.activestate.com/recipes/users/4173505/http://code.activestate.com/recipes/576824-send-a-multipart-email-via-gmails-smtp-server/
<p style="color: grey">
Python
recipe 576824
by <a href="/recipes/users/4173505/">Trent Mick</a>
(<a href="/recipes/tags/email/">email</a>, <a href="/recipes/tags/gmail/">gmail</a>, <a href="/recipes/tags/smtp/">smtp</a>).
Revision 3.
</p>
<p>This is a Python function to send an email (a) with optional text and html alternative parts and (b) via gmail's SMTP server using your gmail account.</p>
Simple FTP Mirror (Python)
2009-05-26T01:54:46-07:00Thimo Kraemerhttp://code.activestate.com/recipes/users/4169283/http://code.activestate.com/recipes/576777-simple-ftp-mirror/
<p style="color: grey">
Python
recipe 576777
by <a href="/recipes/users/4169283/">Thimo Kraemer</a>
(<a href="/recipes/tags/ftp/">ftp</a>, <a href="/recipes/tags/mirror/">mirror</a>).
</p>
<p>A simple tool to create a local or remote mirror over ftp.</p>
Paratessares Time (Python)
2009-01-27T18:43:51-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/576636-paratessares-time/
<p style="color: grey">
Python
recipe 576636
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/paratessares/">paratessares</a>, <a href="/recipes/tags/tessaressunago/">tessaressunago</a>, <a href="/recipes/tags/time/">time</a>).
Revision 3.
</p>
<p>This module provides several functions that covert earth seconds into paratessares time. It is used to implement time keeping on a fictional planet and is the standard time system of Tessaressunago. It can be used as an inspiration to other people creating their own units of time or as partitioned timestamps that can be applied to records. There are four different modules listed below: the standard implementation, a unit test, and two examples. To see the Python 2.5 version of this code in action and to test out its functionality, you can go over to the Utility Mill and find Paratessares_Time in the library ( <a href="http://utilitymill.com/utility/Paratessares_Time" rel="nofollow">http://utilitymill.com/utility/Paratessares_Time</a> ).</p>
sshfs mount tool (Python)
2008-06-24T07:31:22-07:00Sven Bröcklinghttp://code.activestate.com/recipes/users/4158983/http://code.activestate.com/recipes/573473-sshfs-mount-tool/
<p style="color: grey">
Python
recipe 573473
by <a href="/recipes/users/4158983/">Sven Bröckling</a>
.
</p>
<p>This script uses sshfs ans fusermount to mount ssh ressources to local filesystems. It makes it quick to mount with its function to guess a mountname.</p>
simple crawler using twisted (Python)
2007-08-01T05:12:59-07:00Vaibhav Bhatiahttp://code.activestate.com/recipes/users/4007166/http://code.activestate.com/recipes/525493-simple-crawler-using-twisted/
<p style="color: grey">
Python
recipe 525493
by <a href="/recipes/users/4007166/">Vaibhav Bhatia</a>
(<a href="/recipes/tags/network/">network</a>).
</p>
<p>a simple recipe which can be used to download a webpage using twisted. Created this while going through the twisted documentation. supports the following :
- basic authentication
- check whether the page is updated
- progress bar</p>