Skip to content

Instantly share code, notes, and snippets.

Avatar

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 pam_u2f.so
@maxclark
maxclark / random.py
Created Aug 26, 2019
Random number generator in Python
View random.py
#!/usr/bin/env python
from random import randint
for i in range(20):
print(randint(11111,99999))
@maxclark
maxclark / netsapiens-polycom.sh
Created Aug 26, 2019
Rename Polycom firmware files for import into NetSapiens Endpoints
View netsapiens-polycom.sh
#!/bin/bash
# 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
maxclark / fs_rotate.sh
Created Apr 13, 2018
Simple script to rotate FreeSWITCH CDRs for our BSS platform
View fs_rotate.sh
#!/bin/sh
SOURCE=/var/log/freeswitch/cdr-csv
PICKUP=/home/cdr/cdr
ARCHIVE=/home/cdr/archive
# Instructs FreeSWITCH to rotate the CDR file
#
#/bin/kill -HUP `cat /usr/local/freeswitch/run/freeswitch.pid`
/usr/bin/fs_cli -x 'cdr_csv rotate'
@maxclark
maxclark / curl-format.txt
Created Mar 8, 2018
curl -w "@curl-format.txt" -o /dev/null -s "hostname"
View curl-format.txt
\n
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
----------\n
time_total: %{time_total}\n
\n
@maxclark
maxclark / MOTD
Created Jun 25, 2015
This MOTD file was adapted from FBI suggestions for system disclosure.
View MOTD
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
personnel.
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
monitored.
Anyone using this system expressly consents to such monitoring and is advised
View smtpLog.pl
#!/usr/bin/perl
#
# 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
maxclark / dedupe.pl
Created Jun 16, 2014
Removes duplicates from the input file (first parameter on command line) and saves clean/dupe files to separate files
View dedupe.pl
#!/usr/bin/perl
# 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 $/;
View keybase.md

Keybase proof

I hereby claim:

  • I am maxclark on github.
  • I am maxclark (https://keybase.io/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
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);
You can’t perform that action at this time.