Skip to content

Instantly share code, notes, and snippets.

@hartzell
hartzell / failing-test-case.md
Last active January 29, 2020 00:30
Demo of failing and working cases of connecting to files.pythonhosted.org
(alice)[16:00:11]~>>/usr/bin/openssl s_client -connect files.pythonhosted.org:443
CONNECTED(00000005)
depth=1 C = BE, O = GlobalSign nv-sa, CN = GlobalSign CloudSSL CA - SHA256 - G3
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
 0 s:/C=US/ST=California/L=San Francisco/O=Fastly, Inc/CN=r.ssl.fastly.net
   i:/C=BE/O=GlobalSign nv-sa/CN=GlobalSign CloudSSL CA - SHA256 - G3
@hartzell
hartzell / udev
Last active May 20, 2019 17:54
Amazon Linux udev rules
# Copyright (C) 2006-2016 Amazon.com, Inc. or its affiliates.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
@hartzell
hartzell / step-by-step.md
Last active April 24, 2019 02:10
Spack singularity package debugging session

I've fetched/merged your branch and am at commit ec296438fd41b18ea310ea83acf534e8f295a25a.

Here is the definition of source_path for a stage:

Here's the interesting bit, it's returning the first thing that it finds in the output of os.listdir that is a directory (order of things returned by listdir is unspecified):

@hartzell
hartzell / doit.sh
Created February 4, 2019 03:38
Quick/dirty poudriere config to build audio/logitechmediaserver
cp usr_local_etc_poudriere.d_make.conf /usr/local/etc/poudriere.d/make.conf
cp usr_local_etc_poudriere.conf /usr/local/etc/poudriere.conf
echo 'audio/logitechmediaserver' > ./pkglist
sudo mkdir /usr/ports/distfiles
sudo zfs create zroot/poudriere
sudo poudriere jail -c -j 11amd64 -v 11.2-RELEASE
sudo poudriere ports -c -p local
sudo poudriere bulk -f ./pkglist -j 11amd64 -p local
@hartzell
hartzell / doit.sh
Created February 4, 2019 03:38
Quick/dirty poudriere config to build audio/logitechmediaserver
cp usr_local_etc_poudriere.d_make.conf /usr/local/etc/poudriere.d/make.conf
cp usr_local_etc_poudriere.conf /usr/local/etc/poudriere.conf
echo 'audio/logitechmediaserver' > ./pkglist
sudo mkdir /usr/ports/distfiles
sudo zfs create zroot/poudriere
sudo poudriere jail -c -j 11amd64 -v 11.2-RELEASE
sudo poudriere ports -c -p local
sudo poudriere bulk -f ./pkglist -j 11amd64 -p local
@hartzell
hartzell / session.md
Created January 27, 2019 01:37
Adding local networks for Plex in jail
root@helium[/mnt/storage/home/hartzell]# cat /mnt/storage/iocage/jails/plex/root/Plex\ Media\ Server/Preferences.xml
<?xml version="1.0" encoding="utf-8"?>
<Preferences OldestPreviousVersion="1.14.1.5488-cc260c476" MachineIdentifier="7cd0df33-f7a9-48bc-a855-1ea65f46f8b0" ProcessedMachineIdentifier="85517e6e530782f318f9b9b6de5c76baabba18d6" AnonymousMachineIdentifier="514d266b-4d7e-41b0-b1de-935bcc00e5e5" MetricsEpoch="1" allowedNetworks="192.168.42.0/255.255.255.0" AcceptedEULA="1" FriendlyName="helium-plex" PublishServerOnPlexOnlineKey="1" LastAutomaticMappedPort="0"/>
@hartzell
hartzell / singularity-fix-suid.md
Last active July 6, 2018 23:36
Touch up a non-root singularity install

These steps will touch up a non-root install...

libexec_bin=$(spack location -i singularity)/libexec/singularity/bin
suid_files=(action-suid start-suid mount-suid)

for f in "${suid_files[@]}"
do
    sudo chown root:root "${libexec_bin}/${f}"
 sudo chmod 4755 "${libexec_bin}/${f}"
@hartzell
hartzell / spack-install.sh
Last active July 6, 2018 21:12
A script to configure a spack tree and build some things.
#!/bin/sh
set -e
# ask the spack executable the location of root of its tree
export SPACK_ROOT=$(spack location -r)
# having an app tree set up messes up the build. Clear the field.
if [[ $(type -t module) == "function" ]]; then
module purge
fi
@hartzell
hartzell / configparser-is-broken.md
Last active June 20, 2018 17:38
The python module "configparser" is broken.

Importing configparser

The backported configparser is a P.I.T.A..

I tripped across this when trying to use py-jupyter-notebook with my Spack PR that adds dependencies via site.addsitedir(). It fails immediately. That package appears to work if you use "normal" Spack and PYTHONPATH, but it turns out that the only bit that uses configparser is jupyter-nbconvert and that does fail.

@hartzell
hartzell / script-console-job-definition.groovy
Created April 15, 2018 20:56
Demonstration of defining a job interactively from the Jenkins script console
// I end up recreating this every time I need it, so, notes...
// This will run in the Jenkins script console and define a job.
//
import javaposse.jobdsl.dsl.DslScriptLoader
import javaposse.jobdsl.plugin.JenkinsJobManagement
def workspace = new File('.')
def jobManagement = new JenkinsJobManagement(System.out, [:], workspace)