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 / gist:bd4511551c2cbda713c9
Created February 10, 2015 20:53
testing some unix stuff
open Unix
let () =
let server_sock = socket PF_INET SOCK_STREAM 0 in
(* so we can restart our server quickly *)
setsockopt server_sock SO_REUSEADDR true ;
if not (getsockopt server_sock SO_REUSEADDR) then prerr_endline "fail1";
(* build up my socket address *)
@avsm
avsm / opam install
Last active August 29, 2015 14:11 — forked from anonymous/foo
Reproduced failure with debugging for https://github.com/mirage/mirage-skeleton/issues/59
00:00.000 046309 46309 locking /home/avsm/.opam/lock
00:00.000 046309 FILE(config) Read ~/.opam/config in 0.000s
00:00.000 046309 SYSTEM unlocking /home/avsm/.opam/lock (46309)
00:00.000 046309 SYSTEM rm /home/avsm/.opam/lock
00:00.000 046309 STATE LOAD-STATE(switch-lock)
00:00.000 046309 FILE(config) Read ~/.opam/config in 0.000s
00:00.013 046309 STATE Loaded /home/avsm/.opam/state.cache in 0.011s
00:00.013 046309 FILE(aliases) Read ~/.opam/aliases in 0.000s
00:00.018 046309 FILE(repo-config) Read ~/.opam/repo/default/config in 0.000s
00:00.058 046309 FILE(repo-index) Read ~/.opam/repo/package-index in 0.021s
@avsm
avsm / install-mirage.sh
Last active August 29, 2015 14:07
Install Mirage using opam-installext
#!/bin/sh -ex
opam remote add mirage git://github.com/mirage/mirage-dev
opam installext -j 3 mirage-www
eval `opam config env`
git clone git://github.com/mirage/mirage-skeleton
cd mirage-skeleton
make configure && make 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>"

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 / 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
#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
#!/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
@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=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