This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import Darwin; | |
@import Foundation; | |
@import IOKit; | |
/******* | |
This should change the brightness level of a single external display connected to an M1 MBP or MBA relative to the current setting using DDC/CI. Reportedly does not work on M1 Mini. | |
Credits to @tao-j and @alin23 | |
Compile: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import Darwin; | |
@import Foundation; | |
@import IOKit; | |
// clang -fmodules -o i2cwrite i2cwrite.m && ./i2cwrite | |
typedef CFTypeRef IOAVServiceRef; | |
extern IOAVServiceRef IOAVServiceCreate(CFAllocatorRef allocator); | |
extern IOReturn IOAVServiceCopyEDID(IOAVServiceRef service, CFDataRef* x2); | |
// outputBufferSize must be less than (1 << 12) (4096 bytes) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import Darwin; | |
@import Foundation; | |
@import IOKit; | |
// clang -fmodules -o brt brt.m && ./brt | |
// credit to @zhuowei for discovering the following APIs | |
typedef CFTypeRef IOAVServiceRef; | |
extern IOAVServiceRef IOAVServiceCreate(CFAllocatorRef allocator); | |
extern IOReturn IOAVServiceCopyEDID(IOAVServiceRef service, CFDataRef* x2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MediaItem { | |
var duration: Int? | |
var title: String? | |
var urlString: String? | |
static func parseM3U(contentsOfFile: String) -> [MediaItem]? { | |
var mediaItems = [MediaItem]() | |
contentsOfFile.enumerateLines({ line, stop in | |
if line.hasPrefix("#EXTINF:") { | |
let infoLine = line.stringByReplacingOccurrencesOfString("#EXTINF:", withString: "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#EXTM3U | |
#EXTINF:-1 tvg-name="Das Erste HD" tvg-id="ARD.de" group-title="FritzTV" tvg-logo="http://tv.avm.de/tvapp/logos/daserstehd.png",Das Erste HD | |
rtsp://192.168.10.1:554/?avm=1&freq=330&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=1&pids=0,16,17,18,20,5100,5101,1170,1176,2171,2172,5102,5103,5104,5105 | |
#EXTINF:-1 tvg-name="ZDF HD" tvg-id="ZDF.de" group-title="FritzTV" tvg-logo="http://tv.avm.de/tvapp/logos/zdfhd.png",ZDF HD | |
rtsp://192.168.10.1:554/?avm=1&freq=450&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=1&pids=0,16,17,18,20,6100,6110,6120,6121,6123,6130,6131,6170 | |
#EXTINF:-1 tvg-name="RTL" tvg-id="RTL.de" group-title="FritzTV" tvg-logo="http://tv.avm.de/tvapp/logos/rtl.png",RTL | |
rtsp://192.168.10.1:554/?avm=1&freq=122&bw=8&msys=dvbc&mtype=64qam&sr=6900&specinv=1&pids=0,16,17,18,20,101,1401,1400,1402,1403,1404,1406,1407,1408 | |
#EXTINF:-1 tvg-name="SAT.1" tvg-id="Sat1.de" group-title="FritzTV" tvg-logo="http://tv.avm.de/tvapp/logos/sat1.png",SAT.1 | |
rtsp://192.168.10.1:554/?avm=1&freq=122&bw=8&msys=dvbc&mtype=64qa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.host:/vmshared /mnt/vmshared fuse.vmhgfs-fuse allow_other,uid=1000,gid=1000,auto_unmount,defaults 0 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Set the macOS installer path as a variable | |
MACOS_INSTALLER="/Applications/$(ls /Applications | grep "Install macOS")" | |
MOUNT_POINT="$MACOS_INSTALLER/Contents/SharedSupport" | |
echo "macOS installer is \"$MACOS_INSTALLER\"" | |
# Set the target disk as a variable | |
TARGET=$(diskutil info "$(bless --info --getBoot)" | awk -F':' '/Volume Name/ { print $2 }' | sed -e 's/^[[:space:]]*//') | |
echo "Target disk is \"$TARGET\"" |