Skip to content

Instantly share code, notes, and snippets.

View ldelelis's full-sized avatar
🏆

Lucio Delelis ldelelis

🏆
View GitHub Profile
@ldelelis
ldelelis / links.txt
Last active February 25, 2021 15:36
Sky's book of good devops stuff WIP
@ldelelis
ldelelis / ,dig-pool
Created January 26, 2021 17:40
Print all pods on each instance of a given kubernetes node pool
#!/bin/sh
kubectl get node | grep $1 | awk '{print $1}' | while read instance; do printf "\ninstance: $instance\n======\n"; kubectl get po -A --no-headers --field-selector spec.nodeName=$instance; done
# coding: utf-8
import math
def transpose(matrix):
row_length = len(matrix[0])
transpose_matrix = [[] for _ in range(row_length)]
for i, m1 in enumerate(matrix):
for j, m2 in enumerate(m1):
@ldelelis
ldelelis / main.rs
Created July 6, 2020 23:57
First iteration of a low level HTTP server, doing everything by hand
/*
* Objectives:
* 1. Bind TCP port
* 2. Listen for messages
* 3. Parse HTTP request contents
* 4. direct request to a route (function)
* 5. build response
* 6. send response
* 7. contine listening to requests
*/
#!/bin/sh
set -e
echo "Updating remote state"
git fetch --prune
BRANCHES=$(git branch -vv | grep -e 'gone]' | awk '{ print $1 }')
echo "Branches to delete locally:"
@ldelelis
ldelelis / .tmux.conf
Created February 26, 2020 23:31
personalized tmux conf forked from https://github.com/taigacute
# Author :taigacute
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'samoshkin/tmux-plugin-sysstat'
@ldelelis
ldelelis / init.vim
Last active October 12, 2021 15:02
" Configure the editor itself
set background=dark
set title
set ignorecase
set smartcase
set wrap
set autoindent
set copyindent
set smartindent
set number
alias a="alias" # extremely useful
# Open a given ansible module's documentation in the currently open browser as a new tab
# example: ansearch copy
ansearch() {
python -m webbrowser -t "https://docs.ansible.com/ansible/latest/modules/$1_module.html" >/dev/null
}
# Open all file in current directory matching an extension as tabs
# example: vimt tf # open all terraform files as tabs
@ldelelis
ldelelis / gist:26920500f662dfcd0d5209cb2c0e033b
Created February 21, 2018 00:09
weather script NOT MINE, SHAMEFULLY STOLEN FROM r/UNIXPORN AROUND A YEAR AGO. I DON'T REMEMBER THE ORIGINAL CREATOR
#!/usr/bin/python3
import lxml.etree
import requests
url = 'http://www.yr.no/sted/Argentina/Distrito_Federal/Buenos_Aires/forecast_hour_by_hour.xml'
icons = {'02d': u'\uf00c', '42d': u'\uf0b2', '20n': u'\uf01d', '24d': u'\uf00e', '48': u'\uf0b5', '02n': u'\uf081', '22': u'\uf01d', '26n': u'\uf06a', '28d': u'\uf06b', '21n': u'\uf06d', '08n': u'\uf01b', '26d': u'\uf068', '01d': u'\uf00d', '08d': u'\uf01b', '29n': u'\uf06d', '04': u'\uf041', '23': u'\uf01d', '25n': u'\uf01e', '47': u'\uf0b5', '29d': u'\uf06b', '09': u'\uf01a', '27n': u'\uf01d', '46': u'\uf01c', '43d': u'\uf0b2', '50': u'\uf01b', '06n': u'\uf01d', '44n': u'\uf02a', '41d': u'\uf019', '05n': u'\uf029', '24n': u'\uf02c', '03n': u'\uf086', '05d': u'\uf009', '20d': u'\uf01d', '03d': u'\uf002', '42n': u'\uf0b4', '07d': u'\uf0b2', '40d': u'\uf00b', '25d': u'\uf01e', '01n': u'\uf02e', '45n': u'\uf01b', '07n': u'\uf0b4', '45d': u'\uf01b', '11': u'\uf01d', '10': u'\uf019', '13': u'\uf01b', '12': u'\uf0b5', '15': u'\uf014', '14': u'\uf01d', '28n': u'\uf0
#!bin/sh
##################################
# Winboot flash drive automation #
# Author: Lucio Delelis #
##################################
# CREDIT TO USER Cornelius in askubuntu for the procedure
if [ "$#" -ne 2 ] || ! [ -d $2 ]; then