Skip to content

Instantly share code, notes, and snippets.

View sems's full-sized avatar
🔥

Sem Spanhaak sems

🔥
  • Netherlands
  • 05:38 (UTC +02:00)
View GitHub Profile
@sems
sems / setuplinkaggregationunraid.md
Last active June 29, 2024 23:10
Setup guide link aggregation(802.3ad) Unraid with Ubiquiti

Setup guide link aggregation Unraid with Ubiquiti

Introduction

I am writing this guide becuase I coudn't find a proper one online which contained all the information I was searching for. I will try to guide you through the process of enabling link aggregation (802.3ad) with your Ubiquiti hardware and your Unraid server. Note: not all of Ubiquiti's hardware supports link aggregation (LAG). As of the time of writing Ubiquiti states the following.

Applicable to all UniFi Switch models excluding the USW-Flex and USW-Flex-Mini.

Source: Ubiquiti

@fuxingloh
fuxingloh / UILabelSize.swift
Last active March 29, 2024 07:26
iOS Swift: How to find text width, text height or size of UILabel.
extension UILabel {
func textWidth() -> CGFloat {
return UILabel.textWidth(label: self)
}
class func textWidth(label: UILabel) -> CGFloat {
return textWidth(label: label, text: label.text!)
}
class func textWidth(label: UILabel, text: String) -> CGFloat {
@albertbori
albertbori / Installation.md
Last active June 15, 2024 02:19
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@petemcw
petemcw / brew-instructions.sh
Last active March 27, 2024 15:59
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.test domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache