Skip to content

Instantly share code, notes, and snippets.

From 9ed72ef140d40bc1ccea5911b38fa78e7faea160 Mon Sep 17 00:00:00 2001
From: Dan Aloni <[email protected]>
Date: Wed, 1 Apr 2020 12:28:15 +0300
Subject: [PATCH 1/2] Support a script to be executed when the device goes up
This adds the `ifup_script` config option. The script receives the
following environment variables as input:
- NET_DEVICE: The name of the network device of the VPN.
- DNS_SUFFIX: DNS domain search prefix, if provided by the VPN server.

See Darkadia profile

Game name Status
Bowser’s Fury Credits *
Donkey Kong Country Credits
Donkey Kong Country 2 Credits
Donkey Kong Country 3 Credits
Donkey Kong Country: Tropical Freeze Credits
Mario vs Donkey Kong Credits+
@Tatsh
Tatsh / gist:89c700d8d3ab33293a04c0f059f70aa2
Last active March 6, 2021 22:13
HPLIP: Skip installation of plug-in

The HPLIP UI is sometimes very buggy when it comes a) detecting plug-ins are already installed, and b) downloading the ones from HP's site. This has been my experience.

This page shows the list of supported devices and whether they need a plugin and for what reason. If you only want to use printing functionality of your device and your print functionality does not require a plugin, you can skip plugin installation with the steps below.

  1. Install HPLIP the normal way on your distro.
  2. As root, edit /usr/share/hplip/data/models/models.dat (or equivalent path).
  3. Find your device model in the file. It will be in underscore_style and may not be exactly what is written on your box or device. I have the Color LaserJet MFP M277dw, so I search for m277dw.
  4. Find the line in this section that says plugin=1. Change this to plugin=0.
  5. Restart hp-setup.
@Tatsh
Tatsh / chrome-clear-host-cache.js
Last active December 6, 2020 04:47
JXA script to clear Chrome's DNS cache. May not be totally reliable. Only for demonstration of how to run JS in Chrome from JXA.
#!/usr/bin/osascript -l JavaScript
ObjC.import('stdlib')
const t = Application('Google Chrome')
.windows[0]
.activeTab()
t.url = 'chrome://net-internals/#dns'
delay(0.5)
t.execute({
javascript: 'document.querySelector("#dns-view-clear-cache").click()'
})
@Tatsh
Tatsh / missing.md
Last active January 16, 2021 11:26
Big Sur MacPorts migration notes

Fixed

  • git-lfs
  • binary only: shellcheck Trac PR
  • binary only: pandoc Trac
  • duti PR
  • pinentry-mac (to install gnupg2) PR
  • EnvPane - added missing dependency discount
@Tatsh
Tatsh / build-retroarch-ios.sh
Created November 3, 2020 03:39
Build RetroArch scripts
#!/usr/bin/env bash
set -e
SIGNING_IDENTITY=-
mkdir -p ~/dev/retroarch
cd ~/dev/retroarch
if ! [ -d retroarch ]; then
git clone https://github.com/libretro/RetroArch.git retroarch
fi
@Tatsh
Tatsh / pf-faq46.txt
Created September 24, 2020 01:00
This is the closest-matching documentation for macOS' version of PF.
==============================================================================
Language: en [teams]
de fr it nl pl pt ru
PF: The OpenBSD Packet Filter
------------------------------------------------------------------------------
Table of Contents
#!/usr/bin/env python
from datetime import datetime
from os import fstat
from struct import unpack
from typing import (Any, BinaryIO, Mapping, MutableMapping, List, Optional,
Sequence, Union, cast)
import json
import sys
__all__ = ('SolMapping', 'parse_sol')
#!/usr/bin/env python
from dataclasses import dataclass
from os.path import isdir, join
from struct import unpack
from typing import Optional, Tuple
import logging
import os
import sys
__all__ = ('extract_concatenated_oggs', )