Skip to content

Instantly share code, notes, and snippets.

@tafarij
tafarij / Vagrantfile
Last active December 30, 2015 07:53 — forked from Jakobud/Vagrantfile
Vagrant Windows 260 character path limit workaround
# If you are using Windows as your Vagrant host OS, there is a limitation in Windows where any given folder path
# cannot be more than 260 characters long. This becomes a problem with Vagrant because, for example, if you
# install a Linux guest environment and try to create a deep directory structure in a synced folder, Linux will
# throw errors. This is because the synced folder is under the constraints of the Windows host. A common example
# of this happening is when installing node.js modules. NPM is known for creating some very long, deep
# folder paths because each node depenency has it's own dependencies, which have their own dependencies, etc...
#
# This gist solves the problem and works around the Windows 260 character path limit. Add it to your Vagrantfile.
#
# NOTE: This bug in Vagrant was fixed in 1.7.3, but reverted back in 1.7.4 due to some regression bugs.
@tafarij
tafarij / install-pulse.sh
Created April 22, 2017 13:05
Install Pulse Secure on Ubuntu 16.04
# https://vt4help.service-now.com/kb_view_customer.do?sysparm_article=KB0010740#linux
wget https://secure.nis.vt.edu/resources/downloads/pulse-8.2R5.i386.deb
sudo dpkg –i pulse-8.2R5.i386.deb
/usr/local/pulse/PulseClient.sh install_dependency_packages
@tafarij
tafarij / tlsconfig.go
Last active November 2, 2018 20:24
Go default TLS client config
func defaultTLSClientConfig(caFilePath string, log logger.Logger) {
caCert, err := ioutil.ReadFile(caFilePath)
if err != nil {
log.Fatalf("Error reading CA cert file '%s'. %s", caFilePath, err.Error())
}
caCertPool := x509.NewCertPool()
if ok := caCertPool.AppendCertsFromPEM(caCert); !ok {
log.Fatalf("Error reading CA cert file '%s'. Invalid content.", caFilePath)
}