Skip to content

Instantly share code, notes, and snippets.


Max Clark maxclark

View GitHub Profile
View Yubikey Integration with OSX
brew install pam-u2f
mkdir -p ~/.config/Yubico/
pamu2fcfg > ~/.config/Yubico/u2f_keys
<Press the U2f device>
cat ~/.config/Yubico/u2f_keys # should output <your username>:<really long hash>
In /etc/pam.d/screensaver
Add to the top:
auth sufficient
maxclark /
Created Aug 26, 2019
Random number generator in Python
#!/usr/bin/env python
from random import randint
for i in range(20):
maxclark /
Created Aug 26, 2019
Rename Polycom firmware files for import into NetSapiens Endpoints
# echo "Type the firmware version follwed by [ENTER]"
# read version
# read version<sip.ver
version=`head -1 sip.ver`
echo "$version"
echo "sip${version}-spip321.uc.ld"
maxclark /
Created Apr 13, 2018
Simple script to rotate FreeSWITCH CDRs for our BSS platform
# Instructs FreeSWITCH to rotate the CDR file
#/bin/kill -HUP `cat /usr/local/freeswitch/run/`
/usr/bin/fs_cli -x 'cdr_csv rotate'
maxclark / curl-format.txt
Created Mar 8, 2018
curl -w "@curl-format.txt" -o /dev/null -s "hostname"
View curl-format.txt
time_namelookup: %{time_namelookup}\n
time_connect: %{time_connect}\n
time_appconnect: %{time_appconnect}\n
time_pretransfer: %{time_pretransfer}\n
time_redirect: %{time_redirect}\n
time_starttransfer: %{time_starttransfer}\n
time_total: %{time_total}\n
maxclark / MOTD
Created Jun 25, 2015
This MOTD file was adapted from FBI suggestions for system disclosure.
This system is for the use of authorized users only. Individuals using this
system without authority, or in excess of their authority, are subject to having
all of their activities on this system monitored and recorded by system
In the course of monitoring individuals improperly using this system, or in the
course of system maintenance, the activities of authorized users may also be
Anyone using this system expressly consents to such monitoring and is advised
# Small program that writes email data to a database
# for logging purposes and monthly analysis.
use strict;
use Getopt::Long;
use MIME::Words qw(:all);
use DBI;
maxclark /
Created Jun 16, 2014
Removes duplicates from the input file (first parameter on command line) and saves clean/dupe files to separate files
# removes duplicates from the input file (first parameter on command line) and saves clean/dupe files to separate files
$file = $ARGV[0];
open (FILE, $file);
open (CLEAN, ">clean.txt");
open (DUPES, ">dupes.txt");
#undef $/;

Keybase proof

I hereby claim:

  • I am maxclark on github.
  • I am maxclark ( on keybase.
  • I have a public key whose fingerprint is B984 3C33 4A9D 2094 B29D 936C 7565 2AA3 9705 A61A

To claim this, I am signing this object:

maxclark / range.sql
Last active Aug 29, 2015
Repeat a query inserting a range of numbers
View range.sql
INSERT into orig_route_cos_dest (orig_route_id, priority, class_dest, final)
SELECT gs.i, '1', 'bg:14', 't' f
FROM generate_series(417, 437) gs(i);