Skip to content

Instantly share code, notes, and snippets.

View mc-cat-tty's full-sized avatar
:octocat:

Francesco Mecatti mc-cat-tty

:octocat:
View GitHub Profile
@mc-cat-tty
mc-cat-tty / notes.md
Created March 14, 2024 19:12
CMake, Amico o Nemico?

DSL - Domain Specific Language

cmake_minimum_required(VERSION 3.5)
set_executable(example main.cpp)
add_library(...)
# OR
add_subdirectory(...) # File CMakeLists.txt nella subdirectory
target_include_directories(...)
# OR
esptool.py -p /dev/ttyACM1 -b 115200 write_flash [-fm dio] -z 0x1000 bootloader.bin 0x8000 partitions.bin 0x10000 firmware.bin
@mc-cat-tty
mc-cat-tty / CustomKernelConfig
Last active November 2, 2022 11:16
Custom Kernel on QEMU
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.0.0-rc7 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Ubuntu 10.3.0-1ubuntu1~20.10) 10.3.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=100300
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23501
@mc-cat-tty
mc-cat-tty / restore_win_partition.txt
Created June 17, 2022 09:53
Restore Windows partition after unexpected shutdown
sudo ntfsfix /dev/sda4
sudo ntfs-3g -o remove_hiberfile /dev/sda4 /mnt
@mc-cat-tty
mc-cat-tty / nested-session.txt
Last active November 20, 2021 09:20
gnome-shell-development
dbus-run-session -- gnome-shell --nested --wayland
@mc-cat-tty
mc-cat-tty / freebsd_read_write_commands_on_single_user_mode
Last active July 7, 2021 13:25
Commands to issue in BSD-like environments in order to gain read-write privileges from single user boot mode.
fsck -y
mount -u /
mount -a -t ufs
swapon -a
---OR---
mount -u -w /
---ADD USER TO WHEEL GROUP---
EMERGENCY COMMAND
Don't panic, to list all openssl's modules run:
openssl help
RANDOM NUMBER GENERATION
openssl rand [...]
-help list available args
[...] bytes_num
-out outfile redirect stdout to outfile. output redirection operator ('>') is as alternative
@mc-cat-tty
mc-cat-tty / config.yml
Created January 5, 2021 17:21
Fusuma config file. Place inside this directory: ~/.config/fusuma/
swipe:
3:
left:
command: 'xdotool key alt+Right' # History forward
right:
command: 'xdotool key alt+Left' # History back
up:
command: 'xdotool key --clearmodifiers ctrl+t' # Open new tab
keypress:
LEFTSHIFT:
@mc-cat-tty
mc-cat-tty / README.md
Last active March 22, 2021 10:25 — forked from AMoreaux/robbyrussell.zsh-theme
Override oh-my-zsh robbyrussell theme with number of unpushed commits. It now works also inside subdirectories

robbyrussel with unpushed commits counter - ZSH theme

This is a fork of https://gist.github.com/AMoreaux/fb8df10b0de1d89fea45d8da5e467a86

Compared to his parent, this version adds the support for subdirectories inside the folder of a repo, which otherwise would not be recognized

Features

This configuration file override oh-my-zsh robbyrussel theme adding the number of unpushed commits; the counter is placed at the righmost position of the prompt

@mc-cat-tty
mc-cat-tty / Instructions.md
Last active November 17, 2020 18:32
MikroTik RouterBOARD serial console

Enable Serial Console After Reset

  1. Upload this script (enable_serial_console.rsc) from Winbox (Files>Upload)
  2. Move it on flash memory
  3. Next time, reset with /system reset-configuration run-after-reset=flash/enable_serial_console.rsc command