Skip to content

Instantly share code, notes, and snippets.

@uraimo
uraimo / upgrade_rpi3_rpi3b+.md
Last active May 15, 2018 10:58
Use your old Ubuntu Mate 16.04 SD from a Rpi3 with a new Rpi3 B+

Yes! You can reuse your old Ubuntu Mate 16.04 installation from a Raspberry Pi 3 with a new B+.

Trying to boot the B+ with the old SD without modifications, will result in the rainbow screen with thunderbolt screen showing up.

  1. From your old Rpi, update the firmware(kernel.img&co) on the boot partition running sudo rpi-update. This will be enough to boot on the B+ but the wireless card will still not work.

  2. Set a country code for the wireless adapter in your wpa-supplicant.conf (usually under /etc/wpa-supplicant/) adding country=GB.

  3. Get all the files contained in https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm and copy them over the content in /lib/firmware/brcm. This will add a few new and updated drivers for the B+ wireless adapter.

@uraimo
uraimo / dnsovertls.md
Last active March 22, 2024 20:55
Configure your Mac to use DNS over TLS

Tail recursive version of fibonacci:

func fibTail(_ n: Int, _ a: Int = 0,_ b: Int = 1) -> Int{
    if n == 0 { return a }
    if n == 1 { return b }
    return fibTail(n-1,b,a+b)
}

Disable APFS local snapshots: sudo tmutil disable localsnapshot

List the current snapshots: tmutil listlocalsnapshots /

Delete them manually: tmutil deletelocalsnapshots

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 112b5d6..e6f790d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -552,6 +552,8 @@ else()
set(SWIFT_HOST_VARIANT_ARCH_default "powerpc64le")
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "s390x")
set(SWIFT_HOST_VARIANT_ARCH_default "s390x")
+ elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+ set(SWIFT_HOST_VARIANT_ARCH_default "i686")

Reported successes using my binaries on different linuxes:

Ubuntu Core 16 on a Raspi3: Used the mate version and installed clang libpython3.5-dev libcurl3 (or likely libcurl4-nss-dev)

Debian Pi64 on a Raspi3: Used the mate version, installed clang-3.8 libicu-dev libcurl4-nss-dev and copied over libicu.so.55 from an Ubuntu Mate 16.04 system

Armbian(a modified xenial) on an Asus Tinkerboard

@uraimo
uraimo / xcompiler_with_spm_raspbian_302.md
Last active March 9, 2018 03:13
Building a cross-compiling toolchain for Swift 3.0.2 on Raspbian with working SPM

To build a Raspbian toolchain for Swift 3.0.2 a few things need to be changed in the original guide.

Download the Swift 3.0.2 packages instead of the 3.1.1 ones:

curl -o /tmp/swift-3.0.2-RPi1Zero-RaspbianNov16.tgz  https://www.dropbox.com/s/dkrkt9ht1c3hog2/swift-3.0.2-RPi1Zero-RaspbianNov16.tgz
curl -o /tmp/swift-3.0.2-RELEASE-osx.pkg https://swift.org/builds/swift-3.0.2-release/xcode/swift-3.0.2-RELEASE/swift-3.0.2-RELEASE-osx.pkg

Launch the script with these parameters:

@uraimo
uraimo / keybase_local_pgp.md
Created May 10, 2017 17:15
Exporting LOCAL Keybase PGP keys

If you stored locally your pgp private key and didn't upload it on keybase.io (well done), you can get your private key, for example to register it in the local gpg, this way:

keybase pgp export -secret

If you need to clone a big repository on a slow and unreliable connection, you can do a minimal shallow clone:

  git clone --depth=1 <git url>

Then deepen this clone from inside the repo with:

 git fetch --depth=N

Or just: