Skip to content

Instantly share code, notes, and snippets.

@slavc
slavc / gist:27a2cee21732fc036516d60f34ebcca7
Created December 23, 2020 20:16
Raspberry Pi 3B+ notes
# Sensors
## DHT11 temperature and humidity sensor
1-wire bus protocol, read using https://github.com/szazo/DHT11_Python
@slavc
slavc / gist:5dadc41854b7c503ca1f6659bf85f5a1
Created April 27, 2020 21:19
Create Windows installation USB drive from Linux
1. Format USB drive using FAT.
2. Copy over all files from the Windows installation DVD, except for `sources/install.wim` - this file is too large to fit on a FAT filesystem.
3. Use https://www.systutorials.com/docs/linux/man/1-wimlib-imagex-split/ tool to split install.wim file into install.swm install2.swm etc.
@slavc
slavc / vybrid-vf610-tower-bootstrap.txt
Last active January 15, 2019 14:07
Vybrid VF610 tower board bootstrap instructions
# Instructions assume host OS is Fedora Linux.
#
# Clone and build u-boot
#
cd ~/src/
git clone git://git.denx.de/u-boot.git
cd u-boot
sudo dnf install arm-none-eabi-gcc-cs
export ARCH=arm
@slavc
slavc / Asus C100P Notebook PC boot from SD card
Last active December 29, 2020 21:56
Asus C100P Notebook PC - boot from SD card instrcutions
To boot from an SD card on Asus C100P Notebook PC, do the following:
1. Prepare the SD card, e.g. `dd` an OS image onto it and insert it into the notebook.
2. Enable developer mode: turn notebook on while holding Esc+F3(Refresh), after it turns on press Ctrl+D to switch to developer mode.
3. Open a shell (Ctrl+T in Chrome), type `shell` to launch bash, do `sudo crossystem dev_boot_usb=1 dev_boot_signed_only=0`, reboot.
4. At the boot prompt with the developer mode warning, press Ctrl+U to boot from the SD card.
@slavc
slavc / How to install Fedora Linux onto Wandboard
Last active December 13, 2020 20:57
How to install Fedora Linux onto Wandboard
1. Download a Fedora Linux for ARM image.
2. Install fedora-arm-installer:
dnf install fedora-arm-installer
3. Write the image to SD card, not forgetting to set the console to serial port:
fedora-arm-image-installer \
--image=Fedora-Minimal-armhfp-25-1.3-sda.raw.xz \
--target=wandboard \
--media=/dev/sdc \
@slavc
slavc / How to install an Android toolchain
Last active June 21, 2024 15:29
How to install an Android toolchain
These instructions describe how to install an Android toolchain capable of compiling standalone C/C++ programs for an Android device.
1. Download Android NDK from https://developer.android.com/ndk/downloads/index.html and unpack it somewhere.
2. Run the included script to install a standalone toolchain:
mkdir $HOME/opt
$NDK/build/tools/make-standalone-toolchain.sh --arch=arm --install-dir=$HOME/opt/android_toolchain
3. Create a test program and compile it:
cat > hello.c << EOF
@slavc
slavc / after_wakeup.txt
Created January 27, 2016 02:09
Apple MacBook Air 6,2 SMC keys and their values.
0: Key name.
1: Flags? Keys which have c0 as first byte are usually
writeable. Second byte seems to be the length of value.
2: Key type.
3: More flags?
4: Value. ``x'' means value could not be read.
0 1 2 3 4
#KEY 88040000 ui32 acb20200 00 00 02 31
$Adr 88040000 ui32 20070020 00 00 03 00