Skip to content

Instantly share code, notes, and snippets.

Niklas Paulsson np422

  • Sverige
Block or report user

Report or block np422

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View jira.rb
log = 'app-epr-dashboard'
date_sent_perfdata = -
n_logmsg_sent = 0
SCHEDULER.every '300s' do
url1 = ""
board_id = 3
c =
np422 / parse_vcloud_xml.rb
Created Aug 24, 2016
Small script to parse xml-output from vcloud api
View parse_vcloud_xml.rb
#!/usr/bin/env ruby
require "json"
require "crack"
myXML = Crack::XML.parse( ARGV[0] ))
myJSON = myXML.to_json
vAPP = JSON.parse(myJSON)
np422 / format_helper.rb
Last active Feb 29, 2016
Ruby script to print any process environment variables on stdout
View format_helper.rb
# Formatting functions and constants
class FormatHelper
require 'English'
attr_reader :terminal_lines, :terminal_columns
# Returns a FormatHelper that know about your current terminal
# and how to format the key,value pairs in the hash envpairs
# for output
# sudo apt-get install xvfb feh
# edit the screen resolution below to suite your display
trap "pkill xvfb ; pkill gnome-terminal ; exit" SIGINT SIGTERM SIGHUP
( xvfb-run -a -s "-screen 0 1920x1080x24 -fbdir /var/tmp" /usr/bin/gnome-terminal --window --full-screen --hide-menubar --geometry=1920x1080+0+0 --disable-fa\
ctory -e htop ) 2>&1 >/dev/null &
while $(true)

Ideal Postgres environment


  • Documented replication topology
  • Documented network topology
  • Documented interface topology - including users, passwords, connection estimates, load balancers, connection proxies
  • Documented procedure, schedule for failover and testing
  • Documented procedure, schedule for disaster recovery and testing
View gist:4493859
Server Software: Microsoft-IIS/7.5
Server Hostname:
Server Port: 80
Document Path: /TIPS_Bilder/Artikelbilder/farg_656243_S.png
Document Length: 5595 bytes
Concurrency Level: 200
Time taken for tests: 0.066 seconds
Complete requests: 1000
View go_home_php_you_are_drunk.php
echo ( TRUE ? "a" : TRUE ? "b" : "c" ) . "\n";
View gist:4256765
# encoding: UTF-8
IRB.conf[:USE_READLINE] = true
IRB.conf[:SAVE_HISTORY] = 200
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
View gist:3980707
xtest=# set lc_numeric='en_US.UTF-8';
xtest=# select to_char(2.34,'999D99');
(1 row)
xtest=# set lc_numeric='sv_SE.UTF-8';
You can’t perform that action at this time.