This file contains hidden or 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
javap -v [path to your class file] | grep 'major version' |
This file contains hidden or 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
# display duplicate rows | |
SELECT | |
* | |
FROM ( | |
SELECT | |
person_id, | |
@rank := IF( @email = email and @firstname = firstname, @rank + 1, 1) AS row_number, | |
@email := email as email, | |
@firstname := firstname as firstname | |
FROM |
This file contains hidden or 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 TABLE_NAME, | |
COLUMN_NAME, | |
CONSTRAINT_NAME, | |
REFERENCED_TABLE_NAME, | |
REFERENCED_COLUMN_NAME | |
FROM information_schema.KEY_COLUMN_USAGE | |
WHERE TABLE_NAME = "<TABLE_NAME>"; |
This file contains hidden or 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
aws ssm describe-parameters --query "Parameters[].{Name:Name,Description:Description}" --output text |
This file contains hidden or 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
#connect to mysql | |
mysql -u root -p | |
#list privileges | |
select user,host from mysql.user; | |
# create new schema | |
CREATE SCHEMA `[SCHEMA_NAME]` DEFAULT CHARACTER SET utf8; | |
# grant acess on schema to user |
This file contains hidden or 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
#MySQL 8 | |
#convert uuid binary(16) to String | |
SELECT BIN_TO_UUID(uuid) FROM foo | |
#convert uuid string to binary(16) | |
SELECT UUID_TO_BIN(UUID()) | |
#MySQL 5,6,7 |
This file contains hidden or 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
#disable | |
SET FOREIGN_KEY_CHECKS=0; | |
#reenable | |
SET FOREIGN_KEY_CHECKS=1; |
This file contains hidden or 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 | |
git config credential.helper store | |
#then | |
git pull | |
# user credentials will be saved in ~/.git-credentials in PLAIN text | |
# if user credentials are changed in the future, simply execute | |
git pull | |
# and provide a new password and it will work like before. |
This file contains hidden or 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
#see link: http://linuxcommand.org/lc3_wss0120.php | |
# Positional args | |
# $#: number of items on the command line in addition to the name of the command | |
# $0: name of the command | |
> some_program word1 word2 word3 | |
# $# would be 3 | |
# $0 would contain "some_program" |
This file contains hidden or 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
ssh -i ~/.ssh/[KEY_NAME].pem [REMOTE_USER]@[SERVER_IP_or_DNS] |
NewerOlder