Laravel middleware sends parameters to the controller Author: Chuwen Time: 2020-12-23 Classification: Laravel , Other classifications comment ##The handle method in middleware ``` $request->attributes->add(['data'=>'data]); ``` ##Methods to accept parameters in the controller ``` function index(Request $request){ echo $request->get('data'); } ``` --- Reprinted from: https://www.jianshu.com/p/488b92f2015b
CentOS/Alibaba Cloud Linux 2 systemd Process CPU Usage Too High Solution Author: Chuwen Time: 2020-12-22 Classification: Linux comment #The method found online can be solved by updating 'systemd' ```shell yum install systemd ``` #After the upgrade, the CPU utilization immediately dropped
Tencent Cloud CDN has supported IPv6 access Author: Chuwen Time: 2020-12-19 Classification: Chatter comment #Previously, Tencent Cloud IPv6 has been in internal testing. Today, it can be found that it can be opened. It should be recently launched to the public ! [Tencent Cloud CDN has supported IPv6 access] [1] #Tencent Cloud CDN IPv6 Access IPv6 is temporarily not supported outside China; Streaming media on demand acceleration does not support IPv6 temporarily When enabled, it supports access through IPv6 protocol #"The domain name has special configuration, IPv6 access configuration cannot be opened, please submit a work order for modification" If this prompt appears, you need to * * submit the work order * * and let Tencent Cloud modify it in the background. But when you encounter something added a long time ago, such as this blog (nowtime. cc), you need to wait until they arrive in the workday to modify it. Recently added items such as (ip. nowtime. cc) will be refreshed at the specified time after you submit the work order, and then you can open it ! [Tencent Cloud Work Order] [2] #Ip.nowtime.cc IPv6 Query Results Query link: https://ip.nowtool.cn/ip.nowtime.cc |# | IP address | Physical address/ISP| | --- | --- | --- | |1 | [2408:877a: 2000:0:26::] (http://[2408:877a: 2000:0:26::]/"Click to jump to 2408:877a: 2000:0:26::") | Urumqi, Xinjiang, China/China Unicom IDC| |2 | [2408:8719:3000:6:18::] (http://[2408:8719:3000:6:18::]/"Click to jump to 2408:8719:3000:6:18::") | Qingdao, Shandong Province, China/China Unicom IDC| |3 | [2408:80f0:4105: e: 2b::] (http://[2408:80f0:4105: e: 2b::]/"Click to jump to 2408:80f0:4105: e: 2b::") | Beijing, China/China Unicom IDC| |4 | [2408:872b: e02:5:17::] (http://[2408:872b: e02:5:17::]/"Click to jump to 2408:872b: e02:5:17::") | Inner Mongolia, China/China Unicom IDC| |5 | [2408:8774:1:10:11::] (http://[2408:8774:1:10:11::]/"Click to jump to 2408:8774:1:10:11::") | Gansu Province, China/China Unicom IDC| |6 | [2408:8766:0:1000:19::] (http://[2408:8766:0:1000:19::]/"Click to jump to 2408:8766:0:1000:19::") | Sichuan Province, China/China Unicom IDC| |7 | [2408:874c: 0:17:1b::] (http://[2408:874c: 0:17:1b::]/"Click to jump to 2408:874c: 0:17:1b::") | Jiangxi Province, China/China Unicom IDC| |8 | [2408:8766:1:2:23::] (http://[2408:8766:1:2:23::]/"Click to jump to 2408:8766:1:2:23::") | Sichuan Province, China/China Unicom IDC| |9 | [2408:874e: 1000:3:1a::] (http://[2408:874e: 1000:3:1a::]/"Click to jump to 2408:874e: 1000:3:1a::") | Hubei Province, China/China Unicom IDC| | 10 | [121.51.175.120]( http://121.51.175.120/ "Click to jump to 121.51.175.120") | China Guangdong Shenzhen/Shenzhen Tencent Computer System Co., Ltd. (BGP)| ! [ip.nowtime.cc IPv6 Query Result] [3] [1]: https://cdn.nowtime.cc/2020/12/19/3740714580.jpg [2]: https://cdn.nowtime.cc/2020/12/19/497937422.jpg [3]: https://cdn.nowtime.cc/2020/12/19/3293729527.jpg
Nowtime.cc (including subdomain name) has enabled HSTS Author: Chuwen Time: 2020-12-19 Classification: Chatter comment #Submission address >This form is used to submit [HTTP Strict Transport Security (HSTS)] to be included in Chrome( https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security )Preload the fields in the list. This is a list of HTTPS only websites hard coded into Chrome. https://hstspreload.org/ ! [*. nowtime.cc has enabled HSTS] [1] ! [Status: nowtime.cc is pending submission to the preload list.][2] ------------------ [Information]( https://hstspreload.org/#information ) ------------------------------------------ This form is used to submit [HTTP Strict Transport Security (HSTS)] to be included in Chrome( https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security )Preload the fields in the list. This is a list of HTTPS only websites hard coded into Chrome. Most major browsers (Chrome, [Firefox]( https://blog.mozilla.org/security/2012/11/01/preloading-hsts/ ), Opera, Safari, [IE 11 and Edge]( https://blogs.windows.com/msedgedev/2015/06/09/http-strict-transport-security-comes-to-internet-explorer-11-on-windows-8-1-and-windows-7/ ))There is also a HSTS preload list based on the Chrome list. (See [HSTS Compatibility List]( https://caniuse.com/#feat=stricttransportsecurity )。) [Submission requirements]( https://hstspreload.org/#submission -requirements) -------------------------------------------------------- If the site 'preload' sends a command in the HSTS header, it is considered that the request is being requested to be included in the preload list and can be submitted through the form on this site. In order to be accepted into the HSTS preload list through this form, your website must meet the following requirements: 1. Provide valid * * certificate * *. 2. If you are listening on port 80, redirect * * from HTTP * * to HTTPS on the same host. 3. All * * sub domains * * through HTTPS services. -In particular, 'www' must support HTTPS of the subdomain if there are DNS records of the subdomain. 4. Provide * * HSTS headers * * for HTTPS requests in the basic domain: -The 'max age' must be at least '31536000' seconds (1 year). -The 'includeSubDomains' command must be specified. -The 'preload' command must be specified. -If you want to provide another redirect from the HTTPS site, the redirect must still have an HSTS header (not the page it redirects to). For more details on HSTS, see [RFC 6797]( https://tools.ietf.org/html/rfc6797 )。 This is an example of a valid HSTS header: `Strict-Transport-Security:` `max-age=63072000; includeSubDomains; preload` You can check the status of the request by re entering the domain name in the table above, or by` chrome://net-internals/#hsts `Access in the browser to query the current Chrome preload list. Please note that new entries are hard coded into Chrome source code, and it may take several months to reach a stable version. [Continue to ask]( https://hstspreload.org/#continued -requirements) ------------------------------------------------------- You must ensure that your website always meets the submission requirements. Please note that deleting the 'preload' command from the header will immediately make your website have [Delete Table]( https://hstspreload.org/removal/ )Eligibility, and these websites may be automatically deleted in the future because they cannot meet the requirements. In particular, [the above requirements]( https://hstspreload.org/#submission -Requirements) is applicable to all domains submitted on or after * * October 11, 2017 * * ` hstspreload. org '(that is, domains preloaded after Chrome 63) The same requirements apply to early domains submitted on or after * * February 29, 2016 * * (that is, preloaded after Chrome 50), but the maximum validity period required for these domains is only a few seconds of '10886400'. [Deployment suggestions]( https://hstspreload.org/#deployment -recommendations) ----------------------------------------------------------- If your site has promised to use HTTPS and you want to preload HSTS, it is recommended to perform the following steps: 1. Check all subdomains (and nested subdomains) of the website and ensure that they can operate normally through HTTPS. 2. Use the following header values to add the 'Strict Transport Security' header to all HTTPS responses, and gradually expand the 'max age' header: -5 minutes: `max-age=300; includeSubDomains` -1 week: `max-age=604800; includeSubDomains` -1 month: `max-age=2592000; IncludeSubDomains ` In each stage, check whether the page is damaged, and monitor the site's indicators (such as traffic and revenue). Fix all problems, and then wait for the whole stage before continuing. For example, wait one month in the final stage. 3. Once it is determined that there will be no other problems, please extend the validity period of 'max age' to 2 years, and then submit your website to the preload list: -2 years, pre installation required: `max-age=63072000; includeSubDomains; preload` If you have a group of employees or users who can test the beta, please consider trying the first few upgrade stages for these users. Then make sure to go through all stages for all users from scratch. For more specific suggestions on HTTPS deployment, see the [Mozilla Web Security Guide]( https://wiki.mozilla.org/Security/Guidelines/Web_Security )And [about security]( https://developers.google.com/web/fundamentals/security/?hl=en )[Google Web Basics Page]( https://developers.google.com/web/fundamentals/security/?hl=en )。 [Preload should be optional]( https://hstspreload.org/#opt -in) -------------------------------------------- If the project you maintain provides HTTPS configuration suggestions or the option to enable HSTS, * * then 'preload' does not include this instruction by default * *. We received regular emails from site operators who tried HSTS in this way. They found themselves in the preload list only when they found that they needed to delete HSTS to access some subdomains. For these parts, [Clear]( https://hstspreload.org/#removal )Often slow and painful. The best practice is to support HSTS preloading and provide the project with a simple option to enable it. However, HSTS enabled site operators should first understand the long-term consequences of preloading, and then turn on preloading for a given domain. They should also be informed that they need to meet other requirements and submit their site to [hstspreload.org,]( https://hstspreload.org/ )To ensure that the site has been successfully preloaded (that is, fully protected against the expected configuration). [Clear]( https://hstspreload.org/#removal ) -------------------------------------- Note that the contents of the preload list cannot be easily undone. The domain can be deleted, but the change may take several months to enable users to use Chrome updates, so we cannot guarantee the security of other browsers. Unless you are sure you can support * * HTTPS for * * the entire site and all its sub domains for a long time, do not request inclusion. However, if you find that the sub domain cannot provide services through HTTPS due to technical or cost reasons, we usually accept the request to delete the request from Chrome's preload list. To request deletion, please visit [Delete Table]( https://hstspreload.org/removal/ )。 [1]: https://cdn.nowtime.cc/2020/12/19/1265446398.jpg [2]: https://cdn.nowtime.cc/2020/12/19/1552998674.jpg
Notes on Personal Understanding of C Language Pointer Author: Chuwen Time: 2020-12-15 Classification: C/C++ comment #Preamble Just last year (October 2019), in order to learn Android development, I went to learn Java (although I didn't learn much). This strongly typed language should be the * * second strongly typed language * * that I really learned, the first is C language, and I learned basic grammar knowledge when I was a freshman. But in the process of learning * * pointer * *, I learned nothing, I didn't know why I needed to do it. Up to now, I can write some Android software with small functions, such as regular layout, interactive use of basic controls, and use of some frameworks (such as MPAndroidChart and Gson). I also learned a lot of new knowledge and had a certain understanding of the * * pointer * * I learned before. Of course, there are other gains. I may write specifically in the * * 2020 summary * *. #C language pointer >Recently, I learned some algorithms and used C language pointers, but I generally understand what they mean, but sometimes I forget them. So I write again to consolidate them ```c #include "stdio.h" int main(){ Int var1;//Define regular variables Int * point;//Define pointer variables Int * point2;//Define pointer variables Var1=20170101;//Variable assignment Printf ("Print variable value var=% d n", var1); //Add a&before the variable name to indicate the address of the pointer Printf ("Print variable storage address var=% p n n",&var1); /***********************************************************/ //Pointer assignment: assign the pointer address of var1 to the point pointer variable point = &var1; Printf ("point pointer address% p n", point); //Pointer variable value Printf ("The value of the point pointer variable is% d n n", * point); //Pointer variable assignment to pointer variable point2 = point; Printf ("point2 pointer address% p n", point2); //Modify the pointer value because the pointer address of point and point2 points to the pointer address of variable var1 //Then when the pointer variables of point and point2 modify their values, all "pointer variables" pointing to the pointer address //Its value will be changed to 100 *point2 = 100; Printf ("value of var1% d n", var1); Printf ("value of point% d n", * point); Printf ("point2 value% d n n", * point2); var1 = 200; Printf ("value of var1% d n", var1); Printf ("value of point% d n", * point); Printf ("point2 value% d n n", * point2); return 0; } ``` #Summary -Get the pointer address of the general variable, and add '&' before the variable name to get -Get the value of the pointer variable by adding '*' before the pointer variable name -When the value of the pointer address changes, all values pointing to the * * pointer address * * will change