This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setting a new alias | |
git config --global --add alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit --all" | |
# using the new alias | |
git lol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/bin/docker run \ | |
--restart=always \ | |
-d \ | |
--name logs-elasticsearch_1 \ | |
-v /data/logs_elasticsearch/config:/usr/share/elasticsearch/config -v /data/logs_elasticsearch/data:/usr/share/elasticsearch/data \ | |
-p 172.17.42.1:9200:9200 -p 172.17.42.1:9300:9300 \ | |
elasticsearch:1.5.0 | |
/usr/bin/docker run \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SERVER_IP=<MY_SERVER_IP> | |
# copy cloud-config.yml to the server | |
scp cloud-config.yml core@$SERVER_IP:~/ | |
# validate cloud-config file | |
ssh core@$SERVER_IP "coreos-cloudinit -validate --from-file ~/cloud-config.yml" | |
if [[ $? == "0" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template, redirect, url_for | |
from flask.ext.sqlalchemy import SQLAlchemy | |
app = Flask(__name__) | |
app.config.from_object('config') | |
db = SQLAlchemy(app) | |
# Basic Routes # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$FG[245]%}git:(" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$FG[245]%})%{$reset_color%} " | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
ZSH_THEME_SVN_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX | |
ZSH_THEME_SVN_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX | |
ZSH_THEME_SVN_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY | |
ZSH_THEME_SVN_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN | |
vcs_status() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var libxmljs = require("libxmljs"); | |
var xml = [ | |
'<?xml version="1.0" encoding="utf-8"?>', | |
'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">', | |
' <soap:Body>', | |
' <Response xmlns="http://tempuri.org/">', | |
' <Result>', | |
' <client xmlns="">', | |
' <msg>SEARCH OK.</msg>', | |
' <code>0</code>', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Check all existing Docker containers for their mapped paths, and then purge any | |
zombie directories in docker's volumes directory which don't correspond to an | |
existing container. | |
""" | |
import logging | |
import os | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof x !=== 'undefined' && x !=== '') { | |
// not emtpy | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -H "Content-Type: application/json" -d '{ "field": "value" }' http://someurl.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^(?!One|Two|Four)+.* |