Skip to content

Instantly share code, notes, and snippets.

@edwardw
Created January 14, 2012 01:31
Show Gist options
  • Save edwardw/1609770 to your computer and use it in GitHub Desktop.
Save edwardw/1609770 to your computer and use it in GitHub Desktop.
OpenIndiana Miscellaneous

Tunnel both TCP and DNS traffic over SSH

$ ssh -D 1080 -fN user@server

autossh seems to be more suitable for this task:

$ autossh -M 20000 -fN -D 1080 -i /path/to/key user@server

In Firefox about:config, set network.proxy.socks_remote_dns to true.

curl error

There's a ticket. And the workaround:

$ mkdir -p /etc/curl && cat /etc/certs/CA/*.pem > /etc/curl/curlCA

default git can't handle https

Install a new one. This post works:

$ sudo pkg install gcc-dev SUNWscp
$ mkdir sandbox && cd sandbox
$ curl http://git-core.googlecode.com/files/git-1.7.8.3.tar.gz | tar xvz
$ cd git-1.7.8.3
$ PATH=/usr/sfw/bin:/usr/bin:/usr/sbin ; export PATH
$ gmake prefix=/opt/local all
$ gmake prefix=/opt/local install
now add manual pages
$ git clone git://git.kernel.org/pub/scm/git/git-manpages.git
$ cd git-manpages
$ git archive --format=tar origin/master | sudo tar -x -C /usr/share/man/ -vf -

create my first zone for trying to compile ghc

Is this a sparse zone or not?

$ sudo zfs create -p rpool/export/zones
$ sudo zonecfg -z ghc
$ create
$ add net
$ set physical = rge0
$ set address = 192.168.1.100/24
$ end
$ set zonepath = /export/zones/ghc
$ commit
$ exit
$ sudo zoneadm -z ghc install
$ sudo zoneadm -z ghc boot
$ sudo zlogin -C ghc
(now as root in zone ghc)
# pkg install sudo gnu-tar
# mkdir -p /export/home
# useradd -b /export/home -g staff -m edward
# passwd edward
# visudo
edward ALL=(ALL) ALL
(now as edward in zone ghc)
$ sudo pkg install gnu-binutils gnu-coreutils gnu-sed gnu-tar gnu-grep gcc-43
$ mkdir ws && cd ws
$ git clone http://darcs.haskell.org/ghc.git/
$ cd ghc
$ ./sync-all get

Gee, no need to do those myself. There's Spec Files Extra Repository that has all those goodies.

$ pkg set-publisher -p http://pkg.openindiana.org/sfe
$ sudo pkg install ghc

Installing cabal-install is a little difficult, though. This post nails it. But visiting http://hackage.haskell.org/trac/hackage/ ends up with internal server error for now. Should go back and check it later.

ZFS ARC seems to eat all ram

By default ZFS ARC primarycache property is all, so it's very ram hungry. In my home pc with 4G ram, echo "::memstat" | sudo mdb -k" shows it consumes about 1.5G ram! There are three possible primarycache settings: none, metadata and all. My first try is to use metadata:

$ sudo zfs set primarycache=metadata rpool

Well, after reboot, GUI becomes painfully slow although echo "::memstat" | sudo mdb -k" does show ZFS merely uses ~17M ram. Second try:

$ sudo zfs set primarycache=all rpool
$ sudo vi /etc/system
set zfs:zfs_arc_max = 0x20000000

which tells ZFS to use up to 512M primary cache. Reboot and all seems fine. This helps. Need to read through ZFS document later on.

Some good read about ZFS ARC: here, here.

As a side note, ZFS Evil Tuning Guide claims ARC will release memory based on request, but still:

  • Some applications include free-memory checks and refuse to start if there is not enough RAM available - even though the ARC would release its memory based on applications' requests to the OS kernel for memory. Sometimes the ARC can be too slow to release the memory, and better-behaving applications (without preliminary checks) experience longer delays when requesting memory.

Illumos KVM needs EPT

Unfortunately, Illumos KVM needs second generation VT-x, which has EPT support. I tried to run it on my Core 2 Duo processor. sudo qemu-kvm -monitor stdio seems to work, but booting from a FreeBSD 9.0 ISO hangs the whole system.

SmartOS has some improvement to fail gracefully. I tried to boot a 20120113 bi-weekly release of SmartOS USB image. On boot screen it clearly says 'not sufficient virtualization support, no EPT'.

ZFS Miscellaneous

  • There's ZFS root pool, ans there's data pool. Set them up separately, since the former is architecture dependent and the later better not be.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment