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 | |
# Downloads all the log files for a selected instance on a given day. Then | |
# generates a report using pgbadger. | |
# Requirements: | |
# - AWS CLI (https://github.com/aws/aws-cli) | |
# - pgbadger (https://github.com/darold/pgbadger) | |
# How to use: | |
# rds-logs-report <instance_id> <date> |
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
# more settings: https://pastebin.com/4ZCTcf7m | |
# set prefix to Ctrl-a | |
set-option -g prefix C-a | |
unbind-key C-a | |
bind-key C-a send-prefix | |
# use Alt-arraw keys to switch panes | |
bind -n M-Left select-pane -L | |
bind -n M-Right select-pane -R |
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 pandas as pd | |
from sqlalchemy import create_engine | |
driver = "postgresql" | |
server = "" | |
port = "5432" | |
database = "" | |
uid = "" | |
pwd = "" |
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
# customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
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
# modified from http://stackoverflow.com/a/2728344 | |
# iterate through all characters of a string | |
# returns true if all characters are chinese and false otherwise | |
def is_chinese(str) | |
result = nil | |
unless str.nil? | |
# put utf of each character in array | |
list_of_chars = str.unpack("U*") | |
# control if each character is a chinese character | |
# breaks if find a non chinese character |
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
# Ignore bundler config. | |
/.bundle | |
# Ignore the default SQLite database. | |
/db/*.sqlite3 | |
/db/*.sqlite3-journal | |
# Ignore all logfiles and tempfiles. | |
/log/*.log | |
/tmp |