Skip to content

Instantly share code, notes, and snippets.

View Laupe's full-sized avatar

Pavel Dvořák Laupe

View GitHub Profile
@jdeathe
jdeathe / php-cachetool-usage.md
Last active January 11, 2023 23:46
How to Clear PHP Opcache without Restarting PHP-FPM.

PHP CacheTool - Manage cache in the CLI

Use CacheTool to view stats for and manage PHP's APC or Zend Opcache opcode cache.

Using CacheTool you can clear the PHP opcache without reloading PHP-FPM.

In this example, CacheTool is to be installed alongside a demonstration PHP-FPM Docker container.

Prerequisites

@kamermans
kamermans / result.txt
Created October 26, 2015 23:34
PHP time() vs microtime() vs microtime(true) benchmark
PHP
--------------------------------------------------------------
Total Iterations: 10,000,000
time(): 0.73976612091064 seconds (13,517,785/sec)
microtime(): 4.2245488166809 seconds (2,367,116/sec)
microtime(true): 1.2555038928986 seconds (7,964,929/sec)
HHVM
--------------------------------------------------------------
Total Iterations: 10,000,000
@kamermans
kamermans / .bash_git.sh
Created May 22, 2015 19:04
A better bash-git prompt using git-prompt
# A better bash-git prompt using git-prompt
# https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
LIGHT_WHITE="\[\033[1;37m\]"
WHITE="\[\033[0;37m\]"
GRAY="\[\033[1;30m\]"
BLACK="\[\033[0;30m\]"
RED="\[\033[0;31m\]"
LIGHT_RED="\[\033[1;31m\]"
GREEN="\[\033[0;32m\]"
@jpillora
jpillora / utserver.conf
Last active February 21, 2019 11:55
Sample utorrent server "utserver" config file http://forum.utorrent.com/topic/73370-sample-utserverconfig-file/
##
## utserver.conf
## Configuration settings template for μTorrent for Linux.
## Taken from μTorrent Server manual for version alpha-3.3.
## ©2013 BitTorrent, Inc.
## Compiled by Rich.T.
##
##
## Command-line Arguments
@Mic92
Mic92 / uploaddropbox.py
Created March 4, 2013 08:21
dropbox upload for pyload
#!/usr/bin/env python2
import sys
import inspect
import os.path
import subprocess
import logging
from dropbox import client, rest, session
# XXX Fill in your consumer key and secret below
# You can find these at http://www.dropbox.com/developers/apps
@alexnederlof
alexnederlof / selenium-start-stop.sh
Created November 20, 2012 19:49
Selenium start-stop script
#!/bin/bash
# Note that this script requires you to have
# an X window running on Display :90
# This can be done by running: /usr/bin/Xvfb :90 -ac -screen 0 1024x768x8 &
#
# You can save this script as /etc/init.d/selenium to start and stop selenium
PORT=4443
DESC="Selenium server"
@kamermans
kamermans / fail2ban-allstatus.sh
Created July 11, 2011 17:06
Show status of all fail2ban jails at once
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done