Posts

Showing posts from October, 2019

There are four main benefits of using queuing systems

Asynchronicity
Messages allow for asynchronicity. They can be sent and received at any moment. Processes at the various ends of the queues don't need to be aware of the state of the rest of the system. With asynchronicity, long-running tasks don't block UI since they're performed in the background.

Decoupling
Each part of the service does only one thing. Each part is notified when it needs to perform a task, and after completion it sends a notification that the task is complete. You don't need REST API or other RPC methods—with message queuing, there's simple message flow in both directions.

Flexibility
When queuing systems provide client libraries for different platforms, it's easier to connect parts of the system that are written in different languages. 

Scalability
Scaling is easier with messages since you can add more consumers that process data and run tasks. Producers don't need to be aware of how many consumers there are; all they need to know is which queu…

How to check Wifi Password in Windows 10

First Open the command prompt on your device.
Now type the command netsh wlan show profile name=SSID key=clear, replace SSID with your wifi name.
Hit enter to see the wifi password of your given network.

How to find out / locate MySQL dead lock

See also:
How to get Active Transactions and Locks from MySQLSELECT*FROMinformation_schema.innodb_locks;(run it as root)

| Warning | 1681 | 'INFORMATION_SCHEMA.INNODB_LOCKS' is deprecated and will be removed in a future release. |

For every blocked transaction, INNODB_LOCKS contains one row that describes each lock the transaction has requested, and for which it is waiting. INNODB_LOCKS also contains one row for each lock that is blocking another transaction, whatever the state of the transaction that holds the lock ('RUNNING', 'LOCK WAIT', 'ROLLING BACK'or 'COMMITTING'). The lock that is blocking a transaction is always held in a mode (read vs. write, shared vs. exclusive) incompatible with the mode of requested lock.

Mode of the lock. One of 'S', 'X', 'IS', 'IX', 'S,GAP', 'X,GAP', 'IS,GAP', 'IX,GAP', or'AUTO_INC'

How to find out / locate MySQL dead lock

See also:
How to get Active Transactions and Locks from MySQLSELECT*FROMinformation_schema.innodb_locks;(run it as root)

| Warning | 1681 | 'INFORMATION_SCHEMA.INNODB_LOCKS' is deprecated and will be removed in a future release. |

For every blocked transaction, INNODB_LOCKS contains one row that describes each lock the transaction has requested, and for which it is waiting. INNODB_LOCKS also contains one row for each lock that is blocking another transaction, whatever the state of the transaction that holds the lock ('RUNNING', 'LOCK WAIT', 'ROLLING BACK'or 'COMMITTING'). The lock that is blocking a transaction is always held in a mode (read vs. write, shared vs. exclusive) incompatible with the mode of requested lock.

Mode of the lock. One of 'S', 'X', 'IS', 'IX', 'S,GAP', 'X,GAP', 'IS,GAP', 'IX,GAP', or'AUTO_INC'

reverse-list-recursive.java

publicListNode reverseList(ListNode head) {
/* recursive solution */
return reverseListInt(head, null);
}

privateListNode reverseListInt(ListNode head, ListNode newHead) {
if (head ==null)
return newHead;
ListNode next = head.next;
head.next = newHead;
return reverseListInt(next, head);
}

reverse-List-iterative.java

publicListNode reverseList(ListNode head) {
/* iterative solution */
ListNode newHead =null;
while (head !=null) {
ListNode next = head.next;
head.next = newHead;
newHead = head;
head = next;
}
return newHead;
}

How to make bash print every command before executing it

set -x makes bash print every command before executing it.

Or

bash -x my-script.sh

Developing more than one revenue stream is the best career insurance.

However small, the alternative income stream can offer workers some measure of financial protection

Upgrading MySQL by local RPMs

* Stop mysqld

* Verify mysqld is completely stopped using
ps ax | grep mysql
Or
pgrep mysql

* Remove the existing RPMs using
sudo rpm -e --nodeps $(rpm -qa | grep -i ^mysql)


* Install the new RPMs using
sudo yum install mysql-commercial-{client,server,common,libs*}-5.7.28*.x86_64.rpm
(You probably do not need the devel, embedded, or test RPMs)

Yum unfinished transactions remaining

If there are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).

$ sudo yum-complete-transaction --cleanup-only
Loaded plugins: langpacks
Cleaning up unfinished transaction journals
Cleaning up 2018-10-30.12:32.12
$ sudo yum-complete-transaction
Loaded plugins: langpacks
No unfinished transactions left.

Reduce the size of your pages.

Target 50 or fewer requests and 1,000 or fewer bytes to optimize load time.Compress and select efficient images, and prioritize download of visible content.

CentOS / RHEL 7 : How to Install GUI

Installing the environment group “Server with GUI”
# yum groupinstall "Server with GUI"
“Server with GUI” installs the default GUI which is GNOME.
 In case if you want to install only core GNOME packages use :
# yum groupinstall 'X Window System' 'GNOME'
Enable GUI on system start up. In RHEL 7, systemd uses ‘targets’ instead of runlevels. The file /etc/inittab is no more used to change run levels. Issue the following command to enable the GUI on system start.
To set a default target :
# systemctl set-default graphical.target To change the current target to graphical without reboot :
# systemctl start graphical.target Verify the default target :
# systemctl get-default graphical.target

VcXsrv X server for Windows

A X server is needed on Windows if you SSH to remote Linux computers and wish to start X or GUI applications from there. It is also necessary if you are working with a Linux distribution running inside Windows Subsystem for Linux (WSL). VcXsrv is a free open-source X server that can be used for all these purposes.
To install VcXsrv, download its installer from here and install it.
Launch XLaunch from the Windows start menu. This brings up a wizard to pick the X server configuration options. I choose Multiple Windows and go with the default options for the rest. Now the X server is running in the background.

Local: Go to your WSL shell (say Ubuntu) and set the DISPLAY environment variable:

$ export DISPLAY=localhost:0.0
Launch any X or GUI app and its window should now be displayed in its own individual Windows window.
Remote: Remember to SSH to the remote system with trusted X11 forwarding using option -Y. On the remote system, set the DISPLAY variable:

$ export DISPLAY=your-windows-ip:0.0

WSL \\wsl$ mount

In a remote Linux environment (this WSL distro is technically another machine without UI, that just happens to be running locally on your computer), you can run Vim in the terminal to edit your file or you can edit the sources on the Windows side through the \\wsl$ mount.

Express is a popular framework for building and running Node.js applications.

Install the Express Generator#
You can create a new Express application using the Express Generator tool. The Express Generator is shipped as an npm module and installed by using the npm command-line tool npm.
sudo npm install -g express-generator

The -g switch installs the Express Generator globally on your machine so you can run it from anywhere.

Create a New Application
You can now create a new Express application called myExpressApp by running:
express myExpressApp --view pug
The --view pug parameters tell the generator to use the pug template engine (formerly known as jade).
To install all of the application's dependencies, go to the new folder and run npm install.
cd myExpressApp
npm install
Run the Application
Last, let's ensure that the application runs. From the terminal, start the application using the npm start command to start the server.
npm start
The Express app by default runs on http://localhost:3000.

Install Node.js and npm on Ubuntu

From the terminal, install Node.js and npm, the Node.js package manager.
sudo apt-get install nodejs npm
You can verify the installations by running:
node --version
npm --version

Traceroute sends multiple packets to the destination

Traceroute sends multiple packets to the destination, with ever-increasing TTL (starting with 1), and listens for the incoming "time exceeded" responses coming in from all the intermediary routers.

infrastructure as code

Infrastructure as code. Infrastructure as code ( IaC) is the process of managing and provisioning computer data centers through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools.

JPA Modeler is an open source graphical tool that enhances productivity and simplifies development tasks of creating complex entity relationship models.

JPA Modeler

JPA Modeler is an open source graphical tool that enhances productivity and simplifies development tasks of creating complex entity relationship models. Using it developers can create JPA class, visualize & modify Database and automates Java EE 8 code generation.

Build serverless applications in simple and clean syntax

AWS Serverless Application Model

The AWS Serverless Application Model (SAM) is an open-source framework for building serverless applications. It provides shorthand syntax to express functions, APIs, databases, and event source mappings. With just a few lines per resource, you can define the application you want and model it using YAML. During deployment, SAM transforms and expands the SAM syntax into AWS CloudFormation syntax, enabling you to build serverless applications faster.
https://aws.amazon.com/serverless/sam/

VS Code Remote Development

Visual Studio Code Remote Development allows you to use a container, remote machine, or the Windows Subsystem for Linux (WSL) as a full-featured development environment. You can:

    Develop on the same operating system you deploy to or use larger or more specialized hardware.
    Sandbox your development environment to avoid impacting your local machine configuration.
    Make it easy for new contributors to get started and keep everyone on a consistent environment.
    Use tools or runtimes not available on your local OS or manage multiple versions of them.
    Develop your Linux-deployed applications using the Windows Subsystem for Linux.
    Access an existing development environment from multiple machines or locations.
    Debug an application running somewhere else such as a customer site or in the cloud.

No source code needs to be on your local machine to get these benefits. Each extension in the Remote Development extension pack can run commands and other extensions directly inside a …

Sleep enhances your memory.

It prepares your brain to learn new things.

Amazon Feature Products