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
# ag <https://github.com/ggreer/the_silver_searcher> | |
# usage: ag-replace.sh [search] [replace] | |
# caveats: will choke if either arguments contain a forward slash | |
# notes: will back up changed files to *.bak files | |
ag -l $1 | xargs perl -pi.bak -e "s/$1/$2/g" | |
# or if you prefer sed's regex syntax: | |
ag -l $1 | xargs sed -ri.bak -e "s/$1/$2/g" |
#!/usr/bin/python | |
# vim: fileencoding=utf-8 | |
u'''Translate YAML written text to graphviz dot language | |
Input YAML text like below: | |
--- | |
employee: | |
- name | |
- age |
/* | |
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
*/ | |
var http = require('http'), | |
fs = require('fs'), | |
util = require('util'); | |
http.createServer(function (req, res) { | |
var path = 'video.mp4'; |
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
#!/usr/bin/env bash | |
# install docker | |
# https://docs.docker.com/engine/installation/linux/ubuntulinux/ | |
# install docker-compose | |
# https://docs.docker.com/compose/install/ | |
# install letsencrypt | |
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04 |
# Fail2Ban configuration file | |
# | |
# Author: Russell Odom <russ@gloomytrousers.co.uk> | |
# Adapted for sendmail by: Mike A. Leonetti | |
# Sends a complaint e-mail to addresses listed in the whois record for an | |
# offending IP address. | |
# | |
# You should provide the <logpath> in the jail config - lines from the log | |
# matching the given IP address will be provided in the complaint as evidence. | |
# |
#It's not directly mentioned in the documentation on how to do this, so here you go. This command will tunnel everything including DNS: | |
sshuttle --dns -vr user@yourserver.com 0/0 --ssh-cmd 'ssh -i /your/key/path.pem' |
# Build | |
IMAGEID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1) && sudo docker build -t $IMAGEID . | |
# Run new container | |
CONTAINER_ID=$(sudo docker run -t -d -p 0.0.0.0:81:80 $IMAGEID) | |
# Login into running containe. REQUIRES DOCKER >= 1.3 | |
sudo docker exec -it $CONTAINER_ID bash | |
# !!! DEPRECATED !!! Login into running container. REQUIRES DOCKER < 0.9 |
<!DOCTYPE html> | |
<html lang="en"> | |
<body ng-app="myapp" ng-controller="UploadCtrl"> | |
<input type="file" file-change="upload"> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> | |
<script> | |
// the javascript | |
var app = angular.module('myapp', []); |
FROM docker.elastic.co/elasticsearch/elasticsearch:5.5.1 | |
RUN \ | |
mv /usr/share/elasticsearch/plugins/x-pack /usr/share/elasticsearch/plugins/.removing-x-pack && \ | |
mv /usr/share/elasticsearch/plugins/.removing-x-pack /usr/share/elasticsearch/plugins/x-pack && \ | |
/usr/share/elasticsearch/bin/elasticsearch-plugin remove x-pack |