Skip to content

Instantly share code, notes, and snippets.

KEINOS KEINOS

View GitHub Profile
@KEINOS
KEINOS / 0.PregMatchVsCtypeAlnumBench.php
Last active May 19, 2020
[Bench] Which is faster, preg_match() or ctype_alnum() ?
View 0.PregMatchVsCtypeAlnumBench.php
<?php
/**
* Benchmark between preg_match() and ctype_alnum()
*
* $ phpbench run --retry-threshold=1 --revs=1000000 \
* --iterations=10 --report=compare --report=aggregate \
* ./PregMatchVsCtypeAlnumBench.php
*
* Requirement
* $ composer require phpbench/phpbench @dev --dev
View Main.php
<?php
/**
* Sample PHP script to check if a string is available to use in namespace.
*
* View this script in action online:
* https://paiza.io/projects/cjheAXgzbvk4uEq8civKAA
* View this script in Gist:
* https://gist.github.com/KEINOS/b72391409f201777f8c4420a59a9c282
*/
@KEINOS
KEINOS / LOG_Build-Error.sh-session
Created Jul 6, 2019
[LOG] Error log on heroku
View LOG_Build-Error.sh-session
2019-07-06T16:11:37.070517+00:00 app[web.1]: 2019-07-07 01:11:37: (network.c.313) can't bind to socket: 0.0.0.0:80 Permission denied
2019-07-06T16:11:38.074704+00:00 app[web.1]: 2019-07-07 01:11:38: (network.c.313) can't bind to socket: 0.0.0.0:80 Permission denied
2019-07-06T16:11:39.079038+00:00 app[web.1]: 2019-07-07 01:11:39: (network.c.313) can't bind to socket: 0.0.0.0:80 Permission denied
2019-07-06T16:11:40.083423+00:00 app[web.1]: 2019-07-07 01:11:40: (network.c.313) can't bind to socket: 0.0.0.0:80 Permission denied
2019-07-06T16:11:41.087808+00:00 app[web.1]: 2019-07-07 01:11:41: (network.c.313) can't bind to socket: 0.0.0.0:80 Permission denied
2019-07-06T16:11:42.092604+00:00 app[web.1]: 2019-07-07 01:11:42: (network.c.313) can't bind to socket: 0.0.0.0:80 Permission denied
2019-07-06T16:11:43.097222+00:00 app[web.1]: 2019-07-07 01:11:43: (network.c.313) can't bind to socket: 0.0.0.0:80 Permission denied
2019-07-06T16:11:44.101447+00:00 app[web.1]: 2019-07-07 01:11:44: (network.c.313) can'
@KEINOS
KEINOS / dockle-status.json
Last active Jun 21, 2019
Sample JSON of Shields.IO status badge
View dockle-status.json
{
"schemaVersion": 1,
"label": "Dockle",
"message": "FATAL 1 WARN 2",
"color": "red"
}
View LOG_Build_CentOS_DockerImage.sh-session
$ # Env infos
$ # ---------
$ docker version
Client: Docker Engine - Community
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:47:43 2018
OS/Arch: darwin/amd64
@KEINOS
KEINOS / softwareupdate_warning.sh-session
Created Mar 20, 2019
[LOG] Warning while softwareupdate - EmbeddedOSInstall and OSPersonalization Error. One of the two will be used. Which one is undefined.
View softwareupdate_warning.sh-session
$ # Error log
$ softwareupdate -l --verbose
objc[5213]: Class AMSupportURLConnectionDelegate is implemented in both /System/Library/PrivateFrameworks/EmbeddedOSInstall.framework/Versions/A/EmbeddedOSInstall (0x11abdd8c0) and /System/Library/PrivateFrameworks/OSPersonalization.framework/Versions/A/OSPersonalization (0x11aa381e0). One of the two will be used. Which one is undefined.
Software Update Tool
Finding available software
No new software available.
$ man softwareupdate | tail -1
Mac OS September 11, 2012 Mac OS
$ sw_vers
@KEINOS
KEINOS / LOG_Vagrant_debug_output_20190311-1657.sh-session
Last active Mar 11, 2019
[LOG] Debug output log of Vagrant cloud search results by user name. Info for the issue https://github.com/hashicorp/vagrant/issues/10723
View LOG_Vagrant_debug_output_20190311-1657.sh-session
$ ######################################################
$ # Env info (macOS Mojave, OSX 10.14.3)
$ ######################################################
$ # Date and time of occurrence
$ date -R
Mon, 11 Mar 2019 16:57:12 +0900
$ # Vagrant version
$ vagrant -v
Vagrant 2.2.4
$ # Host OS
@KEINOS
KEINOS / LOG_Install_Success-XDebug-20181208.sh-session
Created Dec 8, 2018
[Log] Installding XDebug of PHP on macOS HighSierra
View LOG_Install_Success-XDebug-20181208.sh-session
$ php -v
PHP 7.2.12 (cli) (built: Nov 29 2018 01:59:12) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.12, Copyright (c) 1999-2018, by Zend Technologies
$
$ which php
/usr/local/Cellar/php/7.2.12_2/bin/php
$
$ brew list | grep php
@KEINOS
KEINOS / LOG_Install_Success_mod_wsgi-20181128-0227.sh-session
Last active Nov 27, 2018
[Log] Installing `pip3 install mod_wsgi`
View LOG_Install_Success_mod_wsgi-20181128-0227.sh-session
$ sudo pip3 install mod_wsgi
Downloading/unpacking mod-wsgi
Downloading mod_wsgi-4.6.5.tar.gz (490kB): 490kB downloaded
Running setup.py (path:/tmp/pip-build-ajb0j1v8/mod-wsgi/setup.py) egg_info for package mod-wsgi
/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
warning: no files found matching 'docs/_build/html/_static/*'
warning: no files found matching 'docs/_build/html/_static/css/*'
warning: no files found matching 'docs/_build/html/_static/font/*'
@KEINOS
KEINOS / LOG-BootingPulseAudio_20181016.sh-session
Created Oct 16, 2018
[LOG] Error log while launching PulseAudio in Raspbian Jessie
View LOG-BootingPulseAudio_20181016.sh-session
$ pulseaudio
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="usb-AKAI_MPKmini2_0001-01-MPKmini2" card_name="alsa_card.usb-AKAI_MPKmini2_0001-01-MPKmini2" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
W: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
W: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
E: [pulseaudio] bluez4-util.c: org.bluez.Manager.GetProperties() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with signature "" on interface "org.bluez.Manager" doesn't exist
You can’t perform that action at this time.