Skip to content

Instantly share code, notes, and snippets.

View leverich's full-sized avatar

Jacob Leverich leverich

  • San Francisco, CA
View GitHub Profile
@leverich
leverich / tide_fac.f
Created November 27, 2015 19:02
tide_fac.f modified to compute node factors and equilibrium arguments for all 37 NOS/NOAA tidal constituents
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 September 19, 2015 20:27
jsub - convenient qsub wrapper
#!/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 September 19, 2015 20:25
manage a chunk in a conf file
#!/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 September 19, 2015 20:22
Hacky tool to join timestamped logs
#!/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 September 19, 2015 20:20
swarm - another parallel ssh wrapper
#!/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 September 19, 2015 20:16
Yet another parallel ssh wrapper
#!/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 April 9, 2014 17:07
Systemtap script to trace latency of concurrent memcached requests as they percolate through the Linux kernel.
# Systemtap script to trace latency of concurrent memcached requests
# as they percolate through the Linux kernel.
# - Jacob Leverich <[email protected]> 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 March 3, 2023 06:18
Borrowed Virtual Time patch against Linux 3.5.0
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;