Skip to content

Instantly share code, notes, and snippets.

View seunggabi's full-sized avatar
🎯
Focusing

Seunggabi Kim seunggabi

🎯
Focusing
View GitHub Profile
@tiagocardosos
tiagocardosos / clear_binary_log_mysql.txt
Last active March 5, 2024 12:18
MySQL Clear Binary Log
Can I Remove MySQL Binary Log Yes, as long as the data is replicated to Slave server, it’s safe to remove the file. It’s recommend only remove MySQL Binary Log older than 1 month.
Besides, if Recovery of data is the main concern, it’s recommend to archive MySQL Binary Log.
There are several ways to remove or clean up MySQL Binary Log, it’s not recommend to clean up the file manually, manually means running the remove command.
Remove MySQL Binary Log with RESET MASTER Statement Reset Master statement is uses for new database start up during replication for Master and Slave server. This statement can be used to remove all Binary Log.
To clean up Binary Log on Master Server
@ruanbekker
ruanbekker / python_mailer_smtplib.py
Created July 26, 2017 15:25
Python SMTP Mailer using Amazon SES (smtplib)
import sys
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
name = "Ruan"
from_address = "no-reply@mydomain.com"
to_address = "ruan@mydomain.com"
subject = "Test"
@khornberg
khornberg / encode_decode_dictionary.py
Created August 25, 2017 12:39
python 3 base64 encode dict
"""
Given a dictionary, transform it to a string. Then byte encode that string. Then base64 encode it and since this will go
on a url, use the urlsafe version. Then decode the byte string so that it can be else where.
"""
data = base64.urlsafe_b64encode(json.dumps({'a': 123}).encode()).decode()
# And the decode is just as simple...
data = json.loads(base64.urlsafe_b64decode(query_param.encode()).decode())
# Byte encode the string, base64 decode that, then byte decode, finally transform it to a dictionary
@lucasdavila
lucasdavila / fixup.txt
Last active December 20, 2023 12:00
Fixing mac os yosemite issue "bash: fork: Resource temporarily unavailable"
# see the current limits
$ sysctl -a | grep maxproc
# increase it
$ sudo sysctl -w kern.maxproc=xxxx
$ sudo sysctl -w kern.maxprocperuid=xxx
# run at startup
$ sudo vim /etc/sysctl.conf
@seunggabi
seunggabi / prepare-commit-msg
Last active November 1, 2023 08:03
prepare-commit-msg
#!/bin/bash
if [ -z "${SKIP_BRANCH}" ]; then
SKIP_BRANCH=(master develop release hotfix)
fi
NAME=$(git symbolic-ref --short HEAD)
NAME="${NAME##*/}"
@MinCha
MinCha / ggtics-dev-jd.md
Last active December 28, 2022 09:10
GGtics 신입 및 경력 개발자 채용

회사

모집

  • 신입/경력 서버 개발자 (Java, Scala, Spring)
  • 신입/경력 FE 개발자 (React)
@stefhen
stefhen / du.txt
Created October 26, 2014 17:34
aws cli s3 du
aws s3 ls s3://bucket --recursive | grep -v -E "(Bucket: |Prefix: |LastWriteTime|^$|--)" | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024/1024" GB"}'
@tmusabbir
tmusabbir / create-spark-cluster.sh
Created March 26, 2018 03:19
AWS CLI command to create EMR cluster with default auto-scaling task group
aws emr create-cluster --auto-scaling-role EMR_AutoScaling_DefaultRole --termination-protected --applications Name=Hadoop Name=Hive Name=Spark --ebs-root-volume-size 10 --ec2-attributes '{"InstanceProfile":"EMR_EC2_DefaultRole","SubnetId":"subnet-xxxx","EmrManagedSlaveSecurityGroup":"sg-xxxxx","EmrManagedMasterSecurityGroup":"sg-xxxxx"}' --service-role EMR_DefaultRole --enable-debugging --release-label emr-5.12.0 --log-uri 's3n://aws-logs-xxxx/elasticmapreduce/' --name 'spark-cluster' --instance-groups '[{"InstanceCount":2,"BidPrice":"0.30","AutoScalingPolicy":{"Constraints":{"MinCapacity":0,"MaxCapacity":20},"Rules":[{"Action":{"SimpleScalingPolicyConfiguration":{"ScalingAdjustment":2,"CoolDown":300,"AdjustmentType":"CHANGE_IN_CAPACITY"}},"Description":"","Trigger":{"CloudWatchAlarmDefinition":{"MetricName":"YARNMemoryAvailablePercentage","ComparisonOperator":"LESS_THAN","Statistic":"AVERAGE","Period":300,"Dimensions":[{"Value":"${emr.clusterId}","Key":"JobFlowId"}],"EvaluationPeriods":1,"Unit":"PERCENT","Na
@naveensrinivasan
naveensrinivasan / environmentasmap.go
Created June 23, 2013 22:36
Here is a code to get the environment variables as a map in go instead of slice.
package main
import (
"fmt"
"os"
"strings"
)
func main() {
getenvironment := func(data []string, getkeyval func(item string) (key, val string)) map[string]string {
@mathiasbynens
mathiasbynens / unicodeEscape.js
Created September 26, 2011 19:50
Escape all characters in a string using both Unicode and hexadecimal escape sequences
// Ever needed to escape '\n' as '\\n'? This function does that for any character,
// using hex and/or Unicode escape sequences (whichever are shortest).
// Demo: http://mothereff.in/js-escapes
function unicodeEscape(str) {
return str.replace(/[\s\S]/g, function(character) {
var escape = character.charCodeAt().toString(16),
longhand = escape.length > 2;
return '\\' + (longhand ? 'u' : 'x') + ('0000' + escape).slice(longhand ? -4 : -2);
});
}