IntelliJ IDEA: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Shortcuts==
==Shortcuts==
{|
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
| valign="top" |
!scope='col' style='text-align:left' colspan='2'|
───────────────────────────────────────────────
Shortcuts
⌘ + 1           » Project
|-
⌘ + 2           » Favorites
|valign='top' style='width:50%'|
⌘ + 3           » Find
<syntaxhighlight style='margin:3px 0' lang='text'>
⌘ + 4           » Run
⌘ + 1                     » Project
⌘ + 5           » Debug
⌘ + 2                     » Favorites
⌘ + 6           » Problems
⌘ + 3                     » Find
⌘ + 7           » Structure
⌘ + 4                     » Run
⌘ + 8           » Services
⌘ + 5                     » Debug
⌘ + 9           » Git
⌘ + 6                     » Problems
⌘ + 7                     » Structure
⌘ + 8                     » Services
⌘ + 9                     » Git
</syntaxhighlight>


| valign="top" |
|valign='top' style='width:50%'|
───────────────────────────────────────────────
<syntaxhighlight style='margin:3px 0' lang='text'>
Shift + Shift   » Navigate
Shift + Shift             » Navigate
⌘ + B           » Navigate Usages
⌘ + B                     » Navigate Usages
⌘ + E           » Recent Files
⌘ + E                     » Recent Files
⌘ + E           » Toggle Changes Only Files
⌘ + E                     » Toggle Changes Only Files
⌘ + Shift + F12 » Hide All Windows
⌘ + Shift + F12           » Hide All Windows
⌘ + ,           » Preferences
⌘ + ,                     » Preferences
⌘ + ;           » Project Structures
⌘ + ;                     » Project Structures
⌘ + -           » Folding Collapse
⌘ + -                     » Folding Collapse
⌘ + +           » Folding Expand
⌘ + +                     » Folding Expand
|}
</syntaxhighlight>
----
|-
{|
|valign='top'|
| valign="top" |
<syntaxhighlight style='margin:3px 0' lang='text'>
───────────────────────────────────────────────
Control + N               » New Class, Interface, Enum
Control + N     » New Class, Interface, Enum
⌘ + W                     » Extend Selection
⌘ + W           » Extend Selection
⌘ + Option + V             » Extract Variable
⌘ + Option + V » Extract Variable
⌘ + Option + M             » Extract Method
⌘ + Option + M » Extract Method
⌘ + Option + P             » Extract Parameter
⌘ + Option + P » Extract Parameter
⌘ + Option + N             » Inline  Variable
⌘ + Option + N » Inline  Variable
⌘ + Shift + T             » Navigate Go to Test
⌘ + Shift + T   » Navigate Go to Test
⌘ + F12                   » Navigate File Structure
⌘ + F12         » Navigate File Structure
⌘ + D                     » Duplicate Line
⌘ + D           » Duplicate Line
⌘ + D                     » Git Difference
⌘ + D           » Git Difference
⌘ + Option + Z             » Git Undo the Change
⌘ + Option + Z » Git Undo the Change
</syntaxhighlight>


| valign="top" |
|valign='top'|
───────────────────────────────────────────────
<syntaxhighlight style='margin:3px 0' lang='text'>
Control + Shift + Down» Line Move Down
Control + Shift + Down    » Line Move Down
Control + Shift + Up » Line Move Up
Control + Shift + Up       » Line Move Up
Control + Shift + F10 » Run Unit Test
Control + Shift + F10     » Run Unit Test
Control + Shift + F   » Find or Search
Control + Shift + F       » Find or Search
Control + V           » VCS Operation
Control + V               » VCS Operation
⌘ + Shift + G         » Go to Folder
⌘ + Shift + G             » Go to Folder
⌘ + X                 » Cut Line
⌘ + X                     » Cut Line
Control + F11         » Toggle Bookmark
Control + F11             » Toggle Bookmark
F11                   » Toggle Bookmark
F11                       » Toggle Bookmark
Shift + F9           » Debug Application
Shift + F9                 » Debug Application
Shift + F10           » Run Application
Shift + F10               » Run Application
|}
</syntaxhighlight>
----
|-
{|
|valign='top'|
| valign="top" |
<syntaxhighlight style='margin:3px 0' lang='text'>
───────────────────────────────────────────────
Control + Option + [       » Previous Project Window
Control + Option + [ » Previous Project Window
Control + Option + ]       » Next Project Window
Control + Option + ] » Next Project Window
Control + Option + F12    » Terminal
Control + Option + F12» Terminal
Option  + F4               » Close Idea Window
Option  + F4         » Close Idea Window
Control + F4               » Close Tab Window
Control + F4         » Close Tab Window
Control + F2               » Stop
Control + F2         » Stop
Control + Shift + U       » Toggle Upper Case
Control + Shift + U   » Toggle Upper Case
Control + Shift + R       » Find Replace in Folder
Control + Shift + R   » Find Replace in Folder
Control + R               » Find and Replace
Control + R           » Find and Replace
Control + F               » Find
Control + F           » Find
</syntaxhighlight>


|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='text'>
⌘ + Option + L            » Reformat Code
⌘ + Option + O            » Optimize Import
⌘ + R                      » Find and Replace
⌘ + F                      » Find


| valign="top" |
Option + Shift + M         » Toggle Maven Window
───────────────────────────────────────────────
Alt + Insert               » Generate
⌘ + Option + L        » Reformat Code
⌘ + N                     » Generate
⌘ + Option + O        » Optimize Import
⌘ + L                     » Find Line Number
⌘ + R                » Find and Replace
Control + G               » Find Line Number
⌘ + F                » Find
</syntaxhighlight>
Option + Shift + M   » Toggle Maven Window
Alt + Insert         » Generate
⌘ + N                 » Generate
⌘ + L                 » Find Line Number
Control + G           » Find Line Number
 
|}
|}


==Terminal==
==Terminal==
{|
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
| valign="top" |
!scope='col' style='text-align:left' colspan='2'|
───────────────────────────────────────────────
Terminal
⌘ + W                 » Close a Tab
|-
⌘ + T                 » Open New Tab
|valign='top' style='width:50%'|
⌘ + Shift + [ | Left » Move to Left
<syntaxhighlight style='margin:3px 0' lang='text'>
⌘ + Shift + ] | Right » Move to Right
⌘ + W                     » Close a Tab
⌘ + T                     » Open New Tab
⌘ + Shift + [ | Left       » Move to Left
⌘ + 1..9              » Switch Between
⌘ + Shift + ] | Right     » Move to Right
⌘ + N                » Open New Window


| valign="top" |
───────────────────────────────────────────────
Control + Shift + W  » Close a Tab
Control + Shift + T  » Open New Tab
Control + Shift + P.Up» Move to Left
Control + Shift + P.Dn» Move to Right
Control + P.Up        » Move to Previous
Control + P.Dn        » Move to Next
Alter  + 1..9        » Switch Between
Control + Alter + T  » Open New Window
Enter  +  ~  + .  » Exit an SSH Session


⌘ + 1..9                  » Switch Between
⌘ + N                      » Open New Window
</syntaxhighlight>
|valign='top' style='width:50%'|
<syntaxhighlight style='margin:3px 0' lang='text'>
Control + Shift + W        » Close a Tab
Control + Shift + T        » Open New Tab
Control + Shift + P.Up    » Move to Left
Control + Shift + P.Dn    » Move to Right
Control + P.Up            » Move to Previous
Control + P.Dn            » Move to Next
Alter  + 1..9            » Switch Between
Control + Alter + T        » Open New Window
Enter  +  ~  + .        » Exit an SSH Session
</syntaxhighlight>
|}
|}


==Redis Cli==
==Redis Cli==
redis-cli flushall async
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
redis-cli flushall
!scope='col' style='text-align:left' colspan='2'|
redis-cli flushdb
Redis Cli
|-
|valign='top' style='width:50%'|
<syntaxhighlight style='margin:3px 0' lang='bash'>
redis-cli flushall async
redis-cli flushall
redis-cli flushdb
</syntaxhighlight>
 
|valign='top' style='width:50%'|
|}


==Evaluation==
==Evaluation==
'''Ubuntu'''
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
<syntaxhighlight lang="bash">
!scope='col' style='text-align:left' colspan='2'|
Evaluation
|-
!scope='col' style='width:50%'| Ubuntu
!scope='col' style='width:50%'|
|-
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='bash'>
rm -rf ~/.config/JetBrains/*/eval
rm -rf ~/.config/JetBrains/*/eval
rm ~/.config/JetBrains/*/options/other.xml
rm ~/.config/JetBrains/*/options/other.xml
Line 125: Line 151:
rm -rf ~/.java/..userPrefs
rm -rf ~/.java/..userPrefs
</syntaxhighlight>
</syntaxhighlight>
|valign='top'|
|}


==File Types==
==File Types==
'''Control + Alter + S''' » Editor » File Types » Recognized File Types » JSON » File Name Patterns » '''{Add Your Pattern}'''
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
!scope='col' style='text-align:left'|
File Types
|-
|valign='top'|
'''Control + Alter + S''' » Editor » File Types » Recognized File Types » JSON » File Name Patterns » '''{Add Your Pattern}'''
|}


==Knowledge==
==Knowledge==
'''disk usage'''
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
du -h /var
!scope='col' style='text-align:left' colspan='2'|
du -sh /var
Knowledge
du -csh ~/Do*
|-
du -csh /var/log /var/lib
|valign='top' style='width:50%'|
du -sh --apparent-size /var/lib
<syntaxhighlight style='margin:3px 0' lang='bash'>
du -h /var/ | sort -rh | head -5
# disk usage
du -h /var
du -sh /var
du -csh ~/Do*
du -csh /var/log /var/lib
du -sh --apparent-size /var/lib
du -h /var/ | sort -rh | head -5
 
 
# comment and uncomment sql
sed -i -e 's|postgres|chorke|g' *.sql
sed -i -e 's|^|-- |g' src/main/resources/db/migration/*.sql
sed -i -e 's|^-- ||g' src/main/resources/db/migration/*.sql


'''comment and uncomment sql'''
sed -i -e 's|postgres|chorke|g' *.sql
sed -i -e 's|^|-- |g' src/main/resources/db/migration/*.sql
sed -i -e 's|^-- ||g' src/main/resources/db/migration/*.sql


'''ubuntu'''
# ubuntu
Ctrl + Alt + F5 » Switch Desktop  to Terminal
Ctrl + Alt + F5 » Switch Desktop  to Terminal
Crtl + Alt + F1 » Switch Terminal to Desktop
Crtl + Alt + F1 » Switch Terminal to Desktop
Crtl + Alt + ↑  » Switch Desktop
Crtl + Alt + ↑  » Switch Desktop
Crtl + Alt + ↓  » Switch Desktop
Crtl + Alt + ↓  » Switch Desktop
sudo update-alternatives --config javac
sudo update-alternatives --config java
ls -lah /usr/share/maven/
udo dpkg -l | grep openjdk
git config --global user.name "Full Name"
git config --global user.email "email.id@academia.chorke.org"
'''undo assume unchanged or assume unchanged'''
git update-index --no-assume-unchanged src/main/resources/application.properties
git update-index --assume-unchanged src/main/resources/application.properties
'''list of files assume unchanged'''
git ls-files -v|grep '^h'
'''create and checkout a new branch'''
git checkout -b new_branch_name base_branch_name
git checkout -b new_branch_name


'''renaming and delete branch'''
sudo update-alternatives --config javac
git branch -m old_branch_name new_branch_name
sudo update-alternatives --config java
git branch -D branch_to_delete_without_merge_status
ls -lah /usr/share/maven/
sudo dpkg -l | grep openjdk
git branch -d branch_to_delete
git push origin --delete branch_to_delete


'''discard changes'''
git config --global user.name "Full Name"
git checkout master -f
git config --global user.email "email.id@academia.chorke.org"
'''git stashing'''
git stash; git checkout -b new_branch; git stash pop
git add .; git commit -m "new feature added"; git push
'''rebase vs merge'''
git rebase master #all the updated commits of master will be available in the feature branch
git merge --squash feature #all the feature commits replaced by a new commit in the master
git commit -m 'feature merged with master branch'


'''nodejs'''
sudo npm install -g npm


'''vs code'''
# undo assume unchanged or assume unchanged'
sudo snap install code --classic
git update-index --no-assume-unchanged src/main/resources/application.properties
sudo snap refresh code --classic
git update-index --assume-unchanged src/main/resources/application.properties
code ./my_project
</syntaxhighlight>


<syntaxhighlight lang="sql">
|valign='top' style='width:50%'|
<syntaxhighlight style='margin:3px 0' lang='bash'>
# list of files assume unchanged
git ls-files -v|grep '^h'
 
# create and checkout a new branch
git checkout -b new_branch_name base_branch_name
git checkout -b new_branch_name
 
# renaming and delete branch
git branch -m old_branch_name new_branch_name
git branch -D branch_to_delete_without_merge_status
 
git branch -d branch_to_delete
git push origin --delete branch_to_delete
 
# discard changes
git checkout master -f
 
# git stashing
git stash; git checkout -b new_branch; git stash pop
git add .; git commit -m "new feature added"; git push
 
# rebase vs merge
git rebase master #all the updated commits of master will be available in the feature branch
git merge --squash feature #all the feature commits replaced by a new commit in the master
git commit -m 'feature merged with master branch'
 
# nodejs
sudo npm install -g npm
 
# vs code
sudo snap install code --classic
sudo snap refresh code --classic
code ./my_project
</syntaxhighlight>
|-
|valign='top' colspan='2'|
<syntaxhighlight style='margin:3px 0' lang='sql'>
-- mysql root@localhost user
-- mysql root@localhost user
SELECT user, plugin, host FROM mysql.user WHERE user = 'root';
SELECT user, plugin, host FROM mysql.user WHERE user = 'root';
Line 201: Line 249:
UPDATE mysql.user SET plugin = 'mysql_native_password', authentication_string = PASSWORD('p@$$w0rd') WHERE User = 'root';
UPDATE mysql.user SET plugin = 'mysql_native_password', authentication_string = PASSWORD('p@$$w0rd') WHERE User = 'root';
</syntaxhighlight>
</syntaxhighlight>
 
|-
<syntaxhighlight lang="sql">
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='sql'>
-- postgresql public role
-- postgresql public role
-- revoke public connect from specific database after creation
-- revoke public connect from specific database after creation
Line 213: Line 262:
COMMIT;
COMMIT;
</syntaxhighlight>
</syntaxhighlight>
 
|valign='top'|
du -h /usr/local/var/postgres/{base,pg_wal}
|-
sudo du -h /var/lib/postgresql/11/main/{base,pg_wal}
|valign='top'|
sudo du -h /var/lib/postgresql/12/main/{base,pg_wal}
<syntaxhighlight style='margin:3px 0' lang='bash'>
 
du -h /usr/local/var/postgres/{base,pg_wal}
<syntaxhighlight lang="bash">
sudo du -h /var/lib/postgresql/11/main/{base,pg_wal}
sudo du -h /var/lib/postgresql/12/main/{base,pg_wal}
</syntaxhighlight>
|valign='top'|
|-
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='bash'>
#nano ~/.bashrc
#nano ~/.bashrc
#nano ~/.zshenv
#nano ~/.zshenv
Line 226: Line 281:
export ACADEMIA_LOG_PATH="$HOME/.chorke/academia/var/http/logs"
export ACADEMIA_LOG_PATH="$HOME/.chorke/academia/var/http/logs"
</syntaxhighlight>
</syntaxhighlight>
 
|valign='top'|
<syntaxhighlight lang="bash">
|-
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='bash'>
source ~/.bashrc
source ~/.bashrc
source ~/.profile
source ~/.profile
Line 238: Line 295:
[[ -s "$HOME/.chorke/academia/etc/staging.sh" ]] && source "$HOME/.chorke/academia/etc/staging.sh"
[[ -s "$HOME/.chorke/academia/etc/staging.sh" ]] && source "$HOME/.chorke/academia/etc/staging.sh"
</syntaxhighlight>
</syntaxhighlight>
|valign='top'|
|}


==Git Ignore==
==Git Ignore==
out/
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
*.iml
!scope='col' style='text-align:left' colspan='2'|
*.ipr
Git Ignore
*.iws
|-
.idea/*
|valign='top' style='width:50%'|
cmake-build-*/
<syntaxhighlight style='margin:3px 0' lang='text'>
.idea_modules/
out/
fabric.properties
*.iml
crashlytics.properties
*.ipr
atlassian-ide-plugin.xml
*.iws
crashlytics-build.properties
.idea/*
com_crashlytics_export_strings.xml
cmake-build-*/
.idea_modules/
fabric.properties
crashlytics.properties
atlassian-ide-plugin.xml
crashlytics-build.properties
com_crashlytics_export_strings.xml
</syntaxhighlight>
|valign='top' style='width:50%'|
|-
|valign='top'|
<syntaxhighlight style='margin:3px 0' lang='bash'>
# clear metadata
rm -rf */out */*.iml */*.ipr */*.iws */.idea */cmake-build-* */.idea_modules


'''clear metadata'''
git remote -v;mv src/main/resources/application.properties ..;cd ..
rm -rf */out */*.iml */*.ipr */*.iws */.idea */cmake-build-* */.idea_modules
mv ../application.properties src/main/resources/
 
</syntaxhighlight>
git remote -v;mv src/main/resources/application.properties ..;cd ..
|valign='top'|
mv ../application.properties src/main/resources/
|-
 
|valign='top'|
'''delete and recreate'''
<syntaxhighlight style='margin:3px 0' lang='bash'>
git branch -d staging
# delete and recreate
git branch -D staging
git branch -d staging
git fetch origin staging
git branch -D staging
git checkout -b staging origin/staging
git fetch origin staging
git merge develop
git checkout -b staging origin/staging
git merge develop
</syntaxhighlight>
|valign='top'|
|}


==Serial UID==
==Serial UID==
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
!scope='col' style='text-align:left' colspan='2'|
Serial UID
|-
|valign='top' colspan='2'|
A faster way to find this setting - you might use hotkey <code>Ctrl+Shift+A</code> (find action), type <code>Serializable class without 'serialVersionUID'</code>
A faster way to find this setting - you might use hotkey <code>Ctrl+Shift+A</code> (find action), type <code>Serializable class without 'serialVersionUID'</code>
|-
|valign='top' style='width:50%'|
<syntaxhighlight style='margin:3px 0' lang='text'>
Alter  + Enter  » serialVersionUID =
</syntaxhighlight>


{|
|valign='top' style='width:50%'|
| valign="top" |
<syntaxhighlight style='margin:3px 0' lang='text'>
───────────────────────────────────────────────
Option + Enter  » serialVersionUID =
Alter  + Enter  » serialVersionUID =
</syntaxhighlight>
 
| valign="top" |
───────────────────────────────────────────────
Option + Enter  » serialVersionUID =
 
|}
|}


==References==
==References==
{|
{|class='wikitable mw-collapsible' style='width:100%;margin:3px 0'
| valign="top" |
!scope='col' style='text-align:left' colspan='3'|
References
|-
|valign='top' style='width:33%'|
* [https://stackoverflow.com/questions/2427238/ Difference between git merge --squash and rebase]
* [https://stackoverflow.com/questions/2427238/ Difference between git merge --squash and rebase]
* [https://www.jetbrains.com/help/rider/Adding_Deleting_and_Moving_Lines.html Add, Delete and Move Lines with IntelliJ IDEA]
* [https://www.jetbrains.com/help/rider/Adding_Deleting_and_Moving_Lines.html Add, Delete and Move Lines with IntelliJ IDEA]
Line 294: Line 378:
* [[PostgreSQL]]
* [[PostgreSQL]]


| valign="top" |
|valign='top' style='width:34%'|
* [https://www.baeldung.com/spring-data-jpa-stored-procedures Calling Stored Procedures from Spring Data JPA]
* [https://www.baeldung.com/spring-data-jpa-stored-procedures Calling Stored Procedures from Spring Data JPA]
* [https://stackoverflow.com/questions/39738901/ IntelliJ IDEA activate a Spring Boot profile]
* [https://stackoverflow.com/questions/39738901/ IntelliJ IDEA activate a Spring Boot profile]
Line 306: Line 390:
* [[Sublime Text]]
* [[Sublime Text]]


| valign="top" |
|valign='top' style='width:33%'|
* [https://dba.stackexchange.com/questions/44956/ Explanation of cascade <code>ON DELETE/UPDATE</code>]
* [https://dba.stackexchange.com/questions/44956/ Explanation of cascade <code>ON DELETE/UPDATE</code>]
* [https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config-files Spring Boot External Application Properties]
* [https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config-files Spring Boot External Application Properties]
Line 317: Line 401:
* [https://stackoverflow.com/questions/28932515/how-to-unmerge-a-git-merge/43292158 Git Undo Merge]
* [https://stackoverflow.com/questions/28932515/how-to-unmerge-a-git-merge/43292158 Git Undo Merge]
* [https://editor.swagger.io/ Swagger Editor]
* [https://editor.swagger.io/ Swagger Editor]
|-
|-
| colspan="3" |
|valign='top' colspan='3'|
----
|-
| valign="top" colspan="3"|
* [https://www.dell.com/support/kbdoc/en-us/000131678/an-ubuntu-linux-keyboard-shortcut-reference-guide-for-your-dell-pc Keyboard Shortcuts » Ubuntu » Terminal]
* [https://www.dell.com/support/kbdoc/en-us/000131678/an-ubuntu-linux-keyboard-shortcut-reference-guide-for-your-dell-pc Keyboard Shortcuts » Ubuntu » Terminal]
* [https://support.microsoft.com/en-us/windows/windows-10-keyboard-shortcuts-3d444b08-3a00-abd6-67da-ecfc07e86b98 Keyboard Shortcuts » Windows 10]
* [https://support.microsoft.com/en-us/windows/windows-10-keyboard-shortcuts-3d444b08-3a00-abd6-67da-ecfc07e86b98 Keyboard Shortcuts » Windows 10]
Line 329: Line 409:
* [https://support.apple.com/en-us/HT201236 Keyboard Shortcuts » MacOS]
* [https://support.apple.com/en-us/HT201236 Keyboard Shortcuts » MacOS]
* [https://support.skype.com/en/faq/FA12025/what-are-keyboard-shortcuts-and-how-do-i-use-them-in-skype Keyboard Shortcuts » Skype]
* [https://support.skype.com/en/faq/FA12025/what-are-keyboard-shortcuts-and-how-do-i-use-them-in-skype Keyboard Shortcuts » Skype]
|-
|-
| colspan="3" |
|valign='top'|
----
|-
| valign="top" |
* [https://stackoverflow.com/questions/35531661/ Using env variable in Spring Boot's <code>application.properties</code>]
* [https://stackoverflow.com/questions/35531661/ Using env variable in Spring Boot's <code>application.properties</code>]
* [https://www.freecodecamp.org/news/how-to-delete-a-git-branch-both-locally-and-remotely/ Delete a Git Branch Both Locally & Remotely]
* [https://www.freecodecamp.org/news/how-to-delete-a-git-branch-both-locally-and-remotely/ Delete a Git Branch Both Locally & Remotely]
Line 346: Line 422:
* [https://crontab.guru/ Crontab Guru]
* [https://crontab.guru/ Crontab Guru]


| valign="top" |
|valign='top'|
* [https://stackoverflow.com/questions/27952472/ Jackson Serialize/Deserialize for Java 8 <code>java.time</code>]
* [https://stackoverflow.com/questions/27952472/ Jackson Serialize/Deserialize for Java 8 <code>java.time</code>]
* [https://cdn.chorke.org/exec/cli/psql/ PostgreSQL Export Import Script Online]
* [https://cdn.chorke.org/exec/cli/psql/ PostgreSQL Export Import Script Online]
Line 358: Line 434:
* [[Git]]
* [[Git]]


| valign="top" |
|valign='top'|
* [https://askubuntu.com/questions/1033069/ Ubuntu Move to Workspace Left/Right]
* [https://askubuntu.com/questions/1033069/ Ubuntu Move to Workspace Left/Right]
* [https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs JetBrains » Directories used by the IDE]
* [https://askubuntu.com/questions/1145050/ IntelliJ IDEA Receive System Env]
* [https://askubuntu.com/questions/1145050/ IntelliJ IDEA Receive System Env]
* [https://toolbox-support.jetbrains.com/hc/en-us/articles/115001313270-How-to-uninstall-Toolbox-App- Reinstall JetBrains Toolbox App]
* [https://toolbox-support.jetbrains.com/hc/en-us/articles/115001313270-How-to-uninstall-Toolbox-App- Reinstall JetBrains Toolbox App]
* [https://serverfault.com/questions/283129/ SSH Connection Hang Forever]
* [https://serverfault.com/questions/283129/ SSH Connection Hang Forever]
* [https://www.jdoodle.com/execute-rhino-online/ Online Rhino JS IDE]
* [https://www.jdoodle.com/execute-rhino-online/ Online Rhino JS IDE]
|-
| colspan="3" |
----
|-
|-
| valign="top" |
|valign='top'|
* [https://gist.github.com/VVATOR/c07eeb34e149feab122ca8bb71b3a17c Reset Evaluation Key in Windows: <code>InteIIiJ IDEA</code>]
* [https://gist.github.com/VVATOR/c07eeb34e149feab122ca8bb71b3a17c Reset Evaluation Key in Windows: <code>InteIIiJ IDEA</code>]
* [https://gist.github.com/shahadul878/5f33b90e55c1655aee05fa239ec1b978 Reset Evaluation Key in Windows: <code>PHPStrom</code>]
* [https://gist.github.com/shahadul878/5f33b90e55c1655aee05fa239ec1b978 Reset Evaluation Key in Windows: <code>PHPStrom</code>]
Line 381: Line 454:
* [[JConsole]]
* [[JConsole]]


| valign="top" |
|valign='top'|
* [https://stackoverflow.com/questions/24573643/ Generate <code>serialVersionUID</code> in IntelliJ]
* [https://stackoverflow.com/questions/24573643/ Generate <code>serialVersionUID</code> in IntelliJ]
* [https://stackoverflow.com/questions/51006002/ IntelliJ Terminal Bug with Oh My Zsh]
* [https://stackoverflow.com/questions/51006002/ IntelliJ Terminal Bug with Oh My Zsh]
Line 388: Line 461:
* [https://stackoverflow.com/questions/28981112/ Close a frozen SSH]
* [https://stackoverflow.com/questions/28981112/ Close a frozen SSH]


| valign="top" |
|valign='top'|
 
|}
|}

Latest revision as of 12:44, 16 January 2026

Shortcuts

Shortcuts

⌘ + 1                      » Project
⌘ + 2                      » Favorites
⌘ + 3                      » Find
⌘ + 4                      » Run
⌘ + 5                      » Debug
⌘ + 6                      » Problems
⌘ + 7                      » Structure
⌘ + 8                      » Services
⌘ + 9                      » Git
Shift + Shift              » Navigate
⌘ + B                      » Navigate Usages
⌘ + E                      » Recent Files
⌘ + E                      » Toggle Changes Only Files
⌘ + Shift + F12            » Hide All Windows
⌘ + ,                      » Preferences
⌘ + ;                      » Project Structures
⌘ + -                      » Folding Collapse
⌘ + +                      » Folding Expand
Control + N                » New Class, Interface, Enum
⌘ + W                      » Extend Selection
⌘ + Option + V             » Extract Variable
⌘ + Option + M             » Extract Method
⌘ + Option + P             » Extract Parameter
⌘ + Option + N             » Inline  Variable
⌘ + Shift + T              » Navigate Go to Test
⌘ + F12                    » Navigate File Structure
⌘ + D                      » Duplicate Line
⌘ + D                      » Git Difference
⌘ + Option + Z             » Git Undo the Change
Control + Shift + Down     » Line Move Down
Control + Shift + Up       » Line Move Up
Control + Shift + F10      » Run Unit Test
Control + Shift + F        » Find or Search
Control + V                » VCS Operation
⌘ + Shift + G              » Go to Folder
⌘ + X                      » Cut Line
Control + F11              » Toggle Bookmark
F11                        » Toggle Bookmark
Shift + F9                 » Debug Application
Shift + F10                » Run Application
Control + Option + [       » Previous Project Window
Control + Option + ]       » Next Project Window
Control + Option + F12     » Terminal
Option  + F4               » Close Idea Window
Control + F4               » Close Tab Window
Control + F2               » Stop
Control + Shift + U        » Toggle Upper Case
Control + Shift + R        » Find Replace in Folder
Control + R                » Find and Replace
Control + F                » Find
⌘ + Option + L             » Reformat Code
⌘ + Option + O             » Optimize Import
⌘ + R                      » Find and Replace
⌘ + F                      » Find

Option + Shift + M         » Toggle Maven Window
Alt + Insert               » Generate
⌘ + N                      » Generate
⌘ + L                      » Find Line Number
Control + G                » Find Line Number

Terminal

Terminal

⌘ + W                      » Close a Tab
⌘ + T                      » Open New Tab
⌘ + Shift + [ | Left       » Move to Left
⌘ + Shift + ] | Right      » Move to Right



⌘ + 1..9                   » Switch Between
⌘ + N                      » Open New Window
Control + Shift + W        » Close a Tab
Control + Shift + T        » Open New Tab
Control + Shift + P.Up     » Move to Left
Control + Shift + P.Dn     » Move to Right
Control + P.Up             » Move to Previous
Control + P.Dn             » Move to Next
Alter   + 1..9             » Switch Between
Control + Alter + T        » Open New Window
Enter   +   ~   + .        » Exit an SSH Session

Redis Cli

Redis Cli

redis-cli flushall async
redis-cli flushall
redis-cli flushdb

Evaluation

Evaluation

Ubuntu
rm -rf ~/.config/JetBrains/*/eval
rm ~/.config/JetBrains/*/options/other.xml
rm -rf ~/.local/share/JetBrains/consentOptions
rm -rf ~/.java/..userPrefs

File Types

File Types

Control + Alter + S » Editor » File Types » Recognized File Types » JSON » File Name Patterns » {Add Your Pattern}

Knowledge

Knowledge

# disk usage
du -h /var
du -sh /var
du -csh ~/Do*
du -csh /var/log /var/lib
du -sh --apparent-size /var/lib
du -h /var/ | sort -rh | head -5


# comment and uncomment sql
sed -i -e 's|postgres|chorke|g' *.sql
sed -i -e 's|^|-- |g' src/main/resources/db/migration/*.sql
sed -i -e 's|^-- ||g' src/main/resources/db/migration/*.sql


# ubuntu
Ctrl + Alt + F5 » Switch Desktop  to Terminal
Crtl + Alt + F1 » Switch Terminal to Desktop
Crtl + Alt +   » Switch Desktop
Crtl + Alt +   » Switch Desktop

sudo update-alternatives --config javac
sudo update-alternatives --config java
ls -lah /usr/share/maven/
sudo dpkg -l | grep openjdk

git config --global user.name "Full Name"
git config --global user.email "email.id@academia.chorke.org"


# undo assume unchanged or assume unchanged'
git update-index --no-assume-unchanged src/main/resources/application.properties
git update-index --assume-unchanged src/main/resources/application.properties
# list of files assume unchanged
git ls-files -v|grep '^h'

# create and checkout a new branch
git checkout -b new_branch_name base_branch_name
git checkout -b new_branch_name

# renaming and delete branch
git branch -m old_branch_name new_branch_name
git branch -D branch_to_delete_without_merge_status

git branch -d branch_to_delete
git push origin --delete branch_to_delete

# discard changes
git checkout master -f

# git stashing
git stash; git checkout -b new_branch; git stash pop
git add .; git commit -m "new feature added"; git push 

# rebase vs merge
git rebase master #all the updated commits of master will be available in the feature branch
git merge --squash feature #all the feature commits replaced by a new commit in the master
git commit -m 'feature merged with master branch'

# nodejs
sudo npm install -g npm

# vs code
sudo snap install code --classic
sudo snap refresh code --classic
code ./my_project
-- mysql root@localhost user
SELECT user, plugin, host FROM mysql.user WHERE user = 'root';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'p@$$w0rd';
UPDATE mysql.user SET plugin = 'mysql_native_password', authentication_string = PASSWORD('p@$$w0rd') WHERE User = 'root';
-- postgresql public role
-- revoke public connect from specific database after creation
REVOKE CONNECT ON DATABASE academia_ebis_dev FROM PUBLIC;
-- revoke public connect for all future databases
REVOKE CONNECT ON DATABASE template1 FROM PUBLIC;

-- liquibase unlock database migration
UPDATE databasechangeloglock SET locked = false;
COMMIT;
du -h /usr/local/var/postgres/{base,pg_wal}
sudo du -h /var/lib/postgresql/11/main/{base,pg_wal}
sudo du -h /var/lib/postgresql/12/main/{base,pg_wal}
#nano ~/.bashrc
#nano ~/.zshenv
#nano ~/.profile
#nano ~/.bash_profile
export ACADEMIA_WSS="$HOME/chorke/academia"
export ACADEMIA_LOG_PATH="$HOME/.chorke/academia/var/http/logs"
source ~/.bashrc
source ~/.profile
source ~/.bash_profile

source ~/.zshrc
source ~/.zshenv
source ~/.zprofile/.zlogin

[[ -s "$HOME/.chorke/academia/etc/staging.sh" ]] && source "$HOME/.chorke/academia/etc/staging.sh"

Git Ignore

Git Ignore

out/
*.iml
*.ipr
*.iws
.idea/*
cmake-build-*/
.idea_modules/
fabric.properties
crashlytics.properties
atlassian-ide-plugin.xml
crashlytics-build.properties
com_crashlytics_export_strings.xml
# clear metadata
rm -rf */out */*.iml */*.ipr */*.iws */.idea */cmake-build-* */.idea_modules

git remote -v;mv src/main/resources/application.properties ..;cd ..
mv ../application.properties src/main/resources/
# delete and recreate
git branch -d staging
git branch -D staging
git fetch origin staging
git checkout -b staging origin/staging
git merge develop

Serial UID

Serial UID

A faster way to find this setting - you might use hotkey Ctrl+Shift+A (find action), type Serializable class without 'serialVersionUID'

Alter  + Enter  » serialVersionUID =
Option + Enter  » serialVersionUID =

References

References