Skip to content

Instantly share code, notes, and snippets.

View celskeggs's full-sized avatar

Cel Skeggs celskeggs

View GitHub Profile
@celskeggs
celskeggs / gist:db24e886e63d7134ea2bbb9934c3184f
Created January 7, 2020 01:08
Memset optimization index
Implementation strategies:
- For loop with Duff's device
- `rep movsd` and similar
- mmx with movq on x86
- sse: movaps (16 byte aligned), caution about
https://stackoverflow.com/questions/3654905/faster-way-to-zero-memory-than-with-memset
@celskeggs
celskeggs / _README.md
Last active December 7, 2019 01:04
1-bit Serial Register supplementary data
@celskeggs
celskeggs / WORKSPACE
Created December 1, 2019 20:41
Can't build ceph with rules_foreign_cc
# to reproduce: bazel build @ceph//:all
# will OOM
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "ceph",
url = "https://download.ceph.com/tarballs/ceph_14.2.4.orig.tar.gz",
sha256 = "7180b6afcac57d858f1b7cf49615e8903fbf1a701ae00fb956a5656d608fd0f8",
build_file_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])""",
@celskeggs
celskeggs / 6480.md
Last active December 1, 2019 20:40
A set of publicly usable reproduction steps for #6480

DON'T USE THIS; IT DOESN'T WORK

Reproducing bazelbuild/bazel#6480 in sipb/homeworld

We run pinned versions of bazel in a build chroot (which is run with systemd-nspawn).

(Recommended: using a debian stretch machine with passwordless sudo. A n1-standard-2 GCP instance should work.)

Take the following steps to set up and enter the build chroot:

@celskeggs
celskeggs / hellogo.txt
Created November 22, 2018 07:54
hellogo failures
$ /hellogo
panic: unimplemented
fatal error: panic on system stack
fatal error: unimplemented
panic during panic
runtime stack:
runtime.throw(0x887f82, 0xd)
fatal error: malloc deadlock
stack trace unavailable
@celskeggs
celskeggs / db.py
Created November 13, 2018 00:16
hylock scripts
import os
import sqlalchemy
import sqlalchemy.ext.declarative
import sqlalchemy.orm
SQLBase = sqlalchemy.ext.declarative.declarative_base()
class Locks(SQLBase):
__tablename__ = "locks"
name = sqlalchemy.Column(sqlalchemy.String(63), nullable=False, primary_key=True)
@celskeggs
celskeggs / chop-ccache.py
Created February 25, 2018 02:40
Parser and chopper for krb5 ccaches
def u16(data, index):
assert len(data) >= 2
return int.from_bytes(data[index:index+2], "big")
def u32(data, index):
assert len(data) >= 4
return int.from_bytes(data[index:index+4], "big")
def parse_header(header):
fields = []
@celskeggs
celskeggs / manifest.json
Created February 17, 2018 23:49
broken PodManifest for kvm stage1
{
"acVersion": "0.8.9+git",
"acKind": "PodManifest",
"apps": [
{
"name": "kubedns",
"image": {
"id": "sha512-f281620f59eec9ff4dd26ce3995a52cd6372a615667db97061d876ee9186e4cc"
},
"app": {
@celskeggs
celskeggs / dmesg.txt
Created January 21, 2018 21:49
rcu_sched detected stalls info for hyades
[81210.948409] INFO: rcu_sched detected stalls on CPUs/tasks:
[81210.951215] (detected by 1, t=15712987 jiffies, g=1158641, c=1158640, q=19)
[81210.954048] All QSes seen, last rcu_sched kthread activity 15712987 (4315195843-4299482856), jiffies_till_next_fqs=1, root ->qsmask 0x0
[81210.959599] qemu R running task 0 11176 777 0x00000008
[81210.959604] ffffffffac84a600 ffffffffabca2d7b ffff964a1fd18f80 ffffffffac84a600
[81210.959607] ffffffffabcde16c 0000000000000000 ffff964a06d04dc0 000000000011adf1
[81210.959609] 0000000000000000 0000000000000000 ffffffff00000000 00001e84d8b11400
[81210.959611] Call Trace:
[81210.959615] <IRQ>
[81210.959622] [<ffffffffabca2d7b>] ? sched_show_task+0xcb/0x130
@celskeggs
celskeggs / keybase.md
Last active February 10, 2016 15:59
keybase verification

Keybase proof

I hereby claim:

  • I am celskeggs on github.
  • I am skeggsc (https://keybase.io/skeggsc) on keybase.
  • I have a public key ASAwS9Tpyu4plKdZwYJyUW_D2H-ISdlFeqncRNmoojxwJAo

To claim this, I am signing this object: {