1. aws https://www.fortinet.com/content/dam/fortinet/assets/solutions/aws/FortiGate-AWS-Engineering-Reference-Document-Q4-2015.pdf 2. https://geekdudes.wordpress.com/2018/07/18/install-fortigate-amazon-ec2-instance/ 3. https://geekdudes.wordpress.com/2018/08/19/creating-static-route-in-aws-ec2-fortigate-instance/ Many documents forget SG(security group) 1. FortiGate VM SG need Inbound rules:
All traffic All All 10.0.0.0/16
2. Private VM SG need Inbound rules:
All traffic All All 10.0.0.0/16
Setting finish.
First fortigate cmd:
execute ping Private VM private ip. Need success.
Second in private vm cmd:
ping FortiGate Lan ip. Need success. Don’t forgate Check “Ping” option.
ping 10.0.1.1. Need success.
Now ping 8.
http://liu-xin.me/2017/03/24/%E8%AE%A9%E5%86%99%E5%85%A5%E6%95%B0%E6%8D%AE%E5%BA%93%E7%9A%84%E6%95%B0%E6%8D%AE%E8%87%AA%E5%8A%A8%E5%86%99%E5%85%A5%E7%BC%93%E5%AD%98/```
const to = require(‘await-to-js’).default;
const Redis = require(‘ioredis’);
const redis = new Redis(ooxxooxx);
function Cache() {}
Cache.get = async function(key) {
const [err, res] = await to(redis.get(key));
if (err) {console.error(‘REDIS::Cache::get]’, err); return null;}
return JSON.parse(res);
};
Cache.set = async function(key, value) {
value = JSON.stringify(value);
const [err] = await to(redis.set(key, value));
if (err) {console.error(‘REDIS::Cache::set]’, err); }
};
//
// sequelize.query
//
async function CacheSequelizeQuery(sequelize, sql, params, redisKey) {
const cacheData = await Cache.
https://github.com/luin/ioredis```
const Redis = require(‘ioredis’);
const redis = new Redis();
const delScript = local all_keys = {}; local keys = {}; local done = false; local cursor = "0" repeat local result = redis.call("SCAN", cursor, "match", KEYS[1], "count", KEYS[2]) cursor = result[1]; keys = result[2]; for i, key in ipairs(keys) do all_keys[#all_keys+1] = key; end if cursor == "0" then done = true; end until done for i, key in ipairs(all_keys) do redis.
https://stackoverflow.com/questions/6600868/set-default-value-of-javascript-object-attributes```
// default num: 0, unit: ‘pics’
function items(op) {
const { num, unit } = Object.assign({}, { num: 0, unit: ‘pics’}, op);
}
ALTER TABLE `user` ADD `last name` VARCHAR(50) AS ( case `name` when admin then 0 else CONCAT(`name`, 'user') end ) ;
vscode remote ssh Error: EACCES: permission denied
https://github.com/microsoft/vscode/issues/48659
1. make sure that sudo -u newuser -i works in a regular ssh session without requesting a password 2. remove “-o RemoteCommand=none” and “bash” from extension.js like so```
sed -i s/"-o RemoteCommand=none"/""/ ~/.vscode/extensions/ms-vscode-remote.remote-ssh-*/out/extension.js
sed -i s/“bash”/""/ ~/.vscode/extensions/ms-vscode-remote.remote-ssh-*/out/extension.js
3\. create an ssh config entry with a RemoteCommand like this one:
Host pi-for-newuser
Hostname pi
User pi
RemoteCommand sudo -u newuser -i
[](https://1.bp.blogspot.com/-FXedlr85sQM/Xuw5z-9I5kI/AAAAAAAAZso/-0XXb2R1LWI7qAlYkZvN31GjVuKov9e_gCK4BGAsYHg/s1606/dddddd.jpg) Get Problem: mesg: ttyname failed: Inappropriate ioctl for device [https://unix.
https://firebase.google.com/docs/hosting/manage-cache?hl=zh-cn#using_cookies
将 Firebase 托管与 Cloud Functions 或 Cloud Run 搭配使用时,Cookie 通常会从传入的请求中剥离出来。这是实现高效的 CDN 缓存行为所必需的。只有特别指定的 __session Cookie 可以传入应用执行过程中。 __session Cookie(如果存在)会自动成为缓存键的一部分,也就是说,使用不同 Cookie 的两个用户绝不会收到彼此的已缓存响应。只有在您的应用根据用户授权提供不同的内容时,您才能使用 __session Cookie。