Skip to content

Instantly share code, notes, and snippets.

View ba0f3's full-sized avatar
🇻🇳
#VietnamLeavesNoOneBehind

Huy Doan ba0f3

🇻🇳
#VietnamLeavesNoOneBehind
View GitHub Profile
@ba0f3
ba0f3 / make-gadget-32.sh
Created January 24, 2018 08:59
Make frida-gadget-32 on Ubuntu 16.04_32bit
#!/bin/sh
apt install python3-pip g++-multilib ninja-build nodejs npm git
pip3 install colorama prompt-toolkit pygments
ln -s /usr/bin/nodejs /usr/bin/node
git clone --depth=1 https://github.com/frida/frida.git
cd frida
git submodule init
git submodule update
@ba0f3
ba0f3 / inject.c
Created January 7, 2018 19:08 — forked from NaxAlpha/inject.c
Win32 dll injection with WriteProcessMemory and opcode patching.
#include
#include
// Source:
// http://www.emoticode.net/embed/c-plus-plus/win32-dll-injection-with-writeprocessmemory-and-opcode-patching.html
// No original Copy of page available
/***************************************************************************************************/
// Function:
// Inject
@ba0f3
ba0f3 / make-vmdk.sh
Created January 5, 2018 14:36
Use raw disk/partition as VirtualBox disk image
# verify your disk layout
lsblk -o NAME,FSTYPE,UUID
# NAME FSTYPE UUID
# sda
# ├─sda1 ntfs ECEAA4D4EAA49BF8 <- reserve partition
# ├─sda2 ntfs 9CD2C43CD2C41C80 <- windows
# ├─sda3
# ├─sda5 ext4 5f9e05c1-ace9-45ee-a884-ed1df68bdc3e <- /boot partition
# ├─sda6 ext4 bc1a75df-3625-4c1f-b53a-8ecc725f0d23
# └─sda7 btrfs d305a656-442f-4579-96cf-dadc964c0be2
@ba0f3
ba0f3 / keybase.md
Last active September 6, 2018 15:34

Keybase proof

I hereby claim:

  • I am ba0f3 on github.
  • I am tui (https://keybase.io/tui) on keybase.
  • I have a public key ASAzEvVoPGMcYdCG8hs7V-501p9CwWRZwGgtroIFzteLIgo

To claim this, I am signing this object:

@ba0f3
ba0f3 / compile-emacs.sh
Created July 26, 2016 03:29
Compile emacs from source on Ubuntu
git clone --depth=1 git://git.savannah.gnu.org/emacs.git
cd emacs
sudo apt build-dep emacs24
./autogen.sh
./autogen.sh git
./configure
make && sudo make install
make clean
@ba0f3
ba0f3 / ubuntu_ui_toolkit_for_mac_osx.patch
Created June 26, 2016 05:35 — forked from penk/ubuntu_ui_toolkit_for_mac_osx.patch
Ported Ubuntu Components to Mac OSX and Qt 5.0.2
=== modified file 'modules/Ubuntu/Components/plugin/plugin.cpp'
--- modules/Ubuntu/Components/plugin/plugin.cpp 2013-05-21 11:06:55 +0000
+++ modules/Ubuntu/Components/plugin/plugin.cpp 2013-06-03 21:51:32 +0000
@@ -18,7 +18,7 @@
#include <QtQml>
#include <QtQuick/private/qquickimagebase_p.h>
-#include <QDBusConnection>
+//#include <QDBusConnection>
#include <QtGui/QGuiApplication>
var doSearch = function(array, targetValue) {
var min = 0;
var count = 0;
var max = array.length - 1;
var guess;
while(min <= max) {
guess = Math.floor((max + min)/2);
if(array[guess] === targetValue) {
count++;
println(guess);
@ba0f3
ba0f3 / compile-emacs.sh
Last active July 19, 2017 02:00
Compile emacs 25.1 on CentOS 6.x
yum install gcc make ncurses-devel giflib-devel libjpeg-devel libtiff-devel
wget http://ftp.twaren.net/Unix/GNU/gnu/emacs/emacs-25.1.tar.xz
tar xJf emacs-*
cd emacs-*
./configure --without-x --without-selinux
make && make install
@ba0f3
ba0f3 / h2o.sh
Created October 1, 2015 01:56
Simple H2O init script
#!/bin/bash
### BEGIN INIT INFO
# Provides: h2o
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: H2o HTTP Server
# Description: H2O is the optimized HTTP/1.x, HTTP/2 server
@ba0f3
ba0f3 / bench.nim
Created September 8, 2015 17:18
Nim empty string initialize benchmarking
import stopwatch
var c1, c2: stopwatch.clock
for a in 1..10:
bench(c1):
for i in 0..1_000_000:
var x = ""
x = "Vietnam"
x = ""
x = "Cong Hoa Xa Hoi Chu Nghia VietNam"