Skip to content

Instantly share code, notes, and snippets.

@dnagir
dnagir / async_smtp_delivery_method.rb
Created February 10, 2012 03:38
Threaded mail delivery in rails
# lib/async_smtp_delivery_method.rb
require 'mail'
class AsyncSmtpDeliveryMethod
def initialize(settings)
@settings = settings
end
def deliver!(mail)
@pfreixes
pfreixes / gist:3187511
Created July 27, 2012 11:36
Supervisorctl bash autocomplete
# pfreixes, 2012-07-27
# Add to /etc/bash_completion.d/supervisorctl
_supervisor()
{
local cur prev opts base
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
@nrk
nrk / MasterSlaveClusterInitializer.php
Created February 15, 2013 11:47
This is an example of a cluster (client-side sharding) of "virtual" nodes each one configured in a master/slave replication setup.
<?php
namespace Nrk\Predis;
use Nrk\Predis\Connection\MasterSlaveWrapperConnection;
use Predis\Cluster\Distribution\HashRing;
use Predis\Connection\PredisCluster;
use Predis\Option\ClientOptions;
class MasterSlaveClusterInitializer
@blacktm
blacktm / install_ruby_rpi.sh
Last active May 26, 2024 15:13
A Bash script to install Ruby on the Raspberry Pi
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Set the Ruby version you want to install
@thomasst
thomasst / migrate-redis.py
Created May 14, 2015 18:26
Migrate Redis data on Amazon ElastiCache
"""
Copies all keys from the source Redis host to the destination Redis host.
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are
restricted (e.g. on Amazon ElastiCache).
The script scans through the keyspace of the given database number and uses
a pipeline of DUMP and RESTORE commands to migrate the keys.
Requires Redis 2.8.0 or higher.
@motleytech
motleytech / casper.md
Created June 21, 2016 01:00
Deal with casper

Unofficial Guide to JAMF Casper

This page documents the external/internal behavior of Casper.

Files

Casper installed itself into the following directories:

  • /Library/Application Support/JAMF
    • ManagementFrameworkScripts - a set of scripts that runs on certain events
      • StartupScript.sh - Activated when jamf is started
      • loginhook.sh - Activated when user login
  • logouthook.sh - Activated when user logout
@hrhnick
hrhnick / setup.sh
Created October 18, 2017 15:18
Mac setup script..
#!/bin/bash
## A Mac Setup Script by Nicholas Bonczyk
## v. 0.1
####
## Clear terminal screen
####
@a7ul
a7ul / jamf.md
Last active May 31, 2024 15:49
removing all restrictions on jamf managed macos device - Provided you have root access.

REMOVE JAMF RESTRICTIONS ON MAC

REMOVE ONLY RESTRICTIONS

sudo jamf removeMDMProfile removes all restrictions

sudo jamf manage brings back all restrictions and profiles

REMOVE ALL RESTRICTIONS AND DISABLE JAMF BINARIES WHILE KEEPING YOUR ACCESS TO VPN AND OTHER SERVICES

sudo jamf removeMDMProfile removes all restrictions

@notsure2
notsure2 / build-qbittorrent-ubuntu-16.04-static.sh
Last active July 3, 2021 12:23
How to compile latest qBittorrent-nox with static qt, boost and openssl for Ubuntu 16.04 xenial (using Ubuntu 16.04 xenial)
#!/bin/bash
set -e
apt update -y
apt install -y build-essential git perl python2.7 python2.7-dev zlib1g-dev autoconf libicu-dev pkg-config perl ccache
OPENSSL_TAG=OpenSSL_1_1_1-stable
QBITTORRENT_TAG=v4_2_x
LIBTORRENT_TAG=RC_1_2
QT5_TAG=5.14
BOOST_VER=1.72.0
@windix
windix / README.md
Last active March 30, 2024 10:23
RP2040-Keyboard.ino