#Here is how I keep my secrets out of my source code when working with OpenShift
-
find your app's ssh address:
rhc app show YOUR_APP_NAME
-
ssh into your gear to set your environment variables:
ssh YOUR_APPS_SSH_URL
<?xml version='1.0'?> | |
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> | |
<fontconfig> | |
<match target='font' > | |
<edit mode='assign' name='rgba' > | |
<const>rgb</const> | |
</edit> | |
</match> | |
<match target='font' > | |
<edit mode='assign' name='hinting' > |
require 'sinatra' | |
require 'haml' | |
$users = {'john' => {:roles => [:user] }, 'mike' => {:roles => [:user, :admin] } } | |
$tokens = {'123' => {:username => 'john', :expires_at => Time.now+60}} | |
helpers do | |
def authenticate_user! | |
@auth_token = auth_token | |
if $tokens.has_key?(@auth_token) && !$tokens[@auth_token][:expires_at].nil? && $tokens[@auth_token][:expires_at] > Time.now |
#!/bin/bash | |
# | |
# Copy data from a Time Machine volume mounted on a Linux box. | |
# | |
# Usage: copy-from-time-machine.sh <source> <target> | |
# | |
# source: the source directory inside a time machine backup | |
# target: the target directory in which to copy the reconstructed | |
# directory trees. Created if it does not exists. | |
# |
% nvim | |
*** buffer overflow detected ***: nvim terminated | |
======= Backtrace: ========= | |
/lib/x86_64-linux-gnu/libc.so.6(+0x741cf)[0x7fea042751cf] | |
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7fea0430cb2c] | |
/lib/x86_64-linux-gnu/libc.so.6(+0x10a9f0)[0x7fea0430b9f0] | |
nvim(eval_init+0x5a)[0x4e3853] | |
nvim(main+0x80)[0x42b5bc] | |
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fea04222ec5] | |
nvim[0x42d21c] |
#set-option -g default-terminal "screen-256color" | |
#set -g default-terminal "screen-256color" | |
set -g mode-mouse on | |
set-window-option -g mode-mouse on | |
# remap prefix to Control + a | |
set -g prefix C-a | |
unbind C-b | |
bind C-a send-prefix |
for i in *.JPG; do exiv2 -v -r '%Y-%-m-%d_%H-%M%-%S' rename "$i"; done |
# Turn DD-WRT wireless radio on for business hours only. Verify wireless interface for your router model. | |
# Place in WebUI > Administration > Management > Cron | |
0 18 * * 1,2,3,4,5 root wl -i eth1 radio off | |
0 6 * * 1,2,3,4,5 root wl -i eth1 radio on |
# sass style sheet generation | |
get '/css/:file.css' do | |
halt 404 unless File.exist?("views/#{params[:file]}.scss") | |
time = File.stat("views/#{params[:file]}.scss").ctime | |
last_modified(time) | |
scss params[:file].intern | |
end |
#Here is how I keep my secrets out of my source code when working with OpenShift
find your app's ssh address:
rhc app show YOUR_APP_NAME
ssh into your gear to set your environment variables:
ssh YOUR_APPS_SSH_URL
class Hash | |
alias_method :original, :[] | |
def [](*keys) | |
keys.uniq! | |
if keys[1] | |
keys.map { |key| original key } | |
else | |
original keys[0] | |
end | |
end |