Skip to content

Instantly share code, notes, and snippets.

View soardex's full-sized avatar

Edward Fitz Bucud Abucay soardex

View GitHub Profile
@soardex
soardex / gist:3718f105bfa1b64602bc
Created May 20, 2015 12:55
Generate Makefile for libRocket using MinGW32
# here is the cmake command to generate makefile
cmake -G "Unix Makefiles" -D CMAKE_MAKE_PROGRAM="mingw32-make.exe" -D FREETYPE_INCLUDE_DIRS="../Dependencies/freetype/include;../Dependencies/freetype/include/freetype2" -D FREETYPE_LIBRARY="../Dependencies/freetype/lib/libfreetype.dll.a" .
@soardex
soardex / gist:aa51efd34ee25bf9018c
Created May 22, 2015 00:45
Most simplest GLSL vertex and fragment shader for testing
# vertex shader
```
#version 150
attribute vec3 position;
void main()
{
gl_Position = vec4(position, 1.0);
}
```
@soardex
soardex / gist:226cca23abdb6fd2d370
Created May 26, 2015 08:16
Loading functions from `dll` or `so`
/// compiling:
/// g++ -std=c++0x -o example example.cpp -I./libtool/include/ -L./libtool/lib/ -lltdl
///
#include <cstdio>
#include <iostream>
#include <memory>
#include <ltdl.h>
int main()
@soardex
soardex / gist:f7026f1f427662935dfa
Created May 26, 2015 08:23
Building libraries using MinGW
# build library dll
g++ -c -DBUILDING_EXAMPLE_DLL example_dll.cpp
g++ -shared -o example_dll.dll example_dll.o -Wl,--out-implib,libexample_dll.a
# build executable
g++ -c example_exe.cpp
g++ -o example_exe.exe example_exe.o -L. -lexample_dll
# build without an import library
g++ -o example_exe.exe example_exe.o example_dll.dll
@soardex
soardex / gist:eb3fc9f6db6a75c06af8
Created May 31, 2015 14:51
Useful commands for GDB
### going back the backtrace
backtrace
select-frame [frameno]
up
down
### reversing stepping in the code
target record-full
reverse-{next, continue, step}
### Some Keybinds that I always forgot
Alt + C - Convert to mesh.
Ctrl + Alt + Numpad 0 - Snap the camera to the position of the view.
Shift + B - Render border.
Ctrl + Alt + B - Clear render border.
M - Object move to layer.
### Navigation
@soardex
soardex / gist:6843c6a04b3974fdd582
Last active August 29, 2015 14:22
Trace Network Calls of a Process
# attach to a current network
strace -p [pid] -f -e trace=network -s [strsize]
# or just trace connect calls
strace -p [pid] -f -e trace=network -s [strsize]
# or some chosen network calls
strace -p [pid] -f -e poll,select,connect,recvfrom,sendto -s [strsize]
#### Original Link https://wiki.archlinux.org/index.php?title=Tor
#!/bin/bash
export TORCHROOT=/opt/torchroot
mkdir -p $TORCHROOT
mkdir -p $TORCHROOT/etc/tor
mkdir -p $TORCHROOT/dev
mkdir -p $TORCHROOT/usr/bin
mkdir -p $TORCHROOT/usr/lib
@soardex
soardex / gist:045f8f737f3072b55619
Created June 17, 2015 13:03
Install Flash on CentOS 6.6
rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
yum install -y flash-plugin
@soardex
soardex / gist:c2ebd9d3bdb3c890151c
Created June 17, 2015 13:05
Create GPG Key through SSH
sudo pacman -S rng-tools
sudo rngd -f -r /dev/urandom
gpg2 --full-gen-key