Skip to content

Instantly share code, notes, and snippets.

View telent's full-sized avatar

Daniel Barlow telent

View GitHub Profile
(fn sleep [x] (: (io.popen (.. "sleep " (tostring x))) :close)) ;; simulate a slow process
(fn tick-producer []
(coroutine.wrap
(fn []
(var i 0)
(while (< i 10)
(set i (+ 1 i))
(coroutine.yield i)
(sleep 1)
@telent
telent / gist:9742059
Last active February 19, 2024 09:30
12 factor app configuration vs leaking environment variables
App configuration in environment variables: for and against
For (some of these as per the 12 factor principles)
1) they are are easy to change between deploys without changing any code
2) unlike config files, there is little chance of them being checked
into the code repo accidentally
3) unlike custom config files, or other config mechanisms such as Java
/run/uncaught-logs/current:@400000000000014d0ac6a4d9 int.link.dhcpc udhcpc: broadcasting discover
/run/uncaught-logs/current:@40000000000001500b02481e int.link.dhcpc udhcpc: broadcasting discover
/run/uncaught-logs/current:@400000000000015338118555 int.link.dhcpc udhcpc: broadcasting discover
/run/uncaught-logs/current:@400000000000016a0e95f42a int.link.dhcpc udhcpc: broadcasting discover
/run/uncaught-logs/current:@400000000000016a0f736e03 int.link.dhcpc udhcpc: broadcasting select for 192.16
8.8.223, server 192.168.8.1
/run/uncaught-logs/current:@400000000000016a10b2bb34 int.link.dhcpc udhcpc: lease of 192.168.8.223 obtaine
d from 192.168.8.1, lease time 3600
/run/uncaught-logs/current:@400000000000016a1461834e s6-rc: info: service int.link.dhcpc successfully star
ted
diff --git a/drivers/gpu/drm/panel/msm8953-generated/panel-boe-bs052fhm-a00-6c01.c b/drivers/gpu/drm/panel/msm8953-generated/panel-boe-bs052fhm-a00-6c01.c
index db43159eaf89..72a34d9e1280 100644
--- a/drivers/gpu/drm/panel/msm8953-generated/panel-boe-bs052fhm-a00-6c01.c
+++ b/drivers/gpu/drm/panel/msm8953-generated/panel-boe-bs052fhm-a00-6c01.c
@@ -3,6 +3,7 @@
// Generated with linux-mdss-dsi-panel-driver-generator from vendor device tree:
// Copyright (c) 2013, The Linux Foundation. All rights reserved. (FIXME)
+#include <linux/backlight.h>
#include <linux/delay.h>
[ 19.622226] ------------[ cut here ]------------
[ 19.622230] Unbalanced enable for IRQ 31
[ 19.622248] WARNING: CPU: 7 PID: 2542 at kernel/irq/manage.c:789 __enable_irq+0x4c/0x7c
[ 19.622270] Modules linked in: wcnss_ctrl q6asm_dai q6routing q6voice_dai q6afe_dai q6voice q6afe_clocks q6adm q6asm q6afe q6cvs q6cvp q6mvm q6core snd_q6dsp_common q6voice_common apr pdr_interface qrtr_smd panel_boe_bs052fhm_a00_6c01(+) venus_dec venus_enc videobuf2_dma_contig videobuf2_memops msm crct10dif_ce snd_soc_apq8016_sbc rmi_i2c qcom_rng snd_soc_qcom_common rmi_core qrtr snd_soc_msm8916_digital qcom_wcnss_pil qcom_q6v5_pas gpu_sched drm_display_helper venus_core drm_kms_helper v4l2_mem2mem videobuf2_v4l2 qcom_q6v5_mss qcom_spmi_temp_alarm rtc_pm8xxx videobuf2_common qcom_spmi_vadc qcom_q6v5 qcom_pon qcom_sysmon reboot_mode qcom_vadc_common drm snd_soc_msm8916_analog qmi_helpers videodev qcom_common qcom_pil_info drm_panel_orientation_quirks mc mdt_loader rmtfs_mem socinfo
[ 19.622461] CPU: 7 PID: 2542 Comm: kwo
"qemu-system-mips"
"-M"
"malta"
"-echr"
"16"
"-m"
"272"
"-device"
"loader,file=run-vm-q0Bfcl,addr=0x90000000"
"-serial"
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Odroid C2 with Tow-Boot uses UEFI boot but has an MBR
# partition (not GPT) because the hardware needs firmware blobs
@telent
telent / polar.rb
Created April 26, 2012 15:35
Interface with a polar bluetooth hrm from ruby (linux)
require 'pp'
require 'socket'
module BluetoothPolarHrm
AF_BLUETOOTH=31 # these are correct for the Linux Bluez stack
BTPROTO_RFCOMM=3
class << self
def connect_bt address_str,channel=1
bytes=address_str.split(/:/).map {|x| x.to_i(16) }
s=Socket.new(AF_BLUETOOTH, :STREAM, BTPROTO_RFCOMM)
@telent
telent / sms.fnl
Created September 16, 2022 15:18
(local fcntl (require "posix.fcntl"))
(local posix (require "posix"))
(local { : read : write } (require "posix.unistd"))
(local {: tcgetattr : tcsetattr : tcdrain
: CLOCAL : CREAD
: ICANON : ECHO : ECHOE : ISIG
: OPOST
} (require "posix.termio"))
(local { : nanosleep } (require "posix.time"))
(local { : view } (require "fennel"))
block->blocknum = blocknum;
err = bio_read(cache->dev, block->ptr, (off_t)blocknum * cache->block_size, cache->block_size );
if(block->ptr == (void *)0x8f76c0e4) {
char * p = ((char *)block->ptr);
thread_sleep(1);
while((p < (char *) 0x8f76d0e4) && (*p != 0x99))
p++;
p-=4;
dprintf(SPEW, "%x: %x %x %x %x %x %x %x %x %d %d\n",