Skip to content

Instantly share code, notes, and snippets.

View vookimedlo's full-sized avatar

Michal Duda vookimedlo

View GitHub Profile
@vookimedlo
vookimedlo / predictable_network_linux.md
Last active June 12, 2023 05:05
Predictable network interface device names @ Linux

Predictable network interface device names @ Linux

Predictable network interface device names based on:
 - firmware/bios-provided index numbers for on-board devices
 - firmware-provided pci-express hotplug slot index number
 - physical/geographical location of the hardware
 - the interface's MAC address
@vookimedlo
vookimedlo / macos_mute_unmute.md
Last active May 14, 2025 14:05
MacOS: mute & unmute from command line

Mute volume

osascript -e "set volume with output muted"

Unmute volume

osascript -e "set volume without output muted"
@vookimedlo
vookimedlo / CURL Services.md
Last active November 22, 2018 19:03
Interesting CURL services

Weather

curl wttr.in/

curl wttr.in/Praha

External IP Address

curl checkip.amazonaws.com

@vookimedlo
vookimedlo / interesting_unicode_chars.md
Created December 14, 2018 20:39
Interesting Unicode Characters

‼️💬⚠️ℹ️

@vookimedlo
vookimedlo / shell_shortcuts.md
Created January 22, 2019 18:36
Shell shortcuts
➜  bindkey
"^@" set-mark-command
"^A" beginning-of-line
"^B" backward-char
"^D" delete-char-or-list
"^E" end-of-line
"^F" forward-char
"^G" send-break
"^H" backward-delete-char
@vookimedlo
vookimedlo / windows_batch.md
Created April 1, 2019 20:06
Windows Batch Scripts: Useful constructs

Change Current Directory to the Batch File Directory

cd /D "%~dp0"

@vookimedlo
vookimedlo / git2dch.sh
Created April 20, 2019 20:33 — forked from nikicat/git2dch.sh
Shell script to regenerate debian changelog from git log
#!/bin/sh
sudo apt-get install -y moreutils git-buildpackage
>debian/changelog
prevtag=initial
pkgname=`cat debian/control | grep '^Package: ' | sed 's/^Package: //'`
git tag -l v* | sort -V | while read tag; do
(echo "$pkgname (${tag#v}) unstable; urgency=low\n"; git log --pretty=format:' * %s' $prevtag..$tag; git log --pretty='format:%n%n -- %aN <%aE> %aD%n%n' $tag^..$tag) | cat - debian/changelog | sponge debian/changelog
prevtag=$tag
@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
@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 / 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
}