Skip to content

Instantly share code, notes, and snippets.

View pedromamede's full-sized avatar

Pedro Mamede pedromamede

  • AdReform
  • Fortaleza - CE
View GitHub Profile
#top (inteiro)
top -b > /home/ubuntu/script_top/log_top.txt &
#top (so os processos que estiverem usando mais que 25% da CPU)
watch -n 1 -p "top -bn1 | awk '{if(/^[^0-9 ]/){print}else if(\$9 >= 25.0){print}}' | tail -n +6| tee -a /home/ubuntu/script_top/log_top.txt" &>/dev/null &
public static Connection getConnection(){
try {
Class.forName("com.mysql.jdbc.Driver");
return DriverManager.getConnection(DATABSE_URL, USERNAME, PASSWORD);
} catch (Exception e) {
throw new RuntimeException(e);
}
}