Skip to content

Instantly share code, notes, and snippets.

View np422's full-sized avatar

Niklas Paulsson np422

View GitHub Profile
#Requires -Version 3.0
# Configure a Windows host for remote management with Ansible
# -----------------------------------------------------------
#
# This script checks the current WinRM (PS Remoting) configuration and makes
# the necessary changes to allow Ansible to connect, authenticate and
# execute PowerShell commands.
#
# IMPORTANT: This script uses self-signed certificates and authentication mechanisms
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'time'
require 'gelf'
require 'optparse'
def banner
puts 'Usage: gelf_sender -k kmsg -r rate -s msg_size -d dest_ip -p dest_port -b batch_size -t'
puts ''
Go to https://www.base64decode.org/
Paste the string below and click on decode.
aHR0cHM6Ly93d3cuZnJpYXRpZGVyLnNlLzIyLWFyaW5nZW4tdmlsbGUtYWthLWhlbS10aWxsLWFmZ2hhbmlzdGFuLW1lbi1maWNrLWludGUKCmh0dHBzOi8vbnloZXRlcmlkYWcuc2UvdXBwZ2lmdGVyLXZldGxhbmRhYWZnaGFuZW4tc3VsdGFuaS12cmFsYWRlLWFsbGFodS1ha2Jhci1uYXItaGFuLWhvZ2ctc2l0dC1vZmZlci8=
log = Syslog::Logger.new 'app-epr-dashboard'
date_sent_perfdata = Date.today - 1.day
n_logmsg_sent = 0
N_LOGMESSAGES_PER_DAY = 20
SCHEDULER.every '300s' do
url1 = "https://issue.admin.conextrade.com/"
board_id = 3
c = JSONClient.new
@np422
np422 / parse_vcloud_xml.rb
Created August 24, 2016 13:47
Small script to parse xml-output from vcloud api
#!/usr/bin/env ruby
require "json"
require "crack"
myXML = Crack::XML.parse(File.read( ARGV[0] ))
myJSON = myXML.to_json
vAPP = JSON.parse(myJSON)
@np422
np422 / format_helper.rb
Last active February 29, 2016 03:32
Ruby script to print any process environment variables on stdout
#
# 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
#!/bin/bash
# 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

Documentation

  • 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
@np422
np422 / gist:4493859
Last active December 10, 2015 21:18
Server Software: Microsoft-IIS/7.5
Server Hostname: 10.0.0.15
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