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 | |
/* | |
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP) | |
Author: _ck_ (with contributions by GK, stasilok) | |
Version: 0.1.7 | |
Free for any kind of use or modification, I am not responsible for anything, please share your improvements | |
* revision history | |
0.1.7 2015-09-01 regex fix for PHP7 phpinfo | |
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter |
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
/** | |
* Creates a deep copy of an object | |
* @param {Any} from: Source object to clone | |
* @param {Object} dest: (Optional) destination object to merge with | |
* @return {Any} The cloned object | |
*/ | |
var clone = (function() { | |
var _toString = Object.prototype.toString; | |
function _clone (from, dest, objectsCache) { |
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
#!/bin/bash | |
############################################# | |
# Process Memory consumption # | |
# # | |
# Usage: psmem <process_name> [<user_grep>] # | |
# psmem nginx # | |
# psmem php5-fpm www-data # | |
# # | |
# Author: Dumitru Uzun (DUzun.me) # |
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
FROM httpd:2.4-alpine | |
# SSHD ################################# | |
RUN apk update && \ | |
apk add openssh augeas && \ | |
mkdir -p ~root/.ssh /etc/authorized_keys && chmod 700 ~root/.ssh/ && \ | |
augtool 'set /files/etc/ssh/sshd_config/AuthorizedKeysFile ".ssh/authorized_keys /etc/authorized_keys/%u"' && \ | |
augtool 'set /files/etc/ssh/sshd_config/PermitRootLogin yes' && \ | |
augtool 'set /files/etc/ssh/sshd_config/PasswordAuthentication yes' && \ | |
augtool 'set /files/etc/ssh/sshd_config/Port 22' && \ |
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 | |
// Note: | |
// Whether $list contains a NULL value for $needle at some level, or there is no $needle at all, | |
// in both cases this function returns NULL. | |
// If you want to find non-NULL $needle only, replace `array_key_exists` with `isset` | |
function findByKey($list, $needle) { | |
$stack = [$list]; | |
while( !empty($stack) ) { |
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
#!/bin/sh | |
# | |
# Keep your eyes safe on cron | |
# | |
# @author Dumitru Uzun (DUzun.Me) | |
# @web https://gist.github.com/duzun/99bd0d1cba6c8ad1b5bf321c2689a257 | |
# | |
_user=${USER:-$(whoami)} |
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
#!/bin/sh | |
# https://gist.github.com/duzun/234bd3ca69b243bb32bb | |
basedir=`dirname "$0"` | |
optimagurl=https://duzun.me/optimag.js | |
optimagjs=$basedir/optimag.js | |
case `uname` in | |
*CYGWIN*) optimagjs=`cygpath -w "$optimagjs"`;; |
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
#!/bin/bash | |
fix_lib_links() { | |
local i j dir write | |
[ "$2" = "-w" ] && write="$2" | |
dir=${1:-$PWD} | |
( | |
cd "$dir" && \ | |
for i in *.so.*; do | |
if [ -f "$i" ]; then |
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
#!/bin/bash | |
export REDISCLI_AUTH=my-supper-strong-password-4-redis-server | |
TTL=$(( 24 * 3600 )) | |
# cd "/var/sess" | |
for i in sess_*; do | |
ex=$(( $(date +%s) - $(stat -c %Y "$i") + $TTL )) |
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
#!/bin/node | |
/*jshint esversion: 9*/ | |
/** | |
* Time-shift video subtitles in a .srt file. | |
* | |
* Usage: | |
* shiftsrt.js seconds input_file|- [output_file|-] | |
* | |
* Examples: |