By @myx
- Terms
- Background
- Current Contributors Feature
| #!/usr/bin/env bash | |
| # memusg -- Measure memory usage of processes | |
| # Usage: memusg COMMAND [ARGS]... | |
| # | |
| # Author: Jaeho Shin <netj@sparcs.org> | |
| # Created: 2010-08-16 | |
| ############################################################################ | |
| # Copyright 2010 Jaeho Shin. # | |
| # # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); # |
| var util = require('util') | |
| function hook_stdout(callback) { | |
| var old_write = process.stdout.write | |
| process.stdout.write = (function(write) { | |
| return function(string, encoding, fd) { | |
| write.apply(process.stdout, arguments) | |
| callback(string, encoding, fd) | |
| } |
| kern.netboot = 0 | |
| kern.netboot: 0 | |
| net.local.stream.sendspace: 8192 | |
| net.local.stream.recvspace: 8192 | |
| net.local.stream.tracemdns: 0 | |
| net.local.dgram.maxdgram: 2048 | |
| net.local.dgram.recvspace: 4096 | |
| net.local.inflight: 0 | |
| net.inet.ip.portrange.lowfirst: 1023 | |
| net.inet.ip.portrange.lowlast: 600 |
| kern.ostype = Darwin | |
| kern.osrelease = 11.2.0 | |
| kern.osrevision = 199506 | |
| kern.version = Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 | |
| kern.maxvnodes = 66560 | |
| kern.maxproc = 1064 | |
| kern.maxfiles = 12288 | |
| kern.argmax = 262144 | |
| kern.securelevel = 0 | |
| kern.hostname = Mathieus-MacBook-Air.local |
| [alias] | |
| l50 = "!f () { git log --abbrev-commit --date=short --pretty=format:'%h%x00%cd%x00%s%x00%an%x00%d' $@ | gawk -F '\\0' '{ printf \"\\033[31m%s\\033[0m \\033[32m%s\\033[0m %-50s \\033[30;1m%s\\033[0m\\033[33m%s\\n\", $1, $2, gensub(/(.{49}).{2,}/, \"\\\\1…\",\"g\",$3), $4, $5 }' | less -R; }; f" | |
| l80 = "!f () { git log --abbrev-commit --date=short --pretty=format:'%h%x00%cd%x00%s%x00%an%x00%d' $@ | gawk -F '\\0' '{ printf \"\\033[31m%s\\033[0m \\033[32m%s\\033[0m %-80s \\033[30;1m%s\\033[0m\\033[33m%s\\n\", $1, $2, gensub(/(.{79}).{2,}/, \"\\\\1…\",\"g\",$3), $4, $5 }' | less -R; }; f" | |
| lg50 = "!f () { git log --graph --color=always --abbrev-commit --date=relative --pretty=format:'%x00%h%x00%s%x00%cd%x00%an%x00%d' $@ | gawk -F '\\0' '{ printf \"%s\\033[31m%s\\033[0m %-50s \\033[32m%14s\\033[0m \\033[30;1m%s\\033[0m\\033[33m%s\\n\", $1, $2, gensub(/(.{49}).{2,}/, \"\\\\1…\",\"g\",$3), $4, $5, $6 }' | less -R; }; f" | |
| lg80 = "!f () { git log --graph --color=always --abbrev-commit --date=re |
| # Store data in /usr/local/var/mongodb instead of the default /data/db | |
| dbpath = /usr/local/var/mongodb | |
| # Only accept local connections | |
| bind_ip = 127.0.0.1 | |
| cpu = true | |
| verbose = true | |
| rest = true |
| /** Creates a pronounceable random password | |
| * @param string $len, optional length (default 8) | |
| * @retrun string the generated password | |
| */ | |
| function make_passwd($len=8) | |
| { | |
| $letter=array( | |
| array("b","c","d","f","g","i","l","m","n","o","p","qu","r","s","t","v","z"), | |
| array("a","e","i","o","u")); | |
| $pass=""; |
| // convert 0..255 R,G,B values to binary string | |
| RGBToBin = function(r,g,b){ | |
| var bin = r << 16 | g << 8 | b; | |
| return (function(h){ | |
| return new Array(25-h.length).join("0")+h | |
| })(bin.toString(2)) | |
| } | |
| // convert 0..255 R,G,B values to a hexidecimal color string | |
| RGBToHex = function(r,g,b){ |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |