A Brief Introduction to Multi-Threading in PHP
- Foreword
- Execution
- Sharing
- Synchronization
- Pitfalls
#!/bin/sh | |
# | |
# This script automatically configures rsyslog for Loggly. This script requires that the | |
# your Customer Token is passed in via EC2 user-data, on its own line, as follows: | |
# | |
# LOGGLY_AUTH=<your auth token> | |
# | |
# For example, if your Customer Token is 727bae3d-750c-4e44-96ed-ad83230208bb, then pass | |
# | |
# LOGGLY_AUTH=727bae3d-750c-4e44-96ed-ad83230208bb |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
RDBMS-based job queues have been criticized recently for being unable to handle heavy loads. And they deserve it, to some extent, because the queries used to safely lock a job have been pretty hairy. SELECT FOR UPDATE followed by an UPDATE works fine at first, but then you add more workers, and each is trying to SELECT FOR UPDATE the same row (and maybe throwing NOWAIT in there, then catching the errors and retrying), and things slow down.
On top of that, they have to actually update the row to mark it as locked, so the rest of your workers are sitting there waiting while one of them propagates its lock to disk (and the disks of however many servers you're replicating to). QueueClassic got some mileage out of the novel idea of randomly picking a row near the front of the queue to lock, but I can't still seem to get more than an an extra few hundred jobs per second out of it under heavy load.
So, many developers have started going straight t
/* | |
From https://github.com/gulpjs/gulp/issues/101. Organize gulpfile.js using concept of environment variables. | |
1. Set up sub-tasks to behave in a certain according to env var; may be env agnostic. | |
2. Set up high-level tasks to run a group of sub-tasks to orchestrate a behaviour (testing, staging, prod, etc) | |
*/ | |
var R = 0; | |
var ENV_SWITCH = void 0; |
mkdir ~/kafka | |
vagrant init metrics http://files.vagrantup.com/precise64.box | |
vagrant up | |
vagrant ssh | |
sudo apt-get update | |
sudo apt-get install curl | |
sudo apt-get install python-software-properties |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
## | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 Ryan Morrissey | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
#!/usr/bin/python | |
''' | |
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2 | |
Correct PIN for hash and salt below is 1234. | |
Get 40-character hash value in ascii hex format from file /data/system/password.key on the phone | |
Get salt in signed numeric format by doing sqlite3 query SELECT value FROM locksettings WHERE name = 'lockscreen.password_salt' on /data/system/locksettings.db |
public enum Cacheability | |
{ | |
NoCache, | |
Private, | |
Public, | |
} |