Skip to content

Instantly share code, notes, and snippets.

View krha's full-sized avatar

Kiryong Ha krha

  • Carnegie Mellon University
  • Pittsburgh
View GitHub Profile
@krha
krha / pivot_root.sh
Created February 14, 2012 14:55
script for pivot_root
#!/bin/sh
# credential: http://www.bluegecko.net/amazon-web-services/ec2-persistent-boots-with-pivot-root/
PATH=/bin:/usr/bin:/sbin:/usr/sbin
NEWDEV="/dev/xvdf1"
NEWTYP="ext4"
NEWMNT="/mnt/ebs"
OLDMNT="/mnt/old"
OPTIONS="noatime,rw"
SLEEP=1
@krha
krha / odd.c
Created February 23, 2012 22:41 — forked from theonewolf/odd.c
odd static test in C
#include <stdio.h>
int good(int i)
{
i++;
return i;
}
int not_good(int i)
@krha
krha / rooting.sh
Created February 28, 2012 06:03
Rooting rootFS
#!/bin/bash
PATH=/bin:/usr/bin:/sbin:/usr/sbin
NEWTYP=ext4
NEWMNT="/mnt/new-root"
OLDMNT="/mnt/old-root"
RUNLEVEL=`runlevel | awk '{print $2}'`
if [ $# -eq 1 ]
then
NEWDEV=$1
@krha
krha / VM_TEMPLATE.xml
Created October 9, 2012 22:05
Cloudlet Template XML
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>cloudlet</name>
<uuid>c7a5fdbd-cdaf-9455-926a-d65c16db1801</uuid>
<memory>1048576</memory>
<currentMemory>1048576</currentMemory>
<vcpu>4</vcpu>
<cpu>
<topology sockets='1' cores='4' threads='1'/>
</cpu>
<os>
@krha
krha / VM_XML
Created October 9, 2012 22:06
Cloudlet Template XML
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>cloudlet</name>
<uuid>c7a5fdbd-cdaf-9455-926a-d65c16db1801</uuid>
<memory>1048576</memory>
<currentMemory>1048576</currentMemory>
<vcpu>4</vcpu>
<cpu>
<topology sockets='1' cores='4' threads='1'/>
</cpu>
<os>
@krha
krha / gist:5744228
Last active December 18, 2015 07:09
<domain type='kvm' id='44' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>instance-0000014c</name>
<uuid>48084680-c244-40c5-a22d-100efa0ec733</uuid>
<devices>
<emulator>/usr/lib/python2.7/dist-packages/synthesis/lib/bin/x86_64/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source file='/var/tmp/vmnetfs-sXVNJo/disk/image'/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
@krha
krha / monex.py
Last active August 29, 2015 14:07 — forked from yy/monex.py
#!/usr/bin/env python
# encoding: utf-8
"""
MONitor & EXecute
Yong-Yeol Ahn (http://yongyeol.com/)
This script monitors multiple files and executes the given command when
any of those files is changed.
"""
import sys
def control_migration(self):
self.qmp.connect()
counter_check_comp_size = 0
ret = self.qmp.qmp_negotiate()
if not ret:
raise CloudletGenerationError("failed to connect to
# Sample ``local.conf`` for user-configurable variables in ``stack.sh``
# NOTE: Copy this file to the root ``devstack`` directory for it to
# work properly.
# ``local.conf`` is a user-maintained setings file that is sourced from ``stackrc``.
# This gives it the ability to override any variables set in ``stackrc``.
# Also, most of the settings in ``stack.sh`` are written to only be set if no
# value has already been set; this lets ``local.conf`` effectively override the
# default values.
#!/bin/bash
# tc uses the following units when passed as a parameter.
# kbps: Kilobytes per second
# mbps: Megabytes per second
# kbit: Kilobits per second
# mbit: Megabits per second
# bps: Bytes per second
# Amounts of data can be specified in:
# kb or k: Kilobytes
# mb or m: Megabytes