Skip to content

Instantly share code, notes, and snippets.

View e-minguez's full-sized avatar
😅
I have no idea what I'm doing

Eduardo Mínguez e-minguez

😅
I have no idea what I'm doing
View GitHub Profile
@e-minguez
e-minguez / bootstrap.sh
Last active February 13, 2022 17:21
Bootstrap N54L
yum remove postfix
yum install epel-release
yum install apcupsd smartmontools ssmtpd lm_sensors fail2ban
sensors-detect --auto
cat << EOF > /etc/fail2ban/jail.d/99-enabled.conf
[sshd]
enabled = true
EOF
@e-minguez
e-minguez / ps4-shutdown
Created December 8, 2021 21:41 — forked from autumnharmony/ps4-shutdown
ps4 remote shutdown
dependencies:
https://www.npmjs.com/package/ps4-waker
jq
@e-minguez
e-minguez / elastic.yaml
Last active August 23, 2021 14:05
elastic single node k8s
apiVersion: v1
kind: ConfigMap
metadata:
labels:
product: k8s-elastic
name: elastic-config
data:
elasticsearch.yaml: |
discovery.type: single-node
---
@e-minguez
e-minguez / logid.cfg
Created August 16, 2021 09:51
/etc/logid.cfg configuration file
devices: ({
name: "Wireless Mouse MX Master 2S";
// A lower threshold number makes the wheel switch to free-spin mode
// quicker when scrolling fast.
smartshift: { on: true; threshold: 16; };
hiresscroll: { hires: true; invert: false; target: false; };
// Higher numbers make the mouse more sensitive (cursor moves faster),
@e-minguez
e-minguez / get-all.sh
Created May 4, 2020 13:03
Get all k8s objects, both namespaced or not
#!/usr/bin/env bash
# https://stackoverflow.com/a/55796558/491522
getall() {
for i in $(oc api-resources --verbs=list --namespaced -o name | grep -v "events.events.k8s.io" | grep -v "events" | sort | uniq); do
echo "Resource:" $i
oc -n ${1} get --ignore-not-found=true ${i} -o yaml > ${1}/${i}.yaml
done
}
@e-minguez
e-minguez / pine64-bt.md
Created April 28, 2020 07:03
pine64 bluetooth
  • Install armbian and update it
  • Install the full firmware package and bluetooth support
apt install armbian-firmware-full bluez
  • Include the pine64 bluetooth config file (manually for now, see armbian/firmware#14)
  • Enable and start the bluetooth service
systemctl enable bluetooth --now
@e-minguez
e-minguez / README-pbp-manjaro-sway.md
Last active March 26, 2021 08:48
pbp manjaro sway
$ cat ~/.bash_aliases 

#alias ls="exa -alh --icons"
#alias tree="exa --tree --icons"
#alias cat="bat"
alias vi="nvim"
alias vim="nvim"
alias ls="ls --color=auto"
alias ll="ls -l --color=auto"
@e-minguez
e-minguez / README.md
Created March 23, 2021 08:09
Manjaro pinebook pro FDE howto

Requisites

  • A manjaro x86_64 VM with X (see https://gitlab.manjaro.org/man...jaro-arm-installer/-/issues/10 4 for the reason behind the X requirement)
  • An extra disk. In my case, I've used a 8gb qcow2 empty file mapped as sata (important as the script only recognizes /dev/sd* or /dev/mmclblk* devices) so it is /dev/sda in the VM.

Process

  • ssh into the VM
  • pacman -Syyu manjaro-arm-installer
  • Reboot (just in case as it should have updated a few packages, including the kernel)
@e-minguez
e-minguez / fix_ocp_katacoda.py
Last active January 5, 2021 20:28
fix_ocp_katacoda.py
#!/usr/bin/env python
import ruamel.yaml
import os
import socket
import fcntl
import struct
# https://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-of-eth0-in-python/30990617
def get_ip_address(ifname):
#!/bin/sh
TIMES=4
HOST=$(ip route show default | awk '/default/ {print $3}')
/bin/ping -c${TIMES} ${HOST} > /dev/null
if [ $? != 0 ]
then
/sbin/shutdown -r now "No connectivity to ${HOST}, rebooting..."
fi