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 | |
#coding=utf-8 | |
import apt | |
import apt_pkg | |
from time import strftime | |
import os | |
import subprocess | |
import sys |
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
--- | |
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
--- | |
- 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
#!/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
# Email account configuration | |
via: smtp | |
fromname: Alex | |
authenticate: true | |
account: | |
hostname: smtp.example.com | |
port: 587 | |
username: alex@example.com | |
password: password | |
tls: true |
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
#!/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) |
NewerOlder