Skip to content

Instantly share code, notes, and snippets.

View pblxptr's full-sized avatar

Patryk B pblxptr

  • Poland
  • 10:30 (UTC +01:00)
View GitHub Profile

GPIO CONFIGURATION (PULLUP/DOWN ETC) (based on RPI Zero)

From 6d927f7f846e8ebbc5ad790358beeef308e83167 Mon Sep 17 00:00:00 2001
From: bielu000 <[email protected]>
Date: Tue, 29 Jun 2021 11:01:11 +0200
Subject: [PATCH] Added device tree overlay for hatch2sr.

---
 .../boot/dts/overlays/hatch2sr-overlay.dts    | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)

USEFUL COMMANDS

  • create device file -> sudo mknod -m 666 /dev/hatch2sr 239 0

Tips

  • when writing to userspace (e.g. attr_show) use sysfs_emit - this functions is aware of PAGE_SIZE
  • when reading from userspace (e.g. attr_store), when you want to eg. check if parameter is equal use sysfs_streq

DEVICE ATTRIBUTES

static DEVICE_ATTR(status, S_IWUSR | S_IRUGO, hatch2sr_show_status, hatch2sr_store_status);

radare2

load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main
cmake_minimum_required(VERSION 3.12)
project(nmea_gps)
set(CMAKE_CXX_STANDARD 17)
enable_testing()
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(when no-ssl
(warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
@pblxptr
pblxptr / tmux-gcc-emacs.txt
Last active May 30, 2021 07:41
TMUX/GCC/EMACS
TMUX
C-b c -> create window
C-b & -> kill window
C-, -> name window
C-f -> find window
C-b 1..9 -> switch window
C-b , -> reanme window
C-b w -> choose window from a list
C-b % -> split horizontally (left/right)
C-b " -> split vertically (top/bottom)
public class ServicesUsersMapperProfile : AutoMapper.Profile
{
public ServicesUsersMapperProfile()
{
CreateMap<UserModel, User>();
CreateMap<UsernameAliasModel, UsernameAlias>();
}
}