Skip to content

Instantly share code, notes, and snippets.

@taviso
taviso / .Xresources
Last active February 1, 2021 10:43
Enable Xft support in XTerm Menus
! Set the default XTerm UI font (menus, toolbar, etc)
XTerm*XftFont: Courier:size=10:antialias=true:style=Regular
! All my resources are available here (I disable the Xaw3D effect, I think it looks a bit dated!)
! https://gist.github.com/taviso/a4543b1752fba55017e8fcc2fe052c0a
! It looks like this: https://imgur.com/a/m2PGuuz
!
@65c22
65c22 / tuto_atmosphere_fr.md
Last active August 1, 2023 14:39
Tutoriel - Installer Atmosphère sur votre Nintendo Switch

Tutoriel - Comprendre et utiliser le CFW Atmosphère sur Nintendo Switch (+bonus)

Atmosphère est un CFW (Custom FirmWare - Logiciel modifié) opensource avec un développement très active. Son nom n'a pas été choisi par hazard, effet les developpeurs ont découpés le code en plusieurs couches (comme celle de l'atmosphère), vous n'allez pas tout comprendre mais vous allez pouvoir retenir les quelques features les plus importantes pour une utilisation lambda.

Les couches d'Atmosphère

  • Fusée - le custom bootloader, c'est la première couche lors de l'amorçage du CFW, elle permet le chargement des fichiers KIPs, le chargement d'un kernel personalisé... La configuration de ce composant se situe dans le fichier atmosphere/BCT.ini

  • Exosphère - le custom secure monitor, c'est une réplimentation complète de la TrustZone du firmware de la Switch, permettant la récuperation d'une multitude d'informations pour les Homebrews par exemple.

@haproxytechblog
haproxytechblog / blog20181127-01.cfg
Last active January 24, 2024 13:23
Bot Protection with HAProxy
backend per_ip_and_url_rates
stick-table type binary len 8 size 1m expire 24h store http_req_rate(24h)
backend per_ip_rates
stick-table type ip size 1m expire 24h store gpc0,gpc0_rate(30s)
@avishayp
avishayp / Dockerfile
Created September 25, 2018 19:02
Add non-root user for alpine linux
# non root user example for alpine
#
# usage:
# $ docker build --build-arg "USER=someuser" --tag test .
# $ docker run --rm test
FROM alpine
ARG USER=default
ENV HOME /home/$USER
@paolocarrasco
paolocarrasco / README.md
Last active May 3, 2024 15:20
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@secfigo
secfigo / gist:ff5910b2965fbbea5bc96564a944e62c
Created May 27, 2018 15:07
Gitlab runner registration with extra-hosts for both docker and shell executor
sudo gitlab-runner register \
--non-interactive \
--url "https://gitlab.local/" \
--registration-token "xJWfniGqvSeVyKc3vaQx" \
--executor "docker" \
--docker-image ubuntu:16.04 \
--description "docker-runner" \
--tag-list "docker,aws" \
--run-untagged \
--docker-extra-hosts "gitlab.local:10.0.1.15" \
@acobaugh
acobaugh / git-crypt-list-keys.sh
Created September 29, 2017 15:23
List git-crypt gpg keys
for key in .git-crypt/keys/default/0/* ; do gpg -k $(echo $(basename $key) | sed -e 's/.gpg//') ; done ;
@cskeeters
cskeeters / broadcast_calc.sh
Created December 8, 2016 19:17
Bash script for calculating network and broadcast addresses from ip and netmask or CIDR Notation
#!/bin/bash
# Calculates network and broadcast based on supplied ip address and netmask
# Usage: broadcast_calc.sh 192.168.0.1 255.255.255.0
# Usage: broadcast_calc.sh 192.168.0.1/24
tonum() {
if [[ $1 =~ ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+) ]]; then
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 2, 2024 01:27
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@pmorie
pmorie / gist:8027518
Created December 18, 2013 18:41
bash -eu, explained
# Source: http://fvue.nl/wiki/Bash:_Error_handling
#
#!/bin/bash -eu
# -e: Exit immediately if a command exits with a non-zero status.
# -u: Treat unset variables as an error when substituting.
(false) # Caveat 1: If an error occurs in a subshell, it isn't detected
(false) || false # Solution: If you want to exit, you have to detect the error yourself
(false; true) || false # Caveat 2: The return status of the ';' separated list is `true'
(false && true) || false # Solution: If you want to control the last command executed, use `&&'