Skip to content

Instantly share code, notes, and snippets.

View marcosvidolin's full-sized avatar
🎯
Always learning

Marcos Vidolin⚡ marcosvidolin

🎯
Always learning
View GitHub Profile
@marcosvidolin
marcosvidolin / list_views.sql
Last active August 9, 2019 01:40
Oracle - Get views DDL
SELECT dbms_metadata.get_ddl('VIEW', view_name) FROM user_views;
kubectl get po --all-namespaces -o json | jq '.items[] | select(.status.reason!=null) | select(.status.reason | contains("Evicted")) | "kubectl delete po \(.metadata.name) -n \(.metadata.namespace)"' | xargs -n 1 bash -c
@marcosvidolin
marcosvidolin / create_user.sql
Created August 3, 2018 16:31
Create a Oracle User & Grants
create user <USER> identified by <PASSWorD>;
grant connect to <USER>;
grant create session, create table, resource, connect, create procedure, create sequence, create synonym, create trigger, create view, debug connect session, unlimited tablespace to <USER>;
@marcosvidolin
marcosvidolin / update-application.sh
Last active June 8, 2018 13:00
How to update a especific application? Firefox example
sudo apt-get dist-upgrade firefox
@marcosvidolin
marcosvidolin / redis-del.sh
Last active August 3, 2019 15:38
Redis: How to remove multiples keys from
redis-cli -h <HOSTNAME> KEYS *mvidolin* | xargs redis-cli -h <HOSTNAME> DEL
@marcosvidolin
marcosvidolin / reference.sql
Created January 5, 2018 17:33
How to see all references for a FK
SELECT a.table_name, a.column_name, a.constraint_name, c.owner,
c.r_owner, c_pk.table_name r_table_name, c_pk.constraint_name r_pk
FROM all_cons_columns a
JOIN all_constraints c ON a.owner = c.owner AND a.constraint_name = c.constraint_name
JOIN all_constraints c_pk ON c.r_owner = c_pk.owner AND c.r_constraint_name = c_pk.constraint_name
WHERE c.constraint_type = 'R' AND A.COLUMN_NAME = '<COLUMN_NAME>' and c.owner = '<OWNER_NAME>'
;
Significado de cada campo do Cron
A princípio o Cron pode parecer algo muito bizarro, porém, cada campo possui um significado bem especificado. Abaixo é listado o que cada campo significa junto com seus valores esperados:
A B C D E F
A: Segundos (0 – 59).
B: Minutos (0 – 59).
C: Horas (0 – 23).
D: Dia (1 – 31).
E: Mês (1 – 12).
F: Dia da semana (0 – 6).
@marcosvidolin
marcosvidolin / clearCheckSums.sh
Last active August 3, 2019 15:39
How to clear Liquibase checksums
java -jar /opt/ci/liquibase.jar --driver=oracle.jdbc.OracleDriver --classpath=/opt/ci/ojdbc14-10.2.0.1.0.jar --changeLogFile="db.changelog.xml" --url=<url>:<port>:<sid> --username=<user> --password=<pass> --logLevel=debug clearCheckSums
@marcosvidolin
marcosvidolin / ibus.sh
Last active September 20, 2017 14:44
Keyboard input may be unlocked by restarting IBus daemon from a console
ibus-daemon -rd
@marcosvidolin
marcosvidolin / docker-push.
Created September 15, 2017 12:34
How to push with login
# Login
docker login <server url> -u <user> -p <pass>
# Push (example Harbor)
docker push <server>/<project in harbor>/<image name>>:<tag>