Skip to content

Instantly share code, notes, and snippets.

@0xTowel
0xTowel / SeeSP.c
Created Nov 13, 2017
Simple program that prints the stack pointer. Useful for manual ASLR checking.
View SeeSP.c
/* SeeSP: Print the value of the stack pointer.
* Build: gcc SeeSP.c -o SeeSP
*
* Towel - 2017
*/
#include <stdio.h>
#include <inttypes.h>
int main(void)
{
@marteinn
marteinn / info.md
Last active Jul 27, 2022
Using the Fetch Api with Django Rest Framework
View info.md

Using the Fetch Api with Django Rest Framework

Server

First, make sure you use the SessionAuthentication in Django. Put this in your settings.py

# Django rest framework
REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': [
 'rest_framework.authentication.SessionAuthentication'
@chrisdone
chrisdone / AnIntro.md
Last active Mar 26, 2022
Statically Typed Lisp
View AnIntro.md

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

View closuremacro.nim
import macros
macro `=>`(p, b: expr): expr {.immediate.} =
echo treeRepr(p)
#echo(treeRepr(b))
var params: seq[PNimrodNode] = @[newIdentNode("auto")]
case p.kind
of nnkPar:
for c in children(p):
@bcap
bcap / terminal-control.sh
Last active Sep 29, 2022
Useful terminal control characters
View terminal-control.sh
# Terminal output control (http://www.termsys.demon.co.uk/vtansi.htm)
TC='\e['
CLR_LINE_START="${TC}1K"
CLR_LINE_END="${TC}K"
CLR_LINE="${TC}2K"
# Hope no terminal is greater than 1k columns
RESET_LINE="${CLR_LINE}${TC}1000D"
@netj
netj / memusg
Last active Sep 27, 2022
memusg -- Measure memory usage of processes
View memusg
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #