Skip to content

Instantly share code, notes, and snippets.

@ck-on
ck-on / patch-moon-color.php
Last active February 4, 2016 12:30
Patch Emoji-One Moon Color to Silver instead of Yellow
<?php
/*
Patches Emoji-One svg moon shapes to use silver color instead of bright yellow.
Free for any kind of use, distribution or modification, no attribution required.
Possible to use same technique to create Unicode 8.0 diversity skin colors.
Re-render png from svg via: inkscape -z -w 64 -h 64 -f infile.svg -e outfile.png
version 0.0.5
*/
$path=dirname ( __FILE__ ).DIRECTORY_SEPARATOR; // edit path if running outside SVG directory
@ck-on
ck-on / service
Last active February 4, 2016 12:31
script to enhance SERVICE command in CentOS 7 and avoid systemctl annoyances
#!/bin/bash
#
# script to enhance service command in CentOS 7 and avoid systemctl annoyances
# save to: /usr/local/bin/service then: chmod +x /usr/local/bin/service last: hash -d service
# this is a very unpolished work in progress, wtfpl free for any kind of use
#
service="/usr/sbin/service"
systemctl="/usr/bin/systemctl"
journalctl="/usr/bin/journalctl"
function linebreak { echo '------------------------------'; }
@ck-on
ck-on / hhvminfo.php
Last active September 18, 2022 05:44
HHVMinfo - phpinfo for HHVM HipHop Virtual Machine
<?php
/*
HHVMinfo - phpinfo page for HHVM HipHop Virtual Machine
Author: _ck_
License: WTFPL, free for any kind of use or modification, I am not responsible for anything, please share your improvements
Version: 0.0.6
* revision history
0.0.6 2014-08-02 display fix for empty vs zero
0.0.5 2014-07-31 try to determine config file from process command line (may not always work), style improvements
@ck-on
ck-on / analyze-ip-relationships.php
Created September 16, 2013 12:53
Analyze a large list of IPs for potential relationships (eventually group IPs into CIDR ranges) Useful to help decode a botnet attacking servers.
<?php
$file='ip-list.txt';
$closeness=32768; // 65536 131072;
$minrelated=4;
$sorted=array();
$ips=file($file);
echo '<pre style="white-space:pre-wrap;">',count($ips)," IPs <br>\r\n"; flush();
@ck-on
ck-on / ocp.php
Last active September 5, 2024 01:35
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?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