Showing posts from September, 2018

Database Performance bottleneck

When it turns out that the database is the main contributor to the overall response time of requests to your web application, there might be several reasons:Inappropriate database configuration: memory, disk, tablespaces, connection poolsPoor design and data structure in the database: table relations, slow stored views, missing or wrong indexes, outdated table statisticsInefficient use of the database: wrong query design, poor application logic, incorrect configuration of data access framework

Sample software use case

Suppose that you are creating a social networking application. You want to create a feature that enables an administrator to perform any kind of action, such as sending a message, on members of the social networking application that satisfy certain criteria. The following is sample use case in detail:FieldDescriptionNamePerform action on selected membersPrimary ActorAdministratorPreconditionsAdministrator is logged in to the system.PostconditionsAction is performed only on members that fit the specified criteria.Main Success ScenarioAdministrator specifies criteria of members on which to perform a certain action.Administrator specifies an action to perform on those selected members.Administrator selects the Submit button.The system finds all members that match the specified criteria.The system performs the specified action on all matching members.Extensions1a. Administrator has an option to preview those members who match the specified criteria before he or she specifies the action t…

vis.js - a dynamic, browser based visualization javascript library

vis.js is designed to be easy to use, to handle large amounts of dynamic data, and to enable manipulation of and interaction with the data.  The library consists of the components DataSet, Timeline, Network, Graph2d and Graph3d.


Gradle is build automation evolved.  Gradle can automate the building, testing, publishing, deployment and more of software packages or other types of projects such as generated static websites, generated documentation or indeed anything else.
Gradle combines the power and flexibility of Ant with the dependency management and conventions of Maven into a more effective way to build. Powered by a Groovy DSL and packed with innovation, Gradle provides a declarative way to describe all kinds of builds through sensible defaults. Gradle is quickly becoming the build system of choice for many open source projects, leading edge enterprises and legacy automation challenges.

Email Feedback Forwarding Destination of Amazon SES

When you receive notifications by email, Amazon SES rewrites the From: header and sends the notification to you. The address to which Amazon SES forwards the notification depends on how you sent the original message. If you used the SMTP interface to send the message, then notifications go to the address specified in the MAIL FROM command, which overrides any Return-Path: header specified in the SMTP DATA. If you used the SendEmail API to send the message, then the notifications are delivered as follows: If you specified the optional ReturnPath parameter of SendEmail, then notifications go to that address. Otherwise, notifications go to the address specified in the required Source parameter of SendEmail, which populates theFrom: header of the message. If you used the SendRawEmail API to send the message, then the notifications are delivered as follows: If you specified the optional Source parameter of SendRawEmail, then notifications go to that address, overriding anyReturn-Path: hea…

How to set up NFS server on Amazon AMI EC2

Setting Up the NFS Server Step One—Download the Required Software sudo yum install nfs-utils

Subsequently, run several startup scripts for the NFS server:

sudo chkconfig nfs on
sudo service rpcbind start
sudo service nfs start
Step Two—Export the Shared Directory We need to export the directory:
vi /etc/exports /var/www/html,sync,no_root_squash) rw: This option allows the client server to both read and write within the shared directorysync: Sync confirms requests to the shared directory only once the changes have been committed.no_subtree_check: This option prevents the subtree checking. When a shared directory is the subdirectory of a larger filesystem, nfs performs scans of every directory above it, in order to verify its permissions and details. Disabling the subtree check may increase the reliability of NFS, but reduce security.no_root_squash: This phrase allows root to connect to the designated directory Once you have entered in the settings for each directory, r…

Test you can successfully connect to the NFS server:

$ telnet nfs
Connected to
Escape character is '^]'.

Connection closed by foreign host.

$ telnet 2049
Connected to

Escape character is '^]'.

Open firewall ports for NFS service

You need to open port of 111 and 2049 of both TCP and UDP.

[HDGEM] Microsoft Excel REST API for Office 365

Excel for Office 365 can extend the value of your data, calculations, reporting and dashboards.Use Excel to power custom apps. Excel is an indispensable productivity tool; users across all industries and roles embrace it. It is used for everything from simple task tracking and data management, to complex calculations and professional reporting.

Posted By Blogger to HDGEM at 12/13/2016 11:05:00 AM

Move Large Slow Query Log in MySQL

shell> sudo mv mysql-slow.log mysql-slow.old
(move to the same folder if there is enough space, or else takes longer time)
shell> mysqladmin flush-logs
(this will create a new log file)

To quickly reduce file size of the big file:

$ echo ""> mysql-slow.old

See also:
How to read big/large files in Linux

NFS Stale File Handle error

If you encounter NFS Stale File Handle error, the solution is to unmount and remount the NFS folder.
$ ls /mnt/borrowls: /mnt/borrow: Stale NFS file handle  $ sudo umount -f /mnt/borrow  $ sudo mount -t nfs4 /mnt/borrow

“The road to success is always under construction.” Lily Tomlin

"The road to success is always under construction." Lily Tomlin

Capella, an open source workbench based on Eclipse technology that allows engineers to design complex systems.

Capella is an Open Source solution hosted at The solution provides a process and tooling for graphical modeling of systems, hardware or software architectures, in accordance with the principles and recommendations defined by the Arcadia method. Capella is an initiative of PolarSys, one of several Eclipse Foundation working groups.

December 15 is International Tea Day!

December 15 is International Tea Day!

International Tea Day has been celebrated since 2005 in an aim to draw attention to the impact of global trade on workers and growers in the tea industry.

Google Maps will now alert you when it's time to get off the bus or subway

Google Maps is adding a helpful new feature for travelers and commuters who tend to daydream or lose track of time during their train, subway, or bus ride. The app will now send a push notification when you're approaching your stop.

Google is preparing to use light beams to bring rural areas of the planet online after it announced to a planned rollout in India.

Google is using light beam tech to connect rural India to the internet

The firm is working with a telecom operator in Indian state Andhra Pradesh, home to over 50 million people, to use Free Space Optical Communications (FSOC)

Just because you can doesn't mean you should.

You could also implement your own source control and text editor.

Login to Google AdSense without inputting password again while you already login to Google

Adsense requires you to input password again even you have already login to Google.

You can login to following link:
Google AdSense With Google AdSense, you can earn money from your online content.
Or if Adsense mobile version is sufficient to you, simply go to AdSense mobile view.

Don't forget the trailing '/', otherwise you get 404 Not Found

TrendySkills - skill trends that employers seek in the IT industry

The need for professional software engineers to have a portfolio of knowledge that corresponds as closely as possible to the needs of the labor market is the biggest nowadays than ever. For this reason it is important for the professional to know the requirements of the employers as both as the trends created in regard to required skills and knowledge in new technologies.


searches and extracts from popular advertising websites the skills and technologies that employers are looking forclassifies skills sought (for example, a requirement knowledge for SQL Server is part of the general category of RDBMS)generates useful statistics about the results, as the trends prevailing per category or per time periodprovides the statistical data to the public via a public API

Using a standard username and password combo as the sole gatekeeper between your data and hackers is no longer the safest bet.

Securing access to your cloud applications with multi-factor authentication adds an additional safeguard against wrongful access. MFA requires users to take an extra step like receiving an access code on their phone or onetime passwords to complete the login process so that even if a hacker obtains login credentials, they aren’t able to log in.

Implement SSL certificates SSL certificates enable encrypted communications between a web server and browser.

SSL certificates are issued by Certificate Authorities (CAs), which are organizations that are trusted to verify both the identity and the legitimacy of the entities requesting the certificate.

[HDGEM] How to only allow an object be created via the builder instead of constructor in Java

Remove the public constructor from the class and replace it with a private constructor so that objects can only be created via the builder.

Elgg Email Setting on Amazon AWS EC2

Amazon AWS EC2 has a limit on port 25. You can install
PHPMailer for Elgg
and then use another SMTP.

Percona Software for MySQL

Percona iscommitted to producing open-source softwarefor Percona Server, MySQL, and MariaDB users. It offers a range of MySQL software solutions. All software is open source and free of charge. Percona Software Projects The following software is the sole creation of Percona: Percona Server with XtraDB is our database server, with high performance and scalability, including the Percona XtraDB high-performance storage engine based on InnoDB.Percona XtraDB Cluster is a new high availability and high scalability solution for MySQL users.Percona XtraBackup is the world's only open-source hot backup solution for InnoDB and XtraDB.Percona Toolkit is a collection of advanced command-line tools used by Percona support staff to perform a variety of MySQL and system tasks that are too difficult or complex to perform manually.Percona Monitoring Plugins are high-quality components to add enterprise-grade MySQL monitoring and graphing to your existing monitoring solutions.Percona Data Recovery T…

How to install Plugin in Elgg

To install a plugin, unzip the plugin and copy the plugin's main folder to the "mod" directory in your Elgg installation.

You must then activate the plugin in the Administration panel.

One reason of Caused by: javax.ejb.EJBException: Illegal non-business method access on no-interface view

Sometimes we use IDE to generate codes for us. When for example NetBeans 7.3 Beta 2 creates a method for us, it defaults to default accessibility when the method is in the same package. If you don't pay attention to it, it could then throws

Caused by: javax.ejb.EJBException: Illegal non-business method access on no-interface view

from your @EJB injection of web service client.

You need to change to the method to publicto avoid this exception.

for example, from

voidupdateProspect(String casenumber, String xml){ // TODO implement it later. }

publicvoidupdateProspect(String casenumber, String xml){ // TODO implement it later. }

Intel Corp. said Wednesday that most of the processors running the world’s computers and smartphones have a feature that makes them susceptible to attack.

The largest chipmaker is working with rivals and partners on a fix.

Do not charge your phone in extreme temperatures

While most performance issues related to cold weather are temporary, Apple warns that charging iOS devices in extreme temperatures can damage the devices further.

Companies in India and globally are facing a major shortage of skilled cyber security talent to spot vulnerabilities, fend attacks and respond to emergencies during cyber breaches.

Enterprises across sectors are expected to hire Cyber Security Architects, Information Security Managers and Security Auditors.

generate UUIDs

Java, Scala It's in the standard library.
Node.jsnpm install uuid
var uuid = require("uuid"); uuid.v4();
PHP Install ramsey/uuid from composer.
$uuid4 = Uuid::uuid4();
Haskell Install uuid from hackage
uuid :: IOUUIDuuid = nextRandom

Docker Swarm provides native clustering functionality for Docker containers, which turns a group of Docker engines into a single, virtual Docker engine.

In Docker 1.12 and higher, Swarm mode is integrated with Docker Engine.

Fixed: docker login unauthorized: incorrect username or password

For username, don't use email address. Use username.

Containers run apps natively on the host machine’s kernel.

Containers have better performance characteristics than virtual machines that only get virtual access to host resources through a hypervisor. Containers can get native access, each one running in a discrete process, taking no more memory than any other executable.

Containers can share a single kernel

The only information that needs to be in a container image is the executable and its package dependencies, which never need to be installed on the host system. 
These processes run like native processes, and you can manage them individually by running commands like docker ps—just like you would run ps on Linux to see active processes. 
Finally, because they contain all their dependencies, there is no configuration entanglement; a containerized app “runs anywhere.”

docker 102

$ docker run -it ubuntu bash

For docker 101:
$ docker run hello-world
Hello from Docker! This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:  1. The Docker client contacted the Docker daemon.  2. The Docker daemon pulled the "hello-world" image from the Docker Hub.     (amd64)  3. The Docker daemon created a new container from that image which runs the     executable that produces the output you are currently reading.  4. The Docker daemon streamed that output to the Docker client, which sent it     to your terminal.

Forcing Syntax Coloring for files in Vim

If you are editing a file containing PHP script (for example) but the file doesn't have the extension .php, you can force the desired syntax coloring with :set syntax=php. similarly :set syntax=perl :set syntax=html. Alternatively if the extension causes an undesired coloring, switch off coloring with :set syntax=off

Docker container behind a proxy server?

Proxy servers can block connections to your web app once it’s up and running. If you are behind a proxy server, add the following lines to your Dockerfile, using the ENV command to specify the host and port for your proxy servers:# Set proxy server, replace host:port with values for your servers ENVhttp_proxyhost:portENVhttps_proxyhost:port

SSL Server Test / Verification

SSL Certificate Verificationsslshopper.comSSL Checker - SSL Certificate Verify

Another: this link to test/verify you SSL certificate on your server.

How to solve: java.lang.Exception: Failed to establish chain from reply

Solution: Make sure all the certificates from the chain are imported into the keystore. And they have to be importedin order. If the order is incorrect, you need to delete it and import again according the right order: root certificate first, intermediate certificate second.

keytool -list -keystore keystore.jksshows youthe existing certificates.

keytool -delete -alias s1as -keystore keystore.jks to delete certificate of alias s1as.

keytool -import -v -trustcacerts -alias root -file ~/gd_bundle-g2-g1.crt -keystore keystore.jks -keypass changeit -storepass changeit

keytool -import -v -trustcacerts -alias s1as -file ~/41188d108f1c8.crt -keystore keystore.jks -keypass changeit -storepass changeit

to import certificate of root and s1as respectively.

For Godaddy, you can check the chain order of the certificate here.

Verify your SSL certificate:
SSL Server Test / Verification

Basic Docker commands

docker build -t friendlyname .# Create image using this directory's Dockerfile docker run -p 4000:80 friendlyname # Run "friendlyname" mapping port 4000 to 80 docker run -d-p 4000:80 friendlyname # Same thing, but in detached mode docker container ls# List all running containers docker container ls-a# List all containers, even those not running docker container stop <hash># Gracefully stop the specified container docker container kill <hash># Force shutdown of the specified container docker container rm <hash># Remove specified container from this machine docker container rm $(docker container ls-a-q)# Remove all containers docker image ls-a# List all images on this machine docker image rm <image id> # Remove specified image from this machine docker image rm $(docker image ls-a-q)# Remove all images from this machine docker login # Log in this CLI session using your Docker credentials docker tag <image> userna…

How to stop / remove all docker containers

To stop:
$ docker stop $(docker ps -a -q)Or $ docker container stop $( docker container ls) To remove
$ docker rm $(docker ps -a -q)Or $ docker container rm $(docker container ls -a -q) You can combine a lot of shell commands in a Docker context.

See also:
Difference between `docker stop` and `docker kill`How to remove all local docker images
You can use docker info to get system-wide information.

it’s very easy to define, run, and scale services with the Docker platform

Just write a docker-compose.yml file.

Services are really just “containers in production.” A service only runs one image, but it codifies the way that image runs—what ports it should use, how many replicas of the container should run so the service has the capacity it needs, and so on.

Docker Hub Payara

docker-payaramicro Repository which backs the Docker Hub Payara Micro image docker-payaraserver-web Repository which backs the Docker Hub Payara Server web profile image docker-payaraserver-full Repository which backs the Docker Hub Payara Server full profile image


docker search payara
docker pull payara/server-full

To start a new Docker container based on the Payara image we have just downloaded
docker run -it -p 8080:8080 -p 4848:4848 payara/server-full /bin/bash
payara@2bfba3cce362:/opt/payara41/glassfish/bin/asadmin statusRemote server does not listen for requests on [localhost:4848]. Is the server up?
No such local command: status.  Unable to access the server to execute the command remotely.  Verify the server is available.
Command status failed.
payara@2bfba3cce362:/opt/payara41/glassfish/bin/asadmin start-domain payaradomainWaiting for payaradomain to start .......................
Successfully started the domain : payaradomain
domain  Location: /opt/payara41/glassfish/domains/payaradomain
Log File: /opt/payara41/glassfish/domains/payaradomain/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.

Money market price

Once upon a time, a businessman came to a mountain village. The mountains around the village were full of monkeys. The merchant said to the farmer who grew the land in the village, I bought a monkey, 100 yuan, the villagers do not know is true or false, try to catch a monkey, the businessman really gave 100 yuan, the village people to catch a monkey, this is much easier than farming. Soon the merchant bought more than two thousand monkeys, and there were few in the mountains. At this time, the merchant offered 2000 yuan for a monkey. When the villagers saw that the price of the monkey had doubled, they all went after him and bought it again. But the monkey was hard to catch. The businessman offered another 13,000 yuan for a monkey. The monkey could hardly catch it. Businessmen bid 25,000 yuan each, there are no monkeys on the mountain, more than 3,000 monkeys are in the merchant here. One day, when the merchant was in town, his assistant went to the village and said to the peasants, I…

Studying web development is a path with many ups and downs.

You might have one day where you figure out a tough problem and feel absolutely amazing. But then the very next day, you get stuck on a seemingly easy problem for hours. You end up feeling completely defeated.

Adobe Scan is a capture app for creating PDFs

Adobe Scan uses your phone's camera to scan images and text into a PDF. Because Adobe Scan has optical character recognition (OCR), you can then start copying and pasting the text you just scanned. OCR also makes the content of your scans searchable.

Apple Inc. will release a patch for the Safari web browser on its iPhones, iPads and Macs within days

Major chipmakers disclosed flaws that leave nearly every modern computing device vulnerable to hackers.

AdWords allows you to take advantage of the benefits of online advertising

Show your ads to the right people, in the right place, and at the right time.