View get_tds_cert.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
View get_tds_cert.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
View sqlservercert.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
View ansible-role-test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
View 1.my_filter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
View sysv.init.script.to.systemd.unit.file.md
Let's say you have a SysV Init Script
named foo
-
Copy the file to
/etc/init.d/foo
-
Enable the SysV service:
chkconfig --add foo
-
Enable the SysV service:
chkconfig foo on
-
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
-
Edit
/etc/systemd/system/foo.service
by runningsystemctl edit foo.service
, add in the following line tofoo.servie
(this makes the service installable)
[Install]
View wgetinstructions.md
##1 — Install Wget https://www.merenbach.com/software/wget/
##2 — Scrape a Site
wget -m -k -K -E -p http://url/of/web/site
View Yii2_eb_ext.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
View install-cluster-client.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files: | |
"/home/ec2-user/install-cluster-client.sh": | |
mode: "000744" | |
owner: root | |
group: root | |
content: | | |
#!/bin/bash | |
#hide old ini | |
if [ -a /etc/php.d/50-memcached.ini ] | |
then |
NewerOlder