Skip to content

Instantly share code, notes, and snippets.

View kksudo's full-sized avatar
:octocat:
Software is like sex: It’s better when it’s free.

Kirill kksudo

:octocat:
Software is like sex: It’s better when it’s free.
View GitHub Profile
@kksudo
kksudo / certificate_synthetic.js
Created April 7, 2022 15:15 — forked from adamcrews/certificate_synthetic.js
New Relic SSL/TLS Synthetic
/*
To use this synthetic, set the following Secure credentials:
NEW_RELIC_INSIGHTS_API_KEY - Your api key from the account settings.
NEW_RELIC_ACCOUNT_ID - Your account ID, also found in the account settings.
CERTS_TO_MONITOR - A list of hosts to check via https, separated by a comma and a space, for example:
host.example.com, foo.example.com
Create a new Synthetic monitor, copy the entire contents of this script to the monitor.
Set the monitor to run once a day from a single location.
@kksudo
kksudo / ipaddr_demo.rb
Last active August 29, 2015 14:25 — forked from Lax/ipaddr_demo.rb
Ruby IPAddr class, inet_aton and inet_ntoa equivalence.
require 'ipaddr'
IPAddr.new("192.168.0.1").to_i
=> 3232235521
IPAddr.new(3232235521, Socket::AF_INET).to_s
=> "192.168.0.1"
#!/bin/sh
# ./convert_ploop_to_simfs.sh VEID
# chmod +x convert_ploop_to_simfs.sh
rsync_options='-aHAX --progress --stats --numeric-ids --delete'
partition='vz'
if [ ! -e /etc/vz/conf/$1.conf ]; then
echo "Virtual server configuration file: /etc/vz/conf/$1.conf does not exist."
exit 1
fi
if [ ! -d /$partition/private/$1/root.hdd ]; then