Skip to content

Instantly share code, notes, and snippets.


Daniel Schaffrath dsh2

View GitHub Profile
u1735067 / 1.
Last active Mar 11, 2021
Properly set-up i2c RTC ds1307 on ArchLinux
View 1.
echo "dtoverlay=i2c-rtc,ds3231" >> /boot/config.txt
cat <<EOF > /etc/udev/rules.d/55-rtc-i2c.rules
#/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc"
#/lib/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"
# I2C RTC, when added and not the source of the sys clock (kernel), is used
ACTION=="add", SUBSYSTEMS=="i2c", SUBSYSTEM=="rtc", KERNEL=="rtc0", ATTR{hctosys}=="0", \\
RUN+="/sbin/hwclock '--rtc=\$root/\$name' --hctosys", \\
RUN+="/sbin/logger --tag systemd-udevd 'System clock set from i2c hardware clock \$name (\$attr{name})'"
blueyed / _tmux_pane_words.zsh
Last active Jun 27, 2021
ZSH configuration to complete words from tmux pane(s)
View _tmux_pane_words.zsh
# Complete words from tmux pane(s) {{{1
# Source:
# Gist:
_tmux_pane_words() {
local expl
local -a w
if [[ -z "$TMUX_PANE" ]]; then
_message "not running inside tmux!"
return 1