Skip to content

Instantly share code, notes, and snippets.

@airways
airways / meeseeks.php
Last active September 27, 2022 01:48
I'm Mr. Meeseeks the PHP Encryption Tool, look at me!
<?php
// I'm Mr. Meeseeks the PHP Encryption Tool, look at me!
//
// Cobbled together with great trepidation by Blueapples.
//
// Visit me at Blueapples.org
//
// Version 1.0, 2022-09-26.
define('LF', "\n");
@airways
airways / migrate_model.py
Created May 27, 2022 17:14
This is a reusable model migration tool which we use internally to move data from one # host to another for our hosted CRM.
################################################################################
# NNS CRM #
################################################################################
# This is a reusable model migration tool which we use internally to move data from one
# host to another for our hosted CRM. Might be useful to other people using Django in
# multi-tenant situation.
#
# This has been released under the MIT License by Near North Software, LLC.
#
# https://www.nearnorthsoftware.com/
@airways
airways / fix-filenames.ps1
Created February 18, 2022 21:51
Remove non-ascii characters from filenames
# This will allow for the files to be zipped by the built-in Explorer "Compress to ZIP file" command
function FixFilenames {
pwd
$Files = gci
$Files | ForEach-Object {
$OldName = $_.Name
$NewName = $OldName -replace "[^\u0020-\u007F]", "_"
if ( $OldName -ne $NewName ) {
echo "$OldName -> $NewName"
@airways
airways / youtube unsubscribe all.js
Last active September 3, 2021 00:30
Remove all youtube subscriptions
/*
* Instructions:
* 1) Go to https://www.youtube.com/feed/channels
* 2) Right click and click Inspect
* 3) Click Console tab
* 4) Paste the snippet below.
* 5) Keep page open until you see "Done" in a dialog box.
* 6) You may need to refresh the page and paste the snippet again. Sometimes it can't get them all beacuse of how YouTube loads the list.
*/
var subs = Array.from(document.getElementsByClassName('ytd-subscribe-button-renderer'));
@echo off
set /p domain="Enter Domain: "
set OPENSSL_CONF=../conf/openssl.cnf
if not exist .\%domain% mkdir .\%domain%
set dir="%cd%"
cd ..\php
..\php\extras\openssl\openssl.exe req -config %dir%\cert.conf -new -sha256 -newkey rsa:2048 -nodes -keyout %dir%\%domain%\server.key -x509 -days 365 -out %dir%\%domain%\server.crt
@airways
airways / softsalefile-to-license.php
Created April 15, 2020 17:05 — forked from cgi-caesar/softsalefile-to-license.php
Soft File to License Scheme Plugin
<?php
/**
* @title Soft File to License Scheme
* @path application/default/plugins/misc/softsalefile-to-license.php
*/
class Am_Plugin_SoftsalefileToLicense extends Am_Plugin
{
const PLUGIN_STATUS = self::STATUS_PRODUCTION;
@airways
airways / ppp.sh
Created June 30, 2017 22:19
Start pppd if ethernet connection has no network, kill it if ethernet comes up
#!/bin/sh
CONNECTION=1
while [ 1 ]
do
if ping -q -c 1 -w 1 -I eth0 google.com > /dev/null ; then
if [ $CONNECTION -eq 0 ] ; then
echo "Ethernet connection is up, killing pppd"
killall pppd

Keybase proof

I hereby claim:

  • I am airways on github.
  • I am airways (https://keybase.io/airways) on keybase.
  • I have a public key ASA3E-SpXPxLruHW3Az8XZ56s7rQszUvQQt5Pe2UPaKa_Qo

To claim this, I am signing this object:

@airways
airways / IOHelper.php
Last active July 30, 2018 08:29
Custom hook to allow plugins for Craft CMS to inject custom "file kinds" into IOHelper. Patch is at very end of snipped IOHelper.php. Example plugin hook at end of YourPlugin.php
<?php
namespace Craft;
/**
* Class IOHelper
*
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
* @copyright Copyright (c) 2014, Pixel & Tonic, Inc.
* @license http://craftcms.com/license Craft License Agreement
* @see http://craftcms.com
@airways
airways / notification.html
Created August 3, 2016 18:49
Basic ProForm notification template
{fields}
{if field_type != "hidden"}
{field_label}: {field_value}
{/if}
{/fields}