Skip to content

Instantly share code, notes, and snippets.

View littlebookboy's full-sized avatar

Gene Su littlebookboy

View GitHub Profile
@littlebookboy
littlebookboy / proxy_info.txt
Created August 25, 2022 04:01 — forked from ericzon/proxy_info.txt
Example of Tiny proxy with Basic auth
brew install tinyproxy
tinyproxy -c /usr/local/etc/tinyproxy/tinyproxy.conf -d
Tests:
NO AUTH
curl -iv --noproxy "*" --location http://www.google.com
AUTH FAIL
@littlebookboy
littlebookboy / index.html
Created May 10, 2022 08:38 — forked from alecordev/index.html
Example vanilla JS WebSocket
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
// use vanilla JS because why not
window.addEventListener("load", function() {
// create websocket instance
var mySocket = new WebSocket("ws://localhost:8080/ws");
@littlebookboy
littlebookboy / macosx-install-php-oracle-oci8.md
Created September 6, 2021 10:00 — forked from yajra/macosx-install-php-oracle-oci8.md
install Oracle PHP Extension (oracle OCI8) - instantclient for Mac OS 10.8 - homebrew environnement

Installation

This procedure is tested on Mac OS X 10.8 with Developpers tools installed (xCode).

PHP 5.4 installed with Homebrew.

Update: I wrote a blog post about this.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):

Real-time PHP-FPM Status

This gist will explain you how to enable an undocumented feature of PHP-FPM which will give a real-time performance stats.

Everybody knows the famous phpinfo() and the page it generates, right? Then the real-time PHP-FPM status page design is very similar.

image

Some informations from the top are not displayed to avoid security issues.

Enable PHP-FPM Status

Linux中常用的監控CPU整體性能的工具有:
§ mpstat: mpstat 不但能查看所有CPU的平均信息,還能查看指定CPU的信息。
§ vmstat:只能查看所有CPU的平均信息;查看cpu隊列信息;
§ iostat: 只能查看所有CPU的平均信息。
§ sar: 與mpstat 一樣,不但能查看CPU的平均信息,還能查看指定CPU的信息。

Web Development with Laravel 5

目標

如何在開發的過程中加入測試。

  1. Model
  2. Repository
  3. Controller
  4. Auth