Skip to content

Instantly share code, notes, and snippets.

View svalaskevicius's full-sized avatar

Sarunas Valaskevicius svalaskevicius

View GitHub Profile
(gdb) bt full
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
tid = <optimized out>
ret = 0
pd = <optimized out>
old_mask = {__val = {140730074006592}}
ret = <optimized out>
#1 0x000076ce9f4e0463 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:78
No locals.
#2 0x000076ce9f487120 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
import cats.{Eval, Monad}
class StateT[F[_], S, A](val run: S => F[(S, A)]) extends AnyVal
object StateT {
implicit def monad[F[_], S](implicit F: Monad[F]): Monad[StateT[F, S, *]] = new Monad[StateT[F, S, *]] {
def flatMap[A, B](fa: StateT[F, S, A])(f: A => StateT[F, S, B]): StateT[F, S, B] =
new StateT(
s =>
F.flatMap(
#!/usr/bin/env bash
PACKAGE="$1"
VERSION="$(cat "$1.cabal" | grep -e '^version:[0-9 \.]*$' | sed -e 's/^version:\s*\([0-9\.]*\)\s*$/\1/')"
if test -z "$VERSION" ; then
echo "version not found."
exit 1
fi
@svalaskevicius
svalaskevicius / _bdbxml-clang-cpp11.md
Created December 16, 2012 20:57
BDB XML on mac with clang and cpp11

Compiling BDBXML for clang and c++11

To be able to compile BDB XML with clang, there are some code changes to be implemented first - see the accompanying patch file.

patch -p2 < ~/bdbxml-clang.patch

./buildall.sh -m 'make -j6' \
--with-configure-env="CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -lc++ -mmacosx-version-min=10.7 -Wno-c++11-narrowing' LDFLAGS='-stdlib=libc++ -lc++ -mmacosx-version-min=10.7'" \
@svalaskevicius
svalaskevicius / _proftpd_for_sftp.md
Created December 15, 2012 15:12
a guide to install sftp with proftpd

Setting up

The following commands assume the system is CentOS/RedHat Linux and ProFTPD configuration is same or similar to CentOS package version: 1.3.3g; release: 1.el6.

yum install proftpd

cd ~/
wget https://gist.github.com/raw/4296200/proftpd.conf.patch
#!/bin/bash
set -e
if [[ $1 == "-v" ]]; then
verbose=1
shift
fi
process=$1