Skip to content

Instantly share code, notes, and snippets.

View henkmeulekamp's full-sized avatar

HJ Meulekamp henkmeulekamp

View GitHub Profile
@henkmeulekamp
henkmeulekamp / applications.ps1
Last active April 4, 2025 13:52
Powershell Cleanup Old NewRelic Apps
# walk through all applications and delete the ones that are not reporting, ask per app
#
# Create this file .credential-config with
#{
# "newrelictoken": "your-newrelic-api-key"
#}
# if in repo, make sure .credential-config is in .gitignore
$configFile = ".\.credential-config"
$newrelicUrlApplications = "https://api.newrelic.com/v2/applications.json"
@henkmeulekamp
henkmeulekamp / docker-compose.yml
Last active November 4, 2024 16:28
Kafka UI test
networks:
redpanda-kafka-network:
driver: bridge
attachable: true
services:
zookeeper:
container_name: zookeeper-all
image: confluentinc/cp-zookeeper:7.2.2
restart: no
@henkmeulekamp
henkmeulekamp / rfc-resources.md
Created June 23, 2022 09:45
writing-rfc-resources.md

Note page to drop all interestign articles on the topic

Why RFC/Design docs writing

Building up an engineering writing culture through design docs/rfcs.

  • Time efficiency. Sharing ideas through writing eliminates the need for repetitive verbal updates to disseminate ideas and information.
  • Knowledge sharing. Documenting important ideas forces clarity of thought and makes information more accessible to everyone in the company, versus slide decks that are ephemeral and require less rigor of thought.
  • Communication. Clear writing requires clear thinking, meaning employees invest more time shaping their ideas before sharing them.
@henkmeulekamp
henkmeulekamp / uncheck-all.js
Created November 10, 2016 14:00
Uncheck all checkboxes in page by bookmark toolbar
// Uncheck all checkboxes in browser page (for example big confluence checkbox list used for releases)
// make new bookmarkbar button and copy in following javascript, name it uncheck or something
javascript:function iprl5() { var d=document,b=d.body; try{ if(!b) throw(0); var checkboxes = d.getElementsByTagName("LI"); for(var i=0, n=checkboxes.length;i<n;i++) { checkboxes[i].classList.remove("checked"); } }catch(e) {alert('Please wait until the page has loaded.'); } }iprl5() ;void(0)
@henkmeulekamp
henkmeulekamp / pagerduty-daily-maintenance.ps1
Created July 7, 2014 15:07
Powershell script to create recurring maintenance windows in PagerDuty
param (
[int]$numberOfDaysForward = 365,
[string]$requesterId = "XXXXXXXXx", #pagerduty-userid
[string]$apiKey = "XXXXXXXXXXXXXXX", #pagerduty api-key
[string]$pagerdutyUrl = "https://XXXXXXX.pagerduty.com", #https://[account-name].pagerduty.com
[string]$description = "Daily Blackout Hours 2:30 to 4am", #description of maintenance window
[string]$serviceIDs="'XXXXXX', 'XXXXXX', 'XXXXXX'", #serviceIds of services to set in maintenance "'ABC123', 'ABC100', 'ABC101'"
[string]$start = "2014-07-07T02:30:00", # "yyyy-MM-ddTHH:mm:ss"
[string]$end = "2014-07-07T04:00:00" # "yyyy-MM-ddTHH:mm:ss"
)
@henkmeulekamp
henkmeulekamp / pagerduty-maintenance.ps1
Created May 26, 2014 20:27
Powershell script to set Pagerduty in maintenance mode for x minutes
param (
[int]$minutes = 3,
[string]$requesterId = "<your-pager-duty-user-id>",
[string]$apiKey = "<your-pager-duty-api-token>",
[string]$description = "Deploy new version of app",
[string]$serviceIDs = "'<serviceId1>', '<serviceId2>', '<serviceId..>'"
)
function Execute-HTTPPostCommand() {
param(
@henkmeulekamp
henkmeulekamp / newrelic-deployment.ps1
Last active May 7, 2018 08:05
Powershell script to inform NewRelic of deployment; parameterized
param (
[string]$appname = "<your-newrelic-appname>",
[string]$appid = "<your-newrelic-appid>",
[string]$apiKey = "<your-newrelic-api-key>"
)
function Execute-HTTPPostCommand() {
param(
[string] $target = $null,
[string] $postParam,
@henkmeulekamp
henkmeulekamp / restore-logs.ps1
Created September 16, 2012 16:08
PowerShell script to restore TRN into Standby readonly SQL2008R2 database
-------------------
## henk meulekamp - 2012-09-14
## Script to restore transaction log (.TRN files) into office readonly copy
$logBackupFolder="D:\sshRoot"
$server = "smtpserver"
$toemail ="monitor email"
$fromemail ="sender email"
$nl = [Environment]::NewLine
##Variable for time duration - the amount of time you need to generate and restore LOG backups
@henkmeulekamp
henkmeulekamp / EnumerableXmlReader_stream.cs
Created July 31, 2012 23:59
Enumerable stream Xnodes
public IEnumerable<T> Stream<T>(string nodeName)
{
//move to content
_reader.MoveToContent();
// Parse the file by node
while (_reader.Read())
{
switch (_reader.NodeType)
{
case XmlNodeType.Element: