EExcel 丞燕快速查詢2

EExcel 丞燕快速查詢2
EExcel 丞燕快速查詢2 https://sandk.ffbizs.com/

[轉]Windows Server 2019 vs. Linux vs. FreeBSD Performance On A 2P EPYC Server

https://www.phoronix.com/scan.php?page=article&item=windows2019-linux-bsd&num=1&fbclid=IwAR0VBMPUsmOw_qJQtJ1AzEq4el8KhZMPK9sRmlMN8rLhwZJfFqO32RuefGI

[轉]FreeBSD ZFS vs. Linux EXT4/Btrfs RAID With Twenty SSDs

https://www.phoronix.com/scan.php?page=article&item=freebsd-12-zfs&num=1&fbclid=IwAR2utCninwUWUjjt_5IUu-1-rfm3vcCc1SiOvuZrYf4Bu0sW0HVsh9-lvQA

台北以太坊社群專欄

https://medium.com/taipei-ethereum-meetup

ethereum dapp

https://dappradar.com/

[轉]區塊鏈養蝦遊戲和數學之美

https://medium.com/taipei-ethereum-meetup/ether-shrimp-farm-analysis-e92ab76dc22f

docker proxmox 使用方法

底層採用PVE(Proxmox),建立KVM VM,KVM VM使用docker-machine或是自建用boot2docker iso做好backup,使用時直接restore

docker 執行時 Restart policies:always,這樣VM開機就會自動執行,不需要另外再設定。
Volume 直接用docker-compose YAML volume減少權限問題,資料也會儲存在VM內,使用VM後,備份是以VM為主,不用擔心資料遺失

一個VM放多個docker、整組docker-compose 或 一個VM放單一功能docker可以自己決定

VM可以被快照保護,一但出問題,還原後、開完機,VM內的docker會自動起服務,資料也是存在的,減少docker backup&resotre問題

為了管理docker方便,第一次建立VM時,執行Portainer always,可以backup,將來每一個VM都可以利用圖形界面查看docker運作情況



缺點:

硬碟空間使用受限於KVM,擴充大小有可能需要重開機
線上移轉只能以VM,不能用docker,但docker設計上也不走線上移轉


為什麼需要用到docker呢?

因為現在很多專案有直接提供docker使用,確實可以減少大量安裝時間,
但volume資料儲存、權限卻是最大的問題,上述架構可以解決這部份顧慮。

docker backup


https://docs.docker.com/storage/volumes/#backup-restore-or-migrate-data-volumes


$ docker run --rm --volumes-from dbstore -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /dbdata

???

Real Demo Example

mongo cantainer


  mongo:
    image: mongo
    #restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example
    volumes:
      - alldata:/data/db
    networks:
      - fastdev

volumes is /data/db
docker running name is testbackup_mongo_1_1c9e49740f2e (this use docker ps check your run time docker name. Don't copy)

run


$ docker run --rm --volumes-from testbackup_mongo_1_1c9e49740f2e -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /data/db


ls -al can see backup.tar


README:

1. use ubuntu container link to mongo
2. mount $(pwd) path to ubuntu inside /backup directory. $(pwd) run command at path.
3. tar cvf "put where & filename" "what data be tar", So "put where & filename"=/backup/backup.tar "what data be tar"=/data/db
/data/db be tar write to backup.tar in /backup, then /backup be mount to $(pwd), you can see backup.tar put run command path.


acme let's encrypt


renew manually dns


acme.sh --issue -d *.oooxxx.com --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please


Cer Key /root

cp ~/.acme.sh/\*.oooxxx.com/\*.oooxxx.com.cer  wildcardoooxxx.cer
cp ~/.acme.sh/\*.oooxxx.com/\*.oooxxx.com.cer  wildcardoooxxx.key

[轉]解釋 Golang 中的 Interface 到底是什麼

https://yami.io/golang-interface/

[轉]Proxmox VE - One Public IP

https://raymii.org/s/tutorials/Proxmox_VE_One_Public_IP.html

實例 https://www.facebook.com/groups/pve.tw/permalink/1225387670963125/

楊凱麟
以下也是我目前interfaces的設定
其中1.2.3.x為真實IP
1.2.3.Y為IDC提供的gateway
設置完後再將區網設定填上10.0.0.X (X=0~255)
即可上網,連外網的公共IP會是1.2.3.X

----network configuration----

auto lo
iface lo inet loopback

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
address 1.2.3.X
netmask 255.255.255.248
network 1.2.3.0
broadcast 1.2.3.255
gateway 1.2.3.Y
bridge_ports eno1
bridge_stp off
bridge_fd 0

auto vmbr1
iface vmbr1 inet static
address 10.0.0.254
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.21.21.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.21.21.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to 10.21.21.5:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 2222 -j DNAT --to 10.21.21.5:22


https://forum.proxmox.com/threads/pfsense-proxmox-5-one-nic.41512/#post-208059
==============


  • CSF firewall can focus vmbr2

#############################
https://download.configserver.com/csf/readme.txt11. Multiple Ethernet Devices

 If you have multiple ethernet NICs that you want to apply all rules to, then you can set ETH_DEVICE to the interface name immediately followed by a plus sign. For example, eth+ will apply all iptables rules to eth0, eth1, etc. 

 That said, if you leave ETH_DEVICE blank all rules will be applied to all ethernet devices equally.


#############################
https://www.dmehosting.com/clients/knowledgebase.php?action=displayarticle&id=79&language=chinese

2. Edit /etc/csf/csf.conf, set the following parameters:
ETH_DEVICE = "venet0"
MONOLITHIC_KERNEL = "1"
VERBOSE = "0"



  • CSF iptables nat
https://blackonsole.org/how-to-add-nat-iptables-rules-with-csf/

FireHOL iptables

FireHOL is a language (and a program to run it) which builds secure, stateful firewalls from easy to understand, human-readable configurations. The configurations stay readable even for very complex setups.

docker gui manager docker-machine portainer.io

https://www.portainer.io/



docker run -d -p 9000:9000 --restart always -v /var/run/docker.sock:/var/run/docker.sock -v /opt/portainer:/data portainer/portainer




今天發現一個docker gui管理工具
https://www.portainer.io/

很符合簡單管理

先用docker-machine開一台機器,直接就是docker ready的VM ,VM可以是virtualbox等等

然後登入後,直接用 啟動 portainer的docker,管理這台機器上的docker

有圖形化介面,可以看到每一個docker使用情況,又可以直接登入到docker內,web terminal,這樣就有符合實際使用情況了

docker資料有用volume寫到本機vm內,再把整台vm打包備份的話,資料又不容易不見

[轉]致传统企业朋友:不够痛就别微服务,有坑

原始連結  https://mp.weixin.qq.com/s/tHRl5OQHY2mNXqKwACCVWw

非常不錯!


http://dockone.io/article/8390


docker問題

https://blog.csdn.net/u011166225/article/details/84940228




对于个人开发者来说,在一定情况下很好用。但是对于构建管理项目或者提供构建流程管理的Devops项目而言却是个灾难--本地存储结构不能对用户开放,它们也不能干扰用户本身的构建流程。所幸的是,Moby umbrella的开发团队注意到了这一点,他们希望通过重构存储管理和容器快照来解决一部分问题,于是BuildKit诞生了。

---------------------

作者:狗蛋丶

来源:CSDN

原文:https://blog.csdn.net/u011166225/article/details/84940228

版权声明:本文为博主原创文章,转载请附上博文链接!

[轉]Centos7 容器中删除文件的问题

http://dockone.io/question/1516

巨坑!

Centos7默认xfs文件系统与docker默认overlay2存储驱动不匹配,会导致容器内文件无法删除等问题
https://blog.csdn.net/weixin_41826563/article/details/80549323


wx65251206
再次遇到这个问题,终于还是发扬刨根问题的精神,经过一上午的百度,google,bing
终于找到根本原因。
这里记录一下,为了帮助后面的人,同时也提醒自己。
问题原因与docker无关,在于linux内核版本。
测试有问题的内核版本是Red Hat 4.8.3-9---对应的发行版是CentOS7.2

ssh 反代

https://zhuanlan.zhihu.com/p/34908698
https://zaiste.net/ssh_port_forwarding/

這個動態有錯,測試不出來 (D 後查資料,變成是proxy socket方式,給porxy使用,這裡不需要這個設定)



內網主機A  外網主機B


內網主機A 設定:


ssh -NR 20000:localhost:80 xxxx@xxx.ooo.xxx.ooo

20000: 遠端打算 打開的port

localhost:80  :指目前 內網主機A上的服務port,或是其他主機和port也可以,只要是A主機連得到的

xxx :B user id
xxx.ooo.xxx.ooo :B ip

PS:這個連上後,可以在 B上試 curl localhost:20000是否會通,不通則代表沒有建立成功或是該服務不接受連線,測試連線位址只限用localhost本地
PS:-g是別人(所有人)可以連,但 -NR + g => -gNR  經測試是無效的


外網主機B:

這裡最主要目的是開放 20000開放讓所有人可以連,但實際上2000已經被反向代理使用中,也被限制住了(localhost),所以
變成 開放 30002 讓別人(所有人)可以連,透過30002轉向20000



ssh -gL 30002:localhost:20000 localhost

-gL : -g 開放給別人連(所有人):這裡和教學不同,教學用D,試是失敗的 (D 後查資料,變成是proxy socket方式,給porxy使用,這裡不需要這個設定)

30002: 指外網主機B 打算開那個port 給人用
localhost: 這裡指的都是 外網主機B
20000:最上面操作時,在外網主機B 開的port


A 80 ->  B 20000 <-> 30002 <-  outside people



The -nNT flags will cause SSH to not allocate a tty and only do the port forwarding.

$ ssh -nNT -L 9000:imgur.com:80 user@example.com

======
https://superuser.com/questions/408031/differences-between-ssh-l-to-d
https://explainshell.com/explain?cmd=ssh+-L+-N+-f+-l

Differences between ssh -L to -D



ssh -L opens a local port. Everything that you send to that port is put through the ssh connection and leaves through the server. If you do, e.g., ssh -L 4444:google.com:80, if you open http://localhost:4444 on your browser, you'll actually see google's page.

ssh -D opens a local port, but it doesn't have a specific endpoint like with -L. Instead, it pretends to be a SOCKS proxy. If you open, e.g., ssh -D 7777, when you tell your browser to use localhost:7777 as your SOCKS proxy, everything your browser requests goes through the ssh tunnel. To the public internet, it's as if you were browsing from your ssh server instead of from your computer.



Specifies a local “dynamic” application-level port forwarding. This works by allocating a socket to listen to port on the local side, optionally bound to the specified bind_address. Whenever a connection is made to this port, the connection is forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are supported, and ssh will act as a SOCKS server. Only root can forward privileged ports. Dynamic port forwardings can also be specified in the configuration file.



==== become ssh tunnel service
https://kauri.io/make-use-of-your-remote-ethereum-node-using-an-ssh-tunnel-and-metamask/348d6c66da2949978c85bf2cd913d0ac/a


$ cat > persistent.ssh.tunnel.service <<EOF
[Unit]
Description=Persistent SSH Tunnel

[Service]
User=user
Type=simple
Restart=always
ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/ssh -N -v user@172.16.389.54 -L 8545:localhost:8545

[Install]
WantedBy=default.target
EOF


$ sudo mv persistent.ssh.tunnel.service /etc/systemd/system/
$ sudo systemctl daemon-reload
$ sudo systemctl enable persistent.ssh.tunnel.service
$ sudo systemctl start persistent.ssh.tunnel.service


sudo systemctl status persistent.ssh.tunnel.service

ethereum metamask chrome use detail and becarful

1. You want to clean all data,  just remove metamask then reinstall chrome extend again.  Sometime do this step, can finish many problems.

2. use private china (private network). If you reconnect failed or miss connect,


3. private network best good action is


Sometime you sure private network is work and ok. But check netowrks list failed, this time just redo Custome Network then everything is ok.

4. How to know private network have web3 and ok?

Just broswer web EX:http://192.168.9.10:38545  get 200 ok, sure web3 is ok.

5. geth rpc be careful

Fire time Open everything:--rpcapi "db,admin,debug,miner,personal,txpool,eth,net,web3" --rpc --rpcaddr "0.0.0.0" --rpccorsdomain "*" --rpcvhosts=*

check ok then remove or fix setting. EX:fix 0.0.0.0 => 140.140.140.140 then check again. If can't connect, you know which parms have problems.


6. smart contract
https://remix.ethereum.org/
https://solidity.readthedocs.io/en/v0.5.2/introduction-to-smart-contracts.html#simple-smart-contract
This example is simple for test.


use injected Web3 that call metamask. I try use Web3 Provide always failed. Don't wast time.

Error: invalid sender  get this error.  metamask custome network have one option
Try to put, sure connect, Then remove........ problem is this.


Why try put and remove. Because I try to put smart contract, get this message, then put chain id. Still get error message. Then I test for remove again, test private is ok or not. This time is success..........

PS:reload remix ethereum website maybe can fix bug


7. Why are MetaMask transactions taking a long time? MetaMask 交易為何十分耗時?
To ensure transactions are received in the correct order, each Ethereum transaction comes with an incrementing nonce. If you've used an account in MetaMask on a different network, you'll need to reset the nonce value. Click on the settings icon (3-bars), Settings, Reset Account. The transaction history will be cleared and now you can resubmit the transaction.

為了確保能夠以正確的順序接收交易,每個以太坊交易都會隨附累加的 nonce。 如果您將 MetaMask 中的帳戶用於不同的網路上,則必須重設 nonce 值。 請依序按一下設定圖示 (3 橫列) [設定]、[重設帳戶]。 交易歷程記錄將會清除,屆時您即可重新提交交易。
https://docs.microsoft.com/zh-tw/azure/blockchain/templates/ethereum-poa-deployment#why-are-metamask-transactions-taking-a-long-time

8. Do I need to specify gas fee in MetaMask? 我是否需要在 MetaMask 中指定燃料費?
Ether doesn't serve a purpose in proof-of-authority consortium. Hence there is no need to specify gas fee when submitting transactions in MetaMask.

乙太幣在權威證明聯盟中派不上用場。 因此,在於 MetaMask 中提交交易時,無須指定燃料費。
https://docs.microsoft.com/zh-tw/azure/blockchain/templates/ethereum-poa-deployment#why-are-metamask-transactions-taking-a-long-time

年輕人



https://www.mobile01.com/topicdetail.php?f=291&t=5107288&p=1085#10849



以你的情況,我可以給你明確的做法

1、絕對不要把錢放活存,如果你的錢就動態需要的,你開一個richart的帳戶,活存能有1%

2、如果你這40萬是要存下來的,之前有同事和我說她手上有幾十萬該怎麼投資,我回她目前中美貿易戰,fed升息局勢不好,所以不要急著投資股市,可以把錢放美金定存,由於我慣用的銀行是中國信託,我和她說定存1個半月後,再解定存轉美金優存能有2.8%,上星期五我看已經有3%了,她已經定存了一年,大約幾十萬到美金3%中。

3、她和她老公手上還有一些閒錢,每個月會有薪資進來,所以目前會抽特別股,大概會是3.5%~5%,風險是公司若沒有賺錢,也許當年不會發利息出來,好處是股價不會變動,很適合未經訓練的新手,因為股價不會變動,所以不會產生貪婪及恐懼亂買,亂賣損失手續費、交易稅及差價。


4、假日六、日選一天到圖書館看理財的書,選一天到運動或到山中爬山,做這兩件事可以減少你的開銷,也可以讓你的身體更健康,更可以強化你的心靈,平常日有空多走路,走路會讓你的頭腦更強化,讓你閱讀更有效率,我連續十幾年上班坐公車,下班走路,風雨無阻,如果你家離公司太遠,晚上可以到公園走路,把一些youtube財經節目轉成mp3放到手機中,一邊走一邊聽。

5、專注你的本業,讓你的薪資可以再提升,每個月,每年讓你的戶頭變大,當你一邊存錢,一邊看理財書時,你可以虛擬的買一些股票試試,虛擬的壞處是無法練訓自我心理面,畢竟你辛苦存的40萬賠3萬,和虛擬的40萬賠3萬壓力是不同的,但至少你可以練習交易的感覺,也可以練你投資的眼光,當你的虛擬帳戶開始賺錢後再進來股市,但我個人建議,你去圖書館看書時,先選如何看懂財報的書,像什麼二十萬賺1億,永遠不敗術,躺著賺錢…等,這種書你就先別看,心法、技術面的書也都先別看,先把基本面打好,在做虛擬投資時先試著報看公司的財報,然後評估股價的價值,然後像我一樣研究,觀察,記錄。


如果4、5你辨不到,覺得太多事要做了,你不是這塊料,那你就先執行1~3,最後你找機會在10年線下再買0050,以後就分批買進,你可以得到該有的報酬,每年也許可以得到3~4%的股息,如果買的時間點對,也許還能賺到一點點的差價,如果你到40以後,你真的很想要房子,車子及兒子,認命一點的工作到六十五,退休時應該能存個幾萬百退休金,如果你不要房子、車子及兒子,也許你40~50就能退休了,目前的年輕人被這個世界逼到要懂的選擇,不要傻乎乎的聽老一輩的人說什麼快結緍,快生小孩,要結緍前要先買房子然後揹三十年或四十年房貸,有了小孩後要買車子代步,對於一個平凡的人,要這三樣東西會讓你40歲前的人生變黑白,甚至50歲前人生變黑白,只要30歲沒有富爸爸的資助,沒有過人的資薪,你買房子、車子或生兒子是讓你接下來人生悲慘的開始。

房子及車子是給懂得玩金錢遊戲的人擁有的,這很悲哀但卻是事實,房子在全世界並不是拿來住的,而是拿來炒作的~

dcoker helpful command shell part 2


dpsrm < pattern docker cantainer name >


#!/bin/sh
IFS=$'\n'
echo $1

docker ps -a --no-trunc  | grep $1 | awk '{print $1}' | xargs -r --no-run-if-empty docker stop
docker ps -a --no-trunc  | grep $1 | awk '{print $1}' | xargs -r --no-run-if-empty docker rm
docker rmi -f $(docker images | grep $1 | awk '{print $3}')

[轉]My list of helpful docker commands

https://gist.github.com/garystafford/f0bd5f696399d4d7df0f



docker exec -it $(docker container ls | grep 'pattern' | awk '{print $1}') bin/bash

docker ps -a --no-trunc  | grep 'pattern' | awk '{print $1}' | xargs -r --no-run-if-empty docker rm

docker images -a | grep 'pattern' | awk '{print $3}' | xargs docker rmi



###############################################################################
# Helpful Docker commands and code snippets
###############################################################################

### CONTAINERS ###
docker stop $(docker ps -a -q) #stop ALL containers
docker rm -f $(docker ps -a -q) # remove ALL containers
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter

# exec into container
docker exec -it $(docker container ls  | grep '' | awk '{print $1}') sh
# exec into container on windows with Git Bash
winpty docker exec -it $(docker container ls  | grep '' | awk '{print $1}') sh

# helps with error: 'unexpected end of JSON input'
docker rm -f $(docker ps -a -q) # Remove all in one command with --force
docker exec -i -t "container_name_here" /bin/bash # Go to container command line

# to exit above use 'ctrl p', 'ctrl q' (don't exit or it will be in exited state)
docker rm $(docker ps -q -f status=exited) # remove all exited containers

### IMAGES ###
# list images and containers
docker images | grep "search_term_here"

# remove image(s) (must remove associated containers first)
docker rmi -f image_id_here # remove image(s)
docker rmi -f $(docker images -q) # remove ALL images!!!
docker rmi -f $(docker images | grep "^" | awk '{print $3}') # remove all  images
docker rmi -f $(docker images | grep 'search_term_here' | awk '{print $1}') # i.e. 2 days ago
docker rmi -f $(docker images | grep 'search_1\|search_2' | awk '{print $1}')

### DELETE BOTH IMAGES AND CONTAINERS ###
docker images && docker ps -a
# stop and remove containers and associated images with common grep search term
docker ps -a --no-trunc  | grep "search_term_here" | awk "{print $1}" | xargs -r --no-run-if-empty docker stop && \
docker ps -a --no-trunc  | grep "search_term_here" | awk "{print $1}" | xargs -r --no-run-if-empty docker rm && \
docker images --no-trunc | grep "search_term_here" | awk "{print $3}" | xargs -r --no-run-if-empty docker rmi

# stops only exited containers and delete only non-tagged images
docker ps --filter 'status=Exited' -a | xargs docker stop docker images --filter "dangling=true" -q | xargs docker rmi

### DELETE NETWORKS AND VOLUMES ###
# clean up orphaned volumes
docker volume rm $(docker volume ls -qf dangling=true)

# clean up orphaned networks
docker network rm $(docker network ls -q)

### NEW IMAGES/CONTAINERS ###
# create new docker container, ie. ubuntu
docker pull ubuntu:latest # 1x pull down image
docker run -i -t ubuntu /bin/bash # drops you into new container as root

### OTHER ###
# install docker first using directions for installing latest version
# https://docs.docker.com/installation/ubuntulinux/#ubuntu-trusty-1404-lts-64-bit

# other great tips: http://www.centurylinklabs.com/15-quick-docker-tips/
# fix fig / docker config: https://gist.github.com/RuslanHamidullin/94d95328a7360d843e52