Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| Set AppObj = CreateObject("Shell.Application") | |
| If WScript.Arguments.Length=1 Then | |
| AppObj.ShellExecute "C:\Console2\Console.exe", " -t ""Git Bash"" -d """ & WScript.Arguments(0) & """" | |
| Else | |
| AppObj.ShellExecute "C:\Console2\Console.exe", " -t ""Git Bash""" | |
| End If |
| # bourne shell functions below take 1 argument, the file_to_hash. | |
| # prints hex digest on stdout | |
| md5() { | |
| perl -MDigest::MD5=md5_hex -le'print md5_hex(<> or die)' "$1" | |
| # ruby -rdigest/md5 -e"puts Digest::MD5.file'/dev/null'" | |
| # python -sBc "import hashlib;print hashlib.md5(open('$1','rb').read()).hexdigest()" | |
| # md5 "$1"|cut -d' ' -f4 # mac | |
| # md5sum "$1"|cut -d' ' -f1 # linux | |
| # openssl md5 "$1" | grep -o '[[:xdigit:]][[:xdigit:]]*$' | cat |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| package main | |
| import ( | |
| "io" | |
| "log" | |
| "mime/multipart" | |
| "net/http" | |
| "os" | |
| "path/filepath" | |
| "runtime" |
| #!/usr/bin/env bash | |
| # | |
| ############################################################################## | |
| # Copyright 2002-2013 LAMP/EPFL | |
| # | |
| # This is free software; see the distribution for copying conditions. | |
| # There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A | |
| # PARTICULAR PURPOSE. | |
| ############################################################################## |
| # Something in lines of http://stackoverflow.com/questions/348630/how-can-i-download-all-emails-with-attachments-from-gmail | |
| # Make sure you have IMAP enabled in your gmail settings. | |
| # Right now it won't download same file name twice even if their contents are different. | |
| import email | |
| import getpass, imaplib | |
| import os | |
| import sys | |
| detach_dir = '.' |
| require 'ruby-box' #gem install ruby-box | |
| require 'term/ansicolor' #gem install term-ansicolor | |
| include Term::ANSIColor | |
| MODIFIED_AT_CUTOFF = Time.new(2013,7,1) | |
| session = RubyBox::Session.new({ | |
| client_id: "YOUR_CLIENT_ID", | |
| client_secret: "YOUR_CLIENT_SECRET", |
| #******************************************************************************* | |
| # chpy.py | |
| # Zac Hester <[email protected]> | |
| # 2012-08-07 | |
| # | |
| # Change the Windows file association for .py to a given Python interpretor. | |
| # | |
| # For usage examples, type: | |
| # chpy.py help | |
| # |
| #!/usr/bin/env/python | |
| # | |
| # More of a reference of using jinaj2 without actual template files. | |
| # This is great for a simple output transformation to standard out. | |
| # | |
| # Of course you will need to "sudo pip install jinja2" first! | |
| # | |
| # I like to refer to the following to remember how to use jinja2 :) | |
| # http://jinja.pocoo.org/docs/templates/ | |
| # |