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 / dockerdev.sh
Created June 17, 2016 15:20
Build and install Docker master on an Ubuntu cloud VM
#!/bin/sh -e
# Build and install latest Docker dev version on an Ubuntu cloud VM
install() {
echo Installing
service docker stop || true
cp -av bundles/latest/binary-daemon/* /usr/bin
cp -av bundles/latest/binary-client/* /usr/bin
service docker start
}

maki 0.1

  • Released on: 2016-05-25 15:18:52 +00:00
  • Synopsis: Persistent incremental computations, for repeatable tests and benchmarks.
  • More Info: Source Code or OPAM Page
  • Changes: Unknown

odepack 0.6.7

  • Released on: 2016-05-25 18:26:45 +00:00
@avsm
avsm / usr_local_bin_opam
Created February 24, 2015 16:03
systrace policy for opam
# Policy for opam.
#
Policy: /usr/local/bin/opam, Emulation: native
native-rename: filename match "/tmp/*" and filename[1] match "/tmp/*" then permit
native-rename: filename match "/tmp/*" and filename[1] match "$HOME/.opam/*" then permit
native-rename: filename match "$HOME/.opam/*" and filename[1] match "$HOME/.opam/*" then permit
native-rename: filename match "$HOME/.opam/*" and filename[1] match "/tmp/*" then permit
native-chown: filename match "$HOME/.opam/*" then permit
native-chown: filename match "/tmp/*" then permit
native-fswrite: filename match "/tmp/*" then permit
@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