A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
var dns = require('dns'); | |
function reverseLookup(ip) { | |
dns.reverse(ip,function(err,domains){ | |
if(err!=null) callback(err); | |
domains.forEach(function(domain){ | |
dns.lookup(domain,function(err, address, family){ | |
console.log(domain,'[',address,']'); | |
console.log('reverse:',ip==address); |
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
#!/bin/bash | |
# | |
# Litecoin CPU Mining setup on Ubuntu Server | |
# | |
sudo apt-get update; | |
# install prerequisit software/libs | |
sudo apt-get -y install make automake build-essential libcurl4-openssl-dev htop |
/* Sample JavaScript file added with ScriptTag resource. | |
This sample file is meant to teach best practices. | |
Your app will load jQuery if it's not defined. | |
Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7. | |
Your app does not change the definition of $ or jQuery outside the app. | |
Example: if a Shopify theme uses jQuery 1.4.2, both of these statements run in the console will still return '1.4.2' | |
once the app is installed, even if the app uses jQuery 1.9.1: | |
jQuery.fn.jquery => "1.4.2" | |
$.fn.jquery -> "1.4.2" | |
*/ |
mix3d asked for some help using this guide with windows so here we go. This was tested with Windows 10. Run all commands in Git Bash once it's installed.
Github will be the main account and bitbucket the secondary.
#!/bin/bash | |
target_branch="production" | |
working_tree="PATH_TO_DEPLOY" | |
while read oldrev newrev refname | |
do | |
branch=$(git rev-parse --symbolic --abbrev-ref $refname) | |
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then | |
<!-- | |
To force Tomcat to redirect and revert all requested HTTP traffic over to HTTPS, configure the `conf/web.xml` file with the below block. | |
This should be placed at the very end of the file near and above the ending `</webapp>` tag: | |
--> | |
<security-constraint> | |
<web-resource-collection> | |
<web-resource-name>Automatic Forward to HTTPS/SSL | |
</web-resource-name> | |
<url-pattern>/*</url-pattern> | |
</web-resource-collection> |
resource "aws_instance" "web" { | |
ami = "ami-7f89a64f" | |
instance_type = "t1.micro" | |
ebs_block_device { | |
device_name = "/dev/sdg" | |
volume_size = 5 | |
volume_type = "gp2" | |
delete_on_termination = false | |
} | |
} |
curl -L https://github.com/coreos/etcd/releases/download/v2.1.0-rc.0/etcd-v2.1.0-rc.0-linux-amd64.tar.gz -o etcd-v2.1.0-rc.0-linux-amd64.tar.gz
tar xzvf etcd-v2.1.0-rc.0-linux-amd64.tar.gz
cd etcd-v2.1.0-rc.0-linux-amd64
./etcd
by default etcd listening on port 2379 for client communication and on port 2380 for server to server communication
Test