Skip to content

Instantly share code, notes, and snippets.

View flaviut's full-sized avatar

Flaviu Tamas flaviut

View GitHub Profile
@0xTowel
0xTowel / SeeSP.c
Created November 13, 2017 20:48
Simple program that prints the stack pointer. Useful for manual ASLR checking.
/* 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 January 21, 2024 06:57
Using the Fetch Api with Django Rest Framework

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 March 24, 2024 21:13
Statically Typed Lisp

Basic unit type:

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

Basic functions:

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 March 29, 2024 14:02
Useful terminal control characters
# 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 January 29, 2024 15:04
memusg -- Measure memory usage of processes
#!/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"); #