Skip to content

Instantly share code, notes, and snippets.

View yeokm1's full-sized avatar

Yeo Kheng Meng yeokm1

View GitHub Profile
@yeokm1
yeokm1 / archlinux-rpi3-serial-and-bluetooth.md
Last active October 9, 2021 09:59
Arch Linux Raspberry Pi 3 configuration to use both Serial Debug Port and Bluetooth

The new Raspberry Pi 3 released on 29 Feb 2016 has issues with its UART port as the pinout GPIO 14/15 on the pin header is now based on a low throughput mini-UART.

To understand the issue better than reading the wall of text below, you can see the talk I gave on this issue.

The actual hardware UART on the BCM2837 SoC has now been assigned to handle Bluetooth with the BCM43438 Wifi/Bluetooth chip. More details can be found here and here.

This mini-UART does not produce a stable baud rate as it fluctuates based on the Core clock speed whenever it rises or falls. The result is that the serial debug output is practically unusable. On Raspbian you may see garbage or nothing at all. The solution is simple, add core_freq=250 to /boot/config.txt to cap the core frequency to a constant value. This optio

@yeokm1
yeokm1 / Read-only FS on Intel Edison Yocto.md
Last active April 13, 2018 02:54
Set up Yocto runnig on Intel Edison to boot from and use a read-only file-system

Unlike your typical computer where you usually shutdown properly, I cannot rely on this during the use of my Intel Edison. If the Intel Edison is improperly shutdown too many times, data corruption in the file system leading to unbootable system may result. So we should use a read-only file system.

This version has been adapted from my Raspberry Pi Arch Linux's instructions.

#Update everything first
opkg update
opkg upgrade

#Adjust /etc/fstab, add/modify to the following hashed lines. Mount certain directories to RAM disk.
@yeokm1
yeokm1 / ttrss-on-ubuntu.md
Created May 16, 2015 09:42
How to install Tiny Tiny RSS on Ubuntu

Adapted from here

  1. Install all packages
sudo apt-get update
sudo apt-get install php5 php5-pgsql php5-fpm php-apc php5-curl php5-cli postgresql nginx git
  1. Configure PostgresSQL
@yeokm1
yeokm1 / Octoprint on read-only Arch Linux ARM for Raspberry Pi.md
Last active October 15, 2022 13:18
Use Octoprint on Arch Linux ARM with read-only file system for Raspberry Pi

I wanted Octoprint (a 3D-printer management software) to start up fast without the bloatness of using Raspbian. I also regularly forgot to shutdown the Raspberry Pi hosting Octoprint properly leading to file system corruption and unbootable SD card.

This set of instructions should provide all that is needed to use Octoprint without fear of improper shutdown with Arch Linux ARM by using a read-only file system.

This instructions does not have the webcam setup as I didn't intend to use it. If you wish to use the webcam, please consult and try to port the official Raspbian FAQ.

##Instructions

  1. Convert the Arch Linux ARM file system to read-only. Please follow the instructions from my previous gist. The following instructions assume you are logged into with the root account.
@yeokm1
yeokm1 / Static IP Wifi for Raspbian.md
Last active August 29, 2015 14:06
Set up Wifi connection with static IP on Raspbian
sudo nano /etc/network/interfaces

##Add/Edit these lines
iface demo inet static
address 192.168.0.4
netmask 255.255.255.0
gateway 192.168.0.1
#
@yeokm1
yeokm1 / Read-only FS on Raspbian.md
Last active January 5, 2021 01:50
Set up Raspbian on Raspberry Pi to boot from and use a read-only file-system
sudo apt-get update
sudo apt-get upgrade
sudo rm -rf opt
cd /var/log/ 
sudo rm `find . -type f`
sudo swapoff --all
sudo update-rc.d -f dphys-swapfile remove
sudo apt-get remove dphys-swapfile
sudo rm /etc/init.d/dphys-swapfile
@yeokm1
yeokm1 / Minimal Raspbian.md
Last active November 21, 2016 03:29
Set of commands to strip down the default Raspbian installation as of 20 September 2014
rm -rf python_games
rm -rf Desktop

sudo apt-get --auto-remove --purge remove aptitude aptitude-common aspell aspell-en cifs-utils dbus dbus-x11 dconf-gsettings-backend:armhf dconf-service debconf-i18n debian-reference-common debian-reference-en desktop-base desktop-file-utils dictionaries-common dillo esound-common ed fbset firmware-atheros firmware-brcm80211 firmware-libertas firmware-ralink firmware-realtek fontconfig fontconfig-config fonts-droid fonts-freefont-ttf galculator gconf-service gconf2 gconf2-common gdb gdbserver gettext-base ghostscript gir1.2-glib-2.0 glib-networking:armhf glib-networking-common glib-networking-services gnome-icon-theme gnome-themes-standard-data gpicview groff-base gsettings-desktop-schemas gsfonts gsfonts-x11 gtk2-engines:armhf gvfs:armhf gvfs-backends gvfs-common gvfs-daemons gvfs-fuse gvfs-libs:armhf hicolor-icon-theme idle idle-python2.7 idle-python3.2 idle3 jackd jackd2 java-common krb5-locales leafpad lightdm lightdm-gtk-greeter lua5.1 luajit lxappearance lxde 
@yeokm1
yeokm1 / Read-only FS on Arch Linux ARM.md
Last active August 18, 2023 05:43
Set up Arch Linux ARM on Raspberry Pi to boot from and use a read-only file-system

Read-only FS on Arch Linux ARM

Unlike your typical computer where you usually shutdown properly, I cannot rely on this during the use of my Raspberry Pi. If the Raspberry Pi is improperly shutdown too many times, data corruption in the file system leading to unbootable SD card may result. So we should use a read-only file system.

Full instructions and explanations are obtained from this link but you can run these commands directly. I modified some of the instructions for personal convenience.

Login with default username: alarm, password: alarm

#Optionally enable root over SSH. The rest of these instructions assume u are in root.