Skip to content

Instantly share code, notes, and snippets.

View espozbob's full-sized avatar

bob espozbob

View GitHub Profile
@espozbob
espozbob / Cache_control_for_browser.md
Last active January 12, 2019 03:28
Cache control for browser

Using PHP:

header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
header("Pragma: no-cache"); // HTTP 1.0.
header("Expires: 0"); // Proxies.
Using Java Servlet, or Node.js:

response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
response.setHeader("Pragma", "no-cache"); // HTTP 1.0.
@espozbob
espozbob / export.sh
Created December 10, 2018 12:37 — forked from chrisdiana/export-cognito-users.sh
Export AWS Cognito User Pool
aws --profile production cognito-idp list-users --user-pool-id us-west-2_XXXXXXXXX --output table > ~/users.txt
@espozbob
espozbob / TerminalCommandEditKey.txt
Created December 10, 2018 06:57
Terminal Command Editing Key
1. 제일 많이 쓰일 것 같은 단축 키
ctrl + L : 현재 입력 글자들은 남겨둔 채 'clear' 실행
ctrl + U : 현재 커서 위치부터 그 줄 처음부분 까지 지우기
2. 그나마 좀 쓰일 것 같은 단축키
ctrl + D : 현재 커서에 있는 글자 지우기
alt + B : 이전 단어로 커서 이동
@espozbob
espozbob / App.java
Last active December 2, 2020 19:22
AWS - Amazon DynamoDB Transaction Example for Java
package com.vogella.maven.quickstart;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.regions.Regions;
@espozbob
espozbob / AWSTUDY-SSM-EnableTerminationProtectionEC2
Created November 15, 2018 01:10
Document of AWS Systems Manager that allows Automation to perform the actions for enabling termination protection of the instance
{
"schemaVersion": "0.3",
"assumeRole": "{{ AutomationAssumeRole }}",
"description": "Disable Termination Protection of Instance",
"parameters": {
"InstanceId": {
"type": "String",
"description": "(Required) The ID of the instance."
},
"LambdaAssumeRole": {
@espozbob
espozbob / AWSTUDY-SSM-DisableTerminationProtectionEC2
Last active November 15, 2018 01:10
Document of AWS Systems Manager that allows Automation to perform the actions for disabling termination protection of the instance
{
"schemaVersion": "0.3",
"assumeRole": "{{ AutomationAssumeRole }}",
"description": "Disable Termination Protection of Instance",
"parameters": {
"InstanceId": {
"type": "String",
"description": "(Required) The ID of the instance."
},
"LambdaAssumeRole": {
@espozbob
espozbob / ec2_kill_with_fire.py
Created November 14, 2018 06:32 — forked from tomislacker/ec2_kill_with_fire.py
Kill EC2 Instances With Fire
#!/usr/bin/env python
"""
EC2 Instance Killer
Usage:
ec2_kill_with_fire.py [options] <instance_id>...
Options:
-h, --help Show this dialog
-r, --region NAME EC2 region [default: us-east-1]
@espozbob
espozbob / redis_cheatsheet.bash
Created August 1, 2018 05:06 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@espozbob
espozbob / redirect-domain-with-s3-and-cloudfront.json
Created May 13, 2018 06:51 — forked from amosshapira/redirect-domain-with-s3-and-cloudfront.json
CloudFormation template to redirect "company.co.uk" to "company.com"
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Redirect {www.,}company.co.uk web site to company.com, including SSL",
"Resources": {
"BucketCompanyCoUk": {
"Properties": {
"AccessControl": "PublicRead",
"BucketName": "company.co.uk",
"CorsConfiguration": {
"CorsRules": [
@espozbob
espozbob / User-Guide-AWS-CodeCommit.md
Last active December 10, 2018 06:32
AWS CodeCommit - User Guide

AWS CodeCommit

Git

Store Git Credential

  • Go to AWS IAM and download a Git credential file.
$ git config --global credential.helper store
$ git fetch
Username for 'repo': xxx