This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table my_backup_table as (select * from my_table); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %APPENGINE_HOME%/appcfg.sh update "WAR_PATH" | |
# Enter your Google username and password at the prompts. | |
# see: https://developers.google.com/appengine/docs/java/gettingstarted/uploading | |
/opt/appengine-java-sdk-1.8.0/bin/appcfg.sh update target/gae-springmvc-template-0.0.1-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Este comando efetua a cópia de dados entre duas tabelas dentro de um mesmo banco, ou entre bancos diferentes. | |
Muito útil para equalizar dados para testes, simulações de erros, etc... | |
A sintaxe é: | |
COPY FROM <db> TO <db> <opt> <tbl> {<<cls>>} USING <sel> | |
Onde: | |
<db> : string de banco de dados, ex.: usuário/senha@banco1 | |
<opc>: Uma das palavras chaves: APPEND, CREATE, INSERT ou REPLACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To use cron for tasks meant to run only for your user profile, add entries to | |
# your own user's crontab file. Start the crontab editor from a terminal window: | |
$crontab -e | |
# Commands that normally run with administrative privileges (i.e. they are | |
# generally run using sudo) should be added to the root user's crontab (instead of the user's crontab): | |
$sudo crontab -e | |
# see: | |
# https://help.ubuntu.com/community/CronHowto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dd if=/dev/sdb of=imagem.img bs=1MB | |
of = output | |
if = input | |
bs = Block Size | |
example (tested): | |
# to make an image | |
sudo dd if=/dev/mmcblk0 of=~/Desktop/image.iso bs=1MB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map modelMap = model.asMap(); | |
for (Object modelKey : modelMap.keySet()) { | |
Object modelValue = modelMap.get(modelKey); | |
System.out.println(modelKey + " -- " + modelValue); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvn org.glassfish:maven-glassfish-plugin:run |