Having trouble installing the latest stable version of tmux?
Save yourself some time and run this little fellow!
- gcc
- wget
#!/bin/bash | |
[ -z "$DOMAIN" ] && DOMAIN=test.example.com | |
[ -z "$DOMAIN_FILE" ] && DOMAIN_FILE=$DOMAIN | |
# Generate Key | |
openssl genrsa -out $DOMAIN_FILE.key 2048 | |
# Generate Certificate Signing Request | |
openssl req -new -sha256 -key $DOMAIN_FILE.key -out $DOMAIN_FILE.csr |
#!/bin/bash | |
echo 'deb http://apt.newrelic.com/debian/ newrelic non-free' | sudo tee /etc/apt/sources.list.d/newrelic.list | |
wget -O- https://download.newrelic.com/548C16BF.gpg | sudo apt-key add - | |
apt-get update | |
apt-get install newrelic-sysmond | |
nrsysmond-config --set license_key=KEY |
# Export | |
mysqldump --result-file=/data/output.sql --default-character-set=latin1 -ec -uUSERNAME -pPASSWORD -h localhost DATABASENAME | |
# Load | |
mysql | |
# > use databasename; | |
## Optional vvv | |
# > set names latin1; | |
# > source /path/to/dump.sql; |
<VirtualHost *:80> | |
# ... | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} | |
</VirtualHost> |
server { | |
# ... | |
# force https-redirects | |
if ($scheme = http) { | |
return 301 https://$server_name$request_uri; | |
} | |
} |
Having trouble installing the latest stable version of tmux?
Save yourself some time and run this little fellow!
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
" Highlight trailing whitespace | |
highlight ExtraWhitespace ctermbg=red guibg=red | |
match ExtraWhitespace /\s\+$/ | |
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ | |
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/ | |
autocmd InsertLeave * match ExtraWhitespace /\s\+$/ | |
autocmd BufWinLeave * call clearmatches() | |
function! TrimWhiteSpace() | |
%s/\s\+$//e | |
endfunction |
# ~/.gitconfig Alias for changelog | |
[alias] | |
cl = !git log --format='format: * %s (%an: %ad) [%h]' --no-merges |
class FooStruct | |
def initialize(attrs) | |
# Create a Singleton Class (Anonymous Class) inheriting from FooStruct | |
klass = ( class << self; self; end ) | |
# Loop through the attributes | |
attrs.each do |attr| | |
# Within the context of the anonymous class... | |
klass.class_eval do | |
# Define accessors for each of the attributes | |
attr_accessor attr.to_sym |