Skip to content

Instantly share code, notes, and snippets.

" Settings
set nohud
set nosmoothscroll
set noautofocus " The opposite of autofocus; this setting stops
" sites from focusing on an input box when they load
set typelinkhints
let searchlimit = 30
let scrollstep = 70
let barposition = "bottom"
@wudixiaotie
wudixiaotie / user-script.json
Last active November 1, 2016 09:10
SmartOS vmadm create json file. The script run during vm initialization.
{
// ...
"customer_metadata": {
"root_authorized_keys": "ssh key",
"user-script": "rm -rf ~root/.ssh/authorized_keys; /usr/sbin/mdata-get root_authorized_keys > ~root/.ssh/authorized_keys;"
}
}
@wudixiaotie
wudixiaotie / memory.sh
Created November 1, 2016 09:07
Determining if virtual machines are running out of memory
zonememstat
prstat -p <Pid List> -c <Refresh Intervals> -u <User Name>
@wudixiaotie
wudixiaotie / set_gz_ssh_key.sh
Created November 1, 2016 09:03
Set ssh public key for Smart Global Zone. Even reboot will still work.
mkdir -p /usbkey/config.inc
# paste your key into this file
vi /usbkey/config.inc/authorized_keys
echo "root_authorized_keys_file=authorized_keys" >>/usbkey/config
@wudixiaotie
wudixiaotie / ch_gz_pwd.sh
Created November 1, 2016 09:00
Change root password of SmartOS Global Zone
umount /etc/shadow; cp /usbkey/shadow /etc/shadow; passwd root; cp /etc/shadow /usbkey/shadow
@wudixiaotie
wudixiaotie / server.erl
Last active December 3, 2015 01:55
Non-blocking TCP server with ssl encryption
-module(server).
-export([start/0]).
start() ->
ssl:start(),
Opts = [binary,
{packet, 0},
{reuseaddr, true},