This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT last_value FROM sequence_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT setval(pg_get_serial_sequence('table_name', 'id'), coalesce(max(id),0) + 1, false) FROM table_name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This command solves a recurrent audio problem on my Dell G3 3590 | |
#For some reason the audio suddenly loses definition in some random situations (during video calls, after screen blank, etc) | |
sudo kernelstub -a "i915.enable_psr=0" | |
#Hardware info (neofetch output): | |
# ///////////// lbarbieri@pop-os | |
# ///////////////////// ---------------- | |
# ///////*767//////////////// OS: Pop!_OS 22.04 LTS x86_64 | |
# //////7676767676*////////////// Host: G3 3590 | |
# /////76767//7676767////////////// Kernel: 6.4.6-76060406-generic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl delete pod <PODNAME> --grace-period=0 --force --namespace <NAMESPACE> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--list private ip addresses from the specified <subnet-id> | |
aws ec2 describe-network-interfaces --filters Name=subnet-id,Values=<subnet-id> | jq -r '.NetworkInterfaces[].PrivateIpAddress' | sort | |
--list dependencies of a security group | |
aws ec2 describe-network-interfaces --filters Name=group-id,Values=<security-group-id> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pesquisa uma string recursivamente ignorando alguns diretórios comuns em projetos node, java, etc | |
grep -Hrn 'text_to_find' --exclude-dir 'node_modules' --exclude-dir 'build' --exclude-dir 'bin' --exclude-dir 'public' . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit your .zshrc/.bashrc/whatever and add this line to create an alias | |
alias multipull="find . -mindepth 1 -maxdepth 1 -type d -print -exec git -C {} pull \;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adaptado da página oficial do pgAdmin: https://www.pgadmin.org/download/pgadmin-4-apt/ | |
# Testado na versão 20.3 (una) | |
# | |
# Setup the repository | |
# | |
# Install the public key for the repository (if not done previously): | |
sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /etc/upstream-release/lsb-release | |
# Example output: | |
# DISTRIB_ID=Ubuntu | |
# DISTRIB_RELEASE=20.04 | |
# DISTRIB_CODENAME=focal | |
# DISTRIB_DESCRIPTION="Ubuntu Focal Fossa" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl top pods --all-namespaces --containers=true --sort-by=memory | |
kubectl top pods --all-namespaces --containers=true --sort-by=cpu |
NewerOlder