Skip to content

Instantly share code, notes, and snippets.

View Eskalol's full-sized avatar

Eskil Opdahl Nordland Eskalol

View GitHub Profile
@Eskalol
Eskalol / emerald_install.sh
Last active February 27, 2017 15:12
Emerald install
mkdir emerald
cd emerald
wget -qO- http://www.uio.no/studier/emner/matnat/ifi/INF5510/v11/undervisningsmateriale/kompilator/emerald-0.99-linux.tar.gz | tar -zxv
cd ..
echo "#Emerald" >> ~/.bashrc
echo "export EMERALDROOT='$PWD/emerald'" >> ~/.bashrc
echo "export PATH=\$PATH:\$EMERALDROOT/bin" >> ~/.bashrc
echo "set EMERALDARCH='i686mt'" >> ~/.bashrc
echo "emx -U -R" >> ~/.bashrc
echo "emx -U -Rhostname:port program" >> ~/.bashrc
@Eskalol
Eskalol / Makefile
Last active February 2, 2017 05:43
Makefile template
CC = gcc
CFLAGS = -g -Wall -Wextra
OBJECTS = #insert objects here example: cool.o
PHONY: clean all
all: main
%.o: %.c
@Eskalol
Eskalol / gist:7948ac68e3b7280ef55d691e31b95081
Created November 16, 2016 13:55
Useful profilers and debuggers for C
# valgrind check for leaks and other errors
$ valgrind --leak-check=full ./program arg1 arg2
# gdb debugger for segmentation fault etc...
$ gbd -ex=r --args ./program arg1 arg2
# kcachegrind visual profiling
$ valgrind --tool=callgrind ./program
$ kcachegrind &