ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install caskroom/cask/brew-cask
brew tap caskroom/versions
brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup
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
# OSX for Hackers (Mavericks/Yosemite) | |
# | |
# Source: https://gist.github.com/brandonb927/3195465 | |
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Ask for the administrator password upfront |
open a tty to the docker container
docker exec -it [container-id] bash
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/perl -s | |
# | |
# solo v1.6 | |
# Prevents multiple cron instances from running simultaneously. | |
# | |
# Copyright 2007-2013 Timothy Kay | |
# http://timkay.com/solo/ | |
# | |
# It is free software; you can redistribute it and/or modify it under the terms of either: | |
# |
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
public class IncomingSms extends BroadcastReceiver { | |
// Get the object of SmsManager | |
final SmsManager sms = SmsManager.getDefault(); | |
public void onReceive(Context context, Intent intent) { | |
// Retrieves a map of extended data from the intent. | |
final Bundle bundle = intent.getExtras(); | |
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
Dir.glob('/home/git/repositories/**/*.git') do |item| | |
hook = "#{item}/hooks" | |
if not File.symlink?(hook) | |
puts "Updating #{hook}" | |
File.rename(hook, "#{hook}.old") | |
File.symlink("/home/git/gitlab-shell/hooks", hook) | |
end | |
end |
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 | |
# Get id, name and ip adresses of all active docker container | |
function do_get_ip_address() { | |
paste <(sudo docker ps | tail -n +2 | awk {'printf "%s\t%s\n", $1, $2 '}) <(sudo docker ps -q | xargs sudo docker inspect | tail -n +2 | grep \"IPAddress\" | awk '{ print $2 }' | tr -d ',"') | |
} | |
# stop and remove a container based on his id | |
function do_stop_rm_container() { | |
[ -z "$1" ] && echo "Give me a container ID" && return |
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 | |
# add vhost reverse proxy for new docker instance for nginx and restart nginx | |
# use like this : do_nginx_proxy_vhost subdir.example.com http://192.168.0.20:8080 | |
function do_nginx_proxy_vhost() { | |
[ -z $1 -o -z $2 ] && echo "Give host and address" && return | |
host=$1 | |
address=$2 | |
[ -f /etc/nginx/sites-available/proxy_reverse_$host ] && (echo "Updating proxy for host: $host" && sudo rm /etc/nginx/sites-enabled/proxy_reverse_$host) || echo "Creating proxy for host: $host" |
Data directories are created in /home/coreos
and mounted into the container using volume cli options of docker run. All data the container writes is stored on the host and as long as the host persists safe against container restarts / recreates.
- Pro
- No effort, just create the directories and mount them into the container
- Contra
- Container is bound to host (unable to failover)
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
{ | |
"title": "Apache and Tomcat Logs", | |
"services": { | |
"query": { | |
"list": { | |
"0": { | |
"query": "apache !tomcat !static", | |
"alias": "", | |
"color": "#7EB26D", | |
"id": 0, |