Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# password for vscode
PASS=XXX
# hostname at duckdns.org
HOST=XXX
# duckdns.org token
DUCK=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
# sysadmin email
EMAIL=XXX@XXX.XXX
import turtle
t = turtle.Turtle()
for c in ['red', 'green', 'yellow', 'blue']:
t.color(c)
t.forward(75)
t.left(90)
@ckxng
ckxng / dsa-http-svc-chk
Created April 21, 2021 16:10
quick ldap dsa healthcheck service
#!/usr/bin/env python3
"""simple socket service simulating an HTTP response to see if LDAP DSA is alive
"""
from subprocess import Popen, PIPE
from json import dumps
import socket
import sys
bind_host = ""
bind_port = 1200
@ckxng
ckxng / emergency-shell
Last active January 3, 2021 14:52
emergency shell script
#!/usr/bin/perl -WT
# Using taint and strict. All variables must be declared and all input must be
# processed before use. The most aggressive settings are used for warnings.
# This script will fail if it is misused or perscribed conditions are not met.
use warnings FATAL => 'all';
use strict;
=head1 NAME
emergency-shell
#!/bin/sh
# parse the page and pagepath from QUERY_STRING
page=$(
echo "${QUERY_STRING}" | \
sed -n 's/^.*page=\([^&]*\).*$/\1/p' | \
sed 's/[^a-zA-Z0-9\/\-_]/X/g'
)
if [ "${page}" = '' ]; then
page='index'
@ckxng
ckxng / .emacs
Created October 13, 2020 08:31
orgmode config
(define-key global-map "\C-ca" 'org-agenda)
(set-time-zone-rule "US/Central")
(require 'org)
(setq org-clock-persist 'history)
(setq org-agenda-files (list "~/org/athenahealth.org"
@ckxng
ckxng / modelhelper.js
Created August 28, 2020 00:33
sample of uos model helper function
/**
* model helper module
*
* This module contains helper functions for interacting with models
*
* @module lib/modelhelper
*/
// jshint.unstable bigint: true
var Members = require("../models/members");
@ckxng
ckxng / .gitconfig
Last active August 27, 2020 06:38
personal .gitconfig
[core]
# on windows:
# autocrlf = true
# on linux:
autocrlf = input
[alias]
lol = log --oneline --decorate --graph --all --color=auto
co = checkout
st = status
ci = commit
@ckxng
ckxng / docker-compose.yml
Created August 5, 2020 23:45
Docker compose for smokeping on RaspberryPI
---
version: "2"
services:
smokeping:
image: linuxserver/smokeping
container_name: smokeping
environment:
- PUID=1000
- PGID=1000
- TZ=US/Central
#!/usr/bin/perl -w
my $h = {};
while(read DATA, $_, 1) {
$h->{$_} = 0 unless $h->{$_};
$h->{$_}++;
}
use Data::Dumper;
print Dumper($h);