Skip to content

Instantly share code, notes, and snippets.

View avsm's full-sized avatar
💭
never gonna git u up, never gona git u down, never gonna turn around and reset u

Anil Madhavapeddy avsm

💭
never gonna git u up, never gona git u down, never gonna turn around and reset u
View GitHub Profile
@avsm
avsm / source-install-libsodium.sh
Last active August 29, 2015 13:56
install libsodium from source
#!/bin/sh -ex
V=0.7.1
curl -OL https://download.libsodium.org/libsodium/releases/libsodium-${V}.tar.gz
tar -zxvf libsodium-${V}.tar.gz
cd libsodium-${V}
./configure
make
sudo make install
@avsm
avsm / setup-iocaml-macos.sh
Last active August 29, 2015 13:56
OCaml iocaml on MacOS X 10.9 howto
#!/bin/sh
# Various things to get OCaml/IPython working on MacOS X
# get the right version of zmq
brew tap homebrew/versions
brew install zeromq32
brew link zeromq32
# install ipython
pip install ipython
@avsm
avsm / .ocamlinit
Created March 30, 2014 15:22
default ocamlinit for realworldocaml
#use "topfind";;
#thread;;
#camlp4o;;
#require "core.top";;
#require "core.syntax";;
#!/bin/sh -ex
V=2.0.2
curl -OL http://tipok.org.ua/downloads/media/aacplus/libaacplus/libaacplus-${V}.tar.gz
tar -zxvf libaacplus-${V}.tar.gz
cd libaacplus-${V}
sudo apt-get install autotools-dev automake autoconf
./autogen.sh
make
sudo make install
@avsm
avsm / may19th-sched.md
Last active August 29, 2015 14:01
Scheduling for next week

Several visitors are arriving at the Computer Lab during the week of 19th May, as well as an OCaml Labs group meeting, so planning the agendas here. Talks are in bold.

Monday 19th May 2014

  • 1700: Andy Ray and Martyn Riley arriving from Edinburgh.
  • 1730: Flying Pig (Rolf, JonC, Andy, Martyn, Anil, ++)
  • midnight: all OCaml 2014 speaking submissions to go in.

Tuesday 20th May 2014

#!/bin/sh -ex
V=0.3-beta
curl -OL http://download.nanomsg.org/nanomsg-${V}.tar.gz
tar -zxvf nanomsg-${V}.tar.gz
cd nanomsg-${V}
./configure
make
sudo make install
#internal OPAM solver
preamble:
property: installed-root: bool = [false], reinstall: bool = [false], buildessential: bool = [false], essential: bool = [false], sourceversion: int = [1], sourcenumber: string = [""], source: string = [""], number: string, recommends: vpkgformula = [true!]
package: oasis2opam
version: 43
depends: ocamlfind , oasis-mirage >= 38 | oasis < 52 , oasis-mirage >= 38 | oasis >= 38 , oasis
conflicts: oasis2opam
number: 0.3.4
source: oasis2opam
@avsm
avsm / oclwebsite-postproc.sh
Created June 19, 2014 21:00
postproc script for ocl website
#!/bin/sh -e
rm -rf pkg
~/src/git/avsm/opam2web/src/_build/opam2web.native --where='tag:org:mirage' --where='tag:org:ocamllabs' --prefix="/projects/ocamllabs/"
cd pkg
rm -f index-*.html
tail -n +2 index.html |sed '$d' > index-b.html
rm -f index.html
# generate subdirs

Building RPMs using OpenSUSE's Open Build Service in n easy steps

  • Get yourself an account on OBS, and create your home project
  • Get the CLI and build tool
$ apt-add-repository "deb http://download.opensuse.org/repositories/openSUSE:/Tools/xUbuntu_14.04/ /"                                             
$ curl http://download.opensuse.org/repositories/openSUSE:/Tools/xUbuntu_14.04/Release.key | sudo apt-key add -                                   
$ apt-get update
$ apt-get install -y osc build                                                                                                                    
@avsm
avsm / test.ml
Created October 9, 2014 12:47
Example of Lwt thread-local storage values
(* Build with:
ocamlbuild -use-ocamlfind -pkg lwt.unix -tag annot test.native
*)
let id_key = Lwt.new_key ()
let log fmt =
let tid =
match Lwt.get id_key with
| None -> "<unknown>"