Skip to content

Instantly share code, notes, and snippets.


Brad Stancel stancel

View GitHub Profile
ecki / sqlservercert.ps1
Created Mar 8, 2019
Powershell to generate self-signed SQL Server TLS certificate
View sqlservercert.ps1
# Create Self Signed RSA Cert for SQL Server usage
# Customize:
# + -Subject should contain hostname (or virtal name for FCI)
# + -FriendlyName is anything which helps you to recognize the key
# + -DnsName should list all variants (FQDN) of hostnames used by clients (VIP+Machines)
# + -NotAfter set expire accoring to your policy
# + (Non)Exportable is more secure but harder to manage
# - Using RSASSA-PSS (-AlternateSignatureAlgorithm) does not work with Java 8 clients:
geerlingguy /
Last active Aug 7, 2022
Ansible Role Test Shim Script
# Ansible role test shim.
# Usage: [OPTIONS] ./tests/
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
paulirish /
Last active Aug 7, 2022
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$" "$extension_id%26uc" 
unzip -d "$extension_id-source" "$"

Thx to crxviewer for the magic download URL.

naholyr /
Created Dec 13, 2012
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.


Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
outadoc / pushover
Last active Jun 18, 2022
Pushover Bash Script
View pushover
if [ $# -eq 0 ]; then
echo "Usage: ./pushover <message> [title]"
nmcgann / install-cluster-client.config
Created Jan 13, 2016
AWS Elastic Beanstalk .ebextensions config to install Elasticache memcached cluster client (PHP 5.6)
View install-cluster-client.config
mode: "000744"
owner: root
group: root
content: |
#hide old ini
if [ -a /etc/php.d/50-memcached.ini ]
tuxfight3r /
Created Mar 14, 2017
ansible custom filters demo
#place the file in your ansible playbook director under filter_plugins
class FilterModule(object):
def filters(self):
return {
'a_filter': self.a_filter,
'another_filter': self.b_filter
houtianze /
Last active Dec 21, 2021
Convert SysV Init scripts to Systemd Unit File

Let's say you have a SysV Init Script named foo

  1. Copy the file to /etc/init.d/foo

  2. Enable the SysV service: chkconfig --add foo

  3. Enable the SysV service: chkconfig foo on

  4. Start the service: service foo start. After this, systemd-sysv-generator will generate this file /run/systemd/generator.late/foo.service, copy this file to /etc/systemd/system by running: cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service

  5. Edit /etc/systemd/system/foo.service by running systemctl edit foo.service, add in the following line to foo.servie (this makes the service installable)


Scherlac /
Last active Nov 8, 2021 — forked from lnattrass/
A terrible way to connect to MS SQL Server and dump the certificate as a PEM
import sys
import pprint
import struct
import socket
import ssl
from time import sleep
# Standard "HELLO" message for TDS
prelogin_msg = bytearray([ 0x12, 0x01, 0x00, 0x2f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x06, 0x01, 0x00, 0x20,
0x00, 0x01, 0x02, 0x00, 0x21, 0x00, 0x01, 0x03, 0x00, 0x22, 0x00, 0x04, 0x04, 0x00, 0x26, 0x00,
bickart / repair.php
Created Apr 26, 2013
How to perform a SugarCRM Quick Repair and Rebuild from the line
View repair.php
* Copyright 2013
* Jeff Bickart
* @bickart
* jeff @