Skip to content

Instantly share code, notes, and snippets.

View stephen-soltesz's full-sized avatar

Stephen Soltesz stephen-soltesz

View GitHub Profile
@stephen-soltesz
stephen-soltesz / main.go
Created April 11, 2022 20:58
Example updating BigQuery view or table descriptions using an M-Lab YAML description file.
package main
import (
"context"
"flag"
"io/ioutil"
"cloud.google.com/go/bigquery"
"github.com/m-lab/go/cloud/bqx"
package main
import (
"fmt"
"time"
"cloud.google.com/go/civil"
"github.com/m-lab/go/rtx"
)
@stephen-soltesz
stephen-soltesz / main.go
Last active December 3, 2019 04:57
Example usage of logx.Loggers() and logx.Setup()
import (
"flag"
"log"
"github.com/m-lab/go/flagx"
"github.com/m-lab/go/logx"
"github.com/m-lab/go/rtx"
)
@stephen-soltesz
stephen-soltesz / README
Last active October 29, 2019 03:40
reflect / schema
git clone https://gist.github.com/stephen-soltesz/fd52e5633563e9f652f83606cfdeb526 reflect-schema
cd reflect-schema/
go get .
bash-4.1# cat increase.sh
#/bin/bash
c=1
while true ; do
echo RUNNING `date --rfc-3339=seconds` - $c
for minute in 1 2 3 4 ; do
for i in `seq 1 $c` ; do
./web100clt -n ndt.iupui.mlab1.iad1t.measurement-lab.org -p 3001 --disablemid --disablec2s --disablesfw &
done
@stephen-soltesz
stephen-soltesz / ds.py
Created November 22, 2017 18:56
datastore python example
# Imports the Google Cloud client library
from google.cloud import datastore
# Instantiates a client
datastore_client = datastore.Client('mlab-staging')
# The kind for the new entity
kind = 'Task'
# The name/ID for the new entity
cd_func ()
{
local x2 the_new_dir adir index
local -i cnt
if [[ $1 == "--" ]]; then
dirs -v
return 0
fi
bash-4.1# gdb python
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-75.el6)
...
[snip]
...
Reading symbols from /usr/bin/python...Reading symbols from /usr/lib/debug/usr/bin/python2.6.debug...done.
done.
(gdb) attach 12168
Attaching to program: /usr/bin/python, process 12168
Reading symbols from /usr/lib/libpython2.6.so.1.0...Reading symbols from /usr/lib/debug/usr/lib/libpython2.6.so.1.0.debug...done.
#!/bin/bash
# Current prod release (first ndt-ssl release)
SERVER=ndt.iupui.mlab4v4.atl04.measurement-lab.org
# Latest ndt-ssl development.
SERVER=ndt.iupui.mlab2v4.nuq0t.measurement-lab.org
# Previous prod release (non-ssl) - 3.7.0.1
SERVER=ndt.iupui.mlab3v4.nuq1t.measurement-lab.org
PORT=3001
# PORT=4649 # For mlab2.nuq0t and port=4659 for ssl.
@stephen-soltesz
stephen-soltesz / kill_ndt.sh
Last active November 14, 2016 22:03
Run with: ./fetch.py --user iupui_ndt --nodelist ../plsync/good.ndt.txt --threadcount=40 --timeout 300 --script kill_ndt
(
parent=$( pstree -a -A -p | grep ndtd | grep -v grep | head -1 | tr ',' ' ' | awk '{print $2}' )
ps ax -opid,args \
| grep ndtd \
| grep -v grep \
| awk 'BEGIN {
start_time_index = 22 ;
utime_index = 14 ;
stime_index = 15 ;