Skip to content

Instantly share code, notes, and snippets.

View TyrfingMjolnir's full-sized avatar
💭
in my scriptorium whipping up some whoopass

Tyrfing Mjølner TyrfingMjolnir

💭
in my scriptorium whipping up some whoopass
View GitHub Profile
@TyrfingMjolnir
TyrfingMjolnir / nmap-build-TomSellers.sh
Last active January 30, 2018 20:54 — forked from syzdek/mmap-build-TomSellers.sh
Simple build script to build TomSellers' nmap repository
#!/bin/bash
echo "building TomSellers's nmap..."
set -x -e
pwd
git clone https://github.com/TomSellers/nmap.git
( cd nmap && git branch build 7c833b933e771923e660 && checkout build )
( cd nmap && ./configure --prefix=/opt/nmap )
( cd nmap/libdnet-stripped && make )
( cd nmap/liblinear && make )
@TyrfingMjolnir
TyrfingMjolnir / cli-nsrunloop.m
Created January 2, 2018 15:25 — forked from syzdek/cli-nsrunloop.m
Creating an NSRunLoop for a command line utility.
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
NSRunLoop * runLoop;
CLIMain * main; // replace with desired class
@autoreleasepool
{
// create run loop
@TyrfingMjolnir
TyrfingMjolnir / Playgrounds.swift
Last active February 7, 2017 07:39 — forked from SpacyRicochet/Playgrounds.swift
Snippet of the Week; Prototyping views in Playgrounds
import UIKit
import PlaygroundSupport
let thisIsNotPlayground = false
//: NSLayoutConstraint convenience methods
public extension NSLayoutConstraint {
public static func pinning(attribute: NSLayoutAttribute, ofView firstView: UIView, toView secondView: UIView, multiplier: CGFloat = 1, offset: CGFloat = 0) -> NSLayoutConstraint {
return NSLayoutConstraint(item: firstView, attribute: attribute, relatedBy: .equal, toItem: secondView, attribute: attribute, multiplier: multiplier, constant: offset)
//
// AppDelegate.swift
// test
//
// Created by IOANNIS DELIGIANNIS on 1/2/16.
// Copyright © 2016 IOANNIS DELIGIANNIS. All rights reserved.
//
import Cocoa
@TyrfingMjolnir
TyrfingMjolnir / dhcpd.conf
Created May 21, 2016 23:04 — forked from robinsmidsrod/dhcpd.conf
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
@TyrfingMjolnir
TyrfingMjolnir / _INSTALL.md
Created May 4, 2016 19:23 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

Share a ZFS file system over SMB/CIFS and advertise it via mDNS so that it shows up in the OS X Finder. Assumes SmartOS, but should work fine on any illumos distribution.

# Create volume
zfs create zones/store

# Allow guest access to a trusted subnet
zfs set sharesmb=rw=10.10.1.0/22,guestok=true,name=store zones/store

# Advertise the SMB service, it will now show up in Finder
/**
*
* Convert Excel dates into JS date objects
* exampleInput: "42090"
* exampleOutput: "Fri Mar 27 2015 01:00:00 GMT+0100 (CET)"
*
* @param excelDate {Number}
* @return {Date}
*
*/
var o2x = require( 'object-to-xml' );
var j2c = require( 'json-2-csv' );
var j2t = require( 'json-2-tsv' );
function( req, res, next ) {
if( req.accepts( 'application/json' ) ) {
return res.json( req.payload );
}
if( req.accepts( 'text/xml' ) ) {
res.set( 'content-type', 'text/xml' );
//
// FixturesController.m
// Liga Zon Sagres Companion
//
// Created by Berto Bettencourt on 2/10/2014.
// Copyright (c) 2014 Orrian. All rights reserved.
//
#import "FixturesController.h"
#import "GADBannerView.h"