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
<VirtualHost *:80> | |
RewriteEngine on | |
ReWriteCond %{SERVER_PORT} !^443$ | |
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] | |
</VirtualHost> | |
HTTP to HTTPS redirect in apache, requires mod_ssl and mod_rewrite | |
Goes in httpd.conf (CentOS, RHEL) or sites-enabled/{site} file |
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 this: | |
---------- | |
csv_file = csv.DictReader(open(sys.argv[2], 'r')) | |
To This: | |
-------- | |
with open(sys.argv[2], 'r') as csv_file: | |
csv_data = csv.DictReader(csv_file) | |
for row in csv_data: | |
... |
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
Oscar | |
https://github.com/adrienthebo/oscar | |
Puppet Debugging Kit | |
https://github.com/Sharpie/puppet-debugging-kit | |
Beaker | |
https://github.com/puppetlabs/beaker | |
Hiera |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
} | |
export PS1='\[\e[0;95m[\] \u\[\e[0;97m\]@\[\e[0;92m\]\h: $(parse_git_branch) \[\e[0;97m\]\W \[\e[0;95m\]] $\[\e[0m\] ' |
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
showmount -e nasserver | |
sudo mount -t nfs -o resvport,rw nasserver:/opt/storage ~/storage/ | |
sudo umount -f ~/storage |
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
require 'erb' | |
module TemplateVariables | |
def self.construct(variables) | |
b = get_binding | |
variables.each do |key, value| | |
b.local_variable_set(key, value) | |
end | |
b |
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 ruby | |
require 'sqlite3' | |
db = SQLite3::Database.new("locations.db") | |
def getAllLocations() | |
return db.execute("SELCT name FROM locations") | |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1='\[\e[33;34m\]\u\[\e[0;97m\]@\[\e[33;32m\]\h\[\e[33;31m\]$(parse_git_branch)\[\e[0m\] \[\e[0;97m\]\W \[\e[33;40m\]->\[\e[0m\] ' |
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
dm() { | |
case $1 in | |
ip ) | |
docker-machine ip $DOCKER_MACHINE_NAME | |
;; | |
set ) | |
eval $(docker-machine env $2) | |
;; | |
* ) | |
docker-machine $@ |
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
class StaticController < ApplicationController | |
def welcome | |
end | |
def scoreboard | |
@teams = Array.new | |
@bargraph = Array.new | |
@scoreboard = Hash.new | |
@colors = ['#FF1493','#F08080','#DC143C','#FF4500','#FF0000','#FFD700','#008000','#32CD32','#40E0D0','#4169E1','#9370DB'] | |
Team.blueteams.includes([services_for_scoring: :checks_for_scoring]).each do |team| |
OlderNewer