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 / jetty-goals.txt
Last active December 23, 2015 08:29
Jetty - specifying a port
// para subir o jetty numa determinada porta via linha de comando
mvn -Djetty.port=9999 jetty:run
// para subir o jetty numa determinada porta via Goals (Eclipse)
jetty:stop -Djetty.port=8080 jetty:run
@marcosvidolin
marcosvidolin / locked_object.sql
Created September 18, 2013 14:03
Oracle - Check leased objects in Oracle
select * from v$locked_object;
@marcosvidolin
marcosvidolin / catalina.sh
Created September 18, 2013 18:41
Tomcat - Debug remoto no Tomcat. Inclua o código a baixo no arquivo %CATALINA_HOME%/bin/catalina.sh e inicie normalmente o tomcat (startup.sh) No eclipse em "Debug Configurations", informe o nome da conexão remota, o projeto, host e porta do servidor remoto.
CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
@marcosvidolin
marcosvidolin / table_relationships.sql
Created September 18, 2013 19:28
Oracle - See all table relationships
select table_name from user_constraints
where r_constraint_name in
(select constraint_name
from user_constraints
where constraint_type in ('P','U')
and table_name = upper('&tableOfInterest')
)
@marcosvidolin
marcosvidolin / glassfish-embedded.txt
Created September 24, 2013 18:58
Maven- To run glassfish embedded
mvn org.glassfish:maven-glassfish-plugin:run
@marcosvidolin
marcosvidolin / iterating.a.map.java
Created October 30, 2013 02:23
Iterating a map
Map modelMap = model.asMap();
for (Object modelKey : modelMap.keySet()) {
Object modelValue = modelMap.get(modelKey);
System.out.println(modelKey + " -- " + modelValue);
}
@marcosvidolin
marcosvidolin / sdcard.image.sh
Created October 30, 2013 20:32
How to make a SD card image using command line
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
@marcosvidolin
marcosvidolin / crontab.sh
Created November 1, 2013 00:18
Crontab edition
# 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
@marcosvidolin
marcosvidolin / copy.data.sql
Created November 11, 2013 12:31
Cópia de dados entre duas tabelas
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
@marcosvidolin
marcosvidolin / appcfg.update.sh
Created November 13, 2013 23:01
How to deploy a Google AppEngine application?
# %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