Skip to content

Instantly share code, notes, and snippets.

Nico Van Severen nicovs

Block or report user

Report or block nicovs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View get_singlecheckpoint.sh
#!/bin/zsh
EXPLORERAPI=https://explorer.nycoin.community/api
BLOCKHIGHT=$(curl -s "$EXPLORERAPI/getblockcount")
calc(){ awk "BEGIN{ print $* }" ;}
echo "["
for i in {16376..$BLOCKHIGHT..16376}
do
HASH=$(curl -s "$EXPLORERAPI/getblockhash?index=$i")
sleep 1
DATA=$(curl -s "$EXPLORERAPI/getblock?hash=$HASH")
@nicovs
nicovs / get_headercheckpoints.sh
Last active May 9, 2018
Newyorkcoin electrumx checkpoints file
View get_headercheckpoints.sh
#!/bin/zsh
EXPLORERAPI=https://explorer.nycoin.community/api
BLOCKHIGHT=$(curl -s "$EXPLORERAPI/getblockcount")
calc(){ awk "BEGIN{ print $* }" ;}
counter=0
echo "["
for i in {2015..$BLOCKHIGHT..2016}
do
HASH=$(curl -s "$EXPLORERAPI/getblockhash?index=$i")
sleep .5
View Node and Iquidus Explorer Setup for Dummies
Node / Iquidus Explorer Setup for Dummies
Pulse Crypto is used in this example.
This Tutorial is going to create a Daemon (node) and install Explorer.
THIS IS NOT GOING TO CREATE A GUI CLIENT.
Follow the instructions in [whatever coin name] docs folder Unix build - some builds are different.
I setup this up on both Ubuntu 15.10 and 16.04 with no issues.
You can create an account on vultr and get $50 free to be used in 2 months.
@nicovs
nicovs / 0_reuse_code.js
Created May 15, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View batch-strace.sh
#!/bin/bash
additional_strace_args="$1"
MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep 'master process' | cut -d ' ' -f 6)
pgrep php-fpm |while read -r pid;
do
if [[ $pid != $MASTER_PID ]]; then
nohup strace -r -p "$pid" $additional_strace_args >"/root/fpm-traces/$pid.trc" 2>&1 &
View batch-strace.sh
#!/bin/bash
additional_strace_args="$1"
MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep 'master process' | cut -d ' ' -f 6)
while read -r pid;
do
if [[ $pid != $MASTER_PID ]]; then
nohup strace -r -p "$pid" $additional_strace_args >"$pid.trc" 2>&1 &
View gdbvarnish
gdb varnishd
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
@nicovs
nicovs / default_vanrish
Created Nov 6, 2013
etc/default/varnish
View default_vanrish
# file managed by puppet
#
# Configuration file for varnish
#
# /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and $MEMLOCK
# to be set from this shell script fragment.
#
# Should we start varnishd at boot? Set to "yes" to enable.
START=yes
@nicovs
nicovs / default.vcl
Last active Dec 27, 2015
Magento Varnish Turpentine VCL
View default.vcl
C{
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <pthread.h>
static pthread_mutex_t lrand_mutex = PTHREAD_MUTEX_INITIALIZER;
void generate_uuid(char* buf) {
pthread_mutex_lock(&lrand_mutex);
long a = lrand48();
long b = lrand48();
@nicovs
nicovs / innobackupex-restore.sh
Created Oct 29, 2012 — forked from dalecaru/innobackupex-restore.sh
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
View innobackupex-restore.sh
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# This script is provided as-is; no liability can be accepted for use.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"
You can’t perform that action at this time.