March 21, 2020 in MySql, Tips and Tricks
convert varchar to int in select query order by
Sql Server query varchar data sort like int
MySQL ABS() returns the absolute value of a number.
SELECT * FROM MyTable ORDER BY ABS(MyCol) DESC;
March 21, 2020 in MySql, Tips and Tricks
MySQL ABS() returns the absolute value of a number.
SELECT * FROM MyTable ORDER BY ABS(MyCol) DESC;
March 8, 2020 in MySql, Tips and Tricks
I have a pre-existing table, containing ‘fname’, ‘lname’, ’email’, ‘password’ and ‘ip’. But now I want an auto-increment column id. However, when I enter:
ALTER TABLE `myTable` ADD COLUMN `id` INT AUTO_INCREMENT UNIQUE FIRST;
March 2, 2020 in Tips and Tricks, Ubuntu
uninstall or removes an installed varnish package itself from Ubuntu
$ sudo apt-get remove varnish
remove varnish and it’s dependent packages which are no longer needed
$ sudo apt-get remove --auto-remove varnish
use with purge options to varnish package all the configuration and dependent packages will be removed
$ sudo apt-get purge varnish
purge options along with auto remove, will be removed everything regarding the package
$ sudo apt-get purge --auto-remove varnish
Email : adityaypi@yahoo.com, Mobile : +91-9555699081
February 26, 2020 in Tips and Tricks
You can add a promotional video to your store listing by entering a YouTube URL in the “Promo video” field. A promo video isn’t required, but it’s highly recommended as a fun, engaging way to show features of your app to potential users.
Here are the most important things to keep in mind when adding a promo video:
https://www.youtube.com/watch?v=yourvideoidhttps://youtu.be/yourvideoidDevelopers with a video in their store listing must disable ads by November 1, 2019 to keep the video eligible to be shown on Google Play. If your videos are monetized (that is, enabled for monetization on YouTube or containing copyrighted content with monetization claims), they may show ads, which can be confusing for users.
To keep your video active, you’ll need to:
Please note that if your video uses copyrighted content, turning off monetization for your video may not be enough to prevent ads. In that case you will need to use a different video without copyrighted content with monetization claims.
If your video is monetized or uses copyrighted content and you do nothing, your video will no longer play on your store listing after November 1, 2019.
Your promo video is displayed before your screenshots on your app’s store listing and promotional areas on Google Play. Users can watch your promo video by selecting the Play button that overlays on your feature graphic.
screenrecord to capture video directly from your device.February 26, 2020 in Tips and Tricks
To publish an app and have it be featured anywhere on Google Play, a feature graphic is required. Your feature graphic is a powerful tool to show off your creative assets and attract new users.
Important: To display a feature graphic on your app’s store listing, you also need to add a promo video.
Requirements
Your feature graphic is displayed before your screenshots on your app’s store listing. If you’ve added a promo video, a Play button will overlay on your feature graphic so users can watch your promo video.
February 22, 2020 in Free Website Submission, Tips and Tricks, Ubuntu
ubuntu@nonames:/etc$ hostname --fqdn
nonames.com
ubuntu@nonames:/etc$
Setting your hostname:
/etc/hostname with your new hostname.sudo hostname $(cat /etc/hostname).Setting your domain:
/etc/resolvconf/resolv.conf.d/head, you’ll add then line domain your.domain.name (not your FQDN, just the domainname).sudo resolvconf -u to update your /etc/resolv.conf (alternatively, just reproduce the previous change into your /etc/resolv.conf).Both:
Finally, update your /etc/hosts file. There should be at least one line starting with one of your IP (loopback or not), your FQDN and your hostname. grepping out ipv6 addresses, your hosts file could look like this:
127.0.0.1 localhost
1.2.3.4 service.domain.com service
ubuntu@nonames:/etc$ hostnamectl
Static hostname: nonames.com
Icon name: computer-vm
Chassis: vm
Machine ID: 0edddc7ee9394aec8b44c30670b611c5
Boot ID: 4bdaebcdf36a487792fc02abf1a6b958
Virtualization: xen
Operating System: Ubuntu 18.04.3 LTS
Kernel: Linux 4.15.0-1060-aws
Architecture: x86-64
February 12, 2020 in News, Tips and Tricks
Please review the face recognition setting
Your face recognition setting is off. We want to let you know what face recognition is and how we use it, and then you can decide whether to turn it on or keep it off.How we use face recognition
If you turn this setting on, we’ll create your face recognition template and use it in the following types of ways:
What we collect
Face recognition is a technology that analyses photos and videos you’re in to calculate a unique number, called a “template”. When your face recognition setting is on, we create and use your template to compare it to analyses of other photos or videos to recognise if you appear in that content.
We don’t share your template with anyone. We’ll keep your template while your account is active but will delete it if you turn your face recognition setting off.

Do you want to turn on the face recognition setting?
To understand how we use face recognition, please see the previous page. These examples help explain how your experience changes if you turn the setting on or keep it off. You can always manage this later in Settings.When this setting is on:
When this setting is off:

February 11, 2020 in Tips and Tricks, Ubuntu
Make a copy of the default Apache Configuration file
$ sudo cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf.bk
Edit the Configuration file
$ sudo nano /etc/apache2/apache2.conf
Changing the KeepAlive directives
Scroll down on the page until you see the below directives:
KeepAlive On: When set to ‘On’ Apache will allow persistent connections. This means more than one connection will be allowed per request. You should set this value to ‘On’ if it was set to ‘Off’ to activate KeepAlive on your server.
MaxKeepAliveRequests: This represents the maximum number of connections that should be allowed on your web server when KeepAlive is enabled.
You can set the value to ‘0’ for unlimited connections but this is not recommended. The default value is ‘100’ and this can work for most websites but you can keep this number high depending on the number of users visiting your website.
KeepAliveTimeout: This directive represents the number of seconds to wait for another request from the same client using the same connection. The default value is ‘5’ seconds.
Setting a high value on this directive may lead to a lot of idle connections and can degrade the performance of your server. So only adjust this value when users experience a lot of aborted connections when browsers try to establish connections to closed sessions.
Remember to press CTRL + X, Y and Enter to save the changes. Then, you need to restart Apache for the changes to take effect using the command below:
$ sudo systemctl restart apache2
February 10, 2020 in Tips and Tricks
How to limit the amount of concurrent connections from the same IP address.
This will prevent the simpler DDOS attacks.
$ iptables -I INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --set
$ iptables -I INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --update --seconds 60 --hitcount 10 -j DROP
$ iptables-save >/etc/iptables.up.rules
How to identify the IP that is attacking you
Issue the following command
$ netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
It will show a list of the current active connections by IP address and the offending IP is usually the one with a high number of connections:
1 127.0.0.1
1 Address
1 servers)
132 201.119.167.193
In the example above the first number is the number of connections followed by the Originating IP address, the results of the netstat command used are sorted by number of connections so your offender is usually at the end, (note that there maybe several offending IPs most of the times from anonymous proxies)
In this case the offending IP is the one with 132 connections.
How to reset iptables to default settings
Using below set of command you will set accept rule for all type of connections.
# iptables -P INPUT ACCEPT
# iptables -P OUTPUT ACCEPT
# iptables -P FORWARD ACCEPT
Using below set of commands, delete your currently configured rules from iptables.
# iptables -F INPUT
# iptables -F OUTPUT
# iptables -F FORWARD
Or you can do it in single command –
# iptables -F
February 10, 2020 in Tips and Tricks
The best way to secure and protect sub-domains can be accomplished through the use of a Wildcard SSL Certificate. These certificates offer convenience and affordability by use of a public key certificate which can be used with multiple sub-domains of a domain. Therefore, instead of purchasing and administering several separate SSL Certificates for each sub-domain, a business can utilize a Wildcard SSL Certificate.
While Wildcard SSL Certificates provide versatility, only a single level of sub-domain matching is supported. For example, the use of *.company.com Wildcard could be:
Although, during the installation process there have been recommendations on changing the Wildcard domain names to match the actual account domain name (not installing as *.company.com). It is possible to have a Wildcard SSL Certificate installed to more than one sub-domain on a single IP address.
However, If you attempt to update a Wildcard SSL Certificate, the single IP address method might not be retained when the Wildcard is installed to more than one sub-domain on a single IP address. If there is no manual configuration then each sub-domain or domain will need its own dedicated IP address. A CPanel can be used for easier management over dedicated IP addresses when each site needs its own IP for SSL.
The WHM menu path which is used to install SSL Certificates is:
WHM: Main>>SSL/TLS>> Install an SSL Certificate and Setup the Domain
1. Copy and paste the Wildcard SSL Certificate into the first text area
2. Permit the rest of the text area to be filled automatically
3. Confirm that the SSL Key and CA bundle are accurate
4. Switch the Wildcard domain name to match the actual account domain name
5. Double check that the username and IP address match the actual account involved
Some mobile devices might not be able to connect because of authentication issues if they do not trust the certificates (because the certificate is not trusted by the customer’s browser). To help prevent this error it is best to use a trusted provider of Wildcard SSL Certificates that issues a certificate the user’s browser will rely on. Basic browsers that do not support “Certificate Request” may have problems because the certificate appears invalid due to lack of verification. Intermediate Certificates are used to connect an SSL Certificate to a trusted root certificate. Commercial Certificates have the trusted root certificate built in.
Although many platforms, devices, servers, services work well with the Wildcard SSL Certificates, there are some that are incompatible such as:
* Microsoft Office Communications Server
* Microsoft Lync Server
* Oracle Wallet Manager
* Windows Mobile 5 Devices
There are different products which can be used to provide SSL for websites. It is important to consider which domains and sub-domains need to be protected, how they can best be protected, and what cost is affordable for the business. A Wildcard SSL Certificate is a versatile tool, although it does have its limitations. IT Professionals and Web Security Experts should consider the effectiveness of the Wildcard SSL Certificate in providing the security they need in the areas that they desire.
Money can be saved when using a wildcard SSL certificate multiple level subdomains by avoiding the individualized costs of other various certificates. So long as the Wildcard has been properly installed it is a great resource in providing easier web security administration in a cost-effective manner. As mentioned before, the Wildcard SSL Certificate will only apply to those servers which are compatible and only to secure and protect sub-domains. There are other options if protection is needed for various domain names. The wildcard SSL certificate is compatible with all major web servers like Apache, NGINX, IIS, Fortigate, Zimbra, Tomcat, Linux, and more.