Skip to content

Instantly share code, notes, and snippets.

View cwen0's full-sized avatar
🎯
Focusing

Cwen Yin cwen0

🎯
Focusing
View GitHub Profile
var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
global inject, delay_cnt
probe begin {
println("injdect diskio delay begin.\n");
}
probe procfs("cnt").read {
$value = sprintf("%d\n", delay_cnt);
}
#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <dlfcn.h>
ssize_t read(int fd, void *buf, size_t count) {
ssize_t (*origin_read)(int, void*, size_t) = dlsym(RTLD_NEXT, "read");
sleep(5);
printf("read sleep 5s\n");
return origin_read(fd, buf, count);
@cwen0
cwen0 / retry.sh
Created June 17, 2019 10:12 — forked from dublx/retry.sh
Bash - retry command N times
#!/bin/bash
set -euo pipefail
function myFunction() {
myCommand
return $?
}
retry=0
maxRetries=5
@cwen0
cwen0 / centos-install-kernel-debuginfo.sh
Created August 7, 2019 05:53 — forked from jarek-przygodzki/centos-install-kernel-debuginfo.sh
CentOS 7 - How to install kernel-debuginfo
yum --enablerepo=base-debuginfo install -y kernel-debuginfo-$(uname -r)