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
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: | |
This CloudFormation stack sets an IAM Password Policy for an account. It uses | |
a custom resource to manage the policy. Note that IAM password policies are | |
global, and this will apply to all regions--not just the region you create | |
the stack in. | |
Parameters: | |
# CIS Benchmark Check 1.5 | |
RequireUppercaseChars: |
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
#!/usr/bin/env python3 | |
# coding: utf-8 | |
""" | |
EC2Backup | |
A tool for encrypting EC2 volumes | |
Inspried by https://github.com/jbrt/ec2cryptomatic | |
""" | |
import argparse |
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
#!/usr/bin/env bash | |
#set -x | |
usage() | |
{ | |
cat << EOF | |
remove-expired-index.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
--- | |
- hosts: all | |
vars: | |
root_password: xxx | |
common_user_password: xxx | |
common_user_name: deploy | |
ssh_port: 22 | |
remote_user: root |
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 | |
LDAP_URI="ldap://ldap.company.cn:3268" | |
BIND="cn=infosys,ou=Group,dc=company,dc=local" | |
BASE="dc=company,dc=local" | |
PASSWORD="password" | |
userid=$1 | |
res=`ldapsearch -x -H $LDAP_URI -b $BASE -D $BIND -w $PASSWORD "(sAMAccountName=${userid})" -LLL msExchUserAccountControl | grep msExchUserAccountControl | awk -F' ' '{print $2}'` |
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
#!/usr/bin/env bash | |
# set -x | |
PG_PRIMARY='db1.example.com' | |
PG_STANDBY='db2.example.com' | |
PG_ROLE='user' | |
PG_DB='test' | |
PASSWORD='password' | |
primary_xloc=$(PGPASSWORD=$PASSWORD psql -U$PG_ROLE -d $PG_DB -h $PG_PRIMARY -q -t -A -c 'select * from pg_current_xlog_location()' | cut -c 3- | bc) |
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
from ansible.runner import Runner | |
# Path to VM host list | |
VM_HOSTS = '/home/ubuntu/workspace/ansible/hosts' | |
def generate_ssh_keys(remote_user, remote_ip): | |
"""Generate ssh keys on remote server by calling Ansible API | |
and Ansible user module. | |
Args: |
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
SELECT COUNT(c.change_id) | |
FROM changes c, accounts a | |
WHERE c.created_on >= (now() - interval '1 year') | |
AND c.owner_account_id = a.account_id | |
AND a.preferred_email similar to '%@gmail.com'; |
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
\documentclass{ctexart} | |
\usepackage[a4paper,hmargin={4cm},vmargin={4cm}]{geometry} | |
\usepackage{fancyhdr} | |
\pagestyle{empty} | |
\fancyhf{} | |
\usepackage{tikz} | |
\usetikzlibrary{shapes,snakes} | |
\begin{document} | |
%书法用纸效果:田字格(10*14)、米字格 |
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
#! /usr/bin/env python | |
import requests | |
from tabulate import tabulate | |
# iPhone SE Model or any other MODEL | |
MODEL = 'MLYC2LL/A' | |
# local zipcode | |
ZIPCODE = '02148' | |
QUERY_URI = 'http://www.apple.com/shop/retail/pickup-message' |
NewerOlder