Skip to content

Instantly share code, notes, and snippets.

View pkhamre's full-sized avatar
🎯
Focusing

Pål-Kristian Hamre pkhamre

🎯
Focusing
View GitHub Profile
@pkhamre
pkhamre / graph.html
Created March 12, 2014 09:20
Simple google graph
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Day', 'Number of 502s'],
['2013-01-20', 372],
@pkhamre
pkhamre / gtaftw.md
Last active November 12, 2016 18:49
#gtaftw PSN handles

PSN username handles

Nick PSN handle
denis denizb
eric aatland
espen fooobaar
Flums Flumsen
jonas Zergnomen
norvald norvald
export RED='\e[0;31m'
export GREEN='\e[0;32m'
export RET_SMILEY='$(if [[ $RET = 0 ]]; then echo -ne "\[$GREEN\]:)"; else echo -ne "\[$RED\]:("; fi;)'
export PS1="\[$(tput sgr0)$(tput setaf 5)\]\u@\h\[$(tput sgr0)\]:\[$(tput sgr0)$(tput setaf 4)\]\w\[$(tput sgr0)$(tput setaf 2)\] $RET_SMILEY \[$(tput sgr0)\]"
# GPG Public key for: Pål-Kristian Hamre (Devops guy) <paal.hamre@mintra.no>
export GPGKEY=AB3A7698
export JAVA_HOME="/opt/jdk-1.6.0_38-linux-x64/"
export JDK_HOME="/opt/jdk-1.6.0_38-linux-x64/"
#export JAVA_HOME="/usr/lib/jvm/java-6-openjdk-amd64/"
export PATH=~/bin/:${PATH}
export MAVEN_OPTS='-Xms512m -XX:MaxPermSize=1024m -Xmx2048m'
# Set TERM to xterm
@pkhamre
pkhamre / init.pp
Created November 26, 2012 09:06
Puppet-module: tomcat6
# Class: tomcat6
#
# This modules installs and sets up tomcat6.
#
# Requires:
# Ubuntu 11.10
# Ubuntu 12.04
# Note: Not tested on other distributions.
#
# Sample usage:
@pkhamre
pkhamre / init.pp
Created November 7, 2012 11:12
ruby::rubygems
# Class: ruby
#
# This modules installs ruby1.8
#
# Requires:
# Ubuntu
#
# Sample usage:
#
# Standard usage:
@pkhamre
pkhamre / README.md
Created September 13, 2012 12:02
Pingdom maintenance window

Pingdom maintenance window

A simple ruby-script which uses em-http-request to send an API request to the Pingdom API to pause or unpause all checks.

@pkhamre
pkhamre / readme.markdown
Created July 3, 2012 08:21
Installing graphite 0.9.10 on Amazon Linux

Installing required packages

sudo yum groupinstall "Development tools"
sudo yum install python-devel.noarch
sudo yum install pycairo.x86_64 Django.noarch django-tagging.noarch  python-twisted.noarch python-zope-interface.x86_64
sudo yum install fontconfig.x86_64 fontconfig-devel.x86_64
sudo yum install mod_wsgi.x86_64
sudo yum install python-pip.noarch

sudo pip-python install whisper

sudo pip-python install carbon

@pkhamre
pkhamre / handlers.json
Created March 27, 2012 11:18
Sensu handlers
{
"handlers": {
"default": {
"type": "set",
"handlers": ["mailer", "json"]
},
"mailer": {
"type": "pipe",
"command": "/etc/sensu/handler/mailer.rb"
},
@pkhamre
pkhamre / wp.sh
Created March 13, 2012 15:09
WordPress file permissions
#!/bin/bash
PATH=/bin:/usr/bin
WEBROOT="/var/www/www.example.com"
UPLOADS="${WEBROOT}/wp-content/uploads"
chown -R nobody:nogroup ${WEBROOT}
find ${WEBROOT} -type d -exec chmod 0555 {} \;
find ${WEBROOT} -type f -exec chmod 0444 {} \;