Showing posts from January, 2020

Digital Marketing

Google Earth on mobile

Google Earth on mobile can now display space and the stars around the planet

Google Safe Browsing API

Google Safe Browsing API  lets your client applications download hashed versions of the Safe Browsing lists for storage in a local database. URLs can then be checked locally. Only if a match is found in the local database does the client need to send a request to the Safe Browsing servers to verify whether the URL is included on the Safe Browsing lists.

Google App Engine PHP Runtime

It is no longer necessary to whitelist your application for deployment. Developers interested in the PHP runtime now can create an account and deploy PHP applications immediately .

How to Find and kill a process in Linux

For example, to show all the process IDs of mysql-workbench:  $ ps -A | grep [m]ysql-workbench | awk '{print $1}' The sample outpout: 12974 12982 The awk gives you the first field of each line, which is the PID. The grep filters that based on your search string. [m]ysql-workbench is a trick that applies regex. It will then catch all other mysql-workbench processes but excluding grep itself.  If you use "grep mysql-workbench" directly, the process of grep itself will be caught too. Since [m]ysql-workbench != mysql-workbench, the process of grep will be excluded. To kill them in one line: $ kill $(ps -A | grep [m]ysql-workbench | awk '{print $1}')  (more reliable) The $(x) is to execute x then put its output on the command line. So you end up with a command like "kill 12974 12982". Or even simpler : $ kill $( ps - A | awk '/[m]ysql-workbench/ {print $1}' )

How to install New Relic Java agent to Glassfish

For Glassfish, you need to unpack into your domain's directory, such as /opt/glassfish3/glassfish/domains/domain1/

Child themes for wordpress

Child themes are the recommended way of making modifications to a Wordpress theme. To Make your WordPress child theme compatible with BuddyPress, you need to download and activate the BuddyPress Template Pack plugin. Then head over to admin dashboard > Appearance > BP Compatibility panel, and follow the steps.

Operator Difference: "MEMBER OF" vs "IN" in JPA

JPA distinguishes between the MEMBER OF operator, which should be used for checking a collection field , and the IN operator, which should be used for checking other collections, such as a collection that is passed to the query as a parameter. For example: 'fido' MEMBER OF person.dogs 'fido' IN :dogs

The 20 most expensive keywords in Internet Ad

The highest search volume (i.e. the most used keywords) and highest costs per click, thereby netting Google the most money, are: Insurance (example keywords in this category include "buy car insurance online" and "auto insurance price quotes") Loans (example keywords include "consolidate graduate student loans" and "cheapest homeowner loans") Mortgage (example keywords include “refinanced second mortgages” and “remortgage with bad credit”) Attorney (example keywords include “personal injury attorney” and “dui defense attorney”) Credit (example keywords include “home equity line of credit” and “bad credit home buyer”) Lawyer ("personal  injury lawyer," "criminal defense lawyer) Donate ("car donation centers," "donating a used car") Degree ("criminal justice degrees online," "psychology bachelors degree online") Hosting ("hosting ms exchange," "managed web hosting solu

How to fix: Error: schema com.canonical.notify-osd not installed

use Synaptics and search for notify-osd. Install it.

How to drop database with # in name in MySQL

By default any folders inside the mysql data directories will be read as database and will be shown in "show databases". You can escape database names using backtick quotes to drop it: DROP DATABASE `#mysql50#lost+found`;

Reads from Amazon DocumentDB replicas are eventually consistent.

 Reads from Amazon DocumentDB replicas return the data in the same order as it was written on the primary, and there is often less than a 50 ms replication lag. You can monitor the replica lag for your cluster using the Amazon CloudWatch metrics DBInstanceReplicaLag and DBClusterReplicaLagMaximum. 

How to choose the location for your business

You can choose a location for your business that suits your needs, whether that means working from home, working close to home, or taking the opportunity to travel and see different places.  You might choose a trendy downtown office, or a place outside the city to avoid traffic or a long commute. While you have a lot of flexibility in choosing a location, you should take into account access to customers, employees and suppliers.

How to fix MySQL workbench: statement may be truncated

Edit -> Preferences -> SQL Execution -> Max. Field Value Length to Display. Default 256 bytes

Simple example to access Gmail by Java

To show the folders and their message counts: Properties props = System . getProperties (); props . setProperty ( "mail.pop3.port" , prop . getProperty ( "995" )); Session session = Session . getInstance ( props , null ); Store store = session . getStore ( "imaps" ); store . connect ( "" , "name" , "password" ); javax . mail . Folder [] dfolders = store . getDefaultFolder (). list ( "*" ); for ( Folder f : dfolders ) { System . out . println ( f . getFullName ()); if (( f . getType () & amp ; javax . mail . Folder . HOLDS_MESSAGES ) != 0 ) { System . out . println ( f . getMessageCount ()); } } On github The output: INBOX 25 [Gmail] [Gmail]/All Mail 69 [Gmail]/Drafts 0 [Gmail]/Important 1 [Gmail]/Sent Mail 6 [Gmail]/Spam 4

How to solve: Form submit does not trigger action method on JSF commandlink or commandbutton

First, make sure those commandlink or commandbutton is inside the <h:form> and </h:form> If still not woking, check whether you have "rendered" or "disabled" attribute for that component and your bean is request scope. You should change it from request scope to view scope. This is because if your bean is request scope, your "rendered" or "disabled" attributes are evaluated in different condition during processing the form submit from during displaying the form. JSF won't invoke the command if "rendered" or "disabled" attribute evaluates as "false".

Database Lifecycle

The life-cycle of a database instance includes creating, modifying, maintaining and upgrading, performing backups and restores, rebooting, and deleting the instance.

Finds AWS database instance name and class

The following command finds AWS database instance name and class for up to 100 instances. # aws docdb describe-db-instances     --query 'DBInstances[*].[DBInstanceIdentifier,DBInstanceClass]' | less

Amazon DocumentDB storage automatically scales with the data in your cluster volume.

As your data grows, your cluster volume storage grows in 10 GiB increments, up to 64 TiB. The size of your cluster volume is checked on an hourly basis to determine your storage costs.

How to fix MySQL Warning: Using a password on the command line interface can be insecure

The mysql_config_editor utility (available as of MySQL 5.6.6) enables you to store authentication credentials in an encrypted login file named .mylogin.cnf. The file location is the %APPDATA%\MySQL directory on Windows and the current user's home directory on non-Windows systems. The file can be read later by MySQL client programs to obtain authentication credentials for connecting to MySQL Server. mysql_config_editor set --login-path=local --host=localhost --user=username --password Then you can use in your shell script: mysql --login-path=local  instead of: mysql -u username -p pass  You need to put -- login-path as the first parameter , or else you will get something similar to "unknown variable 'login-path=local'" SET shell> mysql_config_editor set --login-path=local          \ --host=localhost --user=localuser --password Enter password: enter password "localpass" here shell> mysql_config_editor set --login-path=remote

SEO: The description is missing in the head section of the page

The description is missing in the head section of the page Search engines may use the description provided in the <description> tag in the search engine results page (SERP). A well-written description that pertains to the content of the page and that is relevant to the searcher's intent can help you increase traffic since it can help improve the click-through rate of your page in search. Recommended Action: Add a description to the <head> section of the page source: <meta name="description" content="Descriptive, keyword-rich text that talks about the page content goes here.">.

How to install Apple Mobile Device USB Driver in Windows

Sometimes Windows chooses the best driver for you and it doesn't choose Apple Mobile Device USB Driver for your iPhone or iPad. Then you need to install the driver manually. Or else you won't be able to sync your iPhone or iPad to your iTunes. App Screen and Options to Sync Apps Are Grayed Out in iTunes. Inside "Device Manager" Expand all the sections labeled below (not all sections might be listed): Imaging Devices Other Devices Portable Devices Universal Serial Bus Controllers Look for the entry that recognizes the device as a camera. This entry should be called Apple iPhone, Apple iPad, or Apple iPod. Right-click the Apple iPhone, Apple iPad, or Apple iPod entry in Device Manager and choose Update Driver from the shortcut menu. Click "Browse my computer for driver software". Click "Let me pick from a list of device drivers on my computer". Click the Have Disk button. (If the Have Disk option is not present, choose a device cat

How to fix Android Studio: Unable to run mksdcard SDK tool

To fix it on 64 bit Ubuntu: sudo apt-get install lib32z1 lib32ncurses5  lib32stdc++6

How to change Google cloud SQL timezone

See also: How to Configure a MySQL flag for a Google Cloud SQL instance Change MySQL Flag  default_time_zone to the value you want. For example, to change to Eastern Standard time: change default_time_zone to -05:00

How to avoid corrupted binlogs on MySQL

To avoid corrupted binlogs on the MySQL, enabling sync_binlog=1 on MySQL helps in most cases. sync_binlog=1 will synchronize the binary log to disk after every commit. sync_binlog makes MySQL perform on fsync on the binary log in addition to the fsync by InnoDB. As a reminder, it has some cost impact as it will synchronize the write-to-binary log on disk after every commit. On the other hand, sync_binlog=1 overhead can be very minimal or negligible if the disk subsystem is SSD along with battery-backed cache (BBU). You can read more about this here in the  manual. sync_binlog is a dynamic option that you can enable on the fly. Here’s how: Shell 1 mysql - master > SET GLOBAL sync_binlog = 1 ; To make the change persistent across reboot, you can add this parameter in my.cnf.

Java Apache asynchronous HttpClient REST (RESTful) client example

See also: Apache HttpClient asynchronous HTTP request / response Simple Example

Flurry - Analytics Measure, track and analyze app performance, user acquisition and activity with Flurry Analytics.

Unlock App Growth Flurry empowers product, development and growth experts to build better apps that users love. Use Flurry to supercharge app engagement, run a data-driven product iteration process and boost user acquisition efforts. Easily track installs, sessions, time spent, and more Understand your audience and how they use your app Run on-demand analysis with Explorer for funnels, cohorts and more Big insights Gain insight into your user’s age, gender, and behavior. Benchmark your app’s Session Length, Frequency of Use and Retention against all Flurry clients. Compare your app to those in any app store category. Flurry Analytics Explorer Perform even more complex queries with Explorer, an easy-to-use data exploration interface that returns insights in seconds. No need to write code, build queries or wait for calculations.  Free Flurry Analytics is free at any scale and available for iOS, Android, Blackberry, Windows Phone, and mobile web.

Simple OAuth Java lib Scribe Twitter Example

< dependency > < groupId >org.scribe</ groupId > < artifactId >scribe</ artifactId > < version >1.3.7</ version > // please use always the latest version </ dependency >

Simple OAuth Java lib Scribe Linkedin Example

< dependency > < groupId >org.scribe</ groupId > < artifactId >scribe</ artifactId > < version >1.3.7</ version > <!--please use always the latest version--> </ dependency >


The  SIGTERM  signal is a generic signal used to cause program termination. Unlike  SIGKILL , this signal can be blocked, handled, and ignored. It is the normal way to politely ask a program to terminate. The shell command  kill  generates  SIGTERM  by default. The  SIGKILL  signal is used to cause immediate program termination. It cannot be handled or ignored, and is therefore always fatal. It is also not possible to block this signal. This signal is usually generated only by explicit request. Since it cannot be handled, you should generate it only as a last resort, after first trying a less drastic method such as  C-c  or  SIGTERM . If a process does not respond to any other termination signals, sending it a  SIGKILL  signal will almost always cause it to go away. In fact, if  SIGKILL  fails to terminate a process, that by itself constitutes an operating system bug which you should report. The system will generate  SIGKILL  for a process itself under some unusual condit

How to Configure RAID vdisk using Dell Dell OpenManage Server Administrator (OMSA) CLI

Configuring RAID vdisk using Dell Dell OpenManage Server Administrator (OMSA) CLI 1. Install the omsa on a dell system: >wget -q -O - | bash Downloading GPG key: Key already exists in RPM, skipping Downloading GPG key: Key already exists in RPM, skipping Write repository configuration Downloading repository RPM Installing repository rpm: -omsa-repository-2-5.noarch.rpm Installing yum plugins for system id Loaded plugins: dellsysid, security dell-omsa-indep | 1.9 kB 00:00 dell-omsa-specific

Dell OpenManage Server Administrator

Dell OpenManage Server Administrator (OMSA) provides a comprehensive, one-to-one systems management solution in two ways: from an integrated, web browser-based graphical user interface (GUI) and from a command line interface (CLI) through the operating system. Server Administrator is designed for system administrators to manage systems locally and remotely on a network. It allows system administrators to focus on managing their entire network by providing comprehensive one-to-one systems management. What type of tasks can be performed using OMSA? View the server’s hardware configuration Check for hardware errors Check for firmware updates Replace or reconfigure storage See also: How to Access OMSA from web browser

How to enable NetBeans modules

Tools -> Plugins -> Installed -> Activate. You have to install it first if it is not available inside "Installed".

Request body and Length limit to share on Linkedin by API

POST Request body Field Description Max Length (chars) content A collection of fields describing the shared content. title The title of the content being shared. 200 description The description of the content being shared. 256 submitted-url A fully qualified URL for the content being shared. n/a submitted-image-url A fully qualified URL to a thumbnail image to accompany the shared content. The image should be at least 80 x 150px for best results. n/a comment A comment by the member to associated with the share. If none of the above content parameters are provided, the comment must contain a URL to the content you want to share.  If the comment contains multiple URLs, only the first one will be analyzed for content to share. 700 visibility A collection of visibility information about the share. code One of the following values: anyone:  Share will be visible to all members. connections-on

Example of HtmlUnit: login to Twitter

angular-seed — the seed for AngularJS apps

Angular-seed is an application skeleton for a typical AngularJS web app. You can use it to quickly bootstrap your angular webapp projects and dev environment for these projects. The seed contains a sample AngularJS application and is preconfigured to install the Angular framework and a bunch of development and testing tools for instant web development gratification. The seed app doesn't do much, just shows how to wire two controllers and views together.

How to fix MySQL: ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 2

This is likely because the client is being denied to access the MySQL server. Check the server firewall .  If you are restricting connections, make sure this line is in /etc/hosts.allow: mysqld: ALL Or check if the host is listed in /etc/hosts.deny.

How to Combine Multiple RSS Feeds with Google Scripts

This Google Script takes 2 or more RSS feeds and mashes them up into a JSON feed that you can call from an external app by publishing the script as a web app. Internally, the script uses URLFetchApp to fetch the XML feed and parses it using the Xml service. This can also be used for single widgets that output data from multiple RSS feeds.

Different ways of targeting AdWords ads

AdWords offers different ways of targeting: Keywords:  Words or phrases relevant to your products and service, which are used to show your ads when customers search for those terms or visit relevant websites. Ad location:  Show your ads on search engines, commercial sites, or personal sites. Age, location, and language:  Choose the age, geographic location, and language of your customers. Days, times, and frequency:  Show your ads during certain hours or days of the week, and determine how often your ads appear. Devices:  Your ads can appear on all types of devices, and you can fine-tune which devices your ads appear on and when.

Apache HttpClient asynchronous HTTP request / response Simple Example

< dependencies > < dependency > < groupId > org.apache.httpcomponents </ groupId > < artifactId > httpcore </ artifactId > < version > 4.4.3 </ version > < type > jar </ type > </ dependency > < dependency > < groupId > org.apache.httpcomponents </ groupId > < artifactId > httpclient </ artifactId > < version > 4.5 </ version > < type > jar </ type > </ dependency > < dependency > < groupId > org.apache.httpcomponents </ groupId > < artifactId > httpasyncclient </ artifactId > < version > 4.1 </ version > </ dependency > </ dependencies >