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
//--------- | |
run tests whitout go to activator console with additional config parameter: | |
$ activator clean -Dhibernate.hbm2ddl.auto=create "test-only UserControllerTest" | |
//--------- deploy with publish | |
& activator publish; | |
//--------- deploy with jar file(first create zip file and should be extract and run) | |
$ activator clean dist; |
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
git config --global core.editor "vim" |
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
Execute Immediate Statement | |
Secure Usage | |
//--------------------------------------------------- | |
--Execute Immediate - named parameter | |
sqlStmt := 'SELECT emp_id FROM employees WHERE emp_email = :email'; | |
EXECUTE IMMEDIATE sqlStmt USING email; | |
--Execute Immediate - positional parameter | |
sqlStmt := 'SELECT emp_id FROM employees WHERE emp_email = :1 and emp_name = :2'; |
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
0. SSH to server | |
1. Edit /opt/bitnami/apps/jenkins/jenkins_home/config.xml | |
2. set userSecurity to false: <userSecurity>false</userSecurity> | |
3. delete | |
<authorizationStrategy> and <securityRealm> | |
4. /etc/init.d/bitnami restart |
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 -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE" -Dtest=BankAccountTest test |
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
# View git log | |
* git log --pretty=oneline // show log in one line | |
* git log --pretty=format:"%h : %an : %ar : %s" // version : user : date : commit message |
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
curl -X POST http://localhost:8081/api/v1/users?[0-100] -H 'Content-Type: application/json' -H 'cache-control: no-cache' -d '{ "name": "2Mohammad", "email": "Asghar2" }' |
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
grep ^[^#] /etc/apt/sources.list /etc/apt/sources.list.d/* |
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
WITH cte AS ( | |
SELECT current_date - (n || ' day')::INTERVAL AS date | |
FROM generate_series(0, 29) n | |
) | |
SELECT date | |
FROM cte |
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
SELECT s.schemaname, | |
s.relname AS tablename, | |
s.indexrelname AS indexname, | |
pg_relation_size(s.indexrelid) AS index_size, | |
s.idx_scan | |
FROM pg_catalog.pg_stat_user_indexes s | |
JOIN pg_catalog.pg_index i ON s.indexrelid = i.indexrelid | |
WHERE s.idx_scan > 0 -- has never been scanned | |
AND 0 <>ALL (i.indkey) -- no index column is an expression | |
AND NOT i.indisunique -- is not a UNIQUE index |
OlderNewer