Exhaustive list of SPDX (Software Package Data Exchange) licenses: https://spdx.org/licenses/
# Python3 code below | |
import os | |
import base64 | |
import json | |
from Crypto.Cipher import AES | |
from phpserialize import loads | |
import hashlib | |
import hmac | |
Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.
The basic idea is that C:\Program Files\Git\mingw64\
is your /
directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git
, the mingw64
in this directory is your root. Find it by using pwd -W
).
If you go to that directory, you will find the typical linux root folder structure (bin
, etc
, lib
and so on).
If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so
# run with $> python SimpleRequestHandler.py 8081 | |
from BaseHTTPServer import HTTPServer | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import json, sys | |
port = 8080 | |
if len(sys.argv) == 2: | |
port = int(sys.argv[1]) |
#!/bin/bash | |
# Script that detects arrival,presence,departure of iPhone based on bluetooth. It also execute actions | |
# In this script it terminate SSH sessions when defined device lefts range | |
# Requires: bluetooth, hcitools, curl | |
# Written by Zbyszek Żółkiewski, please visit: http://blog.onefellow.com | |
# Install: | |
# - copy ip_scan.sh to /usr/local/bin/ on your local machine/server | |
# - chmod ugo+x /usr/local/bin/ip_scan.sh | |
# - change 'ip_iphone' variable to point you your iPhone mac-address |
#!/bin/bash | |
# Script that detects arrival,presence,departure of iPhone on local network | |
# Requires arp-scan tool | |
# Written by Zbyszek Żółkiewski, please visit: http://blog.onefellow.com | |
# Install: | |
# - copy ip_scan.sh to /usr/local/bin/ | |
# - chmod ugo+x /usr/local/bin/ip_scan.sh | |
# - change 'ip_iphone' variable to point you your iPhone IP | |
# - option: insert your boxcar_id otherwise comment-out boxcar_send function in action_after_grace | |
# - put into cron: echo "*/1 * * * * root /usr/local/bin/ip_scan.sh" > /etc/cron.d/iphone_scan , or whatever user you want |
#!/usr/bin/env python3 | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
see: https://gist.github.com/UniIsland/3346170 | |
""" | |
#!/usr/bin/env python | |
import argparse | |
import http.server | |
import os | |
class HTTPRequestHandler(http.server.SimpleHTTPRequestHandler): | |
def do_PUT(self): | |
path = self.translate_path(self.path) | |
if path.endswith('/'): |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers