Skip to content

Instantly share code, notes, and snippets.

View AlainODea's full-sized avatar

Alain O'Dea AlainODea

View GitHub Profile
@AlainODea
AlainODea / dhcpd.conf
Created August 30, 2013 18:10
My present ISC DHCP configuration at home including iPXE chainloading for SmartOS.
authoritative;
ddns-update-style none;
option domain-name "alainodea.local";
option domain-name-servers 208.67.222.222, 208.67.220.220;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.10 192.168.2.60;
@AlainODea
AlainODea / GetURL.java
Last active February 3, 2019 05:39
Java Proxy Verfication - Simple URL Loader with no dependencies outside JavaSE
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URI;
import java.net.URL;
public class GetURL
{
public static void main(String[] args) throws Exception
@AlainODea
AlainODea / WhatIsMyProxy.java
Created September 11, 2013 14:18
Java Proxy Verification - Output current proxy in use for a supplied URL (if any) with no dependencies outside JavaSE
import java.net.Proxy;
import java.net.ProxySelector;
import java.net.URI;
public class WhatIsMyProxy
{
public static void main(String[] args)
{
String website = args[0];
Proxy proxy = ProxySelector.getDefault().select(URI.create(website)).iterator().next();
@AlainODea
AlainODea / splunkforwarder-manifest.xml
Last active February 10, 2020 15:57
Splunk Forwarder SMF Manifest
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
<service name='site/splunkforwarder' type='service' version='0'>
<create_default_instance enabled='true'/>
<single_instance/>
<dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local'/>
</dependency>
<dependency name='splunk_multi-user' grouping='require_all' restart_on='none' type='service'>
@AlainODea
AlainODea / install_haskell_platform.sh
Created September 19, 2013 20:06
Haskell Platform 2013.2.0.0 on Ubuntu 13.04 (Work in Progress)
#!/usr/bin/env bash
sudo apt-get install --assume-yes ghc libncurses5-dev mesa-common-dev freeglut3-dev
wget http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-src.tar.bz2
wget http://lambda.haskell.org/platform/download/2013.2.0.0/haskell-platform-2013.2.0.0.tar.gz
tar xjvf ghc-7.6.3-src.tar.bz2
tar xzvf haskell-platform-2013.2.0.0.tar.gz
pushd ghc-7.6.3
./configure
make -j $(nproc)
sudo make install
@AlainODea
AlainODea / hello.c
Last active March 16, 2016 09:00
Cross-compiler from x86_64 Linux to x86_64 Illumos on Ubuntu (works for Hello World and possibly more)
#include<stdio.h>
main()
{
printf("Hello World");
}
@AlainODea
AlainODea / 0001-Include-termios.h-for-solaris2-host.-Fixes-8366.patch
Last active December 23, 2015 19:09
Partial setup of GHC Cross-compiler for Ubuntu to Illumos
From 05960e888726b961ebe9c00c439f5158a46c0532 Mon Sep 17 00:00:00 2001
From: Muhaimin Ahsan <[email protected]>
Date: Thu, 26 Sep 2013 16:33:59 -0500
Subject: [PATCH] Include termios.h for solaris2 host. (Fixes #8366)
---
System/Console/Haskeline/Backend/Posix.hsc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/System/Console/Haskeline/Backend/Posix.hsc b/System/Console/Haskeline/Backend/Posix.hsc
@AlainODea
AlainODea / ssh_only.sh
Created September 26, 2013 23:23
Configure SmartOS Global Zone (GZ) for SSH public key-only access
#!/bin/bash
# clumsiness due to my inability to get sed -i working in the GZ (BSD sed)
tempfile=$(tempfile)
cat /usbkey/ssh/sshd_config | sed 's/PasswordAuthentication yes/PasswordAuthentication no/' > $tempfile
cat $tempfile /usbkey/ssh/sshd_config
@AlainODea
AlainODea / man2html-recursive.sh
Last active December 25, 2015 05:49
Use man2html to generate entire hyperlinked documentation from man pages
#!/bin/bash -e
#sudo apt-get -y install realpath man2html-base
#gem install ronn
#git clone [email protected]:joyent/illumos-joyent.git
#git clone [email protected]:joyent/smartos-live.git
pushd illumos-joyent
git pull
popd
pushd smartos-live
git pull
@AlainODea
AlainODea / create_x86_64_smartmachine.sh
Last active December 26, 2015 10:18
SmartOS Haskell Platform for x86_64
# assuming you have Joyent Compute Service available
sdc-createmachine --dataset 17c98640-1fdb-11e3-bf51-3708ce78e75a --package g3-standard-1-smartos --name alain-demo-$(uuid) | json -a id