Skip to content

Instantly share code, notes, and snippets.

View Lzok's full-sized avatar

Leandro Echevarria Lzok

  • Andromeda
View GitHub Profile
@Lzok
Lzok / git-delete-branches.md
Last active July 1, 2019 13:29
Scripts to delete git branches locally and remotely. Except master, development and others.

Note

The following commands were tested in MacOS. Not yet in Linux.

Delete branches locally

Delete all local branches except master, development and the current branch (in this example). You can add as many branches as you want in the regex.

cd into-the-desired-repo
git branch | egrep -v "(master|development|\*)" | xargs git branch -D
@Lzok
Lzok / cluster-leds.py
Last active March 22, 2023 23:09
Script to be used in my Raspberry Pi 4 cluster to show information about CPU Load, Ram Load and CPU Temperature.
#!/usr/bin/env python3
"""
=============== DISCLAIMER ===================
The original library (blinkt) belongs to Pimoroni Company.
https://github.com/pimoroni/blinkt.
I just adapted some examples to meet my needs.
=============== END DISCLAIMER ===============
@Lzok
Lzok / arch-installation.md
Last active November 18, 2020 19:04
My configuration to install Arch Linux.

This guide is updated to date 2020-06-27

I use UEFI mode, LVM to manage the volumes and LUKS to encrypt the LVM volumes. Also I install the system with the Ethernet cable plugged in.

First commands before begin the "actual" work.

Check if my network interface is listed and enabled ip link

@Lzok
Lzok / tplink-adapter-linux.md
Created January 10, 2021 04:50
Commands to install the correct drivers for TP-LINK TL-WN722NC wireless adapter
sudo apt purge ubuntu-report popularity-contest apport whoopsie apport-symptoms\
&& sudo apt-mark hold ubuntu-report popularity-contest apport whoopsie apport-symptoms
@Lzok
Lzok / hyper-v-windows.md
Created February 7, 2021 02:41
Commands to get WSL or Virtual box working (not both)

06-02-2021 I am working in a Windows 10 machine and I noticed I can't work with VirtualBox and WSL together. This is mostly due to Hyper-V.

After some research, the solution I found is quite uncomfortable.

If you want to use WSL, you will need to execute the following in an administrator promp (and reboot):

bcdedit /set hypervisorlaunchtype auto

DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-Vi
@Lzok
Lzok / pyenv-management.md
Last active April 29, 2024 18:17
Commands to manage Python Virtual Environments with Pyenv

Install pyenv (Arch Linux) and add the paths to $PATH variable

sudo pacman -S pyenv

echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc && 
echo 'eval "$(pyenv init -)"' >> ~/.bashrc && 
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc &&
echo 'PATH=$(pyenv root)/shims:$PATH' >> ~/.bashrc

check your swap

free

turn off swap

sudo swapoff /swapfile

To create the SWAP file, you will need to use this.

sudo fallocate -l 4G /swapfile # same as "sudo dd if=/dev/zero of=/swapfile bs=1G count=4"

Secure swap.

@Lzok
Lzok / mousepad-config.md
Created March 21, 2021 21:13
Config for mousepad Linux
sudo nano /etc/X11/xorg.conf.d/30-touchpad.conf
Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    MatchIsTouchpad "on"
 Option "Tapping" "on"
@Lzok
Lzok / bt-audio-modules.md
Created March 21, 2021 21:24
Linux bluetooth audio modules that work for me
# LDAC codecs
sudo pacman -S libldac
# From AUR
paru -S pulseaudio-modules-bt