Skip to content

Instantly share code, notes, and snippets.

View laurybueno's full-sized avatar

Laury Bueno laurybueno

View GitHub Profile
@laurybueno
laurybueno / docker.yml
Last active November 13, 2022 17:43
Use Lima as a Docker Desktop replacement on MacOS
images:
- location: "https://cloud-images.ubuntu.com/releases/22.04/release-20220902/ubuntu-22.04-server-cloudimg-amd64.img"
arch: "x86_64"
digest: "sha256:c777670007cc5f132417b9e0bc01367ccfc2a989951ffa225bb1952917c3aa81"
- location: "https://cloud-images.ubuntu.com/releases/22.04/release-20220902/ubuntu-22.04-server-cloudimg-arm64.img"
arch: "aarch64"
digest: "sha256:9620f479bd5a6cbf1e805654d41b27f4fc56ef20f916c8331558241734de81ae"
cpus: 8
memory: 8GiB
@laurybueno
laurybueno / fizzbuzz.ipynb
Last active June 18, 2020 16:45
Fizzbuzz - a Pyhton solution with timings
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@laurybueno
laurybueno / media_aprendizado_ideb.py
Created December 13, 2019 17:59
Calculadora simples de Proficiência Média Padronizada (parte da base de cálculo do Ideb)
# Calculadora simples de Proficiência Média Padronizada (parte da base de cálculo do Ideb)
## Referência: http://download.inep.gov.br/educacao_basica/portal_ideb/o_que_e_o_ideb/Nota_Tecnica_n1_concepcaoIDEB.pdf
# "limites" são valores constantes determinados pelo Ideb de 1997
limites = {
'matematica': {
'5ano': {
'inferior': 60,
'superior': 322
},
#!/bin/bash
for d in $(ls /var/lib/kubelet/pods); do
mount | grep $d > /dev/null
if [ $? -ne 0 ]; then
#ls -lah /var/lib/kubelet/pods/$d/containers
echo $d
mv /var/lib/kubelet/pods/$d /tmp/
fi
done
@laurybueno
laurybueno / clean-k8s.sh
Last active January 17, 2019 18:39
Clean a kubernetes worker from any configuration before adding it to a new cluster
docker rm -f $(docker ps -qa)
docker rmi $(docker images -a -q)
docker volume rm -f $(docker volume ls -q)
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke"
for dir in $cleanupdirs; do
echo "Removing $dir"
rm -rf $dir
done
for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done
@fabiomontefuscolo
fabiomontefuscolo / wp-migration.markdown
Last active April 23, 2024 09:28
BedRock WordPress + Nginx w Cache + php-fpm

Instalação dos pacotes do Ubuntu

apt-get install pv nginx-extras                                   \
    php-fpm php-gd php-mbstring php-cli php-mysql php-zip php-xml \
    mariadb-server mariadb-client

Instalação do WP-CLI

@syafiqfaiz
syafiqfaiz / how-to-copy-aws-rds-to-local.md
Last active December 8, 2024 22:08
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@Zodiac1978
Zodiac1978 / .htaccess
Last active June 23, 2024 17:39
Safer WordPress with these .htaccess additions
# Don't show errors which contain full path diclosure (FPD)
# Use that line only if PHP is installed as a module and not per CGI
# try using a php.ini in that case.
# Change mod_php5.c to mod_php7.c if you are running PHP7
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
# Don't list directories
<IfModule mod_autoindex.c>