Skip to content

Instantly share code, notes, and snippets.

@carlossless
carlossless / sinolink.py
Last active October 30, 2024 18:00
A shallow mock of sinolink's USB descriptors using facedancer
@carlossless
carlossless / gist:ed4014f300582d7bc8dd8e66a95d9b3a
Created February 18, 2024 12:23
u-boot with CONFIG_SERIAL=n
Running phase: unpackPhase
unpacking source archive /nix/store/bvzli4m66fv7s3h9yb3ra37r2fbcrdjw-u-boot-2023.07.02.tar.bz2
source root is u-boot-2023.07.02
setting SOURCE_DATE_EPOCH to timestamp 1689088844 of file u-boot-2023.07.02/tools/zynqmpimage.h
Running phase: patchPhase
patching script interpreter paths in tools
tools/rmboard.py: interpreter directive changed from "#! /usr/bin/python3" to "/nix/store/qhadfg7ab0rchg2icqy1z0980pmqm8qr-python3-3.11.6-env/bin/python3"
tools/buildman/main.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/qhadfg7ab0rchg2icqy1z0980pmqm8qr-python3-3.11.6-env/bin/python3"
tools/k3_fit_atf.sh: interpreter directive changed from "#!/bin/sh" to "/nix/store/8hdfaadlsdrxhzji9wzypadip450mflv-bash-5.2-p15/bin/sh"
tools/rkmux.py: interpreter directive changed from "#!/usr/bin/env python3" to "/nix/store/qhadfg7ab0rchg2icqy1z0980pmqm8qr-python3-3.11.6-env/bin/python3"
{ lib, pkgs, stdenvNoCC, dtc }:
with lib; {
applyOverlays = (base: overlays': stdenvNoCC.mkDerivation {
name = "device-tree-overlays";
nativeBuildInputs = [ dtc ];
buildCommand = let
overlays = toList overlays';
in ''
mkdir -p $out
@carlossless
carlossless / bcm2711-rpi-4-b.dts
Last active June 19, 2022 15:36
bcm2711-rpi-4-b.dtb with a partially applied poe-hat-overlay
/dts-v1/;
/memreserve/ 0x0000000000000000 0x0000000000001000;
/ {
compatible = "raspberrypi,4-model-b\0brcm,bcm2711";
model = "Raspberry Pi 4 Model B";
#address-cells = <0x02>;
#size-cells = <0x01>;
interrupt-parent = <0x01>;
@carlossless
carlossless / dnsmasq-for-localhost-on-macos.md
Last active December 16, 2022 10:38
Setup dnsmasq for .localhost domains on macOS

.localhost domains on macOS with dnsmasq

  1. Install dnsmasq
brew install dnsmasq
  1. Add an address entry to point everything under .dev to 127.0.0.1 in /usr/local/etc/dnsmasq.conf
echo "address=/.localhost/127.0.0.1" &gt;&gt; "$(brew --prefix)"/etc/dnsmasq.conf
@carlossless
carlossless / check_instrumentation.sh
Created September 14, 2017 14:12
Check Carthage dependency binaries for LLVM Instrumentation symbols
#!/usr/bin/env bash
FRAMEWORK_BINARIES=$(find . -path "./Carthage/Build/*.framework/*" -type f -maxdepth 5 ! -name "*.*")
check_framework () {
printf "Checking $1..."
if OTOOL_OUTPUT=$(otool -l -arch all "$1" | grep __llvm_prf) ; then
printf " LLVM instrumentation symbols found:\n"
printf "$OTOOL_OUTPUT\n\n"
else
@carlossless
carlossless / UncurryBuilder.swift
Created June 18, 2017 12:12
A little Swift 4.0 script to build uncurry functions for https://github.com/carlossless/Uncurry
import Foundation
var chars = "ABCDEFGHIJKLMNOPQRSTU"
let charStrings = chars.characters
.map{ String($0) }
func buildFunc(charStrings: [String], index: Int) -> String {
let lowerCaseChars = charStrings.map { $0.lowercased() }
let upperCaseChars = charStrings.map { $0.uppercased() }
@carlossless
carlossless / Info.plist
Last active February 22, 2023 12:01
ATMEL ICE on OS X
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.atmel.driver.dummy</string>
@carlossless
carlossless / post-commit-global-log.sh
Created September 26, 2016 19:38
A script to log the last commit message to the users shared git log
#!/bin/bash
# A script to log the last commit message to the users shared git log
# Useful to keep track of what you did durring a specific day
LOG_PATH="$HOME/gitlogs"
DATE=`date +'%Y-%m-%d'`
COMMIT=`git log --color --graph --pretty=format:'%h %s' -1 HEAD`
REPO_PATH=`git rev-parse --show-toplevel`
REPO_NAME=`basename "$REPO_PATH"`
@carlossless
carlossless / uninstall-cocoapods.sh
Last active April 8, 2016 09:53
Uninstall All Versions of CocoaPods and Dependencies
#!/bin/bash
gem uninstall cocoapods -a -x
gem uninstall cocoapods-core -a
gem uninstall cocoapods-deintegrate -a
gem uninstall cocoapods-downloader -a
gem uninstall cocoapods-plugins -a
gem uninstall cocoapods-search -a
gem uninstall cocoapods-stats -a
gem uninstall cocoapods-trunk -a