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
#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 & |
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
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); | |
} | |
} |