Skip to content

Instantly share code, notes, and snippets.

View felipepodesta's full-sized avatar
👨‍💻
Stairway To Heaven

Felipe Podestá felipepodesta

👨‍💻
Stairway To Heaven
View GitHub Profile
@felipepodesta
felipepodesta / bash-keys-help.sh
Created February 9, 2021 16:06 — forked from manno/bash-keys-help.sh
bash/zsh help functions
help-history() {
echo -e "
List of Event Designators (zshexpn)
===================================
!$ last word
!! last line
!:0 first word from previous command
!:0-2 first three words
!!:s^foo^bar^
^foo^bar replace on previous command
@felipepodesta
felipepodesta / functions.sh
Created February 9, 2021 16:06 — forked from jabes/functions.sh
Some Bash Functions
#!/bin/bash
function get_rand {
echo "$(date +%s)"
}
function is_empty {
if [[ -z "$1" ]]; then echo 1; else echo 0; fi
}
@felipepodesta
felipepodesta / programs.sh
Created February 9, 2021 16:06 — forked from malcolmgreaves/programs.sh
General bash functions
# Exectuable scripts
PROGRAMS="$HOME/programs/py:$HOME/programs/sh"
export PATH="${PATH}:${PROGRAMS}"
# Programs
port-pid() {
PORT="$1"
@felipepodesta
felipepodesta / functions.sh
Created February 9, 2021 16:04 — forked from rkennesson/functions.sh
bash functions
# __ _ _
# / _|_ _ _ __ ___| |_(_) ___ _ __ ___
# | |_| | | | '_ \ / __| __| |/ _ \| '_ \/ __|
# | _| |_| | | | | (__| |_| | (_) | | | \__ \
# |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/
#
# ▓▓▓▓▓▓▓▓▓▓
# ░▓ author ▓ cirrus <[email protected]>
# ░▓ code ▓ https://gist.github.com/cirrusUK
# ░▓ mirror ▓ http://cirrus.turtil.net
@felipepodesta
felipepodesta / ubuntu-setup.sh
Created February 9, 2021 13:23 — forked from kevcenteno/ubuntu-setup.sh
ubuntu-setup
#!/bin/bash
############################################################
# core functions
############################################################
function check_install {
if [ -z "`which "$1" 2>/dev/null`" ]
then
executable=$1
@felipepodesta
felipepodesta / postgres-cheatsheet.md
Created December 1, 2020 18:12 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@felipepodesta
felipepodesta / .bash_aliases
Created December 1, 2020 14:51 — forked from jose-a-sa/.bash_aliases
WSL Config
## Colorize the ls output ##
alias ls='ls -h --color=auto'
## Use a long listing format ##
alias ll='ls -lhaG'
## Show hidden files ##
alias l.='ls -d .* --color=auto'
## get rid of command not found ##
@felipepodesta
felipepodesta / .bashrc
Created December 1, 2020 14:51 — forked from jeremytwfortune/.bashrc
WSL Configuration
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@felipepodesta
felipepodesta / .zshrc
Created December 1, 2020 13:13
Config WSL
export ZSH="/home/dinh/.oh-my-zsh"
ZSH_THEME="agnoster"
plugins=(git)
source $ZSH/oh-my-zsh.sh
export PATH="$PATH:$HOME/.rvm/bin"
prompt_context() {}
export EDITOR='/usr/bin/vim'
@felipepodesta
felipepodesta / ubuntu.sh
Created September 8, 2020 16:52
Ubuntu 20.04 Stuff
cd ~/Downloads
# Install curl to get GPG keys
sudo apt install -y curl
# Install deb apps
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
wget https://zoom.us/client/latest/zoom_amd64.deb
sudo apt install -y ./*.deb
# Install snap apps