Display country, region, city using ip address in php

	$ipaddress = $_SERVER['REMOTE_ADDR'];
		//$ipaddress='203.115.97.180';
		//$json       = file_get_contents("http://ip-api.com/json");
	//$json       = file_get_contents("http://ipinfo.io/{$ipaddress}");
	//$json       = file_get_contents("http://ipinfo.io/{$ipaddress}");
		$json       = file_get_contents("http://ip-api.com/json/".$ipaddress);
		$details    = json_decode($json);
		$data['countryCode']=$details->countryCode;
		$data['region']=$details->region;
		$data['city']=$details->city;

how to run opencart admin url using curl command without token

Path admin/controller two files contain variable $ignore in the master branch in both login.php and permission.php

<?php
class ControllerStartupLogin extends Controller {
	public function index() {
		$route = isset($this->request->get['route']) ? $this->request->get['route'] : '';

		$ignore = array(
			'common/login',
			'common/forgotten',
			'common/reset',
			'aditya/product_low_quantity'
		);

		// User
		$this->registry->set('user', new Cart\User($this->registry));

		if (!$this->user->isLogged() && !in_array($route, $ignore)) {
			return new Action('common/login');
		}

		if (isset($this->request->get['route'])) {
			$ignore = array(
				'common/login',
				'common/logout',
				'common/forgotten',
				'common/reset',
				'error/not_found',
				'error/permission',
				'aditya/product_low_quantity'
			);

			if (!in_array($route, $ignore) && (!isset($this->request->get['user_token']) || !isset($this->session->data['user_token']) || ($this->request->get['user_token'] != $this->session->data['user_token']))) {
				return new Action('common/login');
			}
		} else {
			if (!isset($this->request->get['user_token']) || !isset($this->session->data['user_token']) || ($this->request->get['user_token'] != $this->session->data['user_token'])) {
				return new Action('common/login');
			}
		}
	}
}
<?php
class ControllerStartupPermission extends Controller {
	public function index() {
		if (isset($this->request->get['route'])) {
			$route = '';

			$part = explode('/', $this->request->get['route']);

			if (isset($part[0])) {
				$route .= $part[0];
			}

			if (isset($part[1])) {
				$route .= '/' . $part[1];
			}

			// If a 3rd part is found we need to check if its under one of the extension folders.
			$extension = array(
				'extension/advertise',
				'extension/dashboard',
				'extension/analytics',
				'extension/captcha',
				'extension/extension',
				'extension/feed',
				'extension/fraud',
				'extension/module',
				'extension/payment',
				'extension/shipping',
				'extension/theme',
				'extension/total',
				'extension/report',
                'extension/openbay'
			);

			if (isset($part[2]) && in_array($route, $extension)) {
				$route .= '/' . $part[2];
			}

			// We want to ingore some pages from having its permission checked.
			$ignore = array(
				'common/dashboard',
				'common/login',
				'common/logout',
				'common/forgotten',
				'common/reset',
				'error/not_found',
				'error/permission',
				'aditya/product_low_quantity'
			);

			if (!in_array($route, $ignore) && !$this->user->hasPermission('access', $route)) {
				return new Action('error/permission');
			}
		}
	}
}

After that run command

curl “https://yourdomain.in/administer/?route=aditya/myurl”

if curl not installed, please install

$ sudo apt update
$ sudo apt install curl
$ curl

php upgrade to 7.4 apache

Add PPA for PHP 7.4

Add the ondrej/php which has PHP 7.4 package and other required PHP extensions.

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

Once you have added the PPA you can install PHP 7.4.

Install PHP 7.4 for Apache

Execute the following command to install PHP 7.4

sudo apt install php7.4

Install PHP 7.4 Extensions

Installing PHP extensions are simple with the following syntax.

sudo apt install php7.4-extension_name

Now, install some commonly used php-extensions with the following command.

sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y

After the installation has completed, you can confirm the installation using the following command

php -v

Enable PHP 7.4 for Apache

Now you need to tell Apache to use the installed version of PHP 7.4 by disabling the old PHP module (below I have mentioned php7.0, you need to use your current php version used by Apache) and enabling the new PHP module using the following command.

sudo a2dismod php7.0
sudo a2enmod php7.4

Restart Apache for the changes to take effect.

sudo service apache2 restart

change default auto login user in ubuntu

sudo leafpad /etc/lxdm/default.conf
sudo leafpad /etc/lightdm/fileexample.conf

In the fist few line, you will see something like autologin=username change it to the original state of # autologin=dgod. Save the file, and then reboot your machine.

autologin-user=username
autologin-user-timeout=0

Using privileged admin account open up terminal or your favorite text file editor and edit the /etc/gdm3/custom.conf configuration file. Change from:

[daemon]
# Uncoment the line below to force the login screen to use Xorg
#WaylandEnable=false

# Enabling automatic login
#  AutomaticLoginEnable = true
#  AutomaticLogin = user1

Soa Technology

Android 12 might allow sharing Wi-Fi passwords with Nearby Share

Android 11 is still rolling out to eligible devices around the world months after Google first rolled out the update to the Pixels last September, but the company is already hard at work putting together the next exciting release – Android 12. We’re now seeing tidbits of Google’s planned features for the next version that will land later this year, including improvements to Wi-Fi setup.

Earlier today, we reported that Android 12 will likely include a feature titled Restricted Networking Mode, as part of changes to iptables, the firewall utility for Android and Linux, to allow only certain apps which have the “use restricted network permission” to use the network.

Another feature has now been discovered by XDA, which is essentially an improvement to the ability to share Wi-Fi networks introduced in Android 10. As of today, users running Android 10 or Android 11 could simply share their Wi-Fi networks via an automatically generated QR code, which the recipients would scan to join instead of typing the password.

However, this is not ideal for most situations, such as when you’re hosting a party at home and don’t really want to print the QR code for everyone to see – or have to keep opening your phone’s Wi-Fi settings and hoping the other person has a QR-code scanner. Google is working on an extension to the AirDrop-like Nearby Share feature that was introduced on Android phones last year, to allow secure sharing of Wi-Fi passwords.

The feature should involve a change to the Wi-Fi sharing option to allow sending the code to any compatible device discoverable by Nearby Share in the vicinity. You can even use this to share Wi-Fi passwords while physically separated by a big group of people, like a gathering at home, without alerting anyone else.

While we still don’t know if this feature will actually make it into Android 12 or appear as a feature update to Nearby Services on Google Play Services, one immediate and obvious benefit of using this method is that your recipient doesn’t need to be on the latest version of Android. Since Nearby Share works on all Android devices running Android Marshmallow (6.0) and above, the feature should be supported out of the box when it is released in September.

sourceby:way2infone

If you forgot the passcode on your iPad, or your iPad is disabled

If you enter the wrong passcode too many times, you’ll see a message that your iPad is disabled. If you can’t remember your passcode, you need to erase your iPad, which deletes your data and settings, including the passcode.

If you backed up your iPad, you can restore your data and settings after restoring your iPad. If you never backed up your iPad before you forgot your passcode, you won’t be able to save the data on your iPad. Follow the steps below to remove your passcode.

Remove the passcode on an iPad that has Face ID

  1. Make sure that your iPad isn’t connected to your computer.
  2. Press and hold the Top button and either volume button until the power off slider appears. Drag the slider to turn off your iPad. Then connect your iPad to your computer while holding the Top button. Keep holding the Top button until you see the recovery mode screen.

If you backed up your iPad, after you remove the passcode,

Remove the passcode on an iPad that has a Home button

  1. Make sure that your iPad isn’t connected to your computer.
  2. Press and hold the Top button until the power off slider appears. Drag the slider to turn off your iPad. Then connect your iPad to your computer while holding the Home button. Keep holding the Home button until you see the recovery mode screen.

If you backed up your iPad, after you remove the passcode

Restore your iPad

  1. Locate your iPad on your computer. When you see the option to Restore or Update, choose Restore. The Finder or iTunes will download software for your iPad. If it takes more than 15 minutes, your iPad will exit recovery mode and you’ll need to repeat the steps above to remove your passcode.

Wait for the process to finish.

source:https://support.apple.com/en-in/HT211078

Your WhatsApp is public now, you cannot deny doing this either

WhatsApp updates Terms of Service and Privacy Policy and if WhatsApp users do not want to agree to the new privacy rules, they may as well delete their account.

New Delhi: WhatsApp has updated its new Terms and Privacy Policy emphasising that users will be required to agree to the same or else they may need delete their account.

WhatsApp updates Terms of Service and Privacy Policy and if WhatsApp users do not want to agree to the new privacy rules, they may as well delete their account. The updated Terms of Service and Privacy Policy which will take effect on February 8, applies to all of WhatsApp Services unless specified otherwise.


WhatsApp
 has a major chunk of information under Automatically Collected Information header which categorises four significant sub-heads –Usage And Log Information, Device And Connection Information, Location Information and Cookies, thus implying that that all your activities are under the watch of the company.

Under the Usage And Log Information section, WhatsApp says, “We collect information about your activity on our Services, like service-related, diagnostic, and performance information. This includes information about your activity (including how you use our Services, your Services settings, how you interact with others using our Services (including when you interact with a business), and the time, frequency, and duration of your activities and interactions), log files, and diagnostic, crash, website, and performance logs and reports. This also includes information about when you registered to use our Services; the features you use like our messaging, calling, Status, groups (including group name, group picture, group description), payments or business features; profile photo, “about” information; whether you are online, when you last used our Services (your “last seen”); and when you last updated your “about” information.”

Furthermore, the instant messaging app says that it collects “device and connection-specific information when you install, access, or use our Services. This includes information such as hardware model, operating system information, battery level, signal strength, app version, browser information, mobile network, connection information (including phone number, mobile operator or ISP), language and time zone, IP address, device operations information, and identifiers (including identifiers unique to Facebook Company Products associated with the same device or account).”

WhatsApp also collects and uses precise location information from your device with your permission when you choose to use location-related features. Furthermore, it uses cookies to “operate and provide our Services, including to provide our Services that are web-based, improve your experiences, understand how our Services are being used, and customize them.”

Aadhaar card update online rules regulations

Dear Resident,

You have selected ‘Address’ data field to update.

We want you to be aware that you can update your :

  • Name – Twice in life time
  • Date of Birth – Once in life time
  • Gender – Once in life time

You can update your name if the change is minor and includes :

  • Spell correction phonetically same
  • Changes in the Sequence
  • Short form to full form
  • Name change after marriage

You are required to submit Valid Document Proof for correcting or updating your Name, Date of Birth and Address. No document is required to be submitted for updating Mobile number or Email.

However, before submitting the update request the new Mobile number or Email will be subjected to OTP authentication.

To successfully save the update request, OTP validation will be performed using your current mobile number.

5.1 and 5.10 compare equal in php

ExampleNameResult
$a == $bEqualtrue if $a is equal to $b after type juggling.
$a === $bIdenticaltrue if $a is equal to $b, and they are of the same type.
$a != $bNot equaltrue if $a is not equal to $b after type juggling.
$a <> $bNot equaltrue if $a is not equal to $b after type juggling.
$a !== $bNot identicaltrue if $a is not equal to $b, or they are not of the same type.
$a < $bLess thantrue if $a is strictly less than $b.
$a > $bGreater thantrue if $a is strictly greater than $b.
$a <= $bLess than or equal totrue if $a is less than or equal to $b.
$a >= $bGreater than or equal totrue if $a is greater than or equal to $b.
$a <=> $bSpaceshipAn int less than, equal to, or greater than zero when $a is less than, equal to, or greater than $b, respectively.
<?php
var_dump(0 == "a"); // 0 == 0 -> true
var_dump("1" == "01"); // 1 == 1 -> true
var_dump("10" == "1e1"); // 10 == 10 -> true
var_dump(100 == "1e2"); // 100 == 100 -> true

switch ("a") {
case 0:
    echo "0";
    break;
case "a": // never reached because "a" is already matched with 0
    echo "a";
    break;
}
?>
<?php  
// Integers
echo 1 <=> 1; // 0
echo 1 <=> 2; // -1
echo 2 <=> 1; // 1
 
// Floats
echo 1.5 <=> 1.5; // 0
echo 1.5 <=> 2.5; // -1
echo 2.5 <=> 1.5; // 1
 
// Strings
echo "a" <=> "a"; // 0
echo "a" <=> "b"; // -1
echo "b" <=> "a"; // 1
 
echo "a" <=> "aa"; // -1
echo "zz" <=> "aa"; // 1
 
// Arrays
echo [] <=> []; // 0
echo [1, 2, 3] <=> [1, 2, 3]; // 0
echo [1, 2, 3] <=> []; // 1
echo [1, 2, 3] <=> [1, 2, 1]; // 1
echo [1, 2, 3] <=> [1, 2, 4]; // -1
 
// Objects
$a = (object) ["a" => "b"]; 
$b = (object) ["a" => "b"]; 
echo $a <=> $b; // 0
 
$a = (object) ["a" => "b"]; 
$b = (object) ["a" => "c"]; 
echo $a <=> $b; // -1
 
$a = (object) ["a" => "c"]; 
$b = (object) ["a" => "b"]; 
echo $a <=> $b; // 1
 
// not only values are compared; keys must match
$a = (object) ["a" => "b"]; 
$b = (object) ["b" => "b"]; 
echo $a <=> $b; // 1

?>

Soa Technology

radio button act like button bootstrap 3

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>    
<div class="btn-group" data-toggle="buttons">
      <label class="btn btn-primary">
        <input type="radio" name="options" id="option1"> Option 1
      </label>
      <label class="btn btn-primary">
        <input type="radio" name="options" id="option2"> Option 2
      </label>
      <label class="btn btn-primary">
        <input type="radio" name="options" id="option3"> Option 3
      </label>
</div>