Skip to content

Instantly share code, notes, and snippets.

View maxclark's full-sized avatar

Max Clark maxclark

View GitHub Profile
#!/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 / MOTD
Created June 25, 2015 18:16
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
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
@maxclark
maxclark / curl-format.txt
Created March 8, 2018 17:29
curl -w "@curl-format.txt" -o /dev/null -s "hostname"
\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 / fs_rotate.sh
Created April 13, 2018 17:15
Simple script to rotate FreeSWITCH CDRs for our BSS platform
#!/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 / netsapiens-polycom.sh
Created August 26, 2019 18:39
Rename Polycom firmware files for import into NetSapiens Endpoints
#!/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 / random.py
Created August 26, 2019 18:40
Random number generator in Python
#!/usr/bin/env python
from random import randint
for i in range(20):
print(randint(11111,99999))
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