Skip to content

Instantly share code, notes, and snippets.

@uraimo
uraimo / fuse-ext2-macos.md
Created May 17, 2019 13:35
Install fuse-ext2 with minimal effort on macOS

Install the dependencies:

brew install m4 autoconf automake libtool e2fsprogs

Clone and build:

git clone https://github.com/alperakcan/fuse-ext2.git	
cd fuse-ext2
@uraimo
uraimo / python_3.6_tensorflow_homebrew.md
Last active February 5, 2019 16:15
Installing Python 3.6.5 on macOS Mojave for Tensorflow

Since Tensorflow is not yet available via pip for Python 3.7 and pyenv can't build python on the latest macOS, let's install 3.6.5_1 via homebrew and use it in conjunction with pyenv to create an enclosed environment that will use 3.6 only when we need it:

brew unlink python
brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
brew switch python 3.7.2_1

Install pyenv if you haven't already, we'll use it to switch to 3.6.5 only when we need it (e.g. jupyter), leaving the latest Python from homebrew as default release (e.g. 3.7.2_1):

brew install pyenv

pyenv rehash

Last update: 5/18

C.H.I.P.

Just use nmtui.

RaspberryPis

On recent ubuntus (16.04+) with the new net interfaces mac rename thingy, disable it to get back to the old naming scheme with:

@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 / 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:

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")
@uraimo
uraimo / bananapi_m3_sd.md
Created April 29, 2017 10:26
How to enable the SD card insertion detection on a Banana Pi M3

Once you dd the image they provide, you'll notice that you can only boot from eMMC when the SD is not inserted and if you inser it after boot, the system doesn't even discover the devices.

There is an easy fix for this.

At boot, uBoot looks for /boot/bananapi/bpi-m3/linux/uEnv.txt and loads /boot/bananapi/bpi-m3/linux/script.bin that contains additional configuration, like how to manage the SD, in binary format.

You just need to follow a few simple steps to enable SD discovery after boot (there is a way to boot from the boot partition on the SD and then load the OS from eMMC but I didn't have time to experiment with that).

@uraimo
uraimo / ubuntu_mate_on_raspberrypi_macos.md
Last active January 10, 2018 08:58
How to install ubuntu mate on an SD for RaspberryPi

Install xz with homebrew:

brew install xz

Insert the SD and get the device name for the SD with df:

Filesystem    512-blocks      Used Available Capacity iused      ifree %iused  Mounted on
/dev/disk1     487867392 157859992 329495400    33% 2352643 4292614636    0%   /
devfs                373       373         0   100%     647          0  100%   /dev
map -hosts             0         0         0   100%       0          0  100%   /net