Posts

Showing posts from May, 2020

Credentials helpers

JUnit 5 is composed of three separate modules

JUnit Platform is the foundation for launching testing frameworks in the JVM; it is supported by many IDEs and build tools.JUnit Jupiter is the newest programming model as well as the TestEngine for JUnit 5 tests.There's JUnit Vintage - the TestEngine for older JUnit 3 and JUnit 4 tests.

Gitpod - Online IDE for GitHub

Gitpod is frictionless coding.
Whether you just want to hack, have code to review or feel like trying something new on GitHub or GitLab,

Gitpod beams you right into a ready-to-code dev environment with a single click.
https://gitpod.io/#https://github.com/freeCodeCamp/freeCodeCamp

Data Science libraries for Python

for performing data cleaning and analysis - pandasfor basic statistical tools – numpy, scipyfor data visualization – matplotlib, seaborn

Check MySQL query history from command line

The .mysql_history file is internally used by the command line editiing utility program, called libedit. The file is not intended to be directly viewed, or edited etc.

The content of the file is encoded by wctomb. To view the content:


shell> cat ~/.mysql_history | python2.7 -c "import sys; print(''.join([l.decode('unicode-escape') for l in sys.stdin]))"

If your system has python 3.x installed, the command must be changed like below:

shell> cat ~/.mysql_history | python -c "import sys; print(*[l.decode('unicode-escape') for l in sys.stdin.buffer])"

MyCli History and Search
MyCli keeps track of the queries entered in the repl. Up/Down arrow can be used to navigate the history.

Pressing <C-r> will enable incremental history search. So press <C-r> and then start typing your search term to see the queries narrowed down. You can cycle through the matches by pressing <C-r> again.

The history file ~/.mycli-history contains all the sq…

GatsbyJS

https://www.gatsbyjs.org
Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps. Enjoy the power of the latest web technologies – React.js , Webpack , modern JavaScript and CSS and more — all set up and waiting for you to start building.

CREATE DATABASE in Derby by ij

Derby does not require or support a CREATE DATABASE statement. To create a new database, simply append create=true to the connection string. If you start ij and run this statement, it automatically creates a new database in the current working directory:

CONNECT 'jdbc:derby:mydb;create=true';

To create a new database for a running Derby service, include the create option in the connection URL in exactly the same way:

CONNECT 'jdbc:derby://localhost:1527/mydb;create=true';

Or
jdbc:derby://localhost:1527/mydb;create=true;user=myaccount;password=mypasswd

Hide or show the Remote Desktop connection bar

Image

Start ssh-agent

eval `ssh-agent -s`
ssh-add

Switch Expressions in Java

int month=5;
String monthString;
monthString =switch (month) {
case1->"January";
case2->"February";
case3->"March";
case4->"April";
case5->"May";
case6->"June";
case7->"July";
case8->"August";
case9->"September";
case10->"October";
case11->"November";
case12->"December

MySQL check all foreign keys to a table or column

For a Table:

SELECT
  TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
FROM
  INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE
  REFERENCED_TABLE_SCHEMA = '<database>' AND
  REFERENCED_TABLE_NAME = '<table>';
For a Column:

SELECT
  TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
FROM
  INFORMATION_SCHEMA.KEY_COLUMN_USAGE
WHERE
  REFERENCED_TABLE_SCHEMA = '<database>' AND
  REFERENCED_TABLE_NAME = '<table>' AND
  REFERENCED_COLUMN_NAME = '<column>';

Limiting the number of records from mysqldump

mysqldump --opt --where="1 ORDER BY id DESC limit 8888"

Best websites to choose icons for your sites.

1. Fontastic
2. Flaticon
3. Swift icons
4. Ionicons
5. Font awesome
6. Icon54
7. Icons8
8. Iconmonstr

MySQL connect by TCP instead of a Unix socket

To ensure that the client makes a TCP/IP connection to the local server, use --host or -h to specify a host name value of 127.0.0.1, or the IP address or name of the local server. You can also specify the connection protocol explicitly, even for localhost, by using the --protocol=TCP option. Examples:


mysql --host=127.0.0.1
mysql --protocol=TCP

You can also easily make that the default my editing your my.cnf so it has this ([client] means any client:

[client]
protocol=tcp

Linux List all the available devices with their Universally Unique Identifier

List all the available devices with their Universally Unique Identifier (UUID), the TYPE of the file-system and the LABEL if it's set.

# blkid

Fixed ec2 nvme: command not found

sudo dnf install nvme-cli

Identify NVMe EBS volume

NVMe EBS volumes have the EBS volume ID set as the serial number in the device identification. Use the lsblk -o +SERIAL command to list the serial number.

[ec2-user@ip-172-16-1-223 ~]$ lsblk -o  +SERIAL

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT SERIAL

nvme1n1 259:0 0 18G 0 disk /opt/glassfish vol0dd95bcb9ed628c19

nvme0n1 259:1 0 8G 0 disk vol08012197781352aaa

├─nvme0n1p1 259:2 0 8G 0 part /

└─nvme0n1p128 259:3 0 1M 0 part

nvme2n1 259:4 0 18G 0 disk vol03f6cfb8cd92bffff

Use the file -s command on Linux to get information about a device

To get information about a device, such as its file system type:

If the output shows simply data, as in the following example output, there is no file system on the device and you must create one.

$ sudo file -s /dev/xvdf
/dev/xvdf: data

$ sudo file -s /mnt
/mnt: directory