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
sudo dpkg --purge $(dpkg --list | grep ^rc | awk '{ print $2; }') | |
# alternative | |
# dpkg --list | grep '^rc\b' | awk '{ print $2 }' | xargs sudo dpkg -P |
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 | |
if [ ! $# == 1 ]; then | |
echo "Missing input param, file name." | |
exit 1; | |
fi | |
sizes=(1280 1024 640 320) | |
# make sizes readonly | |
declare -r sizes |
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: pi-cluster | |
tasks: | |
- ping: ~ | |
- name: Update repositories cache | |
apt: | |
update_cache: yes | |
- name: Upgrade all packages to the latest version | |
apt: | |
name: "*" |
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 requests | |
from datetime import timedelta, date | |
def daterange(start_date, end_date): | |
for n in range(int ((end_date - start_date).days)): | |
yield start_date + timedelta(n) | |
headers={'Content-Type', 'application/json'} | |
base_url='http://elasticsearch:9200' |
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/python | |
import yaml | |
def read_hosts_file(file): | |
try: | |
stream = open(file, 'r') | |
hosts = yaml.load(stream) | |
return hosts | |
except IOError: |
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 | |
STAGE="test" | |
CHANNEL="issuing" | |
RSS="/opt/RiskShield/Resources/RS-Server/$CHANNEL/$STAGE/current" | |
jdbc="/opt/RiskShield/Resources/JDBC/ojdbc6.jar" | |
JMS="/opt/RiskShield/Resources/JmsQueue" | |
# works with symlink | |
RSH="/opt/RiskShield/$CHANNEL/$STAGE/DecisionServer" |
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 | |
STAGE="test" | |
CHANNEL="issuing" | |
RSS="/opt/RiskShield/Resources/RS-Server/$CHANNEL/$STAGE/current" | |
jdbc="/opt/RiskShield/Resources/JDBC/ojdbc6.jar" | |
# works with symlink | |
RSH="/opt/RiskShield/$CHANNEL/$STAGE/DataServer" | |
GCLOG="/var/log/RiskShield//$CHANNEL/$STAGE/cur/data_server_gc-$(date +'%Y%m%d%H%M').log" |
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 | |
# --------------------------------------------------------------------------------------------- | |
# Batch file to start the RiskShield Back Office Component (BOC) | |
# ---------------------------------------------------------------------------------------------- | |
export LANG="en_US" | |
STAGE="test" | |
CHANNEL="issuing" |
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
# Download playbook for Elasticsearch | |
--- | |
- hosts: localhost | |
connection: local | |
vars: | |
version: 6.2.4 | |
target_dir: /home/tan/downloads | |
elastic_base_url: https://artifacts.elastic.co/downloads | |
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 | |
# | |
# Usage: logrange-copy.sh myApp 2017-10-17 /srv/nas/logs/myApp/ | |
# param 1: myApp is a prefix and has multiple folders | |
# param 2: 2017-10-17 the upper range for daily iteration | |
# param 3: target directory to copy the files, could also be AWS S3 | |
# | |
# program is used to copy jboss logs for reindexing with elasticsearch | |
# used for logstash | |
# |
OlderNewer