This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| for file in *.html; do; mv "$file" "${file%.html}.txt"; done |
This file contains hidden or 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
| # remove dangling images | |
| docker rmi $(docker images -q -f dangling=true) | |
| # remove dead containers | |
| docker rm $(docker ps -aq) |
This file contains hidden or 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
| # single tunnel | |
| ssh -L <local-ip-on-my-machine>:<local-port-on-my-machine>:\ | |
| <local-ip-on-server>:<local-port-on-server> \ | |
| -C -N <server-user>@<server-ip> | |
| # EXMAPLES | |
| # ------------- | |
| # SINGLE TUNNEL | |
| ssh -L 0.0.0.0:27017:172.17.42.1:27017 -C -N [email protected] | |
| # ------------- |
This file contains hidden or 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 | |
| # Usage: | |
| # - To only show the possbible volumes to be removed: | |
| # ./docker-cleanup-volumes.sh | |
| # - To remove orphaned docker volumes: | |
| # ./docker-cleanup-volumes.sh clean | |
| if [ "$1" == 'clean' ]; then | |
| echo "cleaning..." |