Skip to content

Instantly share code, notes, and snippets.

MinJeong Kim MJ111

  • South Korea
Block or report user

Report or block MJ111

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MJ111
MJ111 / find_eb_ec2_private_ip.sh
Created Apr 9, 2019
[Get elasticbeanstalk's ec2 private ip list]
View find_eb_ec2_private_ip.sh
#!/usr/bin/env bash
beantalkEnvName="$1"
echo "target beanstalk env name: ${beantalkEnvName}"
## fetch ec2 list
getEc2IpList () {
ec2List=$(aws elasticbeanstalk describe-environment-resources --environment-name ${beantalkEnvName} | python -m json.tool | python -c 'import sys, json; li = json.load(sys.stdin)["EnvironmentResources"]["Instances"]; ec2List = [ dat.values() for dat in li ]; flat_list = [item for sublist in ec2List for item in sublist]; strlist = map(str, flat_list); print " ".join(strlist)')
@MJ111
MJ111 / add_user.sh
Last active Mar 21, 2019
openvpn cli add user script
View add_user.sh
#!/bin/sh
# Usage: sh add_user.sh "username" "groupname"
# ref: https://openvpn.net/vpn-server-resources/managing-user-and-group-properties-from-command-line/
# create user
sudo ./sacli --user $1 --key "type" --value "user_connect" UserPropPut
# add created user to specified group
sudo ./sacli --user $1 --key "conn_group" --value $2 UserPropPut
@MJ111
MJ111 / .vimrc
Created Mar 7, 2019 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
View .vimrc
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@MJ111
MJ111 / solution.py
Created Mar 3, 2019
[pattern discovery - apriori] feedback'll be appreciated.
View solution.py
import itertools
abs_min_support = 771
freq_items = [None, {}]
# part1
counting = {}
with open('categories.txt', 'r') as f:
while True:
line = f.readline()
@MJ111
MJ111 / .bash_profile
Created Feb 28, 2019 — forked from stephenll/.bash_profile
.bash_profile file on Mac OS X
View .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases.
# Much of this was originally copied from:
# http://natelandau.com/my-mac-osx-bash_profile/
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
@MJ111
MJ111 / .bash_profile
Created Feb 27, 2019 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
View .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@MJ111
MJ111 / proxy.config
Created Jan 31, 2019
[aws eb nginx proxy] #nginx
View proxy.config
files:
/etc/nginx/conf.d/proxy.conf:
mode: "000644"
owner: root
group: root
content: |
upstream nodejs {
server 127.0.0.1:5000;
keepalive 256;
}
@MJ111
MJ111 / get_utc_iso_format.py
Created Jun 19, 2018
get_utc_iso_format.py
View get_utc_iso_format.py
def get_iso_format():
"""
this returns utc iso8601 string. for example: '2018-06-19T08:51:56+00:00'
"""
import datetime
return datetime.datetime.now(tz=datetime.timezone.utc).replace(microsecond=0).isoformat()
@MJ111
MJ111 / disableBtnDuringAjax.js
Last active Jan 11, 2018
[Disable Button during Ajax] #javascript
View disableBtnDuringAjax.js
/**
* disable clicked button before jQuery ajax request and enable after ajax request finished
* @param {Function} ajaxFn
* ajaxFn should return executed jQuery AJAX function
* @returns {Function}
* returned function should be placed in event listener of Element
*
* Usage:
* $('#deactivate-btn').click(disableBtnDuringAjax(function(e) {
* return $.get('/api/users', function (data) {
@MJ111
MJ111 / getQueryParam.js
Last active Jan 10, 2018
[get query param] #javascript
View getQueryParam.js
/**
* @param {string} name
* @returns {string|null}
* getQueryParam('a') returns '1' on page http://domain.com/page.html?a=1&b=2
**/
function getQueryParam(name) {
const q = window.location.search.match(
new RegExp('[?&]' + name + '=([^&#]*)')
);
return q && q[1];
You can’t perform that action at this time.