Skip to content

Instantly share code, notes, and snippets.

View sjorge's full-sized avatar

Jorge Schrauwen sjorge

View GitHub Profile
@sjorge
sjorge / persist-syscfg
Created December 1, 2014 16:38
SmartOS File Server
#!/usr/bin/bash
# Originally based on http://wiki.smartos.org/display/DOC/Allowing+user+CRUD+in+the+global+zone
# Author: hugo@freenode
enable_stmf=1
enable_smb=1
enable_nfs=1
save_us=( /etc/passwd /etc/shadow /etc/group /etc/ouser_attr /etc/user_attr \
/etc/security/policy.conf /etc/security/auth_attr /etc/security/exec_attr \
@sjorge
sjorge / gist:84e6f55d39919a9ec52f
Created December 28, 2014 22:38
seafile truss
execve("/opt/seafile/seafile-server-4.0.2/seafile/bin/seafile-controller", 0x7FFFFFEFF528, 0x7FFFFFEFF558) argc = 5
sysinfo(SI_MACHINE, "i86pc", 257) = 6
mmap(0x00000000, 56, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF440000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF420000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF410000
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF400000
memcntl(0x7FFFFF44A000, 95920, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 4294967295, 0) = 0x7FFFFF3F0000
memcntl(0x7FFFFF4B2000, 81280, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
resolvepath("/native/lib/64/ld.so.1", "/native/lib/amd64/ld.so.1", 1023) = 25
@sjorge
sjorge / gist:7a037522765794393515
Created January 2, 2015 22:39
SmartOS vioif vs e1000 (OmniOS host [qemu])
.---------------.
| SmartOS vioif |
'---------------'
ubuntu lx64 -> Desktop (ubuntu vnic -> smartos gz (vioif) -> omnios (kvm) -> switch -> desktop)
root@lx64ubuntu:~# iperf -c hyperon.acheron.be
------------------------------------------------------------
Client connecting to hyperon.acheron.be, TCP port 5001
TCP window size: 125 KByte (default)
------------------------------------------------------------
@sjorge
sjorge / CONSOLE
Last active August 29, 2015 14:13
shm - gimp
root@lxubuntu64:~# gimp
Failed to execute child process "dbus-launch" (No such file or directory)
//bin/dbus-launch terminated abnormally without any error message
(script-fu:9595): LibGimp-ERROR **: shmat() failed: Invalid argument
Could not attach to gimp shared memory segment
GIMP-Error: Plug-in crashed: "script-fu"
(/usr/lib/gimp/2.0/plug-ins/script-fu)
The dying plug-in may have messed up GIMP's internal state. You may want to save your images and restart GIMP to be on the safe side.
@sjorge
sjorge / CONSOLE
Created January 22, 2015 20:53
shm - x11vnc
root@lxubuntu64:~# x11vnc
###############################################################
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@ @#
#@ ** WARNING ** WARNING ** WARNING ** WARNING ** @#
#@ @#
#@ YOU ARE RUNNING X11VNC WITHOUT A PASSWORD!! @#
#@ @#
#@ This means anyone with network access to this computer @#
#@ may be able to view and control your desktop. @#
@sjorge
sjorge / gist:e7f4151793801b0a6c95
Created January 29, 2015 19:03
linux netstat on lx
root@lxubuntu64:~# ./netstat -tpln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN -
tcp 0 0 172.16.15.232:389 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:7306 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:23232 0.0.0.0:* LISTEN -
STATE STIME FMRI
offline 23:04:48 svc:/milestone/multi-user:default
pkgin -y install gcc47 git-base
PKG_VER=$(cat /opt/local/etc/pkgin/repositories.conf | grep 'SmartOS' | cut -d"/" -f 6)
mkdir -p /content/{distfiles,packages}
cd /content
git clone git://github.com/joyent/pkgsrc.git
cd /content/pkgsrc
git checkout joyent/release/${PKG_VER}
git submodule init
git submodule update
@sjorge
sjorge / _README
Last active August 29, 2015 14:21
pbd-samab4 with zfsacl
Testing repo: http://5.135.127.102/2014Q4/x86_64/All/
Just add as additional repository
Remove net/samba4 and cleanup left over files
Install net/pbd-samba4
Prepare dataset for ACL's and create a share called 'zfsacl'
zfs create -o casesensitivity=mixed -o nbmand=on -o utf8only=on -o aclmode=passthrough -o aclinherit=passthrough -o mountpoint=/share zones/`zonename`/data/shares
zfs create -o quota=512M zones/`zonename`/data/shares/zfsacl
This file has been truncated, but you can view the full file.
CPU ID FUNCTION:NAME
0 4607 brk:entry
0 4608 brk:return 4096
0 4709 uname:entry
0 4710 uname:return 0
0 4625 access:entry
0 4626 access:return -2
0 4601 mmap:entry
0 4602 mmap:return 140737471971328
0 4625 access:entry