Skip to content

Instantly share code, notes, and snippets.

View mikehouse's full-sized avatar

Mikhail Demidov mikehouse

  • Thailand
View GitHub Profile
@mikehouse
mikehouse / runCommand.swift
Created May 5, 2024 12:51 — forked from dduan/runCommand.swift
How to fork()+execv() in Swift
import Foundation
func withCStrings(_ strings: [String], scoped: ([UnsafeMutablePointer<CChar>?]) throws -> Void) rethrows {
let cStrings = strings.map { strdup($0) }
try scoped(cStrings + [nil])
cStrings.forEach { free($0) }
}
enum RunCommandError: Error {
case WaitPIDError
#EXTM3U
#EXTINF:-1 proxy="onltvone_comedy" group-title="Entertainment",Paramount Comedy
https://tvonline.live/paramount-comedy-online.php
@mikehouse
mikehouse / show_all_provisioning_profiles_on_my_mac.sh
Last active December 6, 2023 11:18
Gel list of all mobileprovision in the MacOS system Xcode
#!/bin/sh -e
cd ~/Library/MobileDevice/Provisioning\ Profiles/
echo ""
for file in $(ls | grep 'mobileprovision'); do
XML=$(security cms -D -i $file)
FOUND_CREATION_DATE=false
@mikehouse
mikehouse / GCDWebServer+CORS.m
Created October 2, 2019 15:45
GCDWebServer make Cross-Origin Resource Sharing (WKWebView as example)
GCDWebServer *_webServer = [[GCDWebServer alloc] init];
[_webServer addDefaultHandlerForMethod:@"GET"
requestClass:[GCDWebServerRequest class]
processBlock:^GCDWebServerResponse *(GCDWebServerRequest* request) {
GCDWebServerDataResponse *response = [GCDWebServerDataResponse responseWithHTML:@"true"];
[response setValue:@"*" forAdditionalHeader:@"Access-Control-Allow-Origin"];
[response setValue:@"X-Requested-With, Content-Type" forAdditionalHeader:@"Access-Control-Allow-Headers"];
[response setValue:@"GET, POST, OPTIONS" forAdditionalHeader:@"Access-Control-Allow-Methods"];
@mikehouse
mikehouse / View+Debug.swift
Last active October 3, 2023 08:54
SwiftUI View Debug Tracking
extension View {
public func debugView<T: View>(_ type: T.Type, file: String = #filePath, line: UInt = #line) -> some View {
#if DEBUG
return background(DebugView(type: type, file: file, line: line))
#else
return self
#endif
}
}
#EXTM3U x-tvg-url="https://iptv-org.github.io/epg/guides/af.xml,https://iptv-org.github.io/epg/guides/al.xml,https://iptv-org.github.io/epg/guides/by.xml,https://iptv-org.github.io/epg/guides/ca.xml,https://iptv-org.github.io/epg/guides/ee.xml,https://iptv-org.github.io/epg/guides/fr.xml,https://iptv-org.github.io/epg/guides/lu.xml,https://iptv-org.github.io/epg/guides/ru.xml,https://iptv-org.github.io/epg/guides/uk.xml,https://iptv-org.github.io/epg/guides/us.xml"
#EXTINF:-1 group-title="Entertainment",Paramount Comedy
http://hls4.stb.md/PARAMOUNT_COMEDY_H264/tracks-v1a1/mono.m3u8?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpcCI6Ijk2LjMwLjY4LjEyNyIsIm5iZiI6MTY3MjY0ODc0NywiZXhwIjoxNjcyNzM1MTQ3LCJpYXQiOjE2NzI2NDg3NDcsImlzcyI6InN0Yi5zdGFybmV0Lm1kIn0.-riyqWMOfGwS0zWtmK89l3jA-H2kEPqh2w-uHhuEUFM
#EXTINF:-1 group-title="Entertainment",Дом Кино
https://s208.glaz.tv:8082/liveg/domkino.stream/chunks.m3u8?nimblesessionid=51371518&wmsAuthSign=c2VydmVyX3RpbWU9MS8yLzIwMjMgMTE6MDM6MTcgQU0maGFzaF92YWx1ZT01WGE2RFg5OWNJSlNx
@mikehouse
mikehouse / How_to_pair_apple_tv_to_mac.txt
Last active December 21, 2022 15:48
How to pair Apple TV to MacOS via WiFi
1. Make sure Mac and Apple TV have the same network ("AirPlay and HomeKit", "Allow Access" is set to "Anyone in the Same Network")
2. In Xcode open "Devices & Simulators" window
3. On Apple TV open "Remote App And Device" -> "Remote App And Device"
4. Click "pair" and enter code
5. If "pair" reapear again then turn off the wifi on your Mac for 10 seconds and then turn it on again (https://developer.apple.com/forums/thread/108459)
6. Maybe needed to delete the TV from ingored list https://stackoverflow.com/a/63195311/3614746
@mikehouse
mikehouse / parse_text_segment.py
Created June 22, 2022 09:35
Parse __TEXT __text segment for Mach-O binary in python
#!/usr/bin/env python3
from macholib.MachO import MachO
import os
import hashlib
# Taken and a bit modified from https://www.programcreek.com/python/example/111986/macholib.MachO.MachO
def extract_shellcode(filename):
macho_filename = filename
fileoffset = 0
require 'webrick'
require 'webrick/https'
require 'openssl'
require 'json'
# curl https://localhost:port/test (pass '-k' to accept self signed certificate)
# openssl req -x509 -newkey rsa:4096 -keyout priv.pem -out cert.pem -days 365 -nodes
# cert = OpenSSL::X509::Certificate.new File.read 'cert.pem'
# pkey = OpenSSL::PKey::RSA.new File.read 'priv.pem'
defaults write http://com.apple.dt.Xcode ShowDVTDebugMenu -bool YES
sudo touch /Applications/Xcode.app/Contents/Developer/AppleInternal/Library/Xcode/AppleInternal.plist
Ryzen 9 3900 OEM
XMR Best Score for minimum TDP:
CPU Core 4175 Mz (all cores) | 1.10625 CPU Volts | 15664 H/s
DRAM Ryzen Calcularot 3200 Fast preset (voltage 1.355, Soc 0,975, CCD 0.9, IOD 0.9, VDDP 0.7)
Vcore: 1.08 V