These are a list of usages of shell commands I can't live without on UNIX-based systems.
Using Homebrew (yes, I am opinionated) you can install the following tools with the following packages:
| # | |
| # Wide-open CORS config for nginx | |
| # | |
| location / { | |
| if ($request_method = 'OPTIONS') { | |
| add_header 'Access-Control-Allow-Origin' '*'; | |
| # |
| #!/usr/bin/env ruby | |
| # encoding: utf-8 | |
| # By Uğur Özyılmazel, @vigobronx | @ugurozyilmazel | |
| # http://vigodome.com | http://ugur.ozyilmazel.com | http://github.com/vigo | |
| def get_paged_memory_usage(match_string, paging=4096) | |
| mvar = 3 | |
| if match_string.split(/[^\w]/).length > 1 | |
| mvar = 4 |
| <?php | |
| /** | |
| * A helper file for Laravel 5, to provide autocomplete information to your IDE | |
| * Generated for Laravel 5.1.1 (LTS) on 2015-06-11. | |
| * | |
| * @author Barry vd. Heuvel <[email protected]> | |
| * @see https://github.com/barryvdh/laravel-ide-helper | |
| */ | |
| namespace { |
| define("XHPROF_ROOT", '/var/www/xhprof-0.9.4'); | |
| App::before(function(){ | |
| xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY); | |
| }); | |
| App::after(function(){ | |
| require_once (XHPROF_ROOT . '/xhprof_lib/utils/xhprof_lib.php'); | |
| require_once (XHPROF_ROOT . '/xhprof_lib/utils/xhprof_runs.php'); |
| // Int64.js | |
| // | |
| // Copyright (c) 2012 Robert Kieffer | |
| // MIT License - http://opensource.org/licenses/mit-license.php | |
| /** | |
| * Support for handling 64-bit int numbers in Javascript (node.js) | |
| * | |
| * JS Numbers are IEEE-754 binary double-precision floats, which limits the | |
| * range of values that can be represented with integer precision to: |
| // modules | |
| var redis = require('redis'); | |
| var Step = require('step'); | |
| // config file | |
| var config = require('config'); | |
| // mysql client connect | |
| var mysql = require('mysql'); | |
| var connection = mysql.createConnection({ |
| #!/bin/sh | |
| # This program has two feature. | |
| # | |
| # 1. Create a disk image on RAM. | |
| # 2. Mount that disk image. | |
| # | |
| # Usage: | |
| # $0 <dir> <size> | |
| # |
| var app = require(process.cwd() + '/app'); | |
| var winston = require('winston'); | |
| var _ = require('lodash'); | |
| // Set up logger | |
| var customColors = { | |
| trace: 'white', | |
| debug: 'green', | |
| info: 'green', | |
| warn: 'yellow', |