Skip to content

Instantly share code, notes, and snippets.

@ckxng
ckxng / dsa-http-svc-chk
Created Apr 21, 2021
quick ldap dsa healthcheck service
View dsa-http-svc-chk
#!/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 Jan 3, 2021
emergency shell script
View emergency-shell
#!/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
View microsite.cgi
#!/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 Oct 13, 2020
orgmode config
View .emacs
(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 Aug 28, 2020
sample of uos model helper function
View modelhelper.js
/**
* 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 Aug 27, 2020
personal .gitconfig
View .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 Aug 5, 2020
Docker compose for smokeping on RaspberryPI
View docker-compose.yml
---
version: "2"
services:
smokeping:
image: linuxserver/smokeping
container_name: smokeping
environment:
- PUID=1000
- PGID=1000
- TZ=US/Central
View characters-in-input.pl
#!/usr/bin/perl -w
my $h = {};
while(read DATA, $_, 1) {
$h->{$_} = 0 unless $h->{$_};
$h->{$_}++;
}
use Data::Dumper;
print Dumper($h);
@ckxng
ckxng / .block
Last active May 9, 2020
blockbuilder demo
View .block
license: mit
height: 150
@ckxng
ckxng / 01_alpinelvmsetup.sh
Last active Nov 29, 2020
alpine 3.11 lvm setup
View 01_alpinelvmsetup.sh
setup-keymap
setup-hostname
setup-interfaces
setup-dns
hostname=$(cat /etc/hostname)
hostname $hostname
domainname=$(grep search /etc/resolv.conf|cut -f2)
rc-service networking start
passwd
setup-timezone