Posts

Showing posts from April, 2018

You cannot make an abstract class or method final in Java because abstract and final are the mutual exclusive concept.

An abstract class is incomplete and can only be instantiated by extending a concrete class and implementing all abstract methods, while a final class is considered as complete and cannot be extended further.

Clear Linux is Intel’s uber light weight OS

Clear Linux is targeted at cloud use cases.

The Clear Linux* Project for Intel® Architecture is a distribution built for cloud and IoT use cases. We want to showcase the best of Intel architecture technology and performance, from low-level kernel features to complex applications that span across the entire OS stack. We're putting emphasis on Power and Performance optimizations throughout the operating system as a whole.

Ubuntu 18.04 LTS is powered by the Linux 4.15 kernel.

Various utilities are now offered in the Snap format like System Monitor, Calculator, Characters, and Logs, and there is a new automatic suspend timeout of 20 minutes for laptops.
Ubuntu 18.04 LTSincludes patches for the Meltdown and Spectre security flaws.

Ubuntu 18.04 LTS is powered by the Linux 4.15 kernel.

Various utilities are now offered in the Snap format like System Monitor, Calculator, Characters, and Logs, and there is a new automatic suspend timeout of 20 minutes for laptops.
Ubuntu 18.04 LTSincludes patches for the Meltdown and Spectre security flaws.

Google Mobile-First Indexing

Mobile-first indexing is finally here.



Google has announced that it's beginning migration of best practice-compliant sites into the mobile-first index.

Google Mobile-First Indexing

Mobile-first indexing is finally here.

Google has announced that it's beginning migration of best practice-compliant sites into the mobile-first index.

World Backup Day

World Backup Day was March 31. It's a great reminder to back up all of your digital data and should be a part of your digital spring cleaning.

World Backup Day

World Backup Day was March 31. It's a great reminder to back up all of your digital data and should be a part of your digital spring cleaning.

Facebook Comment Box is a awesome plugin of the Facebook.

Using this Facebook comment box your blogger and websites user or viewers can comment on your posts and those comments will be automatically shared in their Facebook Comment Wall.

The iPhone is the most popular phone

It is time to say formal goodbye to  iPhone 6

The IOS system of the iPhone is very easy to use and the iPhone is expensive. 
The lowest end of the current market for your mobile phone is the iPhone 6.
iPhone 6 has been released for four or five years.The various configurations look very poor than the processors of the CellCon 660 and the Kirin 960, and the memory is even worse. When you upgrade to the latest IOS system, you'll get stuck, and the battery will need to be charged three or four times a day. Price hovering around 2000 yuan, and Xiaomi 6 and Huawei mate9 compared to the difference is too far away, so  iPhone 6, time to say formal goodbye!!!

The iPhone is the most popular phone

It is time to say formal goodbye to  iPhone 6

The IOS system of the iPhone is very easy to use and the iPhone is expensive. 
The lowest end of the current market for your mobile phone is the iPhone 6.
iPhone 6 has been released for four or five years.The various configurations look very poor than the processors of the CellCon 660 and the Kirin 960, and the memory is even worse. When you upgrade to the latest IOS system, you'll get stuck, and the battery will need to be charged three or four times a day. Price hovering around 2000 yuan, and Xiaomi 6 and Huawei mate9 compared to the difference is too far away, so  iPhone 6, time to say formal goodbye!!!

It’s human nature to be greedy when times are good

Market fluctuations are primarily driven by the emotions of the masses.
It's human nature to be greedy when times are good.

It’s human nature to be greedy when times are good

Market fluctuations are primarily driven by the emotions of the masses.
It's human nature to be greedy when times are good.

HtmlCleaner - an open-source HTML parser written in Java

HTML found on Web is usually dirty, ill-formed and unsuitable for further processing. For any serious consumption of such documents, it is necessary to first clean up the mess and bring the order to tags, attributes and ordinary text. For the given HTML document, HtmlCleaner reorders individual elements and produces well-formed XML. By default, it follows similar rules that the most of web browsers use in order to create Document Object Model. However, user may provide custom tag and rule set for tag filtering and balancing.

Features Summary
HtmlCleaner parses input HTML and generates tree-structure suitable for programmatic manipulation.Serializers are responsible for outputting the DOM structure to XML, HTML, DOM or JDom.Parsing phase relies on tag descriptions which can be customized by the user.HtmlClaner's behaviour can be configured through number of parameters.HtmlClaner is thread safe, meaning that single instance can clean multiple html sources at the same time.HtmlClaner c…

How to fix: DatastoreNeedIndexException: The index for this query is not ready to serve in Google App Engine

In the log of the admin panel of your app, you can find the suggestion of the index, such as:

   com.google.appengine.api.datastore.DatastoreNeedIndexException: The index for this query is not ready to serve. See the Datastore Indexes page in the Admin Console.
The suggested index for this query is:

<datastore-index kind="Greeting"ancestor="true"
source="manual">
<property name="date"direction="desc" />
</datastore-index>
Put the suggest index to datastore-indexes.xml file located in your WEB-INF directory. The full xml file would look like:

<?xml version="1.0" encoding="utf-8"?>
<datastore-indexesautoGenerate="true">
<datastore-indexkind="Greeting"ancestor="true"
source="manual">
<propertyname="date"direction="desc" />
</datastore-index>
</datastore-indexes>

How to change / configure default JDK on Ubuntu

$update-java-alternatives-l
$sudoupdate-java-alternatives-sjava-1.8.0-openjdk-amd64
$sudoupdate-alternatives--configjava

Obtain an entity reference without initializing its data in JPA: getReference

The ability to obtain a reference to an entity without having to load its data is very important. The most common case being the need to create an association between an entity and another, existing entity. We achieve this  lazy loading by using EntityManager.getReference(id). With the method “getReference” you will query only for the object ID, you will save some database traffic.Use getReference method when you just to update some state by setter method without need to know the whole object's state from database. getReference returns a proxy object which uses a powerful feature called automatic dirty checking. For example:
publicclassDog {
privateString name;
privateInteger age;
}

publicclassDogServiceImplimplementsDogService {

publicvoidupdateAge(Integerid, IntegernewAge) {
Dog dog = em.getReference(Dog.class, id);
// dog is a proxy
dog.setAge(newAge);
}
}If you call find method, JPA provider, behind the scenes, will call
SELECT NAME, AGE FROM DOG WHERE ID = ?
UPDATE DOG SET AGE…

Avoid using prependId="false" in JSF

Creating a form with prependId="false" will lead to client-IDs of child components of this form where the path to be passed to findComponent() being different from the client-ID.
This leads to confusion, especially with composite components and f:ajax where referencing components outside of the same naming container are being used very often.

How to Create a Durable Reduced Availability Bucket in Google Cloud Storage for lower cost

Creating a Durable Reduced Availability Bucketgsutil mb -c DRA gs://<bucketname>/Durable Reduced Availability Storage enables you to store data at lower cost, with the tradeoff of lower availability than standard Google Cloud Storage.

For normal storage:
gsutil mb gs://<bucketname>
To verify that Durable Reduced Availability Storage is enabled you can execute the following command:
gsutil ls -L -b gs://<bucketname>/

Choose between Nearline and Coldline

Redefining Archival Cloud Storage Nearline and Coldline offer ultra low-cost, highly-durable, highly available archival storage.  Coldline is ideal for cold storage - data your business expects to touch less than once a year. For warmer storage, choose Nearline: data you expect to access less than once a month, but possibly multiple times throughout the year. Both options are available across all GCP regions and provide unparalleled sub-second access speeds with a consistent API.

How to Create Google App Engine App using Maven

Generate guestbook maven project from the command line:
mvnarchetype:generate-Dappengine-version=1.9.37-Dapplication-id=your-app-id-Dfilter=com.google.appengine.archetypes:Then select from the artifact list by supplying the number.

If you want to create the complete, ready-to-run guestbook sample app, supply the number corresponding to com.google.appengine.archetypes:guestbook-archetype.

If you want to create an empty project that contains the required directory structure and files, ready for your own classes, supply the number corresponding to com.google.appengine.archetypes:appengine-skeleton-archetype.

Select the most recent version from the displayed list of available archetype versions by accepting the default.

See also:
Maven Google App Engine archetypes
You can also do it from Eclipse: -> New a Maven Project -> Add the New Maven Archetype From Google.
$ mvn clean installUse maven goal
$ appengine:devserverto run the app.

Use maven goal
$ appengine:updateto upload to Google App Engi…

How to fix Google App Engine Deployment: mvn appengine:update 403 Forbidden You do not have permission to modify this app

To fix
mvn appengine:update 403 Forbidden You do not have permission to modify this app
you have to rename or delete the .appcfg_oauth2_tokens_java file in your home directory, so that the next time you try to deploy it, it will ask again for authentication.

$rm~/.appcfg_oauth2_tokens_java

How to forcefully unmount a Linux disk partition

$ sudo -i umount /extraumount: /extra: device is busy. (In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
$ sudo -i fuser -km /extra
$ sudo -i umount /extra
-- You can also try umount command with –l option:
# umount -l /mnt
Where,

-l : Also known as Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. This option works with kernel version 2.4.11+ and above only.

Caution: Using these commands or option can cause data loss for open files; programs which access files after the file system has been unmounted will get an error.

Forcefully unmount a Linux disk partition

$ sudo -i umount /extraumount: /extra: device is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))
$ sudo -i fuser -km /extra $ sudo -i umount /extra -- You can also try umount command with –l option: # umount -l /mnt
Where,

-l : Also known as Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. This option works with kernel version 2.4.11+ and above only.

Caution: Using these commands or option can cause data loss for open files; programs which access files after the file system has been unmounted will get an error.

Keyboard shortcut for screen program in linux

'screen' gives you the ability to multiplex a number of interactive shell sessions through a single terminal session. You reserve one keystroke ([Ctrl]+[A] by default) which is the meta key that provides access to all 'screen' functions.
Thus the key sequence [Ctrl]+[A], [D] will "detach" your currently running screen session from the current terminal connection. To re-attach later (from that terminal session or any other) you use the 'screen -r' command.

screen -d -r: to remotely force a session to be detached and attach it here (to cleanly reattach from another session)
[Ctrl]+[A], [D] will "detach" your currently running screen session from the current terminal connection.
To resume a detached session: screen -r
To see the list of sessions: screen -ls
To attach without first detaching an active session: screen -x


KeyActionNotesCtrl+a cnew windowCtrl+a nnext windowI bind F12 to thisCtrl+a pprevious windowI bind F11 to thisCtrl+a "sel…

Keyboard shortcut for screen program in linux

'screen' gives you the ability to multiplex a number of interactive shell sessions through a single terminal session. You reserve one keystroke ([Ctrl]+[A] by default) which is the meta key that provides access to all 'screen' functions.
Thus the key sequence [Ctrl]+[A], [D] will "detach" your currently running screen session from the current terminal connection. To re-attach later (from that terminal session or any other) you use the 'screen -r' command.

screen -d -r: to remotely force a session to be detached and attach it here (to cleanly reattach from another session)
[Ctrl]+[A], [D] will "detach" your currently running screen session from the current terminal connection.
To resume a detached session: screen -r
To see the list of sessions: screen -ls
To attach without first detaching an active session: screen -x


KeyActionNotesCtrl+a cnew windowCtrl+a nnext windowI bind F12 to thisCtrl+a pprevious windowI bind F11 to thisCtrl+a "sele…

IBM Q is an industry-first initiative to build commercially available universal quantum computers for business and science.

Explore educational resources, tutorials, and experiment with quantum devices through the IBM Q Experience.

https://quantumexperience.ng.bluemix.net/qx/experience

You need a service registry where you store service information

Service discovery consists of three parts. 

You need a process that will register new services and de-register those that you stop. Finally, you need a way to retrieve service information. For example, when you deploy a new release, the registration process should store the IP address and port in the service registry. The proxy can later discover that information and use it to reconfigure itself. Some of the commonly used service registries are etcdConsul, and ZooKeeper. You can use Registrator for registering and de-registering services and confd and Consul Template for service discovery and templating.

Managing Dependencies with AWS SDK for Java – Bill of Materials module (BOM)

Managing Dependencies with AWS SDK for Java – Bill of Materials module (BOM)
Every Maven project specifies its required dependencies in the pom.xml file. The AWS SDK for Java provides a Maven module for every service it supports. To use the Java client for a service, all you need to do is specify the group ID, artifact ID and the Maven module version in the dependencies section of pom.xml.
The AWS SDK for Java introduces a new Maven bill of materials (BOM) module, aws-java-sdk-bom, to manage all your dependencies on the SDK and to make sure Maven picks the compatible versions when depending on multiple SDK modules. 
To ensure that Maven pulls in the correct version of the dependencies, import the aws-java-sdk-bom into your dependency management section and specify your project’s dependencies.

The Maven version for each dependency will be resolved to the version specified in the BOM. Notice that when you are importing a BOM, you will need to mention the type as pom and the scope as import.

Standard Directory Layout

src/main/javaApplication/Library sourcessrc/main/resourcesApplication/Library resourcessrc/main/filtersResource filter filessrc/main/webappWeb application sourcessrc/test/javaTest sourcessrc/test/resourcesTest resourcessrc/test/filtersTest resource filter filessrc/itIntegration Tests (primarily for plugins)src/assemblyAssembly descriptorssrc/siteSiteLICENSE.txtProject's licenseNOTICE.txtNotices and attributions required by libraries that the project depends onREADME.txtProject's readme

Launching an ad campaign based on video ads is good choice

People on the internet love watching videos. For this reason there is no better way to embark on a marketing campaign than to employ the use of video. With video streaming sites such as YouTube and with social media sites such as Facebook and Twitter relying heavily on video ads, launching an ad campaign based on video ads seems to be a right choice.

AWS CodeStar sample web service

buildspec.yml - this file is used by AWS CodeBuild to build the web servicepom.xml - this file is the Maven Project Object Model for the web servicesrc/main - this directory contains your Java service source filessrc/test - this directory contains your Java service unit test filestemplate.yml - this file contains the AWS Serverless Application Model (AWS SAM) used by AWS CloudFormation to deploy your application to AWS Lambda and Amazon API Gateway.

Chrome OS is the perfect Google operating system.

While built on Linux, much of Chrome OS' functionality relies on Google services. It's also been gaining more users over the years.

Chrome OS is the perfect Google operating system.

While built on Linux, much of Chrome OS' functionality relies on Google services. It's also been gaining more users over the years.

With machine learning, you can use your data to make better, faster decisions to positively impact your customers and business

More customers choose to run intelligent applications on AWS than anywhere else because of the depth and breadth of services and platforms AWS offers.

With machine learning, you can use your data to make better, faster decisions to positively impact your customers and business

More customers choose to run intelligent applications on AWS than anywhere else because of the depth and breadth of services and platforms AWS offers.

Vim is a highly configurable text-based text editor built to enable efficient text editing.

Vim is an improved version of the vi editor distributed with most UNIX systems.

Snappy Ubuntu Core is a new rendition of Ubuntu with transactional updates

Snappy Ubuntu Core is a new rendition of Ubuntu with transactional updates – a minimal server image with the same libraries as today’s Ubuntu, but applications are provided through a simpler mechanism. The snappy approach is faster, more reliable, and lets us provide stronger security guarantees for apps and users — that’s why we call them “snappy” applications.

Ubuntu Snappy supports Canonical’s AppArmor kernel security system for delivering human-friendly security. This means snappy let’s you isolate applications from one another completely. Snappy is easily extensible with frameworks like Docker – after adding a framework to your Snappy you can run apps on it.

Snappy Ubuntu Core

In their own words, “Snappy Ubuntu Core is a new rendition of Ubuntu with transactional updates – a minimal server image with the same libraries as today’s Ubuntu, but applications are provided through a simpler mechanism. The Snappy approach is faster, more reliable, and lets us provide stronger security guarantees for apps and users…” –https://developer.ubuntu.com/en/snappy/

Operating Systems for Docker EE

Choice of Operating SystemsDocker EE Engine 17.06 (which is a required prerequisite for installing UCP and included with Docker EE) is supported on the following host operating systems: RHEL/CentOS/Oracle Linux 7.1/7.2/7.3/7.4 (YUM-based systems)Ubuntu 14.04 LTS, 16.04 LTSSUSE Linux Enterprise 12For other versions, check out the official Docker support matrix.

How to use OpenSSL to validate SSL transmission

# echo 'q' | openssl s_client -host it.i88.ca -port 443
CONNECTED(00000003)
139807315842880:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:ssl/record/rec_layer_s3.c:1407:SSL alert number 40
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 254 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : 0000
    Session-ID:
    Session-ID-ctx:
    Master-Key:
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1523563655
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
    Extended master secret: no
---

How to run nmap to validate SSL transmission

nmap --script ssl-cert,ssl-enum-ciphers -p 443 it.i88.ca

Starting Nmap 7.60 ( https://nmap.org ) at 2018-04-12 20:05 UTC
Nmap scan report for it.i88.ca (104.28.28.79)
Host is up (0.0088s latency).
Other addresses for it.i88.ca (not scanned): 104.28.29.79 2400:cb00:2048:1::681c:1c4f 2400:cb00:2048:1::681c:1d4f

PORT    STATE SERVICE
443/tcp open  https
| ssl-cert: Subject: commonName=sni69294.cloudflaressl.com
| Subject Alternative Name: DNS:sni69294.cloudflaressl.com, DNS:*.2cdn.eu, DNS:*.aceitunoarts.com, DNS:*.alexwacker.com, DNS:*.alvarezperea.org, DNS:*.dwnlodit.com, DNS:*.easyhairstylesformediumhair.tk, DNS:*.fbnist.com, DNS:*.getfiles.co, DNS:*.goyun.info, DNS:*.hdgem.com, DNS:*.hhgem.com, DNS:*.hqgem.com, DNS:*.i88.ca, DNS:*.impactshared.net, DNS:*.impactvps.net, DNS:*.licensebyte.com, DNS:*.lnkmeup.com, DNS:*.miguesamana.ml, DNS:*.musiclatinoradio.ml, DNS:*.mycustom.click, DNS:*.octranspo.org, DNS:*.peliculaxd.com, DNS:*.primaria1decembrie.ro, DNS:*.radiopodersatelite.com.pe, DNS:*.reg…

Trusted End Node Security (TENS) creates a secure end node from trusted media on almost any Intel-based computer (PC or Mac).

Trusted End Node SecurityTENS boots a thin Linux operating system from removable media without mounting a local hard drive. Administrator privileges are not required; nothing is installed. TENS turns an untrusted system (such as a home computer) into a trusted network client. No trace of work activity or malware can be written to the local computer. Simply plug in your USB smart card reader to access CAC and PIV-restricted US government websites.

Free basic antivirus software for Windows and Mac

You can use Microsoft's built-in Windows Defender or Microsoft Security Essentials. Avast and AVG are among the many companies that make free basic antivirus software for Windows and Mac.

Free basic antivirus software for Windows and Mac

You can use Microsoft's built-in Windows Defender or Microsoft Security Essentials. Avast and AVG are among the many companies that make free basic antivirus software for Windows and Mac.

Google Analytics granular data retention controls allows you to manage how long your user and event data is held on our servers.

Google Analytics granular data retention controls allows you to manage how long your user and event data is held on our servers. 
User and event data will be retained according to these settings; Google Analytics will automatically delete user and event data that is older than the retention period you select. Note that these settings will not affect reports based on aggregated data

Amazon Neptune is a fast, reliable, fully-managed graph database service that makes it easy to build and run applications that work with highly connected datasets.

The core of Amazon Neptune is a purpose-built, high-performance graph database engine optimized for storing billions of relationships and querying the graph with milliseconds latency. Amazon Neptune supports popular graph models Apache TinkerPop and W3C's RDF, and their associated query languages TinkerPop Gremlin and RDF SPARQL, allowing you to easily build queries that efficiently navigate highly connected datasets. Neptune powers graph use cases such as recommendation engines, fraud detection, knowledge graphs, drug discovery, and network security.

Exporting data from LibreOffice Base

You copy a table from Base to a new Calc sheet, then you can save or export the data to any file format that Calc supports. Open the database file that contains the database table to be exported. Click Tables to view the tables, or click Queries to view the queries.Choose File - New - Spreadsheet.In the Base window, right-click the name of the table to export. Choose Copy from the context menu.Click cell A1 in the new Calc window, then choose Edit - Paste. Now you can save or export the data to many file types.

Return all rows where COLUMN contains non-ASCII characters in MySQL

select*fromTABLEwhereCOLUMN regexp '[^ -~]';

For non-printable ASCII characters such as newline.

Strip last few characters of a column in MySQL

Get rid of last 8 characters of the MySQL string. LEFT(col,length(col)-8)

Unique rows in Google spreadsheets

UNIQUE
Returns unique rows in the provided source range, discarding duplicates. Rows are returned in the order in which they first appear in the source range.

Sample Usage
UNIQUE(A2:B26)

UNIQUE({1, 2; 3, 4; 5, 6})

Firebase Cloud Messaging (FCM)

Firebase Cloud Messaging (FCM), the successor to Google Cloud Messaging (GCM).



As the next evolution of GCM, Firebase Cloud Messaging allows you to send notifications and data messages reliably to iOS, Android, and the Web at no cost. In addition, FCM provides you with new features like the easy-to-use notifications interface in the Firebase console, so you can easily target and test notifications to re-engage your users.

Firebase Cloud Messaging (FCM)

Firebase Cloud Messaging (FCM), the successor to Google Cloud Messaging (GCM).

As the next evolution of GCM, Firebase Cloud Messaging allows you to send notifications and data messages reliably to iOS, Android, and the Web at no cost. In addition, FCM provides you with new features like the easy-to-use notifications interface in the Firebase console, so you can easily target and test notifications to re-engage your users.