Facebook New Feature FACE RECOGNITION

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:

  • Find photos and video you’re in so we can help you review or share content, suggest tags and provide more relevant content and feature recommendations.
  • Help protect yourself and others from impersonation and identity misuse, and improve platform reliability.
  • Provide accessibility features by telling people with visual impairments who’s in a photo or video.

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:

  • We can notify you about photos you’re in but haven’t been tagged in.
  • We can help protect against someone using your photo to impersonate you.
  • We can tell people with visual impairments when you’re in a photo or video through a screen reader.

When this setting is off:

  • We’ll still notify you when someone tags you in a photo.
  • We won’t be able to use face recognition to help stop someone from impersonating you, but we’ll continue to work to protect your account in other ways.
  • People with visual impairments will only be told that you’re in a photo if you’re tagged.

connection timeout ubuntu apache2 | apache configuration

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 + XY 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

How to stop DDOS attacks

  • Limiting the ammount of concurrent connections from the same IP address to your Server.
  • Identifying the offending IP.
  • And kill the Ongoing TCP Connections with TCPKILL.
  • Or use Cutter to kill the connections on any port/Network interface.
  • Drop it With Iptables.
  • Make the DROP Persistant after a reboot. (iptables save and restore)
  • Basic Iptables-save trouble shoot.
  • Stop Start Iptables

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

Step 1 : Set accept all policy to all connections

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

Step 2 : Delete all existing rules.

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

SSL Certificates for Subdomains | WildCard SSL Certificates

What is Wildcard SSL Certificate?

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.

How Does Wildcard SSL Certificate Work?

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:

  • subscribe.delhijurix.com
  • payment. delhijurix .com
  • login. delhijurix .com,
  • contact. delhijurix .com

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

Issues with the Wildcard SSL Certificate

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

Why Should You Use Wildcard SSL Certificate as a Solution?

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.

HOW TO PROTECT YOUR SERVER FROM DDOS ATTACK MANUALLY

in This part i’ll show you a manually way to protect your linux server from DDOs attack , first of all when your server is going down due to a DDOS attack the first thing you need to know is the striker IP address , so to do this i have a couple of commands :

First one :

——————-

netstat -n|grep :80|awk {‘print $5’}| cut -f1 -d: | sort | uniq -c

——————-

second one :

——————-

netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

——————-

Third One :

——————-

netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n | tail


those command are basicaly to show you the stricker ip addres and to know whos attacking your server , once you use one of them u’ll have a liste contain a lot of ip addresses and beside each ip address you will notice a packets that was sent to the server , if the packets are less than 50 it means its a normal connection to your server if it was more than 100 it means that your having a DDOS attack and you must stop it

Now lets stop those kinds of attacks :

First command :

——————-

iptables -A INPUT -s 0.0.0.0 -j DROP

——————-

Second command :

——————-

iptables -I INPUT 1 -p tcp -d 0.0.0.0 –dport 80 -j DROP

——————-

NOTICE : Change The 0.0.0.0 to the attacker IP address that you wanna stop

HOW TO DETECT DDOS ATTACK ?

Monitor internal network traffic and usage of server resources, such as Domain Name Server (DNS) and web server, to detect early traffic spikes and abnormal utilisation of system resources.

Work with Internet Service Providers (ISPs) or security service providers to monitor your Internet traffic at their operation centre.

Log security events and review alerts generated by security system, such as Intrusion Detection System (IDS) or Intrusion Prevention System (IPS), anti-malware solution, Internet gateway and firewall, to detect suspicious activities.

ASCII Table

ASCII stands for American Standard Code for Information Interchange. Below is the ASCII character table, including descriptions of the first 32 characters. ASCII was originally designed for use with teletypes, and so the descriptions are somewhat obscure and their use is frequently not as intended.

Java actually uses Unicode, which includes ASCII and other characters from languages around the world.

ASCII Table

Dec  = Decimal Value
Char = Character

'5' has the int value 53
if we write '5'-'0' it evaluates to 53-48, or the int 5
if we write char c = 'B'+32; then c stores 'b'


Dec  Char                           Dec  Char     Dec  Char     Dec  Char
---------                           ---------     ---------     ----------
  0  NUL (null)                      32  SPACE     64  @         96  `
  1  SOH (start of heading)          33  !         65  A         97  a
  2  STX (start of text)             34  "         66  B         98  b
  3  ETX (end of text)               35  #         67  C         99  c
  4  EOT (end of transmission)       36  $         68  D        100  d
  5  ENQ (enquiry)                   37  %         69  E        101  e
  6  ACK (acknowledge)               38  &         70  F        102  f
  7  BEL (bell)                      39  '         71  G        103  g
  8  BS  (backspace)                 40  (         72  H        104  h
  9  TAB (horizontal tab)            41  )         73  I        105  i
 10  LF  (NL line feed, new line)    42  *         74  J        106  j
 11  VT  (vertical tab)              43  +         75  K        107  k
 12  FF  (NP form feed, new page)    44  ,         76  L        108  l
 13  CR  (carriage return)           45  -         77  M        109  m
 14  SO  (shift out)                 46  .         78  N        110  n
 15  SI  (shift in)                  47  /         79  O        111  o
 16  DLE (data link escape)          48  0         80  P        112  p
 17  DC1 (device control 1)          49  1         81  Q        113  q
 18  DC2 (device control 2)          50  2         82  R        114  r
 19  DC3 (device control 3)          51  3         83  S        115  s
 20  DC4 (device control 4)          52  4         84  T        116  t
 21  NAK (negative acknowledge)      53  5         85  U        117  u
 22  SYN (synchronous idle)          54  6         86  V        118  v
 23  ETB (end of trans. block)       55  7         87  W        119  w
 24  CAN (cancel)                    56  8         88  X        120  x
 25  EM  (end of medium)             57  9         89  Y        121  y
 26  SUB (substitute)                58  :         90  Z        122  z
 27  ESC (escape)                    59  ;         91  [        123  {
 28  FS  (file separator)            60  <         92  \        124  |
 29  GS  (group separator)           61  =         93  ]        125  }
 30  RS  (record separator)          62  >         94  ^        126  ~
 31  US  (unit separator)            63  ?         95  _        127  DEL

sms-retriever verify in android not working after update

The SMS Retriever API provides a fully automated user experience and should be used when possible. It does, however, require you to place a custom hash code in the message body, and this may be difficult to do if you’re not the sender of that message.

First download app signed certificate der from your play console account.

Then convert it to yourkeystore.keystore with keystore extension using this command:

keytool -importcert -alias nonames098 -file deployment_cert.der -keystore keystore.jks -storepass nonames098
               OR
 keytool -import -alias nonames -keystore keystore.jks -file deployment_cert.der  

Then create string hash using the created keystore.

 keytool -exportcert -alias youralias -keystore keystore.jks | xxd -p | tr -d "[:space:]" | echo -n  com.test.testapp `cat` | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11


MSU1WTd7Goy
SMS Verification APIs

Automatic SMS Verification with the SMS Retriever API

With the SMS Retriever API, you can perform SMS-based user verification in your Android app automatically, without requiring the user to manually type verification codes, and without requiring any extra app permissions. When you implement automatic SMS verification in your app, the verification flow looks like this:

  1. A user initiates SMS verification in your app. Your app might prompt the user to provide a phone number or use the Smart Lock for Passwords hint selector if that information wasn’t required to create the user’s account.
  2. Your app makes a request to your server to verify the user’s phone number. Depending on what information is available in your user database, this request might include the user’s ID, the user’s phone number, or both.
  3. At the same time, your app calls the SMS Retriever API to begin listening for an SMS response from your server.
  4. Your server sends an SMS message to the user that includes a one-time code to be sent back to your server, and a hash that identifies your app.
  5. When the user’s device receives the SMS message, Google Play services uses the app hash to determine that the message is intended for your app, and makes the message text available to your app through the SMS Retriever API.
  6. Your app parses out the one-time code from the message text and sends it back to your server.
  7. Your server receives the one-time code from your app, verifies the code, and finally records that the user has successfully verified their account.

HTTP to HTTPS and HTTPS to HTTP redirect in php/laravel without htaccess

HTTP to HTTPS


<?php
//echo empty($_SERVER['HTTPS']);
if(empty($_SERVER['HTTPS'])) {
$redirect= "https://www".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
//header("location:$redirect"); //php
return redirect()->to($redirect)->send(); //laravel
}
?>

HTTPS to HTTPS


<?php
//echo empty($_SERVER['HTTPS']);
if(!empty($_SERVER['HTTPS'])) {
$redirect= "http://www".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
//header("location:$redirect"); //php
return redirect()->to($redirect)->send(); //laravel
}
?>

how to check user load on ubuntu

different commands to check the load average in linux.Loadaverage is the system load,which is a measure of the amount of computational work that a computer system performs.When you run the command in output,you will see one, five, and fifteen minute moving load average of the system.The practical of load average command is done in Red Hat,CentOS,Ubuntu and Debian system.

ubuntu@ip-172-31-93-130:/$  cat /proc/loadavg
0.00 0.00 0.00 2/196 7337
ubuntu@ip-172-31-93-130:/$
ubuntu@ip-172-31-93-130:/$ w
 10:47:40 up  3:28,  1 user,  load average: 0.06, 0.02, 0.00
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
ubuntu   pts/0    49.36.134.191    07:19    4.00s  0.16s  0.00s w
ubuntu@ip-172-31-93-130:/$
ubuntu@ip-172-31-93-130:/$ uptime
 10:48:42 up  3:29,  1 user,  load average: 0.02, 0.01, 0.00
ubuntu@ip-172-31-93-130:/$
ubuntu@ip-172-31-93-130:/$ top
top - 10:49:24 up  3:30,  1 user,  load average: 0.01, 0.00, 0.00
Tasks: 120 total,   1 running,  79 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.2 sy,  0.0 ni, 99.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 15650116 total, 14640708 free,   479316 used,   530092 buff/cache
KiB Swap: 16777212 total, 16777212 free,        0 used. 14870788 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
    1 root      20   0  159732   8980   6676 S   0.0  0.1   0:03.37 systemd
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kthreadd
    4 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 kworker/0:0H
    6 root       0 -20       0      0      0 I   0.0  0.0   0:00.00 mm_percpu_wq
    7 root      20   0       0      0      0 S   0.0  0.0   0:00.13 ksoftirqd/0

what is meaning of www-data:www-data

security

The files are not world writeable. They are restricted to the owner of the files for writing.

The web server has to be run under a specific user. That user must exist.

If it were run under root, then all the files would have to be accessible by root and the user would need to be root to access the files. With root being the owner, a compromised web server would have access to your entire system. By specifying a specific ID a compromised web server would only have full access to its files and not the entire server.

If you decide to run it under a different user ID, then that user would need to be the effective owner of the files for proper privileges. It could be confusing to have personal ownership of system-wide files to your personal account.

Creating a specific user would make it easier to recognize the files and consistent to recognize which ID to chown to new files and folders added to the site.

The Userid or Name of the owner doesn’t matter. Whatever is chosen or decided upon will have to be configured in the web server configuration files.

By default the configuration of the owner is www-data in the Ubuntu configuration of Apache2. Since that is the default configuration, you conveniently know the ownership needed for your web files. If you change it, you would have to change the files in your site to match.