Skip to content

Instantly share code, notes, and snippets.

View alek-p's full-sized avatar
🏠

Alek P alek-p

🏠
View GitHub Profile
@papertigers
papertigers / downstack.d
Created January 26, 2022 02:53
illumos downstack
#!/usr/sbin/dtrace -FCs
$1:entry
{
stack();
self->trace = 1;
}
$1:return
/self->trace == 1/
@ghfields
ghfields / Ubuntu 18.04.1 Rpool Encryption Trial.sh
Last active February 16, 2022 03:36
Change "zpool create" to more feature rich set with improved encryption algorithm
# Run as root
# sudo -i
# Prepare LiveCD Environment
add-apt-repository -y ppa:jonathonf/zfs
apt install -y zfs-dkms
systemctl stop zfs-zed.service
modprobe -r zfs
modprobe zfs
@ErikAugust
ErikAugust / spectre.c
Last active May 22, 2024 23:07
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@pdobrowolski
pdobrowolski / Makefile
Created May 27, 2015 16:58
Universal C/Cpp makefile
# Universal C/Cpp makefile
# Source: https://sites.google.com/site/michaelsafyan/software-engineering/how-to-write-a-makefile
program_NAME := server
program_C_SRCS := $(wildcard *.c)
program_CXX_SRCS := $(wildcard *.cpp)
program_C_OBJS := ${program_C_SRCS:.c=.o}
program_CXX_OBJS := ${program_CXX_SRCS:.cpp=.o}
program_OBJS := $(program_C_OBJS) $(program_CXX_OBJS)
program_INCLUDE_DIRS :=
@ddd1600
ddd1600 / CIKgetter.R
Created October 22, 2012 20:39
get SEC CIK number from ticker symbol
getCIK = function(ticker) {
stopifnot(is.character(ticker))
uri = "http://www.sec.gov/cgi-bin/browse-edgar"
response = getForm(uri,CIK=ticker,action="getcompany")
html = htmlParse(response)
CIKNode = getNodeSet(html, "//acronym[@title=\"Central Index Key\"][text() = \"CIK\"]")
CIKNodeText = sapply(CIKNode, function(x) xmlValue(getSibling(getSibling(x))))
CIK = sub(" .*","",CIKNodeText)
CIK = sub("^0*","",CIK)
@melodymorgan
melodymorgan / getLatestData.js
Created October 18, 2012 19:09
Rickshaw Update Graph Realtime Data
var seriesData = [ [{ x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 17 }, { x: 3, y: 42 }] ];
var graph = new Rickshaw.Graph( {
element: document.getElementById("chart"),
width: 940,
height: 250,
renderer: 'area',
stroke: true,
series: [
{
color: 'steelblue',
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream