Skip to content

Instantly share code, notes, and snippets.

View brunneis's full-sized avatar

Rodrigo Martínez brunneis

View GitHub Profile
@brunneis
brunneis / fix-eth-hang.md
Last active January 15, 2024 13:45
Proxmox | Fix "e1000e Detected Hardware Unit Hang"
Proxmox Virtual Environment 6.1-3 / Debian 10 (buster)
Kernel 5.3.10-1-pve
Ethernet controller: Intel Corporation Ethernet Connection (2) I218-V (rev 05)
Ethernet driver: e1000e 3.2.6-k
Ethernet firmware: 0.1-4

The solution I've found was to create a oneshot service which disables segmentation offloading.

@brunneis
brunneis / fix-hibernation.md
Last active September 3, 2023 11:19
Fix hibernation / deep sleep issues on MacBook Pro 2013 / 2014 with a NVMe SSD

alt + command + p + r + power

sudo pmset -a hibernatemode 0 standby 0 autopoweroff 0

Default:

sudo pmset restoredefaults
pmset -g
@brunneis
brunneis / install-old-brew-package.sh
Last active August 22, 2023 11:05
How to install an old version of a brew package
#!/bin/bash
# 6.29.3 ~ https://github.com/twmht/python-rocksdb/issues/47#issuecomment-1678961102
PACKAGE_NAME=rocksdb
PACKAGE_VERSION=6.29.3
# Clone the main Homebrew repo
git clone https://github.com/Homebrew/homebrew-core
cd homebrew-core
@brunneis
brunneis / add-wheel.sh
Created July 3, 2018 15:53
Add sudo (wheel) user on CentOS
#!/bin/bash
usermod -aG wheel brunneis
@brunneis
brunneis / create-systemd-service.md
Created October 31, 2019 08:39
Create a systemd service
  1. Create a service file at /usr/lib/systemd/system/<name>.service
  2. systemctl enable <name>
  3. systemctl start <name>

Service template:

[Unit]
Description=

[Service]
@brunneis
brunneis / secure-ssh.sh
Last active October 23, 2022 17:26
Secure SSH (No root SSH login, user login only with private key)
#!/bin/bash
# Create the .ssh directory if it does not exist
mkdir -m 700 -p ~/.ssh
# Import public key
curl https://dev.brunneis.com/brunneis-ecdsa.pub >> ~/.ssh/authorized_keys
# Fix permissions
chmod 600 ~/.ssh/authorized_keys
@brunneis
brunneis / fix.md
Last active July 26, 2021 11:39
Fix MMVV Práctica de Seguridad en Redes

1. Editar archivo /etc/network/interfaces

Añadir auto eth0 tras el fragmento:

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

# The primary network interface
@brunneis
brunneis / hexdump-bitcoin-block0.sh
Created January 3, 2019 14:44
ASCII hexdump of the Bitcoin's block #0 (000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f)
#!/bin/bash
echo -e $(echo -e "import binascii; print(binascii.unhexlify(\"$(curl -s https://blockchain.info/rawblock/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f?format=hex)\"))" | python | cut -d "\"" -f 2) | hexdump -C
@brunneis
brunneis / overlay2-centos.md
Last active July 8, 2021 14:05
Change storage driver to overlay2 on CentOS
  1. systemctl stop docker
  2. Create the file /etc/docker/daemon.json with the following content:
{
  "storage-driver": "overlay2",
  "storage-opts": ["overlay2.override_kernel_check=true"]
}
  1. systemctl start docker
@brunneis
brunneis / fix-lightdm-deepin.sh
Last active April 16, 2021 16:48
LightDM won't start (Deepin Linux)
#!/bin/bash
dpkg-reconfigure xserver-xorg
sudo apt-get purge lightdm
sudo apt-get install lightdm-gtk-greeter
sudo apt-get install lightdm