Skip to content

Instantly share code, notes, and snippets.

View xikaos's full-sized avatar

Francisco Budaszewski Zanatta xikaos

  • NG.CASH
  • Brazil
  • 00:00 (UTC -03:00)
View GitHub Profile
@xikaos
xikaos / phantomjs.sh
Created January 22, 2018 16:54
Download/link Phantomjs bin
#!/bin/bash
#Wget Phantomjs
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
#Extract files
tar -xf phantomjs-2.1.1-linux-x86_64.tar.bz2
#Change to dir
cd phantomjs-2.1.1-linux-x86_64
@xikaos
xikaos / shitty.php
Created February 6, 2018 18:59
Shitty ".select" ruby method analog.
function filter_by_value ($array, $index, $value){
if(is_array($array) && count($array)>0)
{
foreach(array_keys($array) as $key){
$temp[$key] = $array[$key][$index];
if ($temp[$key] == $value){
$newarray[$key] = $array[$key];
}
@xikaos
xikaos / dbg.h
Created February 14, 2018 11:22
Zed's Awesome Debug Macros
#ifndef __dbg_h__
#define __dbg_h__
#include <stdio.h>
#include <errno.h>
#include <string.h>
#ifdef NDEBUG
#define debug(M, ...)
#else
# Entrar no servidor e fora da pasta do projeto
$ git init --bare repo
Criar hooks post-receive
$ cd repo/hooks
$ nano post-receive
## Adicionar no arquivo
@xikaos
xikaos / slave_down.conf
Last active July 4, 2018 00:59
Netdata alert to check if a node is down. Put on the master health.d directory.
alarm: slave_down
on: system.cpu
calc: $now - $last_collected_t
units: seconds ago
every: 10s
warn: $this > (($status >= $WARNING) ? ($update_every) : ( 5 * $update_every))
crit: $this > (($status == $CRITICAL) ? ($update_every) : (60 * $update_every))
info: number of seconds since the last successful data collection
to: sysadmin