Skip to content

Instantly share code, notes, and snippets.

View stefantalpalaru's full-sized avatar

Ștefan Talpalaru stefantalpalaru

View GitHub Profile
@stefantalpalaru
stefantalpalaru / ztaskd_stop.patch
Created March 17, 2012 00:32
django-ztask daemon stop patch
--- ztaskd.py.orig 2012-03-17 01:20:35.322837875 +0100
+++ ztaskd.py 2012-03-17 01:00:47.000000000 +0100
@@ -20,30 +20,81 @@
import logging
import pickle
import datetime, time
-
+import os
+import signal
+from pprint import pprint
@stefantalpalaru
stefantalpalaru / post-update
Created February 9, 2017 17:13
post-update git hook for the test repo
#!/bin/sh
#
# This hook does two things:
#
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
#
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.
@stefantalpalaru
stefantalpalaru / post-update
Last active February 9, 2017 17:17
post-update git hook for the production repo
#!/bin/sh
#
# This hook does two things:
#
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
#
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.
@stefantalpalaru
stefantalpalaru / python-2.7.15-PGO-ICE.patch
Created May 28, 2018 11:48
python-2.7.15-PGO-ICE.patch
diff -ur cpython-2.7.15.orig/Makefile.pre.in cpython-2.7.15/Makefile.pre.in
--- cpython-2.7.15.orig/Makefile.pre.in 2018-04-30 00:47:33.000000000 +0200
+++ cpython-2.7.15/Makefile.pre.in 2018-05-28 13:43:45.872309762 +0200
@@ -210,8 +210,9 @@
# The task to run while instrument when building the profile-opt target
# We exclude unittests with -x that take a rediculious amount of time to
-# run in the instrumented training build or do not provide much value.
-PROFILE_TASK=-m test.regrtest --pgo -x test_asyncore test_gdb test_multiprocessing test_subprocess
+# run in the instrumented training build or do not provide much value
@stefantalpalaru
stefantalpalaru / replicate-python-ICE.sh
Created May 28, 2018 12:23
replicate PGO ICE with Python-2.7.15 and GCC
wget "https://github.com/python/cpython/archive/v2.7.15.tar.gz"
tar xzf v2.7.15.tar.gz
# patch to enable PGO for extensions and leave the *.gcda files at the end
wget "https://gist.githubusercontent.com/stefantalpalaru/3035b87a48cc273585ee69f95e8343bf/raw/874ea6507321e22ff5c7a106ceb36d2d41787b43/python-2.7.15-PGO-ICE.patch"
cd cpython-2.7.15
patch -p1 -i ../python-2.7.15-PGO-ICE.patch
CFLAGS="-O3 -march=native -pipe" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common" ./configure --enable-optimizations --with-lto
make -j8 EXTRATESTOPTS="-j8" 2>&1 | tee build.log
grep '\btimemodule\.c' build.log
find -name 'timemodule.gcda' -exec gcov-dump '{}' \; | head | cut -d ':' -f 2-
@stefantalpalaru
stefantalpalaru / a.cpp
Created May 30, 2018 22:34
GCC precompiled header bug on bdver2 with -march=native
#include "stdafx.h"
int main(int argc, char**argv)
{
std::string s = "Hi";
std::cout << s << std::endl;
return 0;
}
@stefantalpalaru
stefantalpalaru / gist:8cbc3effc9a2ebde788a9995d4a8f3d0
Created December 10, 2018 15:33
stRecursiveCreate/recursiveCreateReturnValue.json stack overflow traceback
Traceback (most recent call last)
test_helpers.nim(167) test_generalstate_json
test_generalstate_json.nim(124) testFixture
test_generalstate_json.nim(70) testFixtureIndexes
vm_state_transactions.nim(53) execComputation
interpreter_dispatch.nim(252) executeOpcodes
interpreter_dispatch.nim(240) updateOpcodeExec
interpreter_dispatch.nim(207) frontierVM
opcodes_impl.nim(586) create
computation.nim(254) applyChildComputation
@stefantalpalaru
stefantalpalaru / gdb-output.sh
Created January 1, 2019 17:56
segfault while compiling aporia-0.4.2 with nim-0.19.2
$ gdb --args nim c -d:release --verbosity:2 -p:"\$lib/packages/gtk2" -p:"\$lib/packages/cairo" -p:"\$lib/packages/dialogs" aporia.nim
Reading symbols from nim...done.
(gdb) r
Starting program: /usr/bin/nim c -d:release --verbosity:2 -p:\$lib/packages/gtk2 -p:\$lib/packages/cairo -p:\$lib/packages/dialogs aporia.nim
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
/etc/nim/nim.cfg(47, 3) Hint: added path: '/root/.nimble/pkgs/' [Path]
nimblepath="$home/.nimble/pkgs/"
^
/etc/nim/nim.cfg(49, 5) Hint: added path: '/opt/nimble/pkgs/' [Path]
@stefantalpalaru
stefantalpalaru / nimbus1.svg
Last active March 6, 2019 01:35
Nimbus resource usage during sync
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stefantalpalaru
stefantalpalaru / nimbus3-long.svg
Last active March 6, 2019 01:41
Nimbus stats - 1s per pixel
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.