Skip to content

Instantly share code, notes, and snippets.

@nicovs
nicovs / innobackupex-restore.sh
Created October 29, 2012 13:41 — forked from dalecaru/innobackupex-restore.sh
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
#!/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"
@nicovs
nicovs / default.vcl
Last active December 27, 2015 13:29
Magento Varnish Turpentine 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 / default_vanrish
Created November 6, 2013 09:50
etc/default/varnish
# 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 / gdbvarnish
Created November 6, 2013 21:57
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/>...
#!/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 &
#!/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 &
@nicovs
nicovs / 0_reuse_code.js
Created May 15, 2017 20:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/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 13:11
Newyorkcoin electrumx checkpoints file
#!/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
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.