should be treated differently depending on the source object and the target object. //of course, if you just make a separate copy of the object, you don't have to worry about calling a method that doesn't belong to itself, and you don't have to differentiate between object get and setObject Value= Getmethod.invoke (obj);//Get Gets the value of the source objectSetmethod.invoke (T,NewObject[] {value});//set is the value of the target object } } returnT; } Cat
;> parser.parse_args('--foo --bar'.split())Namespace(bar=False, baz=True, foo=True)
Append: Save As list
>>> parser = argparse.ArgumentParser()>>> parser.add_argument('--foo', action='append')>>> parser.parse_args('--foo 1 --foo 2'.split())Namespace(foo=['1', '2'])
Append_const: Save As a list and add it according to key const parameters:
>>> parser = argparse.ArgumentParser()>>> parser.add_argument('--str', dest='types', action='append_const', const=str)>>> parser.add_argument('--int', dest='ty
stack addresses that must besaved and restored in such a way that the full range of thestack contains valid data when we switch to it.Stack layout for a greenlet:| ^^^ || older data || |stack_stop . |_______________|. | |. | greenlet data |. | in stack |. * |_______________| . . _____________ stack_copy + stack_saved. | | | |. | data | |greenlet data|. | unrelated | | saved |. | to | | in heap |stack_start . | this | . . |_____________| stack_copy| greenlet || || newer data ||
packets directly through the drop, without giving any response information reject reject the packet through, and if necessary, a response message to the data sender. Log logs information in the/var/log/messages file, and then passes the packet to the next ruleThe following two methods can be used to solve the problem that the rules written by iptables cannot be permanently applied:Iptables-save >/etc/sysconfig/iptablesservice iptables SaveIt can automatically save the rules in/etc/sysconfig/ipt
IBrand product Toolkit: Laravel Database Logger, ibrandlaravel
The new retail e-commerce product of iBrand has become stable since its launch in September 2016, and has been initially tested by the market. It is particularly able to defend against high-concurrency transaction scenarios in the flash sales of residential e-commerce companies.
Next, our team will gradually open up some tools and solutions in use, and open-source e-commerce product code. You are welcome to follow our iBrand produc
Nf_conntrack: table full, dropping packet solution
After the magent agent is added, the memcached test finds that if the concurrency is high and the number of connections to the database remains high, it is reasonable to say that as the key is saved to the cache, the number of connections should be gradually reduced, however, it is normal when the concurrency is low.
When memcached is started, the-vvv parameter is added to print the internal status in
.
First, when you restart Mongodb, you can add more "v" (namely-v,-vv,-vvv,-vvvv, or-vvvvv) to the parameter ), or run the following setParameter command to change the log level.
> Db. adminCommand ({"setParameter": 1, "logLevel": 3 });
Remember to reset the log level to 0, otherwise there will be too much unnecessary content in the log. You can increase the log level to 5. Then, mongod records almost all operations in the log, including the content p
directly reports an error after the memory is exhausted.
-C: Limit the maximum number of connections at the same time (1024 by default)
-K: Lock all paging memory.
Note: This is a restricted value that limits the amount of memory you can lock. If you allocate an operation that exceeds the limit value, the Operation will fail. therefore, you must set the correct limits for the user process that starts memcached, instead of specifying the user to run the command using the-u parameter. in sh, this
. Put the direct code on it. Implements the example in the book, one is the query subnet mask, one is the query time. GitHub address, dot me dot MePorts not up toThis is also an example in the book. For example, a sends the UDP message to B's 10000 port, but B's 10000 port does not open, it will return an ICMP packet to a, tell the A10000 port is not open.Take a look at the effect.Send a UDP message to the 192.168.0.108 10000 port using the Swiss Army knife.% nc -u 192.168.0.108 10000
some problems, such as memory leakage (because more lengthy logs are stored and debugging information is saved ).
$ php app/console octivi:test-command --env=prod
To display better information, add the-v option.
$ php app/console octivi:test-command --env=prod -vvv
The progress bar is a good helper. The progress bar even considers the details of information display. When the degree is relatively low, only basic information is displayed. When the deg
-s:~1.0"-vvv# at the root of your laravel/lumen project to make sure your composer.lock files are in version control
2. Add Service Provider
Laravel: Modify File config/app.php
' Providers ' = [//... Hhxsv5\laravels\illuminate\laravelsserviceprovider::class,],
Lumen: Modify File bootstrap/app.php
$app->register (Hhxsv5\laravels\illuminate\laravelsserviceprovider::class);
3. Publish the configuration file
PHP Artisan Laravels Publish
Special situation:
, file naming and path specification recommendations refer to the PSR-4 specification. Also note that the path to the file needs to match the value of AutoLoad in Composer.json.
By simply two steps, we create our own composer package. The package is then referenced in another project.
Reference Composer Package
Create a new test project, reference the package created above and see the effect, as follows:
1. Create a new test folder, copy or create a new Composer.json file, configured as follows:
has always been simple, right:
$ composer Install SPATIE/LARAVEL-ACTIVITYLOG-VVV
Record dynamic
Activity ()->log (' Look, I logged something ');
Of course, this kind of record doesn't make sense and there's hardly any useful information, so our usual usage should be this:
Activity ()->performedon ($anEloquentModel)->causedby ($user)->withproperties ([' CustomProperty ' = ' Customvalue '])->log (' Look, I logged something '); $lastLoggedActivity =
... Right-click menu to install [Laravel 5 IDE Helper Generator] to our project. Search for Barryvdh/laravel-ide-helper, and click Install to download and add to the project.
Self-help Way
Because we are using it in the project, we add this feature to the project and add the Require-dev branch to the Composer.jsonLaravel 4.*, the version here should be filled in 1.*
"Require-dev": { //... " Barryvdh/laravel-ide-helper ":" 2.* " //...},
Then use the command composer UPDATE-
, INPUT, FORWARD, OUTPUT, and POSTROUTING interfaces;
Raw on the PREOUTING and OUTPUT interfaces;
Sort priorities: raw ---> mangle ---> nat ---> filter
IptablesCommand usage:
Iptables [-t TABLE] command chain [creteria]-j ACTION
-T {raw | mangle | nat | filter}, default filter
COMMAND Category:
Rule Management:
-Append A to the last one (append );
-I # insert the nth entry (insert );
-D # indicates the number of deletes );
-R # indicates replacing a rule;
Link Management class:
-F clears the ru
. 936130 IP 10.153.107.72.1237> 10.153.107.75.22: P1: 53 (52) ack
429495
5024 win 64467
-Q: The quick output mode outputs less protocol information.
-S: print the absolute value of the tcp sequence number, instead of the relative sequence number.
-T: No timestamp is printed.
-Ttt: time difference between printing and the previous packet
-V: print verbose information
-Vv: print more verbose information
-Vvv: print more verbose information
-X: it is pri
Mars is not specified)
-Nn: the host name and port name are not resolved (for example, if port 80 is accessed, Mars. http is displayed without nn, and 1.1.2.2.80 is added)
-X: indicates the message content and the corresponding ASCII value in hexadecimal notation.
-V,-vv,-vvv: added the description package information.
-C: specify the number of captured packets.
-S: print the absolute serial number value (SEQ, ACK ).
-E: capture the Ethernet packet h
Foreword because the previous online server has replaced the IP address, the following problems are recorded in the log when the offline server crontab pulls the backup log (ps: I Am a Singer while solving the bug at home, very refreshing): www.2cto.com note: You must check the log to find server issues...
Foreword because the previous online server has replaced the IP address, the following problems are recorded in the log when the offline server crontab pulls the backup log (ps: I Am a Singer
1. Installation via Composer (packagist)
# Execute composer require "hhxsv5/laravel-s:~1.0"-vvv# at the root of your laravel/lumen project to make sure your composer.lock files are in version control
2. Add Service Provider
Laravel: Modify File config/app.php
' Providers ' = [//... Hhxsv5\laravels\illuminate\laravelsserviceprovider::class,],
Lumen: Modify File bootstrap/app.php
$app->register (Hhxsv5\laravels\illuminate\laravelsserviceprovider::class
is available ldconfig-p|grep libz
Installation
1. Installation via Composer (packagist)
# Execute composer require "hhxsv5/laravel-s:~1.0"-vvv# at the root of your laravel/lumen project to make sure your composer.lock files are in version control
2. Add Service Provider
Laravel: Modify File config/app.php
' Providers ' = [//... Hhxsv5\laravels\illuminate\laravelsserviceprovider::class,],
Lumen: Modify File bootstrap/app.php
$app->register (H
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.