Skip to content

Instantly share code, notes, and snippets.

View GeertJohan's full-sized avatar

Geert-Johan Riemer GeertJohan

View GitHub Profile
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
@GeertJohan
GeertJohan / Dockerfile
Created February 24, 2015 15:34
explanation at the bottom
FROM ubuntu
RUN sudo apt-get update && sudo apt-get -y install xpra x11-apps
RUN export uid=1000 gid=1000 && \
mkdir -p /home/user && \
echo "user:x:${uid}:${gid}:User,,,:/home/user:/bin/bash" >> /etc/passwd && \
echo "user:x:${uid}:" >> /etc/group && \
chown ${uid}:${gid} -R /home/user
$ ls -al
total 172
drwxr-xr-x 2 geertjohan geertjohan 4096 Feb 24 16:23 .
drwx------ 52 geertjohan geertjohan 20480 Feb 24 16:25 ..
-rw-r--r-- 1 geertjohan geertjohan 4443 Feb 24 11:15 :100.log
-rw-r--r-- 1 geertjohan geertjohan 4443 Feb 24 11:14 :100.log.old
srw------- 1 geertjohan geertjohan 0 Feb 24 16:23 5b140a830a50-100
lrwxrwxrwx 1 geertjohan geertjohan 16 Feb 24 16:23 foizetux-100 -> 5b140a830a50-100
-rw-r--r-- 1 geertjohan geertjohan 98 Feb 24 11:28 foizetux-100.log
-rwx------ 1 geertjohan geertjohan 1009 Feb 24 16:23 run-xpra
FROM ubuntu
RUN apt-get update && apt-get install -y ktorrent
CMD /usr/bin/ktorrent
package main
import (
"fmt"
"github.com/segmentio/go-loggly"
"gopkg.in/inconshreveable/log15.v2"
)
type LogglyHook struct {
package main
import (
"fmt"
"github.com/segmentio/go-loggly"
"gopkg.in/inconshreveable/log15.v2"
)
type LogglyHook struct {

Clean up Digishield for use in Guldencoin.

Removing unused local variable nHeight.

Both nTargetSpacing and nTargetTimespanNEW are defined as 2.5*60, which means that retargetInterval will always equal 1. This means that (pindexLast->nHeight+1) % retargetInterval will always resolve to 0 and therefore the block following if ((pindexLast->nHeight+1) % retargetInterval != 0) will never be ran. Removing the complete block as it is dead code.

Removing the genesis exception, we're never mining a genesis block with DIGI.

Removing the now unused local variables nProofOfWorkLimit and retargetSpacing.

// Digi algorithm should never be used until at least 2 blocks are mined.
// Contains code by RealSolid & WDC
// Cleaned up for use in Guldencoin by GeertJohan (dead code removal since Guldencoin retargets every block)
unsigned int static GetNextWorkRequired_DIGI(const CBlockIndex* pindexLast, const CBlockHeader *pblock){
// retarget timespan is set to a single block spacing because there is a retarget every block
int64 retargetTimespan = nTargetSpacing;
// get previous block
const CBlockIndex* pindexPrev = pindexLast->pprev;
assert(pindexPrev);
// Digi algorithm should never be used until at least 2 blocks are mined.
// Contains code by RealSolid & WDC
// Cleaned up for use in Guldencoin by GeertJohan (dead code removal since Guldencoin retargets every block)
unsigned int static GetNextWorkRequired_DIGI(const CBlockIndex* pindexLast, const CBlockHeader *pblock){
// retarget timespan is set to a single block spacing because there is a retarget every block
int64 retargetTimespan = nTargetSpacing;
// get previous block
const CBlockIndex* pindexPrev = pindexLast->pprev;
assert(pindexPrev);
fatal error: fault
[signal 0xb code=0x80 addr=0x0 pc=0x5852d8]
goroutine 1 [running, locked to thread]:
runtime.gothrow(0x7ac5c0, 0x5)
/home/geertjohan/Applications/go/src/runtime/panic.go:503 +0x8e fp=0xc208087a68 sp=0xc208087a50
runtime.sigpanic()
/home/geertjohan/Applications/go/src/runtime/sigpanic_unix.go:29 +0x265 fp=0xc208087ab8 sp=0xc208087a68
github.com/jteeuwen/go-vlc.goEventCB(0x7f219b3e5e10, 0xc2082342e0)
/home/geertjohan/Workspaces/Go/gopath/src/github.com/jteeuwen/go-vlc/callback.go:32 +0xd8 fp=0xc208087b20 sp=0xc208087ab8