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
# Email account configuration | |
via: smtp | |
fromname: Alex | |
authenticate: true | |
account: | |
hostname: smtp.example.com | |
port: 587 | |
username: [email protected] | |
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
#! /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' |
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
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
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
#!/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
#!/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
--- | |
- 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 bash | |
#set -x | |
usage() | |
{ | |
cat << EOF | |
remove-expired-index.sh |
OlderNewer