Skip to content

Instantly share code, notes, and snippets.

@nathansgreen
nathansgreen / gs-resample.sh
Created December 22, 2022 16:17 — forked from lkraider/gs-resample.sh
Ghostscript PDF quality downsample
#!/bin/sh
# It seems it's very hard to set resample output quality with Ghostscript.
# So instead rely on `prepress` preset parameter to select a good /QFactor
# and override the options we don't want from there.
gs \
-o resampled.pdf \
-sDEVICE=pdfwrite \
-dPDFSETTINGS=/prepress \
@nathansgreen
nathansgreen / perl-recent-version-compat.patch
Last active October 30, 2019 15:25 — forked from xywei/patch.txt
A patch for automake to compile it with later versions of Perl
Allow recent versions of Perl to compile automake.
For Yocto. Tested on poky (krogoth branch).
From https://gist.github.com/xywei/03b546054f0d2e2f76c5ac530c88268a
--- a/bin/automake.in 2015-01-06 03:25:55.000000000 +0800
+++ b/bin/automake.in 2017-07-26 13:58:07.086205701 +0800
@@ -3878,7 +3878,7 @@
sub substitute_ac_subst_variables
{
my ($text) = @_;
@nathansgreen
nathansgreen / cloud-init.sh
Created December 6, 2017 15:44 — forked from ambakshi/cloud-init.sh
Amazon Linux cloud-init script
#!/bin/bash
#
# Amazon Linux cloud-init script
#
# Amit Bakshi
# 10/2014
#
if [ `id -u` -ne 0 ]; then
sudo exec /bin/bash -x "$0" "$@"
fi
@nathansgreen
nathansgreen / postgresql-debugger-install-macos
Last active January 18, 2023 04:04 — forked from jhngrant/postgresql-debugger-install-ubuntu
Installing the PL/pgSQL Debugger Extension (pldbgapi) for pgAdmin III on PostgreSQL 9.4 and MacOS
# First install database
brew install postgres
# Clone and build the PL/pgSQL server-side debugger
srcdir=/usr/local/src
[ -e "$scrdir" ] || \
sudo sh -c "mkdir $srcdir && chgrp admin $srcdir && chmod g+w $srcdir"
cd "$srcdir"
# Thanks to this post:
# http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x
which cabextract>/dev/null || which brew>/dev/null || { echo Please install Homebrew!; exit 1; }
install() {
local url=https://sourceforge.net/projects/mscorefonts2/files/cabs/PowerPointViewer.exe
which cabextract>/dev/null || brew install cabextract
mkdir -P ~/tmp/consolas \
&& pushd ~/tmp/consolals \
&& curl -LO "${url}" \