Skip to content

Instantly share code, notes, and snippets.

View brunneis's full-sized avatar

Rodrigo Martínez brunneis

View GitHub Profile
@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 / create-account.py
Created March 3, 2021 12:10
Generate an Ethereum account with Python
from easyweb3 import EasyWeb3
import json
def generate_private_key(password: str) -> dict:
private_key = EasyWeb3().web3.eth.account.create()
private_key_dict = private_key.encrypt(password)
with open(f'./{private_key.address}.json', 'w') as output_file:
json.dump(private_key_dict, output_file)
password = '1234'
@brunneis
brunneis / fix-eth-hang.md
Last active October 21, 2024 02:57
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 / ubuntu-first-steps.sh
Last active January 4, 2020 19:53
Ubuntu first steps
#!/bin/bash
apt-get update
apt-get -y install ntp nano git
apt-get -y install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
apt-get -y install docker-ce docker-ce-cli containerd.io
usermod -aG docker dynuser
curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
@brunneis
brunneis / centos-first-steps.sh
Last active January 4, 2020 19:52
CentOS 8 first steps
#!/bin/bash
yum -y install epel-release
yum -y install nano git
yum -y install yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y install docker-ce --nobest
systemctl enable docker
usermod -aG docker dynuser
curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
@brunneis
brunneis / proxmox-post-setup.sh
Last active December 9, 2019 21:09
Post-setup on Proxmox servers
#!/bin/bash
# Remove annoying message
sed -i.bak "s/data.status !== 'Active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
systemctl restart pveproxy.service
# Remove enterprise repo
rm /etc/apt/sources.list.d/pve-enterprise.list
# Dependencies
@brunneis
brunneis / docker-centos8.sh
Created December 8, 2019 21:44
Docker CentOS 8
#!/bin/bash
# Misc
yum -y update
yum -y install epel-release
yum -y install htop nano git
# Docker
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
@brunneis
brunneis / store-git-credentials.sh
Created November 27, 2019 08:46
Store Git credentials on disk (plain text)
git config --global credential.helper store
@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 / configure-glusterfs.md
Last active December 10, 2019 15:46
GlusterFS

Servers

Installation

yum -y install centos-release-gluster
yum -y install glusterfs-server ntp
systemctl enable glusterd ntpd
systemctl start glusterd ntpd