Skip to content

Instantly share code, notes, and snippets.

View VictorHugoBatista's full-sized avatar
🛰️
Floating in the cyberspace

Victor Hugo Batista VictorHugoBatista

🛰️
Floating in the cyberspace
  • banQi
  • Internet
View GitHub Profile

Pegar as credenciais na tela inicial da AWS, Command line or programmatic access

export AWS_ACCESS_KEY_ID=""\
export AWS_SECRET_ACCESS_KEY=""\
export AWS_SESSION_TOKEN=""
  • aws eks --region us-east-1 update-kubeconfig --name eks-sandbox
  • kubectl get svc
  • Lista todos os pods: kubectl get pods
  • Descreve configurações de um pod: kubectl describe pod [POD-NAME-WITH-CODE]
#Criar Stream
CREATE STREAM f_test_stream (message VARCHAR) WITH (kafka_topic='test', value_format='json');
#Criar o Stream que consome de outro Stream
CREATE STREAM test_consumer_all_stream WITH (KAFKA_TOPIC='test1', value_format='json') AS SELECT * FROM f_test_stream;
@VictorHugoBatista
VictorHugoBatista / drop-all-tables-postgres.sql
Last active October 14, 2021 17:44
Drop all tables from a postgres database
# /!\ Double check before press enter on this command /!\
DO $$ DECLARE
r RECORD;
BEGIN
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = current_schema()) LOOP
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE';
END LOOP;
END $$;
git filter-branch -f --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "<old-email>" ];
then
GIT_COMMITTER_EMAIL="<new-email>";
GIT_AUTHOR_EMAIL="<new-email>";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD
1.
select * from city order by population desc limit 5;
+------+-----------------+-------------+-------------+------------+
| ID | Name | CountryCode | District | Population |
+------+-----------------+-------------+-------------+------------+
| 1024 | Mumbai (Bombay) | IND | Maharashtra | 10500000 |
| 2331 | Seoul | KOR | Seoul | 9981619 |
| 206 | S Paulo | BRA | S Paulo | 9968485 |
+------+-----------------+-------------+-------------+------------+
{
"articles": [
{
"id": 1,
"title": "Quando não usar isset e empty na mesma condição"
},
{
"id": 2,
"title": "Implementando jQuery de maneira organizada"
},
{
"articles": [
{
"id": 1,
"title": "Quando não usar isset e empty na mesma condição"
},
{
"id": 2,
"title": "Implementando jQuery de maneira organizada"
},
select * from customers;
-- O valor dado no registro é aplicado aos registros já existentes ao adicionar uma nova coluna à tabela
alter table customers
add level int default 1;
insert into customers (first_name, last_name, gender)
values ('Primeire', 'Teste', 'O');
{
"php.suggest.basic": false,
"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false,
"editor.fontSize": 19,
"markdown.preview.lineHeight": 1.61,
"editor.lineHeight": 38,
"workbench.iconTheme": "material-icon-theme",
"editor.fontFamily": "Iosevka SS06 Semibold",
"editor.letterSpacing": 0.5,