Skip to content

Instantly share code, notes, and snippets.

View ash.md

(Some research on the ash shell "fast, small, POSIX-compatible Unix shell")

Noted from FreeBSD (and used in BusyBox)

HISTORY

 A sh command, the Thompson shell, appeared in Version 1 AT&T UNIX.  It
 was superseded in Version 7 AT&T UNIX by the Bourne shell, which inher-
 ited the name sh.
View _zabbix-api-spark.md

Output:

$ ./cpu-load-hist.get.sh 
Zabbix.org: Processor load
▂▄▇█▄▆▄▃▂▂▁▁▁▁▂▄▂▃▂▂▂▁▁▁▂▂▁▂▁▁▂▁▃▂▃▃▂▁▁▁▂▂▆▅▄▂▂▂▂▂▂▂▁▁▁▄▄▄▃▁

Zabbix.org: Processor load

View xdebug-setup.md

SSH

ssh -R 9000:localhost:9000 remote_host

Ubuntu

$ sudo apt-get install php5-xdebug
$ cat /etc/php5/conf.d/xdebug.ini
@christianchristensen
christianchristensen / apache2.example.conf
Last active Dec 24, 2015
Log additional request info into apache logs.
View apache2.example.conf
...
LogFormat "\"%r\" \"%{x-meh}o\"" test_123
CustomLog ${APACHE_LOG_DIR}/access.log test_123
...
@christianchristensen
christianchristensen / error.php
Created Aug 9, 2013
Error handling with PHP example.
View error.php
<?php
// Setup
set_time_limit(3);
// http://php.net/manual/en/function.register-shutdown-function.php
function shutdown() {
global $start;
$elapsed=microtime(true) - $start;
echo "SHUTDOWN. Time: ${elapsed}";
@christianchristensen
christianchristensen / .gitignore
Last active Jun 14, 2020
Simple PHP Graph data-structure.
@christianchristensen
christianchristensen / README.md
Last active Dec 19, 2015
Packaging (with FPM)
View README.md

Packaging with fpm

Note: remove .git reference prior to putting files in a package. Note: -e option allows specification of metadata.

bundle exec fpm -s dir -t deb -n packageName -v 1.0.0 -C /path/to/code .

On the target system:

  • Info: dpkg -I packageName.deb