Skip to content

Instantly share code, notes, and snippets.

View idc77's full-sized avatar
💭
Bite My Shiny Metal Ass

idc77

💭
Bite My Shiny Metal Ass
View GitHub Profile
@davidvanvickle
davidvanvickle / urlencode.js
Created July 25, 2012 00:50
JS urlencode
function URLEncode (clearString) {
var output = '';
var x = 0;
clearString = clearString.toString();
var regex = /(^[a-zA-Z0-9_.]*)/;
while (x < clearString.length) {
var match = regex.exec(clearString.substr(x));
if (match != null && match.length > 1 && match[1] != '') {
output += match[1];
x += match[1].length;
@samba
samba / htpasswd-ssl.sh
Created June 13, 2014 16:21
htpasswd replacement with openssl
#!/bin/sh
# Writes an APR1-format password hash to the provided <htpasswd-file> for a provided <username>
# This is useful where an alternative web server (e.g. nginx) supports APR1 but no `htpasswd` is installed.
# The APR1 format provides signifcantly stronger password validation, and is described here:
# http://httpd.apache.org/docs/current/misc/password_encryptions.html
help (){
cat <<EOF
Usage: $0 <htpasswd-file> <username>