Skip to content

Instantly share code, notes, and snippets.

View KingofHamyang's full-sized avatar
🇰🇷
Working At Korea

seongjun.ha KingofHamyang

🇰🇷
Working At Korea
View GitHub Profile
#!/bin/bash
FILE_SYSTEMS=(“xfs” “f2fs” “ext4”)
WRITE_TYPE=(0 1 4)
SYNC_TYPE=(8 8 2)
rm ./output/result.mobibench.dat
for fs in ${FILE_SYSTEMS[@]}; do
umount /dev/sda6 1>/dev/null
if [ $fs == ext4 ]; then
@KingofHamyang
KingofHamyang / gist:ffe50587fe20a743b2b20186c12854df
Created January 15, 2021 12:10
parsing_mobibench_result.sh
#!/bin/bash
FILE_SYSTEMS=("ext4" "xfs" "f2fs") # file systems
WRITE_TYPE=(0 1 4) # option for write pattern, 0=sequential, 1=random, 4=append
SYNC_TYPE=(8 8 2) # option for sync type, 8=fdatsync and 2=fsync
BENCHMARK_WORKING_DIR=/home/haseongjun/workspace # mobibench writing path
file_size=5242880 # 5242880KB = 5GB
# remove old result data
rm ./output/result.dat
@KingofHamyang
KingofHamyang / parsing_data.sh
Last active January 5, 2021 09:40
Code to parse benchmark result data into several forms
#!/bin/bash
# root path for your raw data
root_path=../data_example/result/performance
# output dir for parsed data files
output_path=../data_example/parsed_data
# before run, delete old files
rm -rf $output_path
mkdir ../data_example/parsed_data
@KingofHamyang
KingofHamyang / lms_subscription_migration.rb
Created January 16, 2020 11:06
Notification Migration
NotificationSubscription.find_each do | ns |
LmsSubscription.create!(resource_id: ns.resource_id, resource_type: ns.resource_type, owner_id: ns.owner_id, owner_type: ns.owner_type, last_sent_at: ns.last_sent_at) if ns.subs_type == "lms"
end
require 'csv'
csv_text = File.read('../csvs/immutable_marking_botem_weight.csv')
csv = CSV.parse(csv_text, :headers => true)
csv.each do |row|
Shop::Weight.where(:shop_id => row["shop_id"], :date => row["date"]).first.update(:botem => row["botem"])
end
Shop.find_each do |shop|
botem_weight = shop.botem_weight;
actual_weight = shop.wifi_actual_weight;
Shop::WeightHistory.find_or_create_by(shop_id: shop.id, weight: botem_weight, weight_type: "botem", date: shop.created_at.strftime("%Y-%m-%d"));
Shop::WeightHistory.find_or_create_by(shop_id: shop.id, weight: actual_weight, weight_type: "actual", date: shop.created_at.strftime("%Y-%m-%d"));
end
@KingofHamyang
KingofHamyang / Docusaurus install
Created October 20, 2019 08:48
Docusaurus install
npx docusaurus-init
npm install -g docusaurus-init
yarn global add docusaurus-init
@KingofHamyang
KingofHamyang / klaytn_week2.md
Last active September 14, 2019 16:35
Klaytn week2

Klaytn Study 2주차

<개요>

클레이튼의 네트워크 구조를 살펴보고, 각 노드들의 역할을 파악한 뒤 가장 유명한 블록체인 플랫폼 중 하나인 이더리움과 비교해보고, 그 차이점을 분석해보겠습니다.

<클레이튼 네트워크 구성>

클레이튼은 기존의 public 블록체인들과는 다른 형태의 네트워크 구조를 가집니다. 이더리움과 비트코인 과는 달리, 모든 노드에게 동등한 기회와 능력이 부여되지 않습니다.