Skip to content

Instantly share code, notes, and snippets.

View govorox's full-sized avatar

govorox

  • Interface Devices, Honeybank Studios
  • UK
View GitHub Profile
@govorox
govorox / gist:1c33ff694382a1f413706c6c619907a3
Created January 25, 2022 16:38
Yocto/OE - generate recipes for python modules
pipoe can generate .bb classes corresponding to python packages for you!
Usage:
$ pip3 install pipoe
$ pipoe -p requests
OR
$ pipoe -p requests --python python3
Now copy the generated .bb files to your layer and use them.
@govorox
govorox / gist:a0b7043ee51fe8a9e57a6164416fb1c1
Last active October 13, 2021 11:59
Yocto: building out of tree kernel module
When building an out-of-tree module (inherits module class in a recipe)
make sure to set CONFIG_TRIM_UNUSED_KSYMS=n in defconfig.
this affects Module.symvers in kernel build artifacts imported by the recipe
in order to ensure the symbols from other modules can be referenced correctly
@govorox
govorox / flash_wic_file
Created September 2, 2021 09:02
Flash Yocto WIC file to SD card
gunzip -c <IMAGE>.wic.gz | sudo dd of=/dev/sdX bs=1M iflag=fullblock oflag=direct conv=fsync
Optional:
status=progress
bs=4M
@govorox
govorox / gist:c0d0f8b95c17f47df8e2f6ecfa2cbf05
Created April 22, 2021 10:15
MacOS add GCC paths to libs installed via macports
#GCC default paths
export C_INCLUDE_PATH=/opt/local/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/opt/local/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=/opt/local/lib:$LIBRARY_PATH
@govorox
govorox / postgres_queries_and_commands.sql
Created October 1, 2020 16:39 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
iptables -A OUTPUT -o eth0 -m state --state NEW -j DROP
@govorox
govorox / sys_command.c
Created May 16, 2017 10:51
Fix Microchip harmony command backspace handling
case SYS_CMD_STATE_WAIT_FOR_READ_DONE:
{
if((readBuff[0] == '\r') || (readBuff[0] == '\n'))
{
pCmdIO->cmdState = SYS_CMD_STATE_SETUP_READ;
// new command assembled
if(pCmdIO->cmdPnt == pCmdIO->cmdBuff)
{ // just an extra \n or \r
(*pCmdIO->pCmdApi->msg)(pCmdIO->cmdIoParam, LINE_TERM _promptStr);
@govorox
govorox / gist:cb921abb260e29cf3bbfb12cfaf82ace
Created January 20, 2017 10:57
Lilliput 10' display native mode for HDMI on Raspberry Pi
# settings for Lilliput display
hdmi_cvt=1024 600 60 3 0 0 1
hdmi_group=2
hdmi_mode=87
@govorox
govorox / sys_console_usb_cdc.c
Last active September 26, 2017 08:29
Microchip Harmony fix - USB CDC console issue with escape sequence handling (ArrowUp, ArrowDn, etc)
...
/*******************************************************
* USB CDC Device Events - Application Event Handler
*******************************************************/
USB_DEVICE_CDC_EVENT_RESPONSE USBDeviceCDCEventHandler
(
USB_DEVICE_CDC_INDEX index ,
USB_DEVICE_CDC_EVENT event ,
Normal keys are forwarded over the ssh session. Instead, use the escape sequences.
To kill the current session hit subsequently Enter ↵, ~, .
More of these escape sequences can be listed with Enter ↵, ~, ?:
Supported escape sequences:
~. - terminate session
~B - send a BREAK to the remote system
~R - Request rekey (SSH protocol 2 only)