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 / PrivateGPT.md
Last active August 9, 2023 13:17
How I installed Private GPT in Ubuntu 20.04.6 LTS \n \l
apt-get install neovim vim tmux htop git python3-pip curl
mkdir -p /opt/local/dev
cd /opt/local/dev
git clone https://github.com/imartinez/privateGPT
cd privateGPT
mkdir models
cd models
curl -kLO https://gpt4all.io/models/ggml-gpt4all-j-v1.3-groovy.bin
cd ..
@TyrfingMjolnir
TyrfingMjolnir / TimingCommandExecution.swift
Created June 4, 2023 07:13
Timing the time spend on executing through NSTask
//#!/usr/bin/swift
import Foundation
import QuartzCore
//let task = Process()
//task.launchPath = "/usr/bin/defaults"
//task.arguments = ["write","com.apple.dock","persistent-apps","-array-add","{\"tile-type\"=\"spacer-tile\";}"]
//let pipe = Pipe()
//task.standardOutput = pipe
//task.standardError = pipe
@TyrfingMjolnir
TyrfingMjolnir / ResultBuilderDemo.swift
Created May 25, 2023 07:01 — forked from pitt500/ResultBuilderDemo.swift
Demo explaining Result Builders, check out this link for more context: https://youtu.be/kZ7JPFUVv1w
// Created by Pedro Rojas (aka Pitt)
// Link to learn more about this code: https://youtu.be/kZ7JPFUVv1w
import SwiftUI
import WebKit
@resultBuilder
struct HtmlBuilder {
static func buildBlock() -> [HtmlTag] {
[]
@TyrfingMjolnir
TyrfingMjolnir / HOWTOFM20S.md
Last active September 21, 2023 18:23
How I installed FileMaker 20 Server on a Joyent SmartOS( non-native, non-LX, ) BHYVE zone
import UIKit
import PhotosUI
class ViewController: UIViewController {
@IBAction func presentPickerForImagesIncludingLivePhotos(_ sender: Any ) {
presentPicker( filter: PHPickerFilter.images )
}
private func presentPicker( filter: PHPickerFilter ) {
app.http.server.configuration.address = .unixDomainSocket( path: "/var/run/tld.domain.login" )
@TyrfingMjolnir
TyrfingMjolnir / NetworkingExample.swift
Last active November 7, 2022 12:17 — forked from vinczebalazs/NetworkingExample.swift
Protocol and generic based networking example.
import Foundation
// Model.
struct Employee: Codable {
let id: Int
let name: String
}

OSI model

# Name Typical
7 Application HTTP( APIs etc, ) FTP, SMTP
6 Presentation Encryption
5 Session Controls termination
4 Transport TCP / UDP / ICMP / etc
3 Network IPv4 + IPv6
2 Data link Ethernet MAC( Media Access Control ) Address
@TyrfingMjolnir
TyrfingMjolnir / exa-T.txt
Created April 7, 2022 20:24
Here is a tree listing of the XCode template files.
$ exa -T $(pwd)
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates
├── File Templates
│ ├── iOS
│ │ ├── Apple Watch
│ │ │ └── WatchKit Settings Bundle.xctemplate
│ │ │ ├── ___FILEBASENAME___.bundle
│ │ │ │ ├── en.lproj
│ │ │ │ │ └── Root.strings
│ │ │ │ └── Root.plist
@TyrfingMjolnir
TyrfingMjolnir / smart-pub.md
Created January 6, 2022 01:56 — forked from onnet/smart-pub.md
SmartOS zone manipulation. Snapshot, image, rollback, and migrate.

SmartOS Zone Manipulation

Notes on snapshots, images, and migrations

Create Zone/KVM

# Create zone
vmadm create <<EOL
{
 "brand": "joyent",
 .