Skip to content

Instantly share code, notes, and snippets.

View jhyland87's full-sized avatar

J jhyland87

  • 48°52.6′S 123°23.6′W
View GitHub Profile

Awk Variables

Key Description Value Type Values Default Notes
item,items Header item(s) to look for String Set-Cookie SetCookie setcookie N/A This is the only required value
limit Maximum number of results to return Integer 0 (all) all 2 1 Limits the results to a single item unless this is changed
keys Determines if the results should include the header keys as well boolean 1 0 1 0 is treated the same as all
quote Determines if the output values should have the header value in quotes boolean/string 1 single double 0
format Format to print data in String %-30s : %s\n %s\n N/A
<?php
function getFilePerms( $filename ){
$perms = fileperms( $filename );
switch ($perms & 0xF000) {
case 0xC000: // socket
$info = 's';
break;
case 0xA000: // symbolic link
$info = 'l';
$ npm run build
> myproject.it@1.0.0 build /Users/me/Documents/Projects/personal/myproject.local
> phenomic build
⚡️ Hey! Let's get on with it
ModuleBuildError: Module build failed: ModuleParseError: Module parse failed: Unexpected character '' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
at doBuild (/Users/me/Documents/Projects/personal/myproject.local/node_modules/webpack/lib/NormalModule.js:303:19)
@jhyland87
jhyland87 / phenomic-build-fail.txt
Created October 26, 2017 04:27
Phenomic build failing on bootstrap CSS import Raw
$ npm run build
> myproject.com@1.0.0 build /Users/me/Documents/Projects/personal/myproject.local
> phenomic build
⚡️ Hey! Let's get on with it
ModuleNotFoundError: Module not found: Error: Can't resolve 'assets/plugins/bootstrap/css/bootstrap.css' in '/Users/me/Documents/Projects/personal/myproject.local'
at factoryCallback (/Users/me/Documents/Projects/personal/myproject.local/node_modules/webpack/lib/Compilation.js:276:40)
at factory (/Users/me/Documents/Projects/personal/myproject.local/node_modules/webpack/lib/NormalModuleFactory.js:235:20)
at resolver (/Users/me/Documents/Projects/personal/myproject.local/node_modules/webpack/lib/NormalModuleFactory.js:60:20)
Justin
Oct 11, 2017
09:03 PM -0700
One of my previous invoices spiked way above the usual amount due to some security issues. The case ID is 4469605251, and its been resolved. Can you alter or void the invoice ID 113359921 now that its resolved?
Thank you!
===================================================
Amazon Web Services
Oct 12, 2017
#! /usr/local/bin/awk -f
# echo -e "Jane Doe\n123 Main Street\nAnywhere, SE 12345-6789\n\nJohn Smith\n456 Tree-lined Avenue\nSmallville, MW 98765-4321" | ./include-test.awk
#@include "/Users/jhyland/Documents/scripts/awk/utils.awk"
function resetVhost() {
vhost["server_name"] = ""
vhost["document_root"] = ""
vhost["error_log"] = ""
vhost["access_log"] = ""
vhost["cfg_file"] = ""
#!/usr/local/bin/awk -f
# Todo:
# skip empty rows
# Look for duplicate pids
# Validate data types in columns:
# - pid (int)
# - ppid (int)
# - uid (int)
# - ruid (int)
@jhyland87
jhyland87 / ps-totaler.awk
Created October 11, 2017 19:10
Awk script to total the data returned from ps
#!/usr/bin/awk -f
# Examples
# $ ps -o pid,user,cpu,%cpu,%mem,nswap,sess,tty | ./ps_total.awk
# Count : 58
# USER : 0
# CPU : 0
# %CPU : 1.8
# %MEM : 2.5
# NSWAP : 0
@jhyland87
jhyland87 / Stat_Widgets.html
Created September 19, 2017 18:40
Example output of <Stat/> component
<div class="row">
<div class="col-md-3 col-sm-6">
<div class="widget widget-stats bg-blue-grey">
<div class="stats-icon stats-icon-lg"><i class="fa fa-fw fa-globe"></i></div>
<div class="stats-title">Todays Visits</div>
<div class="stats-number">123</div>
<div class="stats-progress progress">
<div class="progress-bar" style="width: 70.1%;"></div>
</div>
<div class="stats-desc">Better than last week (70.1%)</div>
@jhyland87
jhyland87 / App.jsx
Last active September 19, 2017 18:41
Example ReactJS app using some custom components
'use strict'
import React, { Component } from 'react'
import PageLoader from './PageLoader'
import IconFactory from './IconFactory'
import Tree from 'react-ui-tree'
//import Panel from './Panel'
import Header from './Header'
import Sidebar from './Sidebar'
import TreeView from './TreeView'