-
Open the Terminal
-
Use
mysqldump
to backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql
-
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class MY_Session extends CI_Session{ | |
private $sess_use_redis = TRUE; | |
private $redis = ''; | |
public function __construct($params = array()) { | |
//parent::__construct(); | |
$this->CI =& get_instance(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To disable socket.io, disable the sockets hook (you'll have to disable the pubsub hook as well) | |
// This is a replacement for the default app.js file: | |
require('sails').lift({ | |
hooks: { | |
sockets: false, | |
pubsub: false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This script will boot app.js with the number of workers | |
// specified in WORKER_COUNT. | |
// | |
// The master will respond to SIGHUP, which will trigger | |
// restarting all the workers and reloading the app. | |
var cluster = require('cluster'); | |
var workerCount = process.env.WORKER_COUNT || 2; | |
// Defines what each worker needs to run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var traverse = function(o, fn) { | |
for (var i in o) { | |
fn.apply(this,[i,o[i]]); | |
if (o[i] !== null && typeof(o[i])=="object") { | |
traverse(o[i], fn); | |
} | |
} | |
} | |
// usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vrrp_script chk_redis_master { | |
script "redis-cli info replication | grep -q 'role:master'" | |
interval 2 | |
weight 2 | |
rise 2 | |
fall 2 | |
} | |
vrrp_instance redis_vip { | |
interface eth0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make sure you have these installed | |
yum install -y make gcc perl pcre-devel zlib-devel | |
# Download/Extract source | |
wget -O /tmp/haproxy.tgz http://www.haproxy.org/download/1.7/src/haproxy-1.7.2.tar.gz | |
tar -zxvf /tmp/haproxy.tgz -C /tmp | |
cd /tmp/haproxy-* | |
# Compile HAProxy | |
# https://github.com/haproxy/haproxy/blob/master/README | |
make \ | |
TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
All actions are performed in Terminal.app. | |
1. Install Homebrew http://brew.sh/ | |
2. Install Jack (route audio tool) http://jackaudio.org/. Current stable version from official website doesn't work with | |
MacOS Sierra (I use 10.12.3) so you need to download beta version from there https://yadi.sk/d/JwT10b7v3Dm5yy. | |
After installing reboot your computer. | |
3. Install Darkice (audio streamer) via brew. |
OlderNewer