Skip to content

Instantly share code, notes, and snippets.

View AlexGalhardo's full-sized avatar
👨‍💻
Always Building, Always Learning

Alex Galhardo AlexGalhardo

👨‍💻
Always Building, Always Learning
View GitHub Profile
@AlexGalhardo
AlexGalhardo / Uninstall.md
Created March 7, 2020 19:48 — forked from pokisin/Uninstall.md
Uninstall git, ubuntu

Uninstall git

To remove just git package itself from Ubuntu 14.04 execute on terminal:

$ sudo apt-get remove git

Uninstall git and it's dependent packages

To remove the git package and any other dependant package which are no longer needed from Ubuntu Trusty.

$ sudo apt-get remove --auto-remove git
@AlexGalhardo
AlexGalhardo / lamp.sh
Created March 10, 2020 21:54 — forked from AnythingLinux/Completely Uninstall LAMP Stack Ubuntu 24.04 LTS
Completely Uninstall LAMP Ubuntu 18.04 LTS
#!/bin/bash
# This will remove Apache
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt remove apache2.*
sudo apt-get autoremove
whereis apache2
sudo rm -rf /etc/apache2

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@AlexGalhardo
AlexGalhardo / galhardo-aprendendo-redis.bash
Last active April 26, 2020 20:49 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# https://redis.io/commands
# http://try.redis.io/
# https://aws.amazon.com/pt/elasticache/what-is-redis/
# https://movile.blog/comecando-a-usar-redis-nas-suas-solucoes/
# https://redis.io/topics/data-types-intro
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
@AlexGalhardo
AlexGalhardo / API.md
Created April 30, 2020 05:49 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@AlexGalhardo
AlexGalhardo / git-clearHistory
Created May 7, 2020 16:12 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@AlexGalhardo
AlexGalhardo / jwt_decode.php
Created May 18, 2020 13:06 — forked from ahgood/jwt_decode.php
Get payload data from JWT token.
<?php
/**
* JSON Web Token implementation
*
* Minimum implementation used by Realtime auth, based on this spec:
* http://self-issued.info/docs/draft-jones-json-web-token-01.html.
*
* @author Neuman Vong <neuman@twilio.com>
*/
class JWT
/**
* Script simples para importação de dados de cotação da Bovespa
*
* Requisitos:
* - Node.js instalado
* - instalar as dependencias: npm install extract-zip moment request
*
* Exemplo de uso: node script_simples_importaca_cota_hist_bovespa.js 05022019
*
* Post relacionado: https://albertosouza.net/artigos/22-importando-dados-bovespa
@AlexGalhardo
AlexGalhardo / ler-emails.php
Created March 11, 2021 14:58 — forked from CViniciusSDias/ler-emails.php
Script para ler e-mails em voz alta usando PHP
<?php
use PhpImap\Mailbox;
require_once 'vendor/autoload.php';
$mailbox = new Mailbox(
'{imap.gmail.com:993/imap/ssl}INBOX',
'seu-email@gmail.com',
'sua senha aqui',