Skip to content

Instantly share code, notes, and snippets.

View meetnick's full-sized avatar

Niccola meetnick

  • Belo Horizonte, MG - Brazil
View GitHub Profile
@meetnick
meetnick / LineageOS Android Encryption fixing
Created April 7, 2021 20:03
This is a guide for allowing encryption with Android LineageOS
# DON'T ENCRYPT YOUR PHONE WITH ANY LOCK PATTERN SET (e.g. PIN) BEFORE YOU FOLLOW THIS GUIDE
# Enter terminal (Example TWRP -> Advanced -> Terminal) and type:
df
# df output example:
# Filesystem 1K-blocks Used Available Use% Mounted on
# /dev/block/mmcblk0p12 12324784 546144 60353600 4% /data
# From the above output, we have to remember the mmcblk block and partition numbers (/dev/block/mmcblk0p12).
# Also need to remember 1K-blocks value amount (12324784)
# Now umount /data in TWRP. For this, go to Mount > deselect Data
@meetnick
meetnick / gist:c52b4b8f31069ad40dfe52013c08dceb
Created March 9, 2021 21:12
mecool file for coreelec compatibility for A95X F3 Air Remote Control
# table mecool, type: NEC
0xdf54 KEY_1
0xdf16 KEY_2
0xdf15 KEY_3
0xdf50 KEY_4
0xdf12 KEY_5
0xdf11 KEY_6
0xdf4c KEY_7
0xdf0e KEY_8
0xdf0d KEY_9
@meetnick
meetnick / gist:a0b4d630077bdd94ff42b4f53e429e62
Created March 9, 2021 16:40
A95X F3 Air Remote Control keycode mapping
5211.503965: event type EV_MSC(0x04): scancode = 0xdf1a UP
5246.296039: event type EV_MSC(0x04): scancode = 0xdf48 BOTTOM
5258.109775: event type EV_MSC(0x04): scancode = 0xdf07 RIGHT
5266.236036: event type EV_MSC(0x04): scancode = 0xdf47 LEFT
5274.196059: event type EV_MSC(0x04): scancode = 0xdf06 ENTER
5285.972336: event type EV_MSC(0x04): scancode = 0xdf0a BACK
5298.872040: event type EV_MSC(0x04): scancode = 0xdf42 HOME
5307.768721: event type EV_MSC(0x04): scancode = 0xdf5d VOL UP
5315.618840: event type EV_MSC(0x04): scancode = 0xdf5c VOL DOWN
5335.712039: event type EV_MSC(0x04): scancode = 0xdf4f NETFLIX
# Avoid freeze while pressing volume media shortcut keys,
# sudo nano /usr/share/X11/xkb/symbols/br
# Comment line containing: modifier_map Mod3 { Scroll_Lock };
# logout and login again OR
# enter command:
# setxkbmap -layout br
# Libreoffice bad rendering
# Still unsolved
@meetnick
meetnick / gist:c21af45d9f131c6c54c517d0b9d48583
Created April 24, 2020 19:06
install-cuda-10-1-cudnn-ubuntu-2004-nvidia-driver-440-yolo-tensorflow-gpu
################ NVIDIA DRIVER 440 INSTALLATION
# Install NVIDIA driver
# Ubuntu 20.04 LTS already has nvidia driver version 440
################ NVIDIA CUDA 10.0 INSTALLATION
sudo dpkg -i cuda-repo-ubuntu1804-10-1-local-10.1.243-418.87.00_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-1-local-10.1.243-418.87.00/7fa2af80.pub
sudo apt-get update
# Here we shouldn't install neither cuda-10-0, cuda-runtime-10-0 nor cuda
################ NVIDIA DRIVER 440 INSTALLATION
# Install NVIDIA driver
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/440.64/NVIDIA-Linux-x86_64-440.64.run
chmod a+x NVIDIA-Linux-x86_64-440.64.run
sudo dpkg --add-architecture i386
sudo apt install lib32gcc1 build-essential dkms
sudo ./NVIDIA-Linux-x86_64-440.64.run --no-cc-version-check
# Reboot. Check that GPUs are visible using the command: nvidia-smi
################ NVIDIA CUDA 10.0 INSTALLATION
#!/bin/bash
# Converts any video to Vehicle Portable Backseat DVD Player
ffmpeg -i "$1" -c:v mpeg4 -vtag xvid -vf scale=640:360 "$2"
sudo -H pip3 install virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
mkdir -p $WORKON_HOME
if ! grep -q VIRTUALENV_ALREADY_ADDED $HOME/.bashrc; then
echo "# VIRTUALENV_ALREADY_ADDED" >> $HOME/.bashrc
echo "WORKON_HOME=$HOME/.virtualenvs" >> $HOME/.bashrc
echo "export VIRTUALENV_PYTHON=/usr/bin/python3" >> $HOME/.bashrc
#!/bin/sh
# Windows Core fonts
sudo apt-get install ttf-mscorefonts-installer -y
# Microsoft’s ClearType fonts (Windows Vista Fonts)
sudo apt-get install fontforge -y
wget https://gist.github.com/maxwelleite/10774746/raw/ttf-vista-fonts-installer.sh -q -O - | sudo bash
# Microsoft Tahoma
wget https://gist.githubusercontent.com/maxwelleite/913b6775e4e408daa904566eb375b090/raw/cbfd8eb70184fa509fcab37dad7905676c93d587/ttf-ms-tahoma-installer.sh -q -O - | sudo bash
@meetnick
meetnick / add-external-conf-includes-samba-support
Last active March 14, 2025 01:37
Add support to .conf files individually in samba
#!/bin/sh
# default samba .conf file
SMB_CONF=/etc/samba/smb.conf
# samba directory to store samba configuration files individually
SMB_CONF_DIR=/etc/samba/smb.conf.d/
# first need to create individual .conf files with desired sambs configuration into path defined above
# file which contains all includes to samba configuration files individually
SMB_INCLUDES=/etc/samba/includes.conf
# adds includes.conf file existance to smb.conf file