Skip to content

Instantly share code, notes, and snippets.

View lushl9301's full-sized avatar
🙃
hi

˥n Sɥǝuƃlᴉɐuƃ lushl9301

🙃
hi
View GitHub Profile
@lushl9301
lushl9301 / qemu Linux kernel error
Created September 29, 2015 04:00
make resident_sw.iso; sudo qemu -m 512 -serial stdio -hda resident_sw.iso
XM Hypervisor (3.7 r3)
Detected 3104.41MHz processor.
>> HWClocks [TSC clock (3104041Khz)]
[CPU0] >> HwTimer [i8253 timer (1193Khz)]
1 Partition(s) created
P0 ("linux-partition":0:1) flags: [ SYSTEM FP ]:
[0xa0000:0xa0000 - 0xfffff:0xfffff] flags: 0x10
[0x1800000:0x1800000 - 0x217fffff:0x217fffff] flags: 0x0
[0xc0000000:0xc0000000 - 0xefffffff:0xefffffff] flags: 0x12
[TRAP] PAGE_FAULT(0xe)
//./core/include/xmconf.h:323:struct xmc
//This structure contains every important part of the XtratuM.
struct xmc {
#define XMC_SIGNATURE 0x24584d43 // $XMC
xm_u32_t signature;
xm_u8_t digest[XM_DIGEST_BYTES];
xmSize_t dataSize;
xmSize_t size;
// Reserved(8).VERSION(8).SUBVERSION(8).REVISION(8)
@lushl9301
lushl9301 / tmux-cheatsheet.markdown
Created November 3, 2015 12: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
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
fib_a := 0
fib_b := 1
return func() int {
@lushl9301
lushl9301 / run.sh
Created January 8, 2016 03:29
quick solution for compile xtratum
#!/bin/bash
XM_SDK_PATH="/opt/xm-sdk"
cd ~
rm -rf $XM_SDK_PATH
cd ~/src
#make distro-run
/usr/bin/expect <<EOF

Kaggle_CrowdFlower

Download souces and data

git clone https://github.com/ChenglongChen/Kaggle_CrowdFlower.git
cd Kaggle_CrowdFlower
cd Data
cp ~/Downloads/*.csv .
@lushl9301
lushl9301 / cuda-mutex.cu
Created March 9, 2017 15:45
CUDA Lock; Critical Session; Mutex
#include <stdio.h>
#include <vector>
#include <cuda_runtime.h>
using namespace std;
__device__ void lock(int *mutex) {
while (atomicCAS(mutex, 0, 1) != 0);
}
__device__ void unlock(int *mutex) {
#include <iostream>
#include <set>
#include <vector>
#include <deque>
#include <algorithm>
#include <cmath>
using namespace std;
double Pow(double x, double y) {
for i in {1..9}; do awk -F',' '{printf "%s,%s,%s,%s,%s\n", $1, $2, $3, $5,$6}' dc_topo_new350${i}.csv > dc_topo_cap_${i}.csv; sleep 1; done | tee 1
for i in {0..9}; do awk -F',' -v i="${i}" '{printf "%s,%d,%d,%s,%s\n", $1 + i * 40000, $2 + i * 10000, $3 + i * 10000, $5,$6}' dc_topo_new351${i}.csv > haha_${i}; done