Skip to content

Instantly share code, notes, and snippets.

View ptheywood's full-sized avatar

Peter Heywood ptheywood

View GitHub Profile
@ptheywood
ptheywood / compress-pdf.py
Created July 1, 2019 12:20
Ghostcript compressionutility of PDF through python.
#!/usr/bin/python3
"""
Python script to compress PDF files using ghostscript.
@author Peter Heywood
"""
import os
import subprocess
import argparse
@ptheywood
ptheywood / cat-and-scale-pdfs.shq
Created July 30, 2019 14:31
Combine 2 PDFS of (potentially) different scales
#! /bin/bash
A="a.pdf"
B="b.pdf"
DATE=$(date '+%Y-%m-%d')
OUTFILE="combined-$DATE.pdf"
# Get the page size from each pdf A and B
@ptheywood
ptheywood / fix-nm-fortisslvpn-21.04.md
Last active December 8, 2021 11:40
Probably partial instructions for fixing network-manager-fortisslvpn peer dns on ubuntu 21.04

Fortisslvpn in ubuntu 21.04 (and some earlier versions) does not peer dns correctly since a fortivpn update changed a default parameter. The ubuntu package has not been patched in 2+ years.

The best way to fix this so far, is to manually build a patched .deb to install. These instructions are crude and may be missing dependencies.

@todo - It would be better to alter the package version info so it is newer than that provided by apt repos to avoid needing to hold the package back

  1. Modify /etc/apt/sources.list, uncommenting the line deb-src http://gb.archive.ubuntu.com/ubuntu/ hirsute universe or equivalent
  2. sudo apt-get update
  3. Make and change to a temporary directory. mkdir -p /tmp/fortisslvpn && cd /tmp/fortisslvpn
@ptheywood
ptheywood / CUB-1.5.0-CUDA-11.6.log
Created January 18, 2022 10:43
GitHub Actions Runner log for CUB 1.5.0 Windows.h error, with CUB 1.5.0 and CUDA 11.6 https://github.com/ptheywood/cub-1.15-windows.h-demo/runs/4851931940?check_suite_focus=true
2022-01-18T10:35:37.2325348Z Found online and idle hosted runner in the current repository's organization account that matches the required labels: 'windows-2019'
2022-01-18T10:35:37.3729653Z Waiting for a Hosted runner in the 'organization' to pick this job...
2022-01-18T10:35:37.9295304Z Job is waiting for a hosted runner to come online.
2022-01-18T10:35:44.3060532Z Job is about to start running on the hosted runner: GitHub Actions 12 (hosted)
2022-01-18T10:35:48.2924904Z Current runner version: '2.286.0'
2022-01-18T10:35:48.2953129Z ##[group]Operating System
2022-01-18T10:35:48.2953683Z Microsoft Windows Server 2019
2022-01-18T10:35:48.2953983Z 10.0.17763
2022-01-18T10:35:48.2954228Z Datacenter
2022-01-18T10:35:48.2954526Z ##[endgroup]