Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import web
from zk import ZooKepperConnection
urls = ('/(.*)', 'node')
render = web.template.render('templates/')
zkc = ZooKepperConnection("192.168.0.71:2181")
class node:
root$ dladm show-phys
LINK MEDIA STATE SPEED DUPLEX DEVICE
e1000g0 Ethernet unknown 1000 half e1000g0
grep ^admin_nic /usbkey/config
admin_nic=0:c:29:fb:7f:64
[root@00-0c-29-fb-7f-64 ~]# dladm show-phys -m
LINK SLOT ADDRESS INUSE CLIENT
e1000g0 primary 0:c:29:fb:7f:64 yes e1000g0
@abbaspour
abbaspour / gist:4529501
Created January 14, 2013 11:37
failed to grab pid
$ ppriv $$
29763: -bash
flags = <none>
E: basic,dtrace_proc,dtrace_user,proc_owner
I: basic,dtrace_proc,dtrace_user,proc_owner
P: basic,dtrace_proc,dtrace_user,proc_owner
L: basic,contract_event,contract_observer,dtrace_proc,dtrace_user,file_chown,file_chown_self,
file_dac_execute,file_dac_read,file_dac_search,file_dac_write,file_owner,file_setid,ipc_dac_read,
ipc_dac_write,ipc_owner,net_bindmlp,net_icmpaccess,net_mac_aware,net_privaddr,net_rawaccess,
proc_audit,proc_chroot,proc_lock_memory,proc_owner,proc_setid,proc_taskid,sys_acct,sys_admin,
@abbaspour
abbaspour / gist:4529504
Created January 14, 2013 11:38
SMF manifest with privileges
<exec_method name='start' type='method' exec=...>
<method_context>
<method_credential user='weblogic' privileges='basic,sys_resource,...'/>
</method_context>
</exec_method>
@abbaspour
abbaspour / gist:4529537
Created January 14, 2013 11:43
sys_resource priv in PID
$ ppriv 1745
flags = <none>
E: basic,sys_resource,...
I: basic,sys_resource,...
P: basic,sys_resource,...
.....
@abbaspour
abbaspour / gist:4529541
Created January 14, 2013 11:44
sys_resource definition
$ ppriv -lv sys_resource
sys_resource
Allows a process to modify the resource limits specified
by setrlimit(2) and setrctl(2) without restriction.
Allows a process to exceed the per-user maximum number of processes.
Allows a process to extend or create files on a filesystem that
has less than minfree space in reserve.
@abbaspour
abbaspour / add_priv.sh
Created January 14, 2013 11:45
Add priv to user
usermod -K defaultpriv=basic,sys_resource,... weblogic
@abbaspour
abbaspour / gist:4529549
Created January 14, 2013 11:46
DTrace issue fixed after privs set
$ ppriv $$
8630: -bash
flags = <none>
E: basic,dtrace_proc,dtrace_user,proc_owner,sys_resource
I: basic,dtrace_proc,dtrace_user,proc_owner,sys_resource
P: basic,dtrace_proc,dtrace_user,proc_owner,sys_resource
L: basic,contract_event,contract_observer,dtrace_proc,dtrace_user,file_chown,file_chown_self,file_dac_execute,file_dac_read,file_dac_search,file_dac_write,file_owner,file_setid,ipc_dac_read,ipc_dac_write,ipc_owner,net_bindmlp,net_icmpaccess,net_mac_aware,net_privaddr,net_rawaccess,proc_audit,proc_chroot,proc_lock_memory,proc_owner,proc_setid,proc_taskid,sys_acct,sys_admin,sys_audit,sys_mount,sys_nfs,sys_resource
$ pfexec dtrace -n 'hotspot$target:::object-alloc{ @ = quantize(arg1) }' -p 1745
dtrace: description 'hotspot$target:::object-alloc' matched 1 probe
^C