Skip to content

Instantly share code, notes, and snippets.

View bernd's full-sized avatar

Bernd Ahlers bernd

View GitHub Profile
@bernd
bernd / gist:5e83babe15d0b6d48555
Created June 19, 2014 20:06
Oracle Java debconf automation
sudo apt-get install python-software-properties software-properties-common -y
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
sudo apt-get -q -y install oracle-java7-installer
@bernd
bernd / apt-ssl.conf
Created August 26, 2014 14:51
Put into /etc/apt/apt.conf.d to test https repos
Acquire::https::localhost {
Verify-Peer "false";
Verify-Host "false";
CaInfo "/etc/ssl/certs/ca-certificates.crt";
SslCert "/etc/ssl/certs/ssl-cert-snakeoil.pem";
SslKey "/etc/ssl/private/ssl-cert-snakeoil.key";
SslForceVersion "SSLv3";
};
[url "https://github.com/"]
insteadOf = git://github.com/
insteadOf = git@github.com:
insteadOf = gh:
insteadOf = github:
[url "https://github.com/standard-analytics/"]
insteadOf = sa:
[url "https://git.apache.org/repos/asf/"]
insteadOf = apache:
[url "https://github.com/strmpnk/"]
# In Chef, when a resource is defined all its variables are evaluated during
# compile time and the execution of the resource takes place in converge phase.
# So if the value of a particular attribute is changed in converge
# (and not in compile) the resource will be executed with the old value.
# Example problem:
# Let's consider this situation where there are two steps involved in a recipe
# Step 1 is a Ruby block that changes a node attribute. Rubyblocks get executed
# in converge phase
# Step 2 is a Chef resource that makes use of the node attribute that was

Keybase proof

I hereby claim:

  • I am bernd on github.
  • I am bernd (https://keybase.io/bernd) on keybase.
  • I have a public key whose fingerprint is 7A5F 6639 EB94 D8D5 0D2A 3D41 5C0F 95A9 CC47 90E5

To claim this, I am signing this object:

@bernd
bernd / gist:58327
Created February 4, 2009 20:27 — forked from railsdog/gist:58158
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*
"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"
}
function git_prompt {
local dirty=$(parse_git_dirty)
local branch=$(parse_git_branch)
@bernd
bernd / .vimrc
Created February 10, 2010 19:38 — forked from auxesis/.vimrc
" sessions, backups, temporary files
"set backup " Enable creation of backup file.
"set backupdir=~/.vim/backups " Where backups will go.
set directory=~/.vim/tmp " Where temporary files will go.
set viminfo='100,f1
" how long key sequences can take to complete
set timeoutlen=250
" color schemes
" http://vim.wikia.com/wiki/Remove_unwanted_spaces
"
" Removes trailing spaces
function TrimWhiteSpace()
%s/\s*$//
''
:endfunction
au FileWritePre * :call TrimWhiteSpace()
au FileAppendPre * :call TrimWhiteSpace()
module CouchDBAttachments
def attachment(*args)
lambda do |env|
request = ActionDispatch::Request.new(env)
doc = DocWithAttachments.get(request.params[:doc])
serve_attachment(doc, request.params[:path])
end
end
private
# /etc/security/limits.conf
* soft nofile 999999
* hard nofile 999999
root soft nofile 999999
root hard nofile 999999
===========================================================
# /etc/sysctl.conf
# sysctl for maximum tuning