Skip to content

Instantly share code, notes, and snippets.

Avatar

Jacob Leverich leverich

  • San Francisco, CA
View GitHub Profile
@leverich
leverich / tide_fac.f
Created Nov 27, 2015
tide_fac.f modified to compute node factors and equilibrium arguments for all 37 NOS/NOAA tidal constituents
View tide_fac.f
C PROGRAM TO COMPUTE NODAL FACTORS AND EQUILIBRIUM ARGUEMENTS
C
C
PARAMETER(NCNST=37)
CHARACTER CNAME(NCNST)*8
COMMON /CNSNAM/ CNAME
REAL NODFAC,MONTH
DIMENSION NCON(NCNST)
COMMON /CNST/ NODFAC(NCNST),GRTERM(NCNST),SPEED(NCNST),P(NCNST)
@leverich
leverich / jsub
Created Sep 19, 2015
jsub - convenient qsub wrapper
View jsub
#!/usr/bin/perl
$usage = "jsub version 0.3
Synopsis:
jsub is a speck of a Perl script designed to make life with Torque
a little bit more pleasant. It mimics the functionality of LSF's
bsub; that is, you can directly specify the command (and arguments)
that you want to submit as a batch job rather than having to write
a submission script. It also supports non-shell interactive jobs.
@leverich
leverich / update-conf-file.sh
Created Sep 19, 2015
manage a chunk in a conf file
View update-conf-file.sh
#!/bin/bash
#
# update-conf-file <file to update> [<file to insert> | <directory>]
#
# This script manages the insertion or update of a singleton region of
# a file. You can use it to insert lines into configuration files, and
# cleanly update them later.
#
# If a file to insert is specified, that file will be cat'd into the
# file to update. If a directory is specified, all files that don't
@leverich
leverich / tcorrelate.py
Created Sep 19, 2015
Hacky tool to join timestamped logs
View tcorrelate.py
#!/usr/bin/perl
## assumptions...
### 1. time samples within some correlation coefficient are candidates
### for a matching. this correlation coefficient should be longer than
### the longest sample period.
### 2. the nearest sample (rounded up or down) shall be the matching
### sample. should some samples be collected at a faster rate than
@leverich
leverich / swarm.sh
Created Sep 19, 2015
swarm - another parallel ssh wrapper
View swarm.sh
#!/bin/bash
## Run commands on a set of hosts
WAIT="%%"
while getopts 'w' OPTION; do
case $OPTION in
w) WAIT="" ;;
?) usage; exit ;;
@leverich
leverich / dsh
Created Sep 19, 2015
Yet another parallel ssh wrapper
View dsh
#!/usr/bin/perl
%hosts = (
"example" => "host-0..9",
);
sub usage {
print"
dsh -- run commands with ssh on several hosts simultaneous
@leverich
leverich / track.stp
Created Apr 9, 2014
Systemtap script to trace latency of concurrent memcached requests as they percolate through the Linux kernel.
View track.stp
# Systemtap script to trace latency of concurrent memcached requests
# as they percolate through the Linux kernel.
# - Jacob Leverich <leverich@cs.stanford.edu> 2013
#
# Note: You MUST call this script with "-x <TID>" where TID is the
# *task id* of a memcached worker thread. This is usually PID+1 of
# memcached. So do something like:
#
# % memcached -t 1 -d
# % pgrep memcached
@leverich
leverich / patch-3.5.0-bvt1
Last active Nov 28, 2021
Borrowed Virtual Time patch against Linux 3.5.0
View patch-3.5.0-bvt1
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4a1f493..ef258ef 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1179,6 +1179,10 @@ struct sched_entity {
u64 exec_start;
u64 sum_exec_runtime;
u64 vruntime;
+#ifdef CONFIG_CFS_BVT
+ u64 effective_vruntime;