Skip to content

Instantly share code, notes, and snippets.

View vookimedlo's full-sized avatar

Michal Duda vookimedlo

View GitHub Profile
@vookimedlo
vookimedlo / time-machine.sh
Created January 11, 2025 19:39 — forked from bahamat/time-machine.sh
DNS-SD Bonjour service discovery for Time Machine volumes
#!/bin/bash -x
if [[ -z $1 ]]; then
printf 'Must supply a path\n'
exit 1
fi
# We want to advertise a consistent volume UUID that will survive reprovisions.
zone_uuid=$(zonename)
bonjour_name="$(hostname -s).local"
@vookimedlo
vookimedlo / Bonjour record adisk adVF values.md
Created January 11, 2025 19:33
Bonjour record adisk adVF values
@vookimedlo
vookimedlo / netboot.xyz_dnsmasq.md
Created December 19, 2023 23:05
netboot.xyz dnsmasq configuration
tee -a /etc/dnsmasq.conf << EOF
###################################
# TFTP Server custom configutation
####################################
enable-tftp
tftp-root=/root/tftp

# Architecture list
# https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml#processor-architecture
@vookimedlo
vookimedlo / Linode-Custom_Distro_Installation.md
Last active December 18, 2020 17:49
How to install a Debian Testing from the scratch on the Linode server.

Linode

Custom Debian Installation

Erase generated configurations

  • Create a Linode instance [linode cloud dashboard]
  • Remove all disk [linode cloud dashboard]
  • Remove all configurations [linode cloud dashboard]
@vookimedlo
vookimedlo / xvfb
Created December 18, 2019 21:05 — forked from jterrace/xvfb
xvfb init script for Ubuntu
XVFB=/usr/bin/Xvfb
XVFBARGS=":1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset"
PIDFILE=/var/run/xvfb.pid
case "$1" in
start)
echo -n "Starting virtual X frame buffer: Xvfb"
start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
echo "."
;;
stop)
@vookimedlo
vookimedlo / MacOS: Set application position and size from CLI.md
Last active October 30, 2019 20:41
MacOS: Set the application position and size from the command line [AppleScript]

Dictionary is the application, which shall be adjusted to the position {0, 20} and to the size {1280, 800}.

Note that this is the size of the plain window without a shadow. If you do a screenshot, you can omit a shadow by holding the ⌥ [option] key.

tell application "System Events"
    set ssProcess to first process whose name is "Dictionary"
    tell ssProcess
        tell first window
 set position to {0, 20}
@vookimedlo
vookimedlo / TimeMachine-Raspberry-4.md
Last active October 10, 2022 02:09
Headless TimeMachine backup solution @ Raspberry 4

Download Image

curl -L https://downloads.raspberrypi.org/raspbian_lite_latest | bsdtar -xvf-
https://downloads.raspberrypi.org/raspios_lite_arm64/images/
@vookimedlo
vookimedlo / Share.swift
Created September 12, 2019 18:43 — forked from mosen/Share.swift
Convenient swift-like wrapper over NetFS smb mounting
import Foundation
import NetFS
enum ShareMountError: Error {
case InvalidURL
case MountpointInaccessible
case InvalidMountOptions
}
@vookimedlo
vookimedlo / gist:79dbc79c18e4bc0f094f02aae2540b70
Created August 1, 2019 16:27 — forked from KosmicTask/gist:9a3181909b1fe67368f8
NSTableView custom drag image with background and drop shadow based on contents of NSTableCellView -draggingImageComponents
#pragma mark -
#pragma mark NSTableViewDataSource
- (void)tableView:(NSTableView *)tableView draggingSession:(NSDraggingSession *)session willBeginAtPoint:(NSPoint)screenPoint forRowIndexes:(NSIndexSet *)rowIndexes
{
// configure the drag image
// we are only dragging one item
NSTableCellView *cellView = [self.columnsTableView viewAtColumn:0 row:rowIndexes.firstIndex makeIfNecessary:NO];
if (cellView) {
@vookimedlo
vookimedlo / CalculatorView.swift
Created July 7, 2019 06:07 — forked from nahuelDeveloper/CalculatorView.swift
An IBInspectable Calculator Construction Set
// 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