Skip to content

Instantly share code, notes, and snippets.

View AlainODea's full-sized avatar

Alain O'Dea AlainODea

View GitHub Profile
@AlainODea
AlainODea / ghc_7.10.3_settings.in.patch
Last active July 23, 2017 18:59
WIP: Install GHC 8.0.2 starting from PKGSRC ghc 7.6.3 on SmartOS
--- settings.in 2017-07-23 14:25:55.733820769 +0000
+++ settings.in.patched 2017-07-23 14:26:39.156012024 +0000
@@ -1,33 +1,33 @@
[("GCC extra via C opts", "@GccExtraViaCOpts@"),
("C compiler command", "@SettingsCCompilerCommand@"),
("C compiler flags", "@SettingsCCompilerFlags@"),
- ("C compiler link flags", "@SettingsCCompilerLinkFlags@"),
+ ("C compiler link flags", "@SettingsCCompilerLinkFlags@ -lssp"),
("Haskell CPP command","@SettingsHaskellCPPCommand@"),
("Haskell CPP flags","@SettingsHaskellCPPFlags@"),
@AlainODea
AlainODea / teamcity
Created April 16, 2014 18:17
sysv init.d script for TeamCity (tested on Ubuntu)
#!/bin/bash
#
# chkconfig: 235 10 90
# description: TeamCity startup script
#
TEAMCITY_USER=teamcity
TEAMCITY_DIR=/home/teamcity/TeamCity/
TEAMCITY_SERVER=bin/teamcity-server.sh
@AlainODea
AlainODea / read-errno.d
Created May 6, 2014 01:18
DTrace syscall read(2) errno when non-zero
#!/usr/sbin/dtrace -s
syscall::read:return
/errno != 0/
{
trace(execname);
printf("errno=%d\n", errno);
ustack();
}
@AlainODea
AlainODea / read-eagain.d
Last active August 29, 2015 14:01
DTrace EAGAIN returns from read(2)
#!/usr/sbin/dtrace -s
syscall::open:entry
/arg0 != NULL/
{
self->pathptr = arg0;
self->oflag = arg1;
}
syscall::open:return
@AlainODea
AlainODea / diagnostics.md
Last active August 29, 2015 14:01
Diagnostics for EAGAIN error in GHC Builder on SmartOS
@AlainODea
AlainODea / bootstrap.sh
Last active January 26, 2019 17:34
WIP: SmartOS installing Haskell Cabal 1.16.1.0 (look at install_cabal.sh)
#!/bin/sh
set -o xtrace
# A script to bootstrap cabal-install.
# It works by downloading and installing the Cabal, zlib and
# HTTP packages. It then installs cabal-install itself.
# It expects to be run inside the cabal-install directory.
# install settings, you can override these by setting environment vars
@AlainODea
AlainODea / README.md
Created May 21, 2014 04:44
Chef knife bootstrap distro template for Joyent SmartMachines

joyent-smartmachine.erb

Chef knife bootstrap distro template for Joyent SmartMachines

Usage

Place in .chef/bootstrap/ Add --distro joyent-smartmachine to your knife bootstrap command.

@AlainODea
AlainODea / HelloCovariance.java
Last active November 16, 2022 12:31
Exception in thread "main" java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class HelloCovariance {
public static void main(String[] args) {
ConcurrentHashMap<String, String> properties = new ConcurrentHashMap<>();
Set<String> keySet = properties.keySet();
}
}
@AlainODea
AlainODea / Issues.md
Created June 7, 2014 21:10
Haskell builder issues WIP

EPoll is now available, but epoll.h is missing #include <sys/stdint.h>

wesolows suggested that a lofs mount would let me alter the content of that file.

I could create a corrected epoll.h and lofs mount it into my builder zones.

20140501T225642Z and 20140515T211957Z are the only affected platform images. Hopefully the next release will include a fix for this.

@AlainODea
AlainODea / install-git-annex.sh
Last active August 29, 2015 14:02
Install git-annex on SmartOS (works on base64 14.1.0)
pkgin -y update
pkgin -y full-upgrade
pkgin -y install haskell-platform build-essential pkg-config gsasl gnutls xml2 zlib
export PATH=~/.cabal/bin:$PATH
cabal update
cabal install cabal-install
cabal update
cabal install c2hs -j8
cabal install git-annex -j8
git-annex help