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 / watch.sh
Created November 19, 2013 16:02
Repeat command automaticaly
# Usage: watch [-dhntv] [--differences[=cumulative]] [--help] [--interval=<n>] [--no-title] [--version] <command>
# -d, --differences[=cumulative] highlight changes between updates
# (cumulative means highlighting is cumulative)
# -h, --help print a summary of the options
# -n, --interval=<seconds> seconds to wait between updates
# -v, --version print the version number
# -t, --no-title turns off showing the header
#
#
# example:
@marcosvidolin
marcosvidolin / kill_port_process.sh
Last active June 8, 2021 10:34
Linux: How to list and kill a process using a port
# to list all ports that are used
sudo netstat -ntlp | grep LISTEN
# you can obtain a specific port using the following command
sudo netstat -ntlp | grep :8080
# when you execute the command above you will see something like that
tcp 0 0 0.0.0.0:27370 0.0.0.0:* LISTEN 4394/skype
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 2216/dnsmasq
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 4912/cupsd
@marcosvidolin
marcosvidolin / docker-route.sh
Last active August 3, 2019 15:32
Remove Docker router (gateway)
# 1- ver qual a rota do docker com o comando
route
# 2- remover a rota
sudo route del -net 172.17.0.0 netmask 255.255.0.0
@marcosvidolin
marcosvidolin / table_bkp.sql
Last active August 3, 2019 15:41
How to Backup a table on Oracle
create table my_backup_table as (select * from my_table);
@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>
@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 / 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
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 / 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>'
;
@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