Skip to content

Instantly share code, notes, and snippets.

@strezh
strezh / autoload_driver.md
Last active February 7, 2024 12:16
Automatic create /dev file when driver module is loaded, automatic load driver on startup.

Automatic create /dev file

example driver module:

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/fs.h>
@strezh
strezh / git_save_tree.md
Created November 20, 2023 08:20
git: save all changed file tree between versions

Get tree of changed files between versions and save it to TAR archive

git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $commit_id | xargs tar -rf mytarfile.tar
  1. git diff-tree -r $commit_id: - Take a diff of the given commit to its parent(s) (including all subdirectories, not just the top directory).
  2. --no-commit-id --name-only: - Do not output the commit SHA1. Output only the names of the affected files instead of a full diff.
  3. --diff-filter=ACMRT: - Only show files added, copied, modified, renamed or that had their type changed (eg. file → symlink) in this commit. This leaves out deleted files.
@strezh
strezh / GStreamer-1.0 some strings.sh
Last active October 2, 2023 09:00
GStreamer-1.0 personal cheat sheet
#!/bin/bash
# play YUV444 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y444 ! \
videoconvert ! \
autovideosink
# play YUV422 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
@strezh
strezh / QuestaSimNotes.md
Last active September 27, 2023 12:20
QuestaSim notes

Установка под Linux

При установке под линукс (проверено на Ubuntu 16):

  1. Устанавливаем wine
  2. Из папки crack копируем файл MentorKG.exe в <install_dir>/linux (или /linux_x86_64)
  3. Выполняем
sudo chown root:root ~/.wine
@strezh
strezh / 1605711107.json
Created July 2, 2023 17:28
karabiner kb switching (caps - EN, cmd+caps - RU, ctrl+caps - GE
{
"title": "switch English, Russian",
"rules": [
{
"description": "Use caps switch language to English, left_shift+caps - Russian, left_control+caps - Georgian",
"manipulators": [
{
"from": {
"key_code": "caps_lock"
},
#!/bin/bash
# install homebrew (https://brew.sh/)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# basic software
brew install \
iterm2 \
mc \
google-chrome \
@strezh
strezh / gmock_debian.md
Created February 17, 2015 09:10
Install google-mock on Debian
cd ${GMOCK_ROOT}
mkdir build
cd build
g++ -I../gtest/include -I../gtest -I../include -I.. -c ../gtest/src/gtest-all.cc
g++ -I../gtest/include -I../gtest -I../include -I.. -c ../gmock/src/gmock-all.cc
ar -rv libgmock.a gtest-all.o gmock-all.o
@strezh
strezh / runIntent.cpp
Last active May 24, 2021 17:24
Run Android Intent from Qt (#Android #application #Qt #Launcher)
void runApplication(const QString &packageName, const QString &className)
{
qDebug() << "Start app: " <<packageName <<", "<<className;
QAndroidJniObject activity = QAndroidJniObject::callStaticObjectMethod(
"org/qtproject/qt5/android/QtNative", "activity",
"()Landroid/app/Activity;"); //activity is valid
if ( activity.isValid() )
{
// Equivalent to Jave code: 'Intent intent = new Intent();'
@strezh
strezh / gst_clone.sh
Last active March 26, 2021 02:07
Clone all GStreamer repo
# GStreamer plug-in for OpenMAX IL API specification (deprecated, use gst-omx inst...
git clone git://anongit.freedesktop.org/gstreamer/attic/gst-openmax
# GStreamer QA System (aka "Insanity")
git clone git://anongit.freedesktop.org/gstreamer/attic/insanity
# Insanity GStreamer tests & helper functions
git clone git://anongit.freedesktop.org/gstreamer/attic/insanity-gst
# Cerbero build system used to build the official upstream GStreamer 1.0 SDK binar...
git clone git://anongit.freedesktop.org/gstreamer/cerbero
# 'common' shared submodule
git clone git://anongit.freedesktop.org/gstreamer/common
@strezh
strezh / gist:196f183b97537a1b15bc40d3f78cbb2b
Created March 21, 2017 13:40
Vivado HLS crti.o not found
$> export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LIBRARY_PATH
$> vivado_hls