Skip to content

Instantly share code, notes, and snippets.

@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 / 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"

Installing and configuring dwm on OS X

  1. Install X11.app (it's on the OS X install disk or something.)

  2. Install dwm. You have to customize config.h a bit:

    1. Replace { MODKEY|ShiftMask, XK_q, quit, {0} }, with { MODKEY|ControlMask, XK_q, quit, {0} }, to avoid colliding with the Log Out shortcut in the Apple menu.

    If you install dwm from Homebrew, brew install dwm, this is done automatically.

@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'));
@airways
airways / 1 dist.config.php
Created November 1, 2011 00:44
Simple, single ExpressionEngine configuration file to override almost all paths and server settings. As used by @airways and @litzinger.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// Simple, single configuration file to override almost all paths and server settings. As used by @airways
// and @litzinger.
// Only check in the default as dist.config.php, set your version control system to ignore config.php so that
// local users and each instance (staging, production) can have their own settings.
// These config files are mainly meant to be used on a shared development server used by all developers,
// although it works almost as well for local development as well.
@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 / gist:877661
Created March 19, 2011 17:52
Lightweight Mac OS X / Linux
  • X11.app X server
  • Fink and MacPorts package managers
    • (may replace MacPorts with Homebrew and use Fink only for things not found in Homebrew such as FireFox and nedit)
  • From source tar balls
    • dwm tiling window manager
  • Fink
    • FireFox (browser)
    • Alpine (email)
  • nedit - language mode files (including PHP): http://www.nedit.org/ftp/contrib/highlighting/
@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