Skip to content

Instantly share code, notes, and snippets.

View jespada's full-sized avatar

jespada jespada

View GitHub Profile
@jespada
jespada / linux.nix
Created January 17, 2024 12:26 — forked from dltacube/linux.nix
extract of my home-manager configuration
home = {
sessionPath = [ "${config.xdg.configHome}/emacs/bin" "${config.home.homeDirectory}/.emacs.d/bin" "${pkgs.emacs}/bin" "${pkgs.git}" ];
sessionVariables = {
DOOMDIR = "${config.xdg.configHome}/doom-config";
DOOMLOCALDIR = "${config.xdg.configHome}/doom-local";
#DOOMLOCALDIR = "${config.home.homeDirectory}/.emacs.d";
};
};
xdg = {
enable = true;
@jespada
jespada / ssh-key
Created October 17, 2023 14:14
ssh-key
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILjUIRYZcjh6h7EX0xqjhfDn/yH5slp3WUhTN32jluGh cardno:15 470 894
@jespada
jespada / compile-pgloader-ccl.sh
Created May 18, 2017 10:53
pgloader-ccl-compile
# run as root
git clone git@github.com:dimitri/pgloader.git
cd pgloader
mkdir -p /opt/src/pgloader
cp -R * /opt/src/pgloader
apt-get update
apt-get install -y wget curl make git bzip2 time libzip-dev libssl1.0.0 openssl
apt-get install -y patch unzip libsqlite3-dev gawk freetds-dev subversion
Verifying that I control the following Nostr public key: npub1747ceatm52f6wexdxre5v88zrv9rsjw9cq6nxwg6zp6yzfsz7lysxd4uzf.
@jespada
jespada / links
Last active November 16, 2022 23:44
guix | debian
@jespada
jespada / monzo-alertmanager-config.yaml
Created June 23, 2022 10:13 — forked from milesbxf/monzo-alertmanager-config.yaml
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@jespada
jespada / source-sid
Created May 10, 2019 15:36
debina-sid
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://deb.debian.org/debian/ unstable main contrib non-free
deb-src http://deb.debian.org/debian/ unstable main contrib non-free
#------------------------------------------------------------------------------#
# UNOFFICIAL REPOS
@jespada
jespada / aws-ec2-launched-in-last.sh
Last active September 13, 2018 11:28
ec2 instance launched in last X days
#!/bin/bash
# to list instances launched in in the last 15 days run like:
# ./aws-ec2-launched-in-last.sh 15
# https://stackoverflow.com/questions/18858120/finding-all-amazon-aws-instances-that-do-not-have-a-certain-tag
OLDER=$1
if date -v-"$OLDER"d > /dev/null 2>&1; then
@jespada
jespada / percona-xtrabackup.sh
Created August 26, 2018 16:27 — forked from jaygooby/percona-xtrabackup.sh
Call via crontab on whatever schedule suits you; keep n full mysql Percona xtrabackups of your mysql database, with binary logs applied. Also does a full mysqldump that can then have the binary logs applied to restore to a point-in-time backup via the binlogs. Copy all of this (backup, mysqldump, binlogs) to S3.
#!/bin/bash
#
# Carries out a full mysqldump, calls percona-xtrabackup and then
# copies the sql dump, the percona backup and your mysql bin logs
# to S3 using s3cmd http://s3tools.org/s3cmd
#
# TODO: extract out the S3 backup stuff to make it optional, and so
# other s3 programs can replace the s3cmd call.
# TODO: the if [ $? == 0 ] alert blocks should be a function
# TODO: make the if [ $? == 0 ] if [ $? != 0 ] more consistent - test
@jespada
jespada / jenkins_docker_cleanup.gdsl
Created April 24, 2018 13:43
jenkins dsl cleanup job slaves docker
// got it from https://gist.github.com/tomnomnom/53998ec618a17d61153911f9b5ade0ed
// The ArrayList of slaves is not serializable, so fetching them should be marked as @NonCPS so that
// no attempt is made to serialize and save the local state of the function. See here for details:
// https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md#serializing-local-variables
@NonCPS
def getSlaves() {
def slaves = []
jenkins.model.Jenkins.instance.slaves.each {
if (it.name.startsWith('jenkinsslave-')) {