Skip to content

Instantly share code, notes, and snippets.

Ryan Punt rpunt

Block or report user

Report or block rpunt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View unifi_jail_file_transfer_from_host.sh
# get jail paths
root@freenas:~ > jls
JID IP Address Hostname Path
3 unifi /mnt/default/iocage/jails/unifi/root
root@freenas: > mv ~/keystore /mnt/default/iocage/jails/unifi/root/usr/local/share/java/unifi/data/
View unifi_dns_record.sh
# Create a DNS record in a Unifi USG
# ssh to USG
configure
# create an A record
set system static-host-mapping host-name HOSTNAME inet IPADDRESS
# create a CNAME
set system static-host-mapping host-name HOSTNAME alias CNAME
@rpunt
rpunt / unifi_keystore_gen.sh
Last active Feb 16, 2019
Generate a keystore for Unifi controllers
View unifi_keystore_gen.sh
#!/bin/bash
# Assumptions:
# ./unifi.pem is the signed cert you wish to use
# ./unifi.key is the private key
# ./chain.pem is the CA chain for your issuer, ordered intermediates to root (descending)
# /var/lib/unifi/keystore is the appropriate path for your Keystore; may vary by distro (tested on Debian 8)
openssl pkcs12 -export \
-in unifi.pem \
@rpunt
rpunt / ntpconfig.ps1
Created Jan 21, 2019
Configure NTP on windows server
View ntpconfig.ps1
# from an elevated prompt
Stop-service w32time
w32tm /config /syncfromflags:manual /manualpeerlist:"server1.domain.tld,server2.domain.tld"
w32tm /config /reliable:yes
start-service w32time
# get sync status
W32tm /query /status
View gitconfig
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
since = !git log $(git merge-base --fork-point master)..HEAD
files-changed="!f() { git log --name-only $1..HEAD --oneline --format=%n ${2:-.} | grep -v '^$' | sort | uniq; }; f"
@rpunt
rpunt / 01-install-xenapp-6.ps1
Last active Jun 21, 2017
A fully-automated, silent install for XenApp 6 Enterprise on Server 2008 R2.
View 01-install-xenapp-6.ps1
# This install assumes a couple things:
#
# 1. You're logged in as a local admin, per Citrix recommendations
# 2. These script files are store in d:\software\citrix6
# 3. The installation media for XenApp 6 has been unpacked in d:\software\citrix6\citrix6
# 4. The MSIs for Hotfix Rollup 2 and Profile Manager are located in d:\software\citrix6\citrix6\addons
# (these can be excluded by skipping "04-01-install-patches.bat"
#
# This install occurs across four reboots, and is complete unattended; you can kick it off
# when logged in via RDP or at the console, and let it run to completion. Run time is
View keybase.md

Keybase proof

I hereby claim:

  • I am rpunt on github.
  • I am rpunt (https://keybase.io/rpunt) on keybase.
  • I have a public key whose fingerprint is BF55 A76A E67F F3A1 2E09 E08F ED47 262D 3FF6 076A

To claim this, I am signing this object:

@rpunt
rpunt / parallel_pull.sh
Last active Aug 16, 2016
Parallel git pulls
View parallel_pull.sh
#!/usr/bin/env bash
superpull() {
dir=$1
error_repos=$2
cd $dir
STATUS=`mktemp`
echo -e "\n************************************\n* Pulling $dir\n************************************" >$STATUS
git checkout master 1>>$STATUS 2>&1
if [[ $? != 0 ]]; then
@rpunt
rpunt / retrieve_rooms_from_roomlists.mm
Created Mar 16, 2013
A SOAP message that will retrieve a list of rooms in a roomlist from Exchange 2010.
View retrieve_rooms_from_roomlists.mm
// given the e-mail address of a roomlist, this SOAP message will retrieve the member rooms.
NSString *roomlist = @"roomlist1@domain.tld" // this is the e-mail address of the room list you're querying
NSLog(@"querying roomlist %@", roomlist);
NSString *soapMessage = [NSString stringWithFormat:@""
@"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
@"<soap:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\" xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\">"
@"<soap:Header>"
@"<t:RequestServerVersion Version =\"Exchange2010_SP2\"/>"
@"</soap:Header>"
@rpunt
rpunt / conferenceroom_schedule_SOAP_message.mm
Created Mar 16, 2013
A SOAP message that will retrieve a conference room's schedule for the day in Exchange 2010.
View conferenceroom_schedule_SOAP_message.mm
// for some reason, Exchange Web Services seems to ignore the DST-specific bias settings, and only refer to the
// master bias.
// set the master bias here.
int bias = abs([[NSTimeZone systemTimeZone] secondsFromGMT] / 60);
NSString *soapMessage = [NSString stringWithFormat:@""
@"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
@"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\">"
@"<soap:Body>"
@"<GetUserAvailabilityRequest xmlns=\"http://schemas.microsoft.com/exchange/services/2006/messages\" xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\">"
You can’t perform that action at this time.