Posts

线程同步模式:用户态和内核态 线程间的同步方法大体可分为两类:用户模式和内核模式。顾名思义,内核模式 就是指利用系统内核对象的单一性来进行同步,使用时需要切换内核态与用户态, 而用户模式就是不需要切换到内核态,只在用户态完成操作。 用户模式下的方法有:原子操作(例如一个单一的全局变量),临界区。 内核模式下的方法有:事件,信号量,互斥量 volatile 关键字 volatile 提供多线程共享变量可见性和禁止指令重排序优化: 对于可见性,Java 提供了 volatile 关键字来保证可见性。 当一个共享变量被 volatile 修饰时,它会保证修改的值会立即被更新到主存,当 有其他线程需要读取时,它会去内存中读取新值 禁止指令重排序优化,写操作一定在读操作之后 值传递 当一个对象被当作参数传递到一个方法后,此方法可改变 这个对象的属性,并可返回变化后的结果 Java诊断利器Arthas curl -O https://arthas.aliyun.com/arthas-boot.jar java -jar arthas-boot.jar [arthas@9208]$ thread 1 "main" Id=1 TIMED_WAITING at [email protected]/java.lang.Thread.sleep(Native Method) at [email protected]/java.lang.Thread.sleep(Thread.java:339) at [email protected]/java.util.concurrent.TimeUnit.sleep(TimeUnit.java:446) JVM MEMORY MODEL javax.net.ssl.SSLException: Received fatal alert: protocol_version On Java 1.8 default TLS protocol is v1.2. On Java 1.6 and 1.7 default is obsoleted TLS1.

保险本质

购买保险是为了减少预期以外的事件对被保险人的财务状况造成冲击, 为受益人提供经济补偿减轻负担。也就是, 用经济学原理来解释就是被保险人通过缴纳保费换取未来财务状况更大的确定性。

打个比方,没买保险前,你未来财富现值的范围可能是 [-50万元, 200万元], 有负值的原因可能是各种财富损失,比如家里大火,比如治病过程中支付的高额医疗费用 ;而通过购买保险,你的未来财富现值的范围可能变成[80万, 190万], 虽然最大值因为要交保费而变小了,但是更加确定了 (这个例子中波动范围从250万缩小到110万,所以未来更确定了,当然我这里举例简化了很多统计学上的东西,大家知道我想表达的意思就好)。

保险核心是保障和转移风险。连投、万能、分红、两全是理财

保险最大的风险是你购买的保障并不是你真正需要的保障

国内根据保险业务类别一共有4种牌照:人寿保险、健康险、养老险和财产险。 其中前3种牌照在目前情况下大部分经营范围实际是重叠的, 所以可以认为是同一种,即人身险牌照。 也就是我们常说的保险公司只分为两种: 寿险(说人身险、人寿保险也是一个意思)公司和财险公司

以大家熟知的“中国平安”为例,“中国平安”旗下有非常多的业务, 其中由“平安保险”负责集团的保险业务, 而平安保险实际再分为:平安人寿、平安健康险、平安养老和平安财险四家保险子公司负责。 这四家公司各持有一块牌照,也就是中国平安一共有持有4块牌照经营保险业务。 每家子公司都需单独接受偿付能力监管,集团还有总的偿付能力监管。

保险条款

保险条款着重看“保险责任”和“除外责任”那两节即可

购买保险顺序

社保-意外险-寿险-重疾险

参考

https://post.smzdm.com/p/568110/

certbot Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/et.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/et.com/privkey.pem Your cert will expire on 2018-02-19. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the “certonly” option. To non-interactively renew all of your certificates, run “certbot renew” If you like Certbot, please consider supporting our work by: Donating to ISRG / Let’s Encrypt: https://letsencrypt.

Configuring Piwik accessed via an Nginx reverse proxy public Nginx server configured as location ^~ /piwik/ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host; proxy_pass http://192.168.79.4/piwik/; } config.ini.php config on piwi nginx site [General] proxy_client_headers[] = "HTTP_X_FORWARDED_FOR" proxy_client_headers[] = "X-Real-IP" proxy_host_headers[] = "HTTP_X_FORWARDED_HOST" proxy_ips[] = "192.168.79.4" trusted_hosts[] = "192.168.79.4" trusted_hosts[] = "<public-domain-server>" Configure GeoIP (PECL) With Piwik check php version curl http://localhost/info.php PHP Version 7.

Basic Server Setup To start off, we need to set the password of the PostgreSQL user (role) called “postgres”; we will not be able to access the server externally otherwise. As the local “postgres” Linux user, we are allowed to connect and manipulate the server using the psql command. In a terminal, type: sudo -u postgres psql postgres this connects as a role with same name as the local user, i.

https://stackoverflow.com/questions/21087564/gmail-smtp-is-not-working-in-ec2-instance

https://linuxconfig.org/configuring-gmail-as-sendmail-email-relay

Go to https://www.google.com/settings/security/lesssecureapps and set Access for less secure apps to On

goto : https://accounts.google.com/DisplayUnlockCaptcha

and click continue this going to allow access from other servers.

https://www.mkyong.com/java/javamail-api-sending-email-via-gmail-smtp-example/