replace
var manta = require('manta');with
var manta = require('./mock-manta');replace
var manta = require('manta');with
var manta = require('./mock-manta');| diff --git a/_posts/2014-05-22-crossplatform-implementation-of-which.md b/_posts/2014-05-22-crossplatform-implementation-of-which.md | |
| index 223bc97..37235ee 100644 | |
| --- a/_posts/2014-05-22-crossplatform-implementation-of-which.md | |
| +++ b/_posts/2014-05-22-crossplatform-implementation-of-which.md | |
| @@ -28,7 +28,7 @@ binfind() { | |
| local path path | |
| IFS=: read -a paths <<< "$PATH" | |
| for path in "${paths[@]}"; do | |
| - path=$path/$1 | |
| + path=${path:-.}/$1 |
command is a bash-builtin, that allows for finding aliases and functions (which may or may not use programs installed in $PATH).
$ type -a command
command is a shell builtin
command is /usr/bin/command
svcadm returns 0 unexpectedly for the restart and refresh methods
$ svcadm enable postfix; echo $?
svcadm: svc:/pkgsrc/postfix:default: Permission denied.
1
$ svcadm disable postfix; echo $?
svcadm: svc:/pkgsrc/postfix:default: Permission denied.
1
$ svcadm restart postfix; echo $?
$ echo ▶
▶| #!/usr/bin/env bash | |
| # | |
| # simple bash script to simulate JavaScript's setInterval (blocking) | |
| # | |
| # Author: Dave Eddy <dave@daveeddy.com> | |
| # Date: September 27, 2014 | |
| # License: MIT | |
| setInterval() { | |
| local func=$1 |
| dave - datadyne-hr sunos ~ $ faves /home/dave/backups/github/bahamas10/ | |
| posix-getopt (21) | |
| latest (19) | |
| access-log (10) | |
| request (9) | |
| strsplit (8) | |
| colors (7) | |
| exec (6) | |
| async (6) | |
| routes (6) |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #define MALLOC_SIZE (1 * 1024 * 1024) // 1mb | |
| int main() { | |
| int i = 0; | |
| while (malloc(MALLOC_SIZE)) | |
| i++; | |
| perror("malloc"); |
| #include <fcntl.h> | |
| #include <stdio.h> | |
| #define FILE_TO_OPEN "/etc/passwd" | |
| #define TIMES 5000 | |
| int main() { | |
| int fd; | |
| int i; | |
| printf("pid: %d\n", getpid()); |