Skip to content

Instantly share code, notes, and snippets.

@dizda
dizda / php.rb
Created March 2, 2012 17:01
brew install php 5.4
require 'formula'
def mysql_installed?
`which mysql_config`.length > 0
end
def postgres_installed?
`which pg_config`.length > 0
end
@dizda
dizda / gist:2589229
Last active October 4, 2015 05:57
sample configuration file of nginx for symfony2 project
server {
listen [::]:80;# to listenning both on IPv4 & IPv6
server_name dev.youserver.com;
location / {
root /opt/www/dev.yourserver.com/symfony/web;
index app.php;
if ($request_filename !~ "\.(htc|ico|gif|jpg|jpeg|png|css|js)$") {
rewrite ^(.*) /app.php$1 last;
@dizda
dizda / Growl.js
Last active December 14, 2015 05:49 — forked from Seasons7/app.js
Growl-like notifications in Titanium (tested under iOS)
Growl = (function() {
// constructor
function Growl(message){
this.message = message;
}
Growl.prototype.show = function()
{
this.createWindow();
@dizda
dizda / mongo.js
Created May 4, 2013 23:24
MongoDB Add field to all documents without criteria
db.TheCollection.update({}, {$set:{'parent':true}}, {multi:true});
// {} = empty selector
@dizda
dizda / install-bitcoind.sh
Last active July 18, 2022 06:41
Install bitcoind on debian wheezy
wget https://github.com/bitcoin/bitcoin/archive/v0.9.3.tar.gz
tar xvzf v0.9.3.tar.gz
mv bitcoin-0.9.3/ daemon/
apt-get install build-essential libtool autotools-dev autoconf libssl-dev libboost-all-dev pkg-config
# Get configure
./autogen.sh
# Enable hardening is more secure
@dizda
dizda / keybase.md
Created April 14, 2015 23:03
keybase.io

Keybase proof

I hereby claim:

  • I am dizda on github.
  • I am dizda (https://keybase.io/dizda) on keybase.
  • I have a public key whose fingerprint is 4EFA 466E EFD4 BECC E682 CB8F CB82 C516 AE43 A354

To claim this, I am signing this object:

@dizda
dizda / Gulpfile.js
Created April 20, 2015 09:49
Gulpfile.js
'use strict';
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
minifycss = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
del = require('del'),
useref = require('gulp-useref'),
gulpif = require('gulp-if'),
@dizda
dizda / squid_mysql_redis_auth.php
Created April 21, 2016 14:38
Database auth helper for Squid in php using redis as a cache provider.
#!/usr/bin/env php
<?php
/**
* Database auth helper for Squid in php using redis as a cache provider.
* Jonathan Dizdarevic @dizzda
*/
//stream_set_blocking(STDIN, 0);
//error_reporting(0);
@dizda
dizda / install_nano.sh
Created April 4, 2018 12:05
NANO install specific version's script
#!/usr/bin/env bash
set -o errexit
set -o xtrace
VERSION=$1
rm -rf rai_build_$VERSION/
echo "Installing $VERSION..."
git clone --recursive https://github.com/nanocurrency/raiblocks.git rai_build_$VERSION
cd rai_build_$VERSION
@dizda
dizda / gist:a6b7bb4a2ff56fc40663cdc9e90553fa
Created July 6, 2020 07:26 — forked from carlos8f/gist:3473107
siege Mac OS X caveats
Mac OS X has only 16K ports available that won't be released until socket
TIME_WAIT is passed. The default timeout for TIME_WAIT is 15 seconds.
Consider reducing in case of available port bottleneck.
You can check whether this is a problem with netstat:
# sysctl net.inet.tcp.msl
net.inet.tcp.msl: 15000
# sudo sysctl -w net.inet.tcp.msl=100