Skip to content

Instantly share code, notes, and snippets.

View ryush00's full-sized avatar

SeongHoon Ryu ryush00

  • South Korea
  • 20:09 (UTC +09:00)
View GitHub Profile
@ryush00
ryush00 / install-rbenv-amazon-linux-ami.sh
Last active July 13, 2022 06:49 — forked from luisbebop/install-rbenv-amazon-linux-ami.sh
Install rbenv on Amazon Linux AMI
sudo yum install -y git gcc make readline-devel openssl-devel
git clone https://github.com/rbenv/rbenv ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
# Install ruby-build system-widely
git clone https://github.com/rbenv/ruby-build /tmp/ruby-build
cd /tmp/ruby-build
@ryush00
ryush00 / number.rb
Last active May 6, 2017 12:45
거누와 함께하는 배스킨라빈스 게임!
# COPYRIGHT ryush00
# 사용법
# number.rb 반복수 시작수]
n = ARGV[1].to_i
time = ARGV.first.to_i
string = ""
time.times do
@ryush00
ryush00 / gist:804e58b3caa2e4e568dc3bf93b297d3e
Created March 11, 2017 17:36
AWS Cloudfront ip ranges
13.32.0.0/15
13.54.63.128/26
34.195.252.0/24
35.162.63.192/26
52.15.127.128/26
52.46.0.0/18
52.52.191.128/26
52.56.127.0/25
52.57.254.0/24
52.66.194.128/26
@ryush00
ryush00 / KINX Cloud Comparison.md
Last active February 21, 2017 19:13
Comparison UnixBench results of Kinx, iwinV (Korea Hosting Company) and Linode, DigitalOcean, GCE, Vultr.

###GCE 1GB RAM + 1 CPU

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: instance-1: GNU/Linux
   OS: GNU/Linux -- 4.4.0-43-generic -- #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016
   Machine: x86_64 (x86_64)
var http = require('http');
http.get(url, function(res) {
res.pipe(iconv.decodeStream('KS_C_5601-1987')).collect(function(err, decodedBody) {
console.log(decodedBody);
});
});
@ryush00
ryush00 / cloudflare.sh
Last active July 31, 2016 15:54
Add ip subnets to nginx config from cloudflare website.
#! /bin/bash
# The original source
# I don't know who made it.
# Update cloudflare.conf with new IPs
#
cloudFlareConf="/etc/nginx/conf.d/cloudflare.conf"
IPV4=$(curl -s "https://www.cloudflare.com/ips-v4")
IPV6=$(curl -s "https://www.cloudflare.com/ips-v6")
DATE="$(date)"
@ryush00
ryush00 / gist:f580229e070555b154fb
Created February 23, 2016 17:21 — forked from wedtm/gist:1906478
Ruby based Minecraft Vanilla Query Check
#
# Tested on 1.9.2-p290, Written by Miles Smith (WedTM)
#
require 'socket'
class MCQuery
MAGIC_PREFIX = "\xFE\xFD"
PACKET_TYPE_CHALLENGE = "\x09"
PACKET_TYPE_QUERY = "\x00"
@ryush00
ryush00 / thumb.rb
Created December 21, 2015 15:44
동일 폴더의 모든 동영상의 썸네일 사진 만들기
var ffmpeg = require('fluent-ffmpeg');
var fs = require('fs');
var files = fs.readdirSync(__dirname);
var path = require('path');
for(var i in files) {
if(path.extname(files[i]) === ".mp4") {
@ryush00
ryush00 / friendly_urls.markdown
Last active August 29, 2015 14:26 — forked from jcasimir/friendly_urls.markdown
Friendly URLs in Rails

Friendly URLs

By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:

/people/6

But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.

@ryush00
ryush00 / tester.java
Created July 18, 2015 15:55
소수 구하기
class Tester {
public static void main(String[] args) {
for (int i = 1; i <= 100; i++) {
if (isTest(i))
System.out.println(i);
}
}
public static boolean isTest(int num) {
if (num == 1)