Skip to content

Instantly share code, notes, and snippets.

View CedricCabessa's full-sized avatar

Cédric Cabessa CedricCabessa

View GitHub Profile
git log --pretty=format:'%Cgreen%s%Creset (%an)%n%b%n' --first-parent $(git describe --tags --abbrev=0)..HEAD
@CedricCabessa
CedricCabessa / main.rs
Last active March 14, 2019 13:50
stupidrust
/*
[dependencies]
hyper = "0.12.25"
tokio = "0.1.17"
*/
extern crate hyper;
extern crate tokio;
extern crate futures;
use hyper::Client;
extern crate num;
use std::env;
use std::str::FromStr;
use num::bigint::BigInt;
use num::pow;
fn main() {
let args: Vec<String> = env::args().collect();
let x = BigInt::from_str(&args[1]).unwrap();
@CedricCabessa
CedricCabessa / invoke.cpp
Created November 14, 2016 13:40
QThread Invoke
/*
A is a QObject with
void A::doStuff() {
qDebug() << "I'm in" << QThread::currentThread();
}
*/
#include <QCoreApplication>
#include <QDebug>
#include <QThread>
@CedricCabessa
CedricCabessa / adbbench.py
Last active June 10, 2016 13:53
adbbench.py
#!/usr/bin/env python3
# ./adbtest.py ~/Downloads/1GB.zip
import sys, subprocess, os, time, tempfile, hashlib, shutil
#ADB = os.path.expanduser("~/genymotion/tools/adb")
ADB = "adb"
payload = sys.argv[1]
int main()
{
return 0;
}
@CedricCabessa
CedricCabessa / xcompile
Last active December 12, 2015 10:09
cross compile cfengine for android
ROOT=/home/cedc/android/src.master
export PATH=$PATH:$ROOT/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/
export CFLAGS="-nostdlib -isystem ${ROOT}/system/core/include -isystem ${ROOT}/hardware/libhardware/include -isystem ${ROOT}/hardware/libhardware_legacy/include -isystem ${ROOT}/hardware/ril/include -isystem ${ROOT}/libnativehelper/include -isystem ${ROOT}/frameworks/native/include -isystem ${ROOT}/frameworks/native/opengl/include -isystem ${ROOT}/frameworks/av/include -isystem ${ROOT}/frameworks/base/include -isystem ${ROOT}/frameworks/base/opengl/include -isystem ${ROOT}/external/skia/include -isystem ${ROOT}/out/target/product/maguro/obj/include -isystem ${ROOT}/bionic/libc/arch-arm/include -isystem ${ROOT}/bionic/libc/include -isystem ${ROOT}/bionic/libstdc++/include -isystem ${ROOT}/bionic/libc/kernel/common -isystem ${ROOT}/bionic/libc/kernel/arch-arm -isystem ${ROOT}/bionic/libm/include -isystem ${ROOT}/bionic/libm/include/arm -isystem ${ROOT}/bionic/libthread_db/include"
export CPP
@CedricCabessa
CedricCabessa / android_4.0.4_fedora_18.patch
Last active December 12, 2015 06:39
Patch for android 4.0.4 in order to compile on fedora 18
Index: src.4.0.4/dalvik/vm/native/dalvik_system_Zygote.cpp
===================================================================
--- src.4.0.4.orig/dalvik/vm/native/dalvik_system_Zygote.cpp
+++ src.4.0.4/dalvik/vm/native/dalvik_system_Zygote.cpp
@@ -27,6 +27,8 @@
#include <errno.h>
#include <paths.h>
#include <sys/personality.h>
+#include <sys/time.h>
+#include <sys/resource.h>
@CedricCabessa
CedricCabessa / yum_android_4.0.4_fed18
Last active December 12, 2015 06:38
packages needed to compile android 4.0.4 on fedora 18
yum install gperf bison zip python-markdown flex curl gnupg ncurses.x86_64 ncurses-devel.i686 ncurses-devel.x86_64 ncurses-libs.i686 ncurses-libs.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 zlib.i686 zlib.x86_64 zlib-devel.i686 lib-devel.x86_64 glibc-devel.i686 glibc-devel.x86_64 glibc.i686 mesa-libGL-devel.i686 mesa-libGL-devel.x86_64 mesa-libGLES-devel.i686 mesa-libGLES-devel.x86_64 libX11-devel.i686 perl-Switch
#cyanogenmod
yum install lzma schedtool pngcrush