Skip to content

Instantly share code, notes, and snippets.

View stancel's full-sized avatar

Brad Stancel stancel

View GitHub Profile
@hemc4
hemc4 / Yii2_eb_ext.config
Created April 22, 2016 10:51
Yii2 Elastic Beanstalk configration for advance template
commands:
01cacheClear:
command: rm -rf ~/.composer
02updateComposer:
command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update 1.0.0-alpha11
03globalrequired:
command: export COMPOSER_HOME=/root && /usr/bin/composer.phar global require fxp/composer-asset-plugin:1.1.3
@itsmattsoria
itsmattsoria / wgetinstructions.md
Created September 6, 2016 15:34
Scrape a site and save locally from the command line with Wget
@houtianze
houtianze / sysv.init.script.to.systemd.unit.file.md
Last active February 20, 2024 14:00
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)

[Install]

@tuxfight3r
tuxfight3r / 1.my_filter.py
Created March 14, 2017 12:31
ansible custom filters demo
#place the file in your ansible playbook director under filter_plugins
#/home/user/my_playbook.yml
#/home/user/filter_plugins/my_filters.py
#!/usr/bin/python
class FilterModule(object):
def filters(self):
return {
'a_filter': self.a_filter,
'another_filter': self.b_filter
@geerlingguy
geerlingguy / ansible-role-test.sh
Last active January 18, 2024 17:37
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - 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)
@ecki
ecki / sqlservercert.ps1
Created March 8, 2019 15:38
Powershell to generate self-signed SQL Server TLS certificate
# 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:
@nicolasdao
nicolasdao / elasticbeanstalk_guide.md
Last active December 11, 2023 14:40
Elastic Beanstalk guide. Keywords: elastic bean beanstalk elasticbeanstalk cli eb eb
@Scherlac
Scherlac / get_tds_cert.py
Last active February 14, 2024 15:11 — forked from lnattrass/get_tds_cert.py
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,
@stancel
stancel / get_tds_cert.py
Created August 12, 2021 23:30 — forked from Scherlac/get_tds_cert.py
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,