万兆TL-ST5008F到手初测
先说应该是老的v1版本,起码铭牌上没见到v2的标识,作为初入手万兆光网实验装备应该是足用了。
如图:#1口接千兆RJ45转接头,#2和#8接的X520网卡。
某宝的X520-SR1(单口)和X520-SR2(双口)网卡各搞了几块。
作为VLAN交换机,可以走RS232 console、telnet、web等方式进行设置。
完整阅读本篇»先说应该是老的v1版本,起码铭牌上没见到v2的标识,作为初入手万兆光网实验装备应该是足用了。
如图:#1口接千兆RJ45转接头,#2和#8接的X520网卡。
某宝的X520-SR1(单口)和X520-SR2(双口)网卡各搞了几块。
作为VLAN交换机,可以走RS232 console、telnet、web等方式进行设置。
完整阅读本篇»During maintenance of a production server, we use to encounter a problem like this – an internet-access-blocked port, say 3306 (mysql), is about to be open for a little while due to debugging needs, which is not uncommon, right? So how to make this easily operated, mostly secure, and automatically disabled after working – I guess this’s gonna help somehow.
A Linux server with whatever the distribution including iptables (e.g. CentOS, Rocky for now as example), Nginx, fcgiwrap, a simple shell script and a commonly used web browser, let’s say chrome, will be major ingredients on the recipe.
常做运维,总会遇到某些线上服务器,为了便于调试,在符合安全要求的基础上,需要相对便利的对公网短时定向开放某些端口。
昨天想了一招,用nginx操作shell脚本,对特定公网IP开口子,叫一声“芝麻开门”,便捷又安全。举例端口3306(mysql),系统是Rocky Linux 8(原CentOS 8)。
先查一下现有的防火墙规则,需要的话可以保存一下。换句话说,搞芝麻开门之前,先确定门是隐藏的;也即已经有相应(且持久化)的iptables rule确保到被保护端口的连接是DROP/REJECT状态。
|
1 2 3 4 5 6 7 8 9 10 11 |
[root@localhost ~]# iptables -nvL Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 48772 9041K ACCEPT tcp -- * * 10.0.0.0/8 0.0.0.0/0 tcp 6 376 DROP tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:3306 Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination |
然后就是fcgiwrap的安装,此处就不写nginx安装过程了,默认安装即可。
安装后增加两个systemd服务文件,并测试fcgiwrap服务生效。
【注】那俩服务文件,在Redhat之外的发行版上,fcgiwrap安装包可能自带,请针对所用版本自行检查。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
[root@localhost ~]# dnf install fcgiwrap 上次元数据过期检查:2:45:15 前,执行于 2022年02月09日 星期三 20时00分42秒。 依赖关系解决。 (……部分省略) 已安装: fcgi-2.4.0-36.el8.x86_64 fcgiwrap-1.1.0-12.20181108git99c942c.el8.x86_64 完毕! [root@localhost ~]# [root@localhost ~]# cat /usr/lib/systemd/system/fcgiwrap.service [Unit] Description=Simple CGI Server After=nss-user-lookup.target Requires=fcgiwrap.socket [Service] EnvironmentFile=/etc/sysconfig/fcgiwrap ExecStart=/usr/sbin/fcgiwrap ${DAEMON_OPTS} -c ${DAEMON_PROCS} User=nginx Group=nginx [Install] Also=fcgiwrap.socket [root@localhost ~]# cat /usr/lib/systemd/system/fcgiwrap.socket [Unit] Description=fcgiwrap Socket [Socket] ListenStream=/run/fcgiwrap.socket [Install] WantedBy=sockets.target [root@localhost ~]# systemctl daemon-reload [root@localhost ~]# systemctl enable fcgiwrap.service —now Created symlink /etc/systemd/system/sockets.target.wants/fcgiwrap.socket → /usr/lib/systemd/system/fcgiwrap.socket. [root@localhost ~]# systemctl status fcgiwrap.service ● fcgiwrap.service - Simple CGI Server Loaded: loaded (/usr/lib/systemd/system/fcgiwrap.service; indirect; vendor preset: disable> Active: active (running) since Wed 2022-02-09 22:54:17 CST; 4s ago Main PID: 814486 (fcgiwrap) Tasks: 1 (limit: 23712) Memory: 492.0K CGroup: /system.slice/fcgiwrap.service └─814486 /usr/sbin/fcgiwrap -f -c 1 2月 09 22:54:17 localhost.localdomain systemd[1]: Started Simple CGI Server. [root@localhost ~]# |
接下来为一个新的nginx server准备个根目录,存放网页和之后控制iptables的脚本。
完整阅读本篇»从电影出发,读过了整本 The Great Gatsby 但并未留下什么深刻的印象。而拜当今的CG技术以及对绿幕的滥用,那个年代的浮华,其实电影中表现的很好。
这会儿说起,就在2020年开春,国内疫情声势大噪的时候,出于对彼时国内外经济状况所见所感,我一心想要了解大洋彼岸之世界强国,在其空前繁荣(1920s)和绝后萧条(1930s)中的国计民生。
正所谓“困了有人递枕头,拎醋有人请螃蟹”。在附近书店晃悠时看到这套书《美国成长三部曲》,所谓开卷有益,打开一读,it’s kinda exactly what I expect –
说真的,Florida炒地皮的章节,颇有身临其境之感。买地契击鼓传花那杠杆率玩的,珊瑚阁那威尼斯小船划的,戏剧性的飓风那刮得…… 让人不得不感慨,无论黑格尔有没有说过那句“人类唯一能从历史中吸取的教训就是,人类从来都不会从历史中吸取教训”,反正我是信了。
完整阅读本篇»硬件:SANTAK TG-BOX 600 + RPi 4B (2GB) + Huawei ME909s-821
监控服务:NUT(Network UPS Tools)参考文章挺多,就不详解了;Pi上连了4G模块主要是掉电时可能无法得到Wired Ethernet供应,就发个短信而已,不如直接走wwan靠谱省心。
目前用的是standalone模式,回头有空查下文档试试netserver模式,看config文件介绍,猜测是client可以通过server知道市电挂了,从而在server之前关机?
完整阅读本篇»TLDR,答案不确定哈。
看下今天傍晚ZBAD的清一色“备降”,目的地基本是天津滨海(ZBTJ)和济南遥墙(ZSJN)。
看一眼原因,特情是天气警报,主导能见度150米……
这就好玩了,距离只有30km的我们,窗外视野异常的好,甚至依稀看到几颗星星。
回溯一下METAR信息,很有意思。
完整阅读本篇»