Skip to content

Instantly share code, notes, and snippets.

View danielb2's full-sized avatar

Daniel Bretoi danielb2

View GitHub Profile
mmap(0x0,32768,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 34367037440 (0x8006f6000)
issetugid(0x8008f6a20,0x7fffffffefcc,0x40,0x0,0xffff8008008f7a54,0x0) = 0 (0x0)
lstat("/etc",{ mode=drwxr-xr-x ,inode=24,size=109,blksize=7168 }) = 0 (0x0)
lstat("/etc/libmap.conf",{ mode=-rw-r--r-- ,inode=232,size=107,blksize=4096 }) = 0 (0x0)
open("/etc/libmap.conf",O_CLOEXEC,01760) = 3 (0x3)
fstat(3,{ mode=-rw-r--r-- ,inode=232,size=107,blksize=4096 }) = 0 (0x0)
mmap(0x0,107,PROT_READ,MAP_PRIVATE,3,0x0) = 34367070208 (0x8006fe000)
close(3) = 0 (0x0)
lstat("/usr",{ mode=drwxr-xr-x ,inode=9,size=16,blksize=4096 }) = 0 (0x0)
lstat("/usr/local",{ mode=drwxr-xr-x ,inode=563,size=12,blksize=4096 }) = 0 (0x0)
[/usr/home/daniel]$ pss fish
daniel 40928 0.0 0.1 36656 5808 - Is 5:09PM 0:00.37 /usr/local/bin/fishd
daniel 40926 0.0 0.1 37440 6696 1 S+ 5:09PM 0:00.16 fish
[daniel@luffy]--(17:09:41)
[/usr/home/daniel]$ gdb -p 40926
GNU gdb (GDB) 7.8 [GDB v7.8 for FreeBSD]
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
$ stat -x /Users/daniel/blah
File: "/Users/daniel/blah"
Size: 0 FileType: Regular File
Mode: (0644/-rw-r--r--) Uid: ( 501/ daniel) Gid: ( 20/ staff)
Device: 1,7 Inode: 7326025 Links: 1
Access: Tue Feb 3 10:23:58 2015
Modify: Tue Feb 3 10:23:58 2015
Change: Tue Feb 3 10:23:58 2015
// Load modules
var Stream = require('stream');
var Hoek = require('hoek');
var SafeStringify = require('json-stringify-safe');
// Declare internals
var internals = {};
@danielb2
danielb2 / gist:18f90f017b16e78d264f
Created March 5, 2015 03:24
logger incarnation 2770231B
// Load modules
var EventEmitter = require('events').EventEmitter;
var FS = require('fs');
var Stream = require('stream');
var SafeStringify = require('json-stringify-safe');
var Util = require('util');
// Declare internals
var options = {
filter: {
creditcard: 'creditcard',
cvv: 'censor',
unusedfield: 'remove'
},
opsInterval: 1000,
reporters: [{
reporter: require('good-console'),
events: { log: '*', response: '*' }
{
"pack": {
"app": {
"config": {
"servers": [
{
"security": {
"hsts": false,
"xframe": true
},
function fish_prompt
set_color blue
echo -n [
set_color cyan
echo -n (whoami)
set_color 3FF
echo -n @
set_color cyan
echo -n (hostname|cut -d . -f 1)
set_color blue
@danielb2
danielb2 / with.wreck.js
Created July 14, 2015 20:40
wreck proxy
var Wreck = require('wreck');
var server = new Hapi.Server();
server.connection({ port: 8088 });
var onResponse = function (err, res, request, reply, settings, ttl) {
Wreck.read(res, null, function (err, body) {
@danielb2
danielb2 / lib-index.js
Last active August 29, 2015 14:27
solution
// Load modules
var Hoek = require('hoek');
var Joi = require('joi');
var pkg = require('../package.json');
// Declare internals
var internals = {
schema: {
path: Joi.string().optional().default('/hapi-info')