Skip to content

Instantly share code, notes, and snippets.

@Hyunho
Hyunho / print network bandwidth.sh
Last active August 29, 2015 14:07
print network bandwidth in bit format at linux
#!/bin/sh
rx1=`grep eth0 /proc/net/dev | awk '{print $1}' | sed 's/.*://'`
tx1=`grep eth0 /proc/net/dev | awk '{print $9}'`
sleep 3
rx2=`grep eth0 /proc/net/dev | awk '{print $1}' | sed 's/.*://'`
tx2=`grep eth0 /proc/net/dev | awk '{print $9}'`
rx3=$(((rx2-rx1)/3*8/1024/1024))
tx3=$(((tx2-tx1)/3*8/1024/1024))
@Hyunho
Hyunho / shared_memory.sh
Created October 23, 2014 05:10
Tips for shell
# list shared memory that the owner is 'hyunho'
ipcs -m | grep hyunho
# remove shared memory that the owner is 'hyunho'
shmids=`ipcs -m | grep hyunho |awk '{print $2}'`; for shmid in ${shmids[0]}; do ipcrm -m $shmid ; done
@Hyunho
Hyunho / extract_gap.py
Created November 13, 2014 07:23
MLOGC trace 로그에서시간과 gap을 출력할 수 있다.
#!/usr/bin/python
import sys
import re
from datetime import datetime
import time
if hasattr(datetime, 'strptime'):
#python 2.6
strptime = datetime.strptime
@Hyunho
Hyunho / tip.sh
Created December 10, 2014 04:11
nice tip for linux
#Find Distribution Version
lsb_release -a
@Hyunho
Hyunho / README.md
Last active August 29, 2015 14:17
print TPS and number of tuples for transactions

transaction 기록 출력 문서

실행방법

아래의 명령어를 실행하도록 합니다.

% ./print_dbtps

Create Git Mirror from SVN Repository

This guide will demonstrate how to mirror an SVN into a Git repo. You're the target audience if you're an SVN user, just getting started with Git and need to coax your project team over to Git.

The branching scenario has been simplified for clarity.

References

@Hyunho
Hyunho / tmux-cheatsheet.markdown
Created October 8, 2015 01:03 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Hyunho
Hyunho / firewalld_direct_message.sh
Last active October 29, 2015 08:43
iptables_rule(only allow ssh connection)
# using firewalld utility
firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -p tcp -m tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -p tcp -m tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
firewall-cmd --direct --add-rule ipv4 filter OUTPUT 1 -p tcp -m multiport --dports 200:65535 -j DROP
@Hyunho
Hyunho / example.sh
Created November 6, 2015 19:17
cpio example
echo "DJMP1/mmdb/telcobase_scripts/backupDB" | cpio -pdm upsf_config/
@Hyunho
Hyunho / gdb.md
Created November 13, 2015 04:37
gdb commands

watchpoint 설정

  • watah [변수명] : 변수의 값이 써질때 브레이크가 걸린다.
  • rwatch [변수명] : 변수의 값이 읽혀질 때 브레이크가 걸린다.
  • awatch [변수명] : 변수의 값이 읽혀지거나 쓰이는 모든 경우에 대해 브레이크가 걸린다.