Skip to content

Instantly share code, notes, and snippets.

@riyadparvez
riyadparvez / Dockerfile
Created February 2, 2022 04:54 — forked from knowsuchagency/Dockerfile
Makefile Docker Git GitHub multi-stage build ssh private key recipe
FROM python:3 as build-system
RUN pip install -U pip
COPY requirements.txt requirements.txt
### create temporary image used to download and vendor packages using private key ###
FROM build-system as intermediate
# add credentials on build
#! /bin/bash
#ls /tmp > /dev/null &
sleep 60 &
sudo chrt -f -p 99 $!
#sudo chrt -r
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/APSInt.h"
#include "clang/Driver/Options.h"
#include "clang/AST/AST.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/Expr.h"
#include "clang/AST/OperationKinds.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Frontend/ASTConsumers.h"
@riyadparvez
riyadparvez / addr2line-whole-exec.py
Created February 24, 2015 15:57
Run addr2line on all instructions in the binary. You need pybfd package.
#!/usr/bin/env python
# Import the disassembly library (libopcodes)
from pybfd.opcodes import Opcodes, OpcodesException
from pybfd.bfd import Bfd, BfdException
from sys import argv, exit
from subprocess import Popen, PIPE
@riyadparvez
riyadparvez / build-llvm.sh
Last active August 29, 2015 14:15
Download and build latest llvm, clang and compiler tools.
#!/bin/bash
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm-latest
cd llvm-latest/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd clang/tools
svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
cd ../../../.. #go back to top directory
cd llvm-latest/projects
svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
@riyadparvez
riyadparvez / Microreboot.md
Created June 23, 2014 23:52
Microreboot notes

Microreboot

Microreboots

  • restart fine-grained components “with a clean slate”
  • only take a fraction of the time needed for full system reboot
  • Separate data recovery and application recovery

Goals of confining the reboot

Pregel

Why Graph Computation Is Different

  • Poor locality of memory access
  • Very little work per vertex
  • Changing degree of parallelism over the course of execution

MapReduce

@riyadparvez
riyadparvez / clear_terminal.c
Created May 23, 2014 02:12
Clearing the terminal
//clear the whole terminal screen
printf("\033[2J\033[1;1H");
//only clear the portion for current portion of its
fputs("\033[A\033[2K\033[A\033[2K",stdout);
rewind(stdout);
ftruncate(1,0);
@riyadparvez
riyadparvez / ping.py
Last active December 26, 2015 20:49 — forked from pklaus/ping.py
#!/usr/bin/env python
"""
A pure python ping implementation using raw socket.
Note that ICMP messages can only be sent from processes running as root.
Derived from ping.c distributed in Linux's netkit. That code is