Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
yeet

Lucio Delelis ldelelis

💭
yeet
View GitHub Profile
@ldelelis
ldelelis / links.txt
Last active Feb 25, 2021
Sky's book of good devops stuff WIP
View links.txt
@ldelelis
ldelelis / ,dig-pool
Created Jan 26, 2021
Print all pods on each instance of a given kubernetes node pool
View ,dig-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
View init.vim
" Configure the editor itself
set background=dark
set title
set ignorecase
set smartcase
set wrap
set autoindent
set copyindent
set smartindent
set number
View devoff2.py
# 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 Jul 6, 2020
First iteration of a low level HTTP server, doing everything by hand
View main.rs
/*
* 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
*/
View ,git-prune
#!/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 Feb 26, 2020
personalized tmux conf forked from https://github.com/taigacute
View .tmux.conf
# 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'
View .devops_aliases
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 Feb 21, 2018
weather script NOT MINE, SHAMEFULLY STOLEN FROM r/UNIXPORN AROUND A YEAR AGO. I DON'T REMEMBER THE ORIGINAL CREATOR
View gist:26920500f662dfcd0d5209cb2c0e033b
#!/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
View winboot.sh
#!bin/sh
##################################
# Winboot flash drive automation #
# Author: Lucio Delelis #
##################################
# CREDIT TO USER Cornelius in askubuntu for the procedure
if [ "$#" -ne 2 ] || ! [ -d $2 ]; then