You need to edit the following file using notepad and run as admin
C:\Windows\System32\drivers\etc\hosts
If you edit subsystem linux's /etc/hosts, it will not affect browser such as Google Chrome
You need to edit the following file using notepad and run as admin
C:\Windows\System32\drivers\etc\hosts
If you edit subsystem linux's /etc/hosts, it will not affect browser such as Google Chrome
Assume you already can access your person github repositories using public key id_rsa.pub
# file name: ~/.ssh/id_rsa2
ssh-keygen
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
AddKeysToAgent yes
ServerAliveInterval 60
ServerAliveCountMax 30
# Work GitHub account
Host github-work
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa2
AddKeysToAgent yes
ServerAliveInterval 60
ServerAliveCountMax 30
git clone git@github-work:mycompany/jackt.git
Step 1: add rule to the security group attached to the instance
Step 2: update privilidge of Mysql database
#works for mysql 5.7.8 and up. To change a user's ip
RENAME USER 'teau'@'51.27.292.63' TO 'teau'@'125.256.111.%';
# for new user, need to grant permission
If do not do the step one, most likely will see a connection timeout
If do not do the second step, will see something like
[MySQL][ODBC 8.0(w) Driver]Host '*.*.***.**' is not allowed to connect to this MySQL server
Unable to connect to the MySQL server "***.***.**.**". Check that the server is running and that you have
access privileges to the requested database.
select version();
select user, host from mysql.user;
SHOW GRANTS FOR 'leo'@'52.30.111.16';
https://paysomething.sandbox.mysite.io/v1/tasks/process
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'cookiename: blue',
'X-Apple-Store-Front: 143444,12'
]);
Use ModHeader extension
Click Headers tab to add custom header
docker-compose run --rm -w /var/src/Propel api ./../vendor/bin/propel migrate --fake
it doesn't actually run the migrations, but it marks them as having been completed. It will add versions in propel_migration table.
Mainly there are two use cases.
Here is a sample policy. Only ips in the list will allow to call that API
{
"Version": "2012-10-17",
"Statement": [
{
"Condition": {
"IpAddress": {
"aws:SourceIp": [
"223.333.923.28/32",
"162.222.229.139/32"
]
}
},
"Action": [
"execute-api:Invoke"
],
"Resource": [
"arn:aws:execute-api:us-west-1:112334444444:1wertttt/*/POST/v1/bill",
"arn:aws:execute-api:us-west-1:112334444444:1wertttt/*/GET/vi/bill/*"
],
"Effect": "Allow"
}
]
}
Here is a command to run php 8 in a host machine which only has php 7 installed
docker run --rm --volume `pwd`:/var/src/ -w /var/src php:8.0.26-cli-alpine3.16 php ./bin/swagger_gen.php ./rest/swagger/v1/
Breakdown
--rm Automatically remove the container and its associated anonymous volumes when it exits
--volume `pwd`:/var/src/ Bind mount a volume (docker run --volume host-path:container-path
-w Working directory inside the container
<?php
error_reporting(E_ALL);
class PropertyTest
{
/** Location for overloaded data. */
private $data = array();
public function __set($name, $value)
{
$this->data[$name] = $value;
}
public function __get($name)
{
if (array_key_exists($name, $this->data)) {
return $this->data[$name];
} else {
throw new Exception($name . " not found");
}
}
}
$obj = new PropertyTest();
$obj->goods = ["a", "b"];
//the line below will throw notice
//Indirect modification of overloaded property PropertyTest::$goods has no effect
$obj->goods[] = "c";
//still got ["a", "b"]
var_dump($obj->goods);
To fix the error, replace the last two lines of codes with the below.
$obj->goods= array_merge($obj->goods, ['c']);
//got ["a", "b", "c"]
var_dump($obj->goods);
Here is another example
$obj = new PropertyTest();
$obj->test=["a"=>2];
var_dump($obj->test);
//will throw the notice and will not change value
$obj->test['a'] =3;
//the result is the same as what we get from the last dump
var_dump($obj->test);
To make it work as expected
$obj = new PropertyTest();
$obj->test=["a"=>2];
var_dump($obj->test);
$ans = $obj->test;
$ans['a'] = 3;
$obj->test = $ans;
var_dump($obj->test)