Skip to content

Instantly share code, notes, and snippets.

View honux77's full-sized avatar
๐Ÿ 
Working from home

Hoyoung Jung honux77

๐Ÿ 
Working from home
View GitHub Profile
aws s3api list-objects --bucket %bucketname% --query 'sum(Contents[].Size)' --output json | awk 'BEGIN {total=0}{total+=$0}END{print total/1024/1024/1024" GB"}'
//MY BAD ANSWER
//referenced by http://stackoverflow.com/questions/280634/endswith-in-javascript
var fs = require('fs');
fs.readdir(process.argv[2],function(err, data) {
if(err) throw err;
var dirs = data.toString();
var files = dirs.split(",");
for (var i = 0; i < files.length; i++) {
if (files[i].endsWith("." + process.argv[3]))
@honux77
honux77 / NodeInsert.cpp
Last active August 29, 2015 14:26
NodeInsert.cpp
Node* Insert(Node *head,int data)
{
Node *node = head;
Node *newNode = new Node();
newNode->data = data;
newNode->next = NULL;
if (node == NULL)
return newNode;
while (node->next)
@honux77
honux77 / nodejs
Last active August 26, 2015 07:22
node.js init.d script for CentOS
#!/bin/sh
#
# chkconfig: 35 99 99
# description: Node.js /home/nodejs/sample/app.js
#
. /etc/rc.d/init.d/functions
USER="nodejs"
@honux77
honux77 / rmbucket.java
Created September 2, 2015 07:32
delete s3 bucket
/**
* Delete the specified bucket. You will use the deleteBucket() method of the client object to
* delete the bucket, but first you will need to delete the bucket contents. To delete the contents,
* you will need to list the objects and delete them individually (DeleteObject() method) or as a
* batch (DeleteObjects() method).
*
* The purpose of this task is to gain experience writing applications that remove unused AWS resources
* in an automated manner.
*
* @param s3Client The S3 client object.
@honux77
honux77 / aws_ex.py
Created September 4, 2015 03:57
AWS Python Example
#!/usr/local/bin/python3
from os.path import expanduser
import sys
import boto3
#set env
home = expanduser("~")
print (home)
#getName from Tag
@honux77
honux77 / nat.sh
Created September 15, 2015 05:03
Linux NAT instance setting
#!/bin/sh
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 0 > /proc/sys/net/ipv4/conf/eth0/send_redirects
/sbin/iptables -t nat -A POSTROUTING -o eth0 -s 0.0.0.0/0 -j MASQUERADE
/sbin/iptables-save > /etc/sysconfig/iptables
mkdir -p /etc/sysctl.d/
cat <<EOF > /etc/sysctl.d/nat.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.eth0.send_redirects = 0
EOF
@honux77
honux77 / 1-1.as
Last active October 9, 2015 15:48
6502 tutorial 1-2
LDA #$01
STA $0200
LDA #$02
STA $0201
LDA #$03
STA $0220
LDA #$04
STA $0221
LDA #$05
@honux77
honux77 / stack.as
Last active October 15, 2015 02:18
6502 stack example code
; ___ _ __ ___ __ ___
; / __|_ _ __ _| |_____ / /| __|/ \_ )
; \__ \ ' \/ _` | / / -_) _ \__ \ () / /
; |___/_||_\__,_|_\_\___\___/___/\__/___|
; Change direction: W A S D
define appleL $00 ; screen location of apple, low byte
define appleH $01 ; screen location of apple, high byte
define snakeHeadL $10 ; screen location of snake head, low byte
@honux77
honux77 / itbook.md
Last active April 6, 2020 15:20
Some Good Books for Developers

๊ฐœ๋ฐœ์ž ์ถ”์ฒœ ์„œ์ 

(๋‹คํ˜œ๊ฐ€ ์ด๋ฆ„ ๋ถ™์ž„)

๋Œ€๊ทœ๋ชจ ์„œ๋น„์Šค ์„ฑ๋Šฅ ๊ด€๋ จ

  • ์›น ๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ ๋Œ€๊ทœ๋ชจ ์„œ๋น„์Šค๋ฅผ ์ง€ํƒฑํ•˜๋Š” ๊ธฐ์ˆ 
  • ๊ทธ๋ฆผ์œผ๋กœ ๊ณต๋ถ€ํ•˜๋Š” ์‹œ์Šคํ…œ ์„ฑ๋Šฅ๊ตฌ์กฐ

IT ์ธํ”„๋ผ ๊ถŒ์žฅ ๋„์„œ