apt-get install mkisofs
mkdir /tmp/custom_iso
#!/usr/bin/env bash | |
# The directory to save the generated certificates (and everything about this certificate authority). | |
# This is only used on the node generating the certificates (usually on the journals server). | |
DIR="/etc/ssl/systemd-journal-remote" | |
# The journals centralization server name (the CN of the server certificate). | |
SERVER="server-hostname" | |
# All the DNS names or IPs this server is reachable at (the certificate will include them). |
public class XCTHarness { | |
private typealias XCTestMainType = @convention(c) (_ something: AnyObject?) -> () | |
private static func dlsymcast<T>(_ handle: UnsafeMutableRawPointer!, _ symbol: UnsafePointer<CChar>) -> T! { | |
dlsym(handle, symbol).map { | |
if T.self is AnyObject.Type { | |
return $0 as! T | |
} else { | |
return unsafeBitCast($0, to: T.self) | |
} |
// | |
// Copyright (c) 2016, 2018 Nikolai Ruhe. All rights reserved. | |
// | |
import Foundation | |
public extension FileManager { | |
/// Calculate the allocated size of a directory and all its contents on the volume. |
// | |
// Thanks Kevin! | |
// https://gist.github.com/SheffieldKevin/566dc048dd6f36716bcd | |
// | |
import CoreGraphics | |
import CoreImage | |
extension CGImage { | |
#pragma once | |
#include <type_traits> | |
#include <limits> | |
// The default enumeration category. Conversion is equivalent to static_cast. | |
// Unspecialized enumeration traits use this category. | |
struct enum_default { }; | |
// The standard-layout enumeration category. Values outside the given range are |
#import <CommonCrypto/CommonCrypto.h> |
// CalculatorView.swift | |
// as seen in http://nshipster.com/ibinspectable-ibdesignable/ | |
// | |
// (c) 2015 Nate Cook, licensed under the MIT license | |
import UIKit | |
/// The alignment for drawing an String inside a bounding rectangle. | |
enum NCStringAlignment { | |
case LeftTop |
import Foundation | |
let size = MemoryLayout<Int16>.stride | |
let data = Data(bytes: [1, 0, 2, 0, 3, 0]) // little endian for 16-bit values | |
let int16s = data.withUnsafeBytes { (bytes: UnsafePointer<Int16>) in | |
Array(UnsafeBufferPointer(start: bytes, count: data.count / size)) | |
} | |
let length = data.count * MemoryLayout<Int16>.stride |