Skip to content

Instantly share code, notes, and snippets.

@ckxng
ckxng / markdown-cli.go
Last active May 31, 2022
golang markdown-cli
View markdown-cli.go
package main
import (
"io/ioutil"
"bytes"
"fmt"
"os"
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/extension"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/renderer/html"
@ckxng
ckxng / minecraft
Last active May 31, 2022
minecraft rc file (freebsd)
View minecraft
#!/bin/sh
# from https://minecraft.fandom.com/wiki/Tutorials/FreeBSD_startup_script
#
# PROVIDE: minecraft
# REQUIRE: LOGIN DAEMON NETWORKING mountcritlocal
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local to enable the minecraft server:
#
# minecraft_enable="YES"
View cub_scout_turtle.py
import turtle
print("Hello World.")
t = turtle.Turtle()
t.color('white')
t.left(90)
t.forward(100)
t.left(270)
View check_port_80.pl
#!/usr/bin/perl
#$Id$
use strict;
use warnings;
my $VERSION=1.000;
=head1 NAME
check_port80.pl
@ckxng
ckxng / chack_mysql.pl
Created Mar 5, 2022
Check MySQL Replication Status
View chack_mysql.pl
#!/usr/bin/perl
# $Id$
use strict;
use warnings;
my $VERSION = 0.006;
my $DEBUG = 1;
sub handle_wrn;
sub handle_err;
View additional-memcached-setup.pl
#!/usr/bin/perl
# Copyright 2012 Cameron King. ISC License
use strict;
use warnings;
# changelog
# 1.00 - initial version
# 1.01 - change apc.include_once_override to 0
sub block2 {
@ckxng
ckxng / mysqldiag.pl
Created Mar 5, 2022
MySQL Diagnostics
View mysqldiag.pl
#!/usr/bin/perl
use strict;
use warnings;
system "mkdir /var/log/sec/" unless -d "/var/log/sec";
my $date=`date -Is`;
chomp $date;
my $fn="/var/log/sec/mysql-diag_${date}_$$.log";
open LOG, ">$fn";
@ckxng
ckxng / puppet-facts.pl
Created Mar 5, 2022
Puppet Facts for Client
View puppet-facts.pl
#!/usr/bin/perl
# Client Xenon Product Facts
# Cameron King <http://cameronking.me>
# Version 1.01 - add magento and wordpress counts
# Version 1.00 - initial version
use warnings;
use strict;
my $VERSION = 1.01;
my %facts = ();
View vscode-server cloudinit user_data
#!/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
View teaching_turtledance.py
import turtle
t = turtle.Turtle()
for c in ['red', 'green', 'yellow', 'blue']:
t.color(c)
t.forward(75)
t.left(90)