Skip to content

Instantly share code, notes, and snippets.

@uraimo
uraimo / snmp_guide.md
Last active June 3, 2022 09:16
The bare minimum you need to query an SNMP service

To traverse the tree of public data (i.e. "public" community), starting from the "iso" root:

  snmpwalk -v 2c -Cc -c public -m ALL 10.0.0.1 iso

To print out private data ("private" community, enterprises leaf(1.3.6.1.4)):

snmpwalk -v 2c -c private -l authPriv -u "user" -a MD5 -A "pass" -x DES -X "pass" -m ALL 10.0.0.1 1.3.6.1.4

@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

@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 April 12, 2026 02:39
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: