可爱小蛇

可爱可爱小小蛇

【维护】SSL证书更新

2025-03-28

90 days renewal

My network flow direction:

China Mainland
   -> Hong Kong -> direct out
                -> (for special traffic) forward to US server

Remember to renew SSL certificate of blog.cutesnake.top. Otherwise, internet traffic forwarding to US server would fail because of SSL verication failure.

Use the following command:

cd ~
cd .acme.sh
acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/ --force

(correct output)
[Fri Apr 11 23:55:29 CST 2025] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Fri Apr 11 23:55:29 CST 2025] Single domain='blog.cutesnake.top'
[Fri Apr 11 23:55:30 CST 2025] Getting webroot for domain='blog.cutesnake.top'
[Fri Apr 11 23:55:30 CST 2025] Verifying: blog.cutesnake.top
[Fri Apr 11 23:55:31 CST 2025] Pending, The CA is processing your order, please just wait. (1/30)
[Fri Apr 11 23:55:34 CST 2025] Success
[Fri Apr 11 23:55:34 CST 2025] Verify finished, start to sign.
[Fri Apr 11 23:55:34 CST 2025] Lets finalize the order.
[Fri Apr 11 23:55:34 CST 2025] Le_OrderFinalize='https://acme-v02.api.letsencrypt.org/acme/finalize/1835370607/373098431387'
[Fri Apr 11 23:55:35 CST 2025] Downloading cert.
[Fri Apr 11 23:55:35 CST 2025] Le_LinkCert='https://acme-v02.api.letsencrypt.org/acme/cert/05cf367e4d70556b0e080b83a9c38aaf74f3'
[Fri Apr 11 23:55:36 CST 2025] Cert success.
-----BEGIN CERTIFICATE-----

acme.sh --install-cert -d blog.cutesnake.top
acme.sh --install-cert -d blog.cutesnake.top --key-file /www/server/panel/vhost/cert/cutesnake.top/privkey.pem --fullchain-file /www/server/panel/vhost/cert/cutesnake.top/fullchain.pem --reloadcmd "service nginx reload"
systemctl restart xray
systemctl status xray

No need to renew other websites (etc: secretbase) using this method. I can renew those websites using BT Panel. Why blog.cutesnake.top is so special? Because I specifically configured some xray fallback mechanism on this website. View other ariticle in this blog for more information about xray fallback mechanism.

【日常】公网远程串流画质流畅度测试,测试游戏:鸣潮无ui最高画质,方案:Windows端sunshine+mac端moonlight

2025-02-16

很久没更新了,开始打工以后好忙,同时在玩5款二游,基本时间都吃完了,在考虑这个博客以后该更新些啥。

公网串流前提:已经操作过局域网串流

准备工作: 1,确认发送端和接收端都具备IPv6地址(如果有拓展路由器,也要检查IPv6设置是否开启)。 2,准备好域名,发送端配置ddns-go开机自启,ddns-go设置里IP获取方式为网卡(建议不选临时IPv6地址,换的太频繁了,域名刷新很浪费时间)。只要长期离开发送端的话且选用IPv6的方式这一步就是必做,因为IPv6地址会变化,接收端想确认发送端IPv6地址,只能通过域名解析。如果不选用IPv6,似乎还有个叫皎月连的IPv4方案,我未实践所以不了解,仅作提供思路用。 3,购买米家智能插座,主板bios设置通电开机。提前在手机上的moonlight配对好发送端的sunshine备用。

开始接收:米家APP控制上电,开机自启ddns-go和sunshine(如果需要更新域名映射,视dns供应商更新快慢,有15分钟~2小时左右延迟)。可以在这个网址查看发送端端口情况:https://www.itdog.cn/tcping_ipv6。通过在发送端已经连接好的设备(手机)使用Monnlight连接后,输入新设备Moonlight发送的PIN码,即可连接新设备。

发送端: 地址:浙江 软件:sunshine 系统:Windows 配置:cpu 7950x3d, gpu 4090d 网络:500兆联通宽带,网线直连电脑(PS:一般而言500兆宽带指下载网速500Mbps,上传网速运营商一般会砍到十分之一左右,我这边情况是上传达到6、70Mbps,也就是8MBps左右。用木桶原理来说的话,这个8Mbps就是决定画质的最低的那块板。能支持到的程度是1440p120帧流畅,4K60帧很卡且频繁提示降低码率,4K120帧基本动都动不了)

moonlight: 地址:广东 软件:moonlight 画质:3024*1890,60fps 系统:MacOS 配置:MacBookPro 21年14英寸,芯片M1 Pro 网络:千兆移动宽带,光猫接路由器,经拓展路由器发射WiFi

感想:太浪费时间了,不建议折腾。原本是想过年回家带笔记本也能高画质玩游戏,从花费的时间精力来看是不如在老家也配台新电脑……比较麻烦的地方在于: 1,对大多数人来说IPv4就够用了,所以宽带师傅对IPv6基本就很不上心,基本等于要自己光猫路由器都捋一遍(发送端配好以后找了两三个朋友帮忙测接收端能不能收到,基本都因为没有IPv6没法测了)。幸好所有手机网络都自有IPv6地址吧,发现这一点后至少我能用手机测测了。 2,开机方案:开机卡完全不好使,因为不清楚开机卡提供方用的服务器靠不靠谱。建议还是米家插座吧,至少莫名其妙连不上的时候还能暴力断电,确认当前处于关机状态。 3,方案不稳定,网络状态千变万化,刚刚开机连不上,连上了挂机一会又连不上,总之就是已知的未知的各种原因导致连不上的情况非常常见,虽说等待能解决大部分问题,但不得不说还是十分坐牢。对时间要求高的,事务较紧急的,强烈不建议采用此方案。

不过至少也是有两点收获: 1、证明IPv6公网串流这种方案可行(从1月25日离开浙江到达广东,一直到1月31日都能连接上,期间经历了IPv6地址刷新2次,莫名其妙连不上还是比较折磨,所幸域名刷新后都还能连上) 2、再也没有配置焦虑了。再烂的设备,装有Moonlight的u盘一插,照样能玩全最高画质的游戏、指挥4090d训练模型、漏在家的文件传一传。只要网络好(不过这个要求可能也太高了,要求IPv6,懂的都懂,到头来可能还是要靠手机热点……orz)。

可能考虑写篇博客。

https://www.bilibili.com/video/BV1ufF7e4ELa

网站日常维护:ssl证书更新

2024-07-14

又是被Linux权限困扰的几小时……给了点777,应该不会有什么安全隐患吧……算了,小破网站搞搞就烂,反正我也防不住,干脆不防了。 acme签发由zero ssl改Let’s encrypt。 顺便维护了下xray的流量fallback,端口什么的终于对上了,之前头疼了几个月,这次可算是全部搞懂了。 https://xtls.github.io/document/level-1/fallbacks-lv1.html

Last login: Sun Jul 14 01:47:11 on ttys001
cutesnake@192 ~ % ssh root@66.42.100.165
root@66.42.100.165's password: 
Last login: Sun Jul 14 01:47:49 2024 from xx.xx.xx.xx
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
manpath: can't set the locale; make sure $LC_* and $LANG are correct
[root@vultr ~]# acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/ acme.sh --issue -d secretbase.cutesnake.top --webroot /www/wwwroot/secretbase.cutesnake.top/ acme.sh --issue -d cutesnake.top --webroot /www/wwwroot/cutesnake.top/
[Sun Jul 14 01:49:59 CST 2024] Unknown parameter : acme.sh
[root@vultr ~]# ls
[root@vultr ~]# cd ..
[root@vultr /]# ls
bin   etc   lib64       mnt    proc  sbin         srv  tmp  www
boot  home  lost+found  opt    root  srs          ssl  usr
dev   lib   media       patch  run   srs.log.sys  sys  var
[root@vultr /]# cd root
[root@vultr ~]# ls
[root@vultr ~]# cd .acme.sh
[root@vultr .acme.sh]# ls
account.conf            ca                 
acme.sh                 cutesnake.top_ecc  notify
acme.sh.csh             deploy             secretbase.cutesnake.top_ecc
acme.sh.env             dnsapi
blog.cutesnake.top_ecc  http.header
[root@vultr .acme.sh]# acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/ acme.sh --issue -d secretbase.cutesnake.top --webroot /www/wwwroot/secretbase.cutesnake.top/ acme.sh --issue -d cutesnake.top --webroot /www/wwwroot/cutesnake.top/
[Sun Jul 14 01:55:34 CST 2024] Unknown parameter : acme.sh
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# .acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/ acme.sh --issue -d secretbase.cutesnake.top --webroot /www/wwwroot/secretbase.cutesnake.top/ acme.sh --issue -d cutesnake.top --webroot /www/wwwroot/cutesnake.top/
-bash: .acme.sh: command not found
[root@vultr .acme.sh]# bash acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/ acme.sh --issue -d secretbase.cutesnake.top --webroot /www/wwwroot/secretbase.cutesnake.top/ acme.sh --issue -d cutesnake.top --webroot /www/wwwroot/cutesnake.top/
[Sun Jul 14 01:56:07 CST 2024] Unknown parameter : acme.sh
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# ls
account.conf            ca                 lijunting.com_ecc
acme.sh                 cutesnake.top_ecc  notify
acme.sh.csh             deploy             secretbase.cutesnake.top_ecc
acme.sh.env             dnsapi
blog.cutesnake.top_ecc  http.header
[root@vultr .acme.sh]# acme.sh
https://github.com/acmesh-official/acme.sh
v3.0.8
Usage: acme.sh <command> ... [parameters ...]
Commands:
  -h, --help               Show this help message.
  -v, --version            Show version info.
  --install                Install acme.sh to your system.
  --uninstall              Uninstall acme.sh, and uninstall the cron job.
  --upgrade                Upgrade acme.sh to the latest code from https://github.com/acmesh-official/acme.sh.
  --issue                  Issue a cert.
  --deploy                 Deploy the cert to your server.
  -i, --install-cert       Install the issued cert to apache/nginx or any other server.
  -r, --renew              Renew a cert.
  --renew-all              Renew all the certs.
  --revoke                 Revoke a cert.
  --remove                 Remove the cert from list of certs known to acme.sh.
  --list                   List all the certs.
  --info                   Show the acme.sh configs, or the configs for a domain with [-d domain] parameter.
  --to-pkcs12              Export the certificate and key to a pfx file.
  --to-pkcs8               Convert to pkcs8 format.
  --sign-csr               Issue a cert from an existing csr.
  --show-csr               Show the content of a csr.
  -ccr, --create-csr       Create CSR, professional use.
  --create-domain-key      Create an domain private key, professional use.
  --update-account         Update account info.
  --register-account       Register account key.
  --deactivate-account     Deactivate the account.
  --create-account-key     Create an account private key, professional use.
  --install-cronjob        Install the cron job to renew certs, you don't need to call this. The 'install' command can automatically install the cron job.
  --uninstall-cronjob      Uninstall the cron job. The 'uninstall' command can do this automatically.
  --cron                   Run cron job to renew all the certs.
  --set-notify             Set the cron notification hook, level or mode.
  --deactivate             Deactivate the domain authz, professional use.
  --set-default-ca         Used with '--server', Set the default CA to use.
                           See: https://github.com/acmesh-official/acme.sh/wiki/Server
  --set-default-chain      Set the default preferred chain for a CA.
                           See: https://github.com/acmesh-official/acme.sh/wiki/Preferred-Chain


Parameters:
  -d, --domain <domain.tld>         Specifies a domain, used to issue, renew or revoke etc.
  --challenge-alias <domain.tld>    The challenge domain alias for DNS alias mode.
                                      See: https://github.com/acmesh-official/acme.sh/wiki/DNS-alias-mode

  --domain-alias <domain.tld>       The domain alias for DNS alias mode.
                                      See: https://github.com/acmesh-official/acme.sh/wiki/DNS-alias-mode

  --preferred-chain <chain>         If the CA offers multiple certificate chains, prefer the chain with an issuer matching this Subject Common Name.
                                      If no match, the default offered chain will be used. (default: empty)
                                      See: https://github.com/acmesh-official/acme.sh/wiki/Preferred-Chain

  --valid-to    <date-time>         Request the NotAfter field of the cert.
                                      See: https://github.com/acmesh-official/acme.sh/wiki/Validity
  --valid-from  <date-time>         Request the NotBefore field of the cert.
                                      See: https://github.com/acmesh-official/acme.sh/wiki/Validity

  -f, --force                       Force install, force cert renewal or override sudo restrictions.
  --staging, --test                 Use staging server, for testing.
  --debug [0|1|2|3]                 Output debug info. Defaults to 2 if argument is omitted.
  --output-insecure                 Output all the sensitive messages.
                                      By default all the credentials/sensitive messages are hidden from the output/debug/log for security.
  -w, --webroot <directory>         Specifies the web root folder for web root mode.
  --standalone                      Use standalone mode.
  --alpn                            Use standalone alpn mode.
  --stateless                       Use stateless mode.
                                      See: https://github.com/acmesh-official/acme.sh/wiki/Stateless-Mode

  --apache                          Use apache mode.
  --dns [dns_hook]                  Use dns manual mode or dns api. Defaults to manual mode when argument is omitted.
                                      See: https://github.com/acmesh-official/acme.sh/wiki/dnsapi

  --dnssleep <seconds>              The time in seconds to wait for all the txt records to propagate in dns api mode.
                                      It's not necessary to use this by default, acme.sh polls dns status by DOH automatically.
  -k, --keylength <bits>            Specifies the domain key length: 2048, 3072, 4096, 8192 or ec-256, ec-384, ec-521.
  -ak, --accountkeylength <bits>    Specifies the account key length: 2048, 3072, 4096
  --log [file]                      Specifies the log file. Defaults to "/root/.acme.sh/acme.sh.log" if argument is omitted.
  --log-level <1|2>                 Specifies the log level, default is 2.
  --syslog <0|3|6|7>                Syslog level, 0: disable syslog, 3: error, 6: info, 7: debug.
  --eab-kid <eab_key_id>            Key Identifier for External Account Binding.
  --eab-hmac-key <eab_hmac_key>     HMAC key for External Account Binding.


  These parameters are to install the cert to nginx/apache or any other server after issue/renew a cert:

  --cert-file <file>                Path to copy the cert file to after issue/renew.
  --key-file <file>                 Path to copy the key file to after issue/renew.
  --ca-file <file>                  Path to copy the intermediate cert file to after issue/renew.
  --fullchain-file <file>           Path to copy the fullchain cert file to after issue/renew.
  --reloadcmd <command>             Command to execute after issue/renew to reload the server.

  --server <server_uri>             ACME Directory Resource URI. (default: https://acme.zerossl.com/v2/DV90)
                                      See: https://github.com/acmesh-official/acme.sh/wiki/Server

  --accountconf <file>              Specifies a customized account config file.
  --home <directory>                Specifies the home dir for acme.sh.
  --cert-home <directory>           Specifies the home dir to save all the certs, only valid for '--install' command.
  --config-home <directory>         Specifies the home dir to save all the configurations.
  --useragent <string>              Specifies the user agent string. it will be saved for future use too.
  -m, --email <email>               Specifies the account email, only valid for the '--install' and '--update-account' command.
  --accountkey <file>               Specifies the account key path, only valid for the '--install' command.
  --days <ndays>                    Specifies the days to renew the cert when using '--issue' command. The default value is 60 days.
  --httpport <port>                 Specifies the standalone listening port. Only valid if the server is behind a reverse proxy or load balancer.
  --tlsport <port>                  Specifies the standalone tls listening port. Only valid if the server is behind a reverse proxy or load balancer.
  --local-address <ip>              Specifies the standalone/tls server listening address, in case you have multiple ip addresses.
  --listraw                         Only used for '--list' command, list the certs in raw format.
  -se, --stop-renew-on-error        Only valid for '--renew-all' command. Stop if one cert has error in renewal.
  --insecure                        Do not check the server certificate, in some devices, the api server's certificate may not be trusted.
  --ca-bundle <file>                Specifies the path to the CA certificate bundle to verify api server's certificate.
  --ca-path <directory>             Specifies directory containing CA certificates in PEM format, used by wget or curl.
  --no-cron                         Only valid for '--install' command, which means: do not install the default cron job.
                                      In this case, the certs will not be renewed automatically.
  --no-profile                      Only valid for '--install' command, which means: do not install aliases to user profile.
  --no-color                        Do not output color text.
  --force-color                     Force output of color text. Useful for non-interactive use with the aha tool for HTML E-Mails.
  --ecc                             Specifies use of the ECC cert. Only valid for '--install-cert', '--renew', '--remove ', '--revoke',
                                      '--deploy', '--to-pkcs8', '--to-pkcs12' and '--create-csr'.
  --csr <file>                      Specifies the input csr.
  --pre-hook <command>              Command to be run before obtaining any certificates.
  --post-hook <command>             Command to be run after attempting to obtain/renew certificates. Runs regardless of whether obtain/renew succeeded or failed.
  --renew-hook <command>            Command to be run after each successfully renewed certificate.
  --deploy-hook <hookname>          The hook file to deploy cert
  --ocsp, --ocsp-must-staple        Generate OCSP-Must-Staple extension.
  --always-force-new-domain-key     Generate new domain key on renewal. Otherwise, the domain key is not changed by default.
  --auto-upgrade [0|1]              Valid for '--upgrade' command, indicating whether to upgrade automatically in future. Defaults to 1 if argument is omitted.
  --listen-v4                       Force standalone/tls server to listen at ipv4.
  --listen-v6                       Force standalone/tls server to listen at ipv6.
  --openssl-bin <file>              Specifies a custom openssl bin location.
  --use-wget                        Force to use wget, if you have both curl and wget installed.
  --yes-I-know-dns-manual-mode-enough-go-ahead-please  Force use of dns manual mode.
                                      See:  https://github.com/acmesh-official/acme.sh/wiki/dns-manual-mode

  -b, --branch <branch>             Only valid for '--upgrade' command, specifies the branch name to upgrade to.
  --notify-level <0|1|2|3>          Set the notification level:  Default value is 2.
                                      0: disabled, no notification will be sent.
                                      1: send notifications only when there is an error.
                                      2: send notifications when a cert is successfully renewed, or there is an error.
                                      3: send notifications when a cert is skipped, renewed, or error.
  --notify-mode <0|1>               Set notification mode. Default value is 0.
                                      0: Bulk mode. Send all the domain's notifications in one message(mail).
                                      1: Cert mode. Send a message for every single cert.
  --notify-hook <hookname>          Set the notify hook
  --notify-source <server name>     Set the server name in the notification message
  --revoke-reason <0-10>            The reason for revocation, can be used in conjunction with the '--revoke' command.
                                      See: https://github.com/acmesh-official/acme.sh/wiki/revokecert

  --password <password>             Add a password to exported pfx file. Use with --to-pkcs12.



[root@vultr .acme.sh]# acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/ acme.sh --issue -d secretbase.cutesnake.top --webroot /www/wwwroot/secretbase.cutesnake.top/ acme.sh --issue -d cutesnake.top --webroot /www/wwwroot/cutesnake.top/
[Sun Jul 14 01:57:24 CST 2024] Unknown parameter : acme.sh
[root@vultr .acme.sh]# acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/
[Sun Jul 14 01:57:58 CST 2024] Using CA: https://acme.zerossl.com/v2/DV90
[Sun Jul 14 01:57:58 CST 2024] Single domain='blog.cutesnake.top'
[Sun Jul 14 01:58:00 CST 2024] Getting webroot for domain='blog.cutesnake.top'
[Sun Jul 14 01:58:00 CST 2024] Verifying: blog.cutesnake.top
[Sun Jul 14 01:58:01 CST 2024] Processing, The CA is processing your order, please just wait. (1/30)
[Sun Jul 14 01:58:05 CST 2024] Pending, The CA is processing your order, please just wait. (2/30)
[Sun Jul 14 01:58:08 CST 2024] Pending, The CA is processing your order, please just wait. (3/30)
[Sun Jul 14 01:58:12 CST 2024] Pending, The CA is processing your order, please just wait. (4/30)
[Sun Jul 14 01:58:16 CST 2024] Pending, The CA is processing your order, please just wait. (5/30)
[Sun Jul 14 01:58:19 CST 2024] Pending, The CA is processing your order, please just wait. (6/30)
[Sun Jul 14 01:58:23 CST 2024] Pending, The CA is processing your order, please just wait. (7/30)
[Sun Jul 14 01:58:27 CST 2024] Pending, The CA is processing your order, please just wait. (8/30)
[Sun Jul 14 01:58:30 CST 2024] Pending, The CA is processing your order, please just wait. (9/30)
[Sun Jul 14 01:58:34 CST 2024] Pending, The CA is processing your order, please just wait. (10/30)
[Sun Jul 14 01:58:38 CST 2024] Pending, The CA is processing your order, please just wait. (11/30)
[Sun Jul 14 01:58:41 CST 2024] Pending, The CA is processing your order, please just wait. (12/30)
[Sun Jul 14 01:58:45 CST 2024] Pending, The CA is processing your order, please just wait. (13/30)
[Sun Jul 14 01:58:49 CST 2024] Pending, The CA is processing your order, please just wait. (14/30)
[Sun Jul 14 01:58:52 CST 2024] Pending, The CA is processing your order, please just wait. (15/30)
[Sun Jul 14 01:58:56 CST 2024] Pending, The CA is processing your order, please just wait. (16/30)
2^C   
[root@vultr .acme.sh]# systemctl status xray
● xray.service - Xray Service
   Loaded: loaded (/etc/systemd/system/xray.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/xray.service.d
           └─10-donot_touch_single_conf.conf
   Active: active (running) since Tue 2024-03-12 03:11:35 CST; 4 months 2 days ago
     Docs: https://github.com/xtls
 Main PID: 17312 (xray)
   CGroup: /system.slice/xray.service
           └─17312 /usr/local/bin/xray run -config /usr/local/etc/xray/config...

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
[root@vultr .acme.sh]# systemctl status xray
● xray.service - Xray Service
   Loaded: loaded (/etc/systemd/system/xray.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/xray.service.d
           └─10-donot_touch_single_conf.conf
   Active: active (running) since Tue 2024-03-12 03:11:35 CST; 4 months 2 days ago
     Docs: https://github.com/xtls
 Main PID: 17312 (xray)
   CGroup: /system.slice/xray.service
           └─17312 /usr/local/bin/xray run -config /usr/local/etc/xray/config.json

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
[root@vultr .acme.sh]# vim /usr/local/etc/xray/config.json
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/
[Sun Jul 14 02:14:29 CST 2024] Using CA: https://acme.zerossl.com/v2/DV90
[Sun Jul 14 02:14:29 CST 2024] Single domain='blog.cutesnake.top'
[Sun Jul 14 02:14:31 CST 2024] Getting webroot for domain='blog.cutesnake.top'
[Sun Jul 14 02:14:32 CST 2024] Verifying: blog.cutesnake.top
[Sun Jul 14 02:14:32 CST 2024] Processing, The CA is processing your order, please just wait. (1/30)
[Sun Jul 14 02:14:36 CST 2024] Pending, The CA is processing your order, please just wait. (2/30)
[Sun Jul 14 02:14:40 CST 2024] Pending, The CA is processing your order, please just wait. (3/30)
[Sun Jul 14 02:14:43 CST 2024] Pending, The CA is processing your order, please just wait. (4/30)
[Sun Jul 14 02:14:47 CST 2024] Pending, The CA is processing your order, please just wait. (5/30)
[Sun Jul 14 02:14:51 CST 2024] Pending, The CA is processing your order, please just wait. (6/30)
[Sun Jul 14 02:14:54 CST 2024] Pending, The CA is processing your order, please just wait. (7/30)
[Sun Jul 14 02:14:58 CST 2024] Pending, The CA is processing your order, please just wait. (8/30)
[Sun Jul 14 02:15:01 CST 2024] Pending, The CA is processing your order, please just wait. (9/30)
[Sun Jul 14 02:15:05 CST 2024] Pending, The CA is processing your order, please just wait. (10/30)
[Sun Jul 14 02:15:09 CST 2024] Pending, The CA is processing your order, please just wait. (11/30)
[Sun Jul 14 02:15:12 CST 2024] Pending, The CA is processing your order, please just wait. (12/30)
[Sun Jul 14 02:15:16 CST 2024] Pending, The CA is processing your order, please just wait. (13/30)
[Sun Jul 14 02:15:20 CST 2024] Pending, The CA is processing your order, please just wait. (14/30)
[Sun Jul 14 02:15:24 CST 2024] Pending, The CA is processing your order, please just wait. (15/30)
[Sun Jul 14 02:15:27 CST 2024] Pending, The CA is processing your order, please just wait. (16/30)
[Sun Jul 14 02:15:31 CST 2024] Pending, The CA is processing your order, please just wait. (17/30)
[Sun Jul 14 02:15:34 CST 2024] Pending, The CA is processing your order, please just wait. (18/30)
[Sun Jul 14 02:15:38 CST 2024] Pending, The CA is processing your order, please just wait. (19/30)
[Sun Jul 14 02:15:42 CST 2024] Pending, The CA is processing your order, please just wait. (20/30)
[Sun Jul 14 02:15:45 CST 2024] Pending, The CA is processing your order, please just wait. (21/30)
[Sun Jul 14 02:15:49 CST 2024] Pending, The CA is processing your order, please just wait. (22/30)
[Sun Jul 14 02:15:53 CST 2024] Pending, The CA is processing your order, please just wait. (23/30)
[Sun Jul 14 02:15:56 CST 2024] Pending, The CA is processing your order, please just wait. (24/30)
[Sun Jul 14 02:16:00 CST 2024] Pending, The CA is processing your order, please just wait. (25/30)
[Sun Jul 14 02:16:04 CST 2024] Pending, The CA is processing your order, please just wait. (26/30)
[Sun Jul 14 02:16:07 CST 2024] Pending, The CA is processing your order, please just wait. (27/30)
[Sun Jul 14 02:16:11 CST 2024] Pending, The CA is processing your order, please just wait. (28/30)
[Sun Jul 14 02:16:15 CST 2024] Pending, The CA is processing your order, please just wait. (29/30)
[Sun Jul 14 02:16:18 CST 2024] blog.cutesnake.top:Timeout
[Sun Jul 14 02:16:18 CST 2024] Please add '--debug' or '--log' to check more details.
[Sun Jul 14 02:16:18 CST 2024] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh
[root@vultr .acme.sh]# acme.sh  –set-default-ca –server letsencrypt
/root/.acme.sh/acme.sh: line 8006: –set-default-ca: command not found
[root@vultr .acme.sh]# –set-default-ca –server letsencrypt
-bash: –set-default-ca: command not found
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# acme.sh --set-default-ca  --server  letsencrypt
[Sun Jul 14 02:19:26 CST 2024] Changed default CA to: https://acme-v02.api.letsencrypt.org/directory
[root@vultr .acme.sh]# acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/
[Sun Jul 14 02:19:36 CST 2024] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Sun Jul 14 02:19:37 CST 2024] Create account key ok.
[Sun Jul 14 02:19:37 CST 2024] Registering account: https://acme-v02.api.letsencrypt.org/directory
[Sun Jul 14 02:19:37 CST 2024] Register account Error: {
  "type": "urn:ietf:params:acme:error:invalidContact",
  "detail": "Error creating new account :: invalid contact domain. Contact emails @example.com are forbidden",
  "status": 400
}
[Sun Jul 14 02:19:37 CST 2024] Please add '--debug' or '--log' to check more details.
[Sun Jul 14 02:19:37 CST 2024] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh
[root@vultr .acme.sh]# acme.sh --register-account -m suchacutesnake@gmail.com
[Sun Jul 14 02:21:39 CST 2024] Registering account: https://acme-v02.api.letsencrypt.org/directory
[Sun Jul 14 02:21:39 CST 2024] Register account Error: {
  "type": "urn:ietf:params:acme:error:invalidContact",
  "detail": "Error creating new account :: invalid contact domain. Contact emails @example.com are forbidden",
  "status": 400
}
[root@vultr .acme.sh]# acme.sh --update-account
[Sun Jul 14 02:22:15 CST 2024] The account url is empty, please run '--update-account' first to update the account info first,
[Sun Jul 14 02:22:15 CST 2024] Then try again.
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# acme.sh --register-account -m suchacutesnake@gmail.com
[Sun Jul 14 02:23:17 CST 2024] Registering account: https://acme-v02.api.letsencrypt.org/directory
[Sun Jul 14 02:23:18 CST 2024] Register account Error: {
  "type": "urn:ietf:params:acme:error:invalidContact",
  "detail": "Error creating new account :: invalid contact domain. Contact emails @example.com are forbidden",
  "status": 400
}
[root@vultr .acme.sh]# vim acme.sh --register-account -m suchacutesnake@gmail.com
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 15 2020 16:44:08)
Unknown option argument: "--register-account"
More info with: "vim -h"
[root@vultr .acme.sh]# vim ~/.acme.sh/account.conf
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/
[Sun Jul 14 02:25:12 CST 2024] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Sun Jul 14 02:25:12 CST 2024] Registering account: https://acme-v02.api.letsencrypt.org/directory
[Sun Jul 14 02:25:13 CST 2024] Registered
[Sun Jul 14 02:25:13 CST 2024] ACCOUNT_THUMBPRINT='Zxz16kZ1_7fMubtWS5f2XfYQWyFiO86648mT5WzJ4qo'
[Sun Jul 14 02:25:13 CST 2024] Single domain='blog.cutesnake.top'
[Sun Jul 14 02:25:14 CST 2024] Getting webroot for domain='blog.cutesnake.top'
[Sun Jul 14 02:25:14 CST 2024] Verifying: blog.cutesnake.top
[Sun Jul 14 02:25:14 CST 2024] Pending, The CA is processing your order, please just wait. (1/30)
[Sun Jul 14 02:25:18 CST 2024] Invalid status, blog.cutesnake.top:Verify error detail:66.42.100.165: Invalid response from http://blog.cutesnake.top/.well-known/acme-challenge/5h4A6RVhc2XwOnByBcfxsCdBp71XIqpKm-b7Pbp_tRY: 404
[Sun Jul 14 02:25:18 CST 2024] Please add '--debug' or '--log' to check more details.
[Sun Jul 14 02:25:18 CST 2024] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/
[Sun Jul 14 02:34:12 CST 2024] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Sun Jul 14 02:34:13 CST 2024] Single domain='blog.cutesnake.top'
[Sun Jul 14 02:34:14 CST 2024] Getting webroot for domain='blog.cutesnake.top'
[Sun Jul 14 02:34:14 CST 2024] Verifying: blog.cutesnake.top
[Sun Jul 14 02:34:14 CST 2024] Pending, The CA is processing your order, please just wait. (1/30)
[Sun Jul 14 02:34:18 CST 2024] Invalid status, blog.cutesnake.top:Verify error detail:66.42.100.165: Invalid response from http://blog.cutesnake.top/.well-known/acme-challenge/SEXD707GmP-nLhdcYQs-3h7pC6sUmnqNcVqDYsY8iWs: 404
[Sun Jul 14 02:34:18 CST 2024] Please add '--debug' or '--log' to check more details.
[Sun Jul 14 02:34:18 CST 2024] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/
[Sun Jul 14 02:38:06 CST 2024] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Sun Jul 14 02:38:06 CST 2024] Single domain='blog.cutesnake.top'
[Sun Jul 14 02:38:07 CST 2024] Getting webroot for domain='blog.cutesnake.top'
[Sun Jul 14 02:38:07 CST 2024] Verifying: blog.cutesnake.top
[Sun Jul 14 02:38:08 CST 2024] Pending, The CA is processing your order, please just wait. (1/30)
[Sun Jul 14 02:38:11 CST 2024] Invalid status, blog.cutesnake.top:Verify error detail:66.42.100.165: Invalid response from http://blog.cutesnake.top/.well-known/acme-challenge/PihBl7gj5PBTw0GBYzR_5CezhTNKDQpfQeKxz5r6Ce8: 404
[Sun Jul 14 02:38:11 CST 2024] Please add '--debug' or '--log' to check more details.
[Sun Jul 14 02:38:11 CST 2024] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh
[root@vultr .acme.sh]# sudo acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/
sudo: acme.sh: command not found
[root@vultr .acme.sh]# brew list
-bash: brew: command not found
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# chmod 777 /www/wwwroot/blog.cutesnake.top/.well-known/acme-challenge/
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# acme.sh --issue -d blog.cutesnake.top --webroot /www/wwwroot/blog.cutesnake.top/
[Sun Jul 14 02:46:41 CST 2024] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Sun Jul 14 02:46:41 CST 2024] Single domain='blog.cutesnake.top'
[Sun Jul 14 02:46:43 CST 2024] Getting webroot for domain='blog.cutesnake.top'
[Sun Jul 14 02:46:43 CST 2024] Verifying: blog.cutesnake.top
[Sun Jul 14 02:46:43 CST 2024] Pending, The CA is processing your order, please just wait. (1/30)
[Sun Jul 14 02:46:47 CST 2024] Success
[Sun Jul 14 02:46:47 CST 2024] Verify finished, start to sign.
[Sun Jul 14 02:46:47 CST 2024] Lets finalize the order.
[Sun Jul 14 02:46:47 CST 2024] Le_OrderFinalize='https://acme-v02.api.letsencrypt.org/acme/finalize/1835370607/286984849507'
[Sun Jul 14 02:46:48 CST 2024] Downloading cert.
[Sun Jul 14 02:46:48 CST 2024] Le_LinkCert='https://acme-v02.api.letsencrypt.org/acme/cert/033bffb2b646e8be12c37e74b08325127971'
[Sun Jul 14 02:46:48 CST 2024] Cert success.
-----BEGIN CERTIFICATE-----
MIIDhDCCAwqgAwIBAgISAzv/srZG6L4Sw350sIMlEnlxMAoGCCqGSM49BAMDMDIx
CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQswCQYDVQQDEwJF
NTAeFw0yNDA3MTMxNzQ2NDdaFw0yNDEwMTExNzQ2NDZaMB0xGzAZBgNVBAMTEmJs
b2cuY3V0ZXNuYWtlLnRvcDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABLx4bhCe
BQvvkk2ogHGzbYiO0OHCZTCLaPxtwaAxKf3J9hRHJQvxYsbilhu7pObl1NiIeFvF
ZT8QFSfgb/xhBHyjggITMIICDzAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0lBBYwFAYI
KwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFKLHkn1q
6Y97k9N8qUblZOlU1JL2MB8GA1UdIwQYMBaAFJ8rX888IU+dBLftKyzExnCL0tcN
MFUGCCsGAQUFBwEBBEkwRzAhBggrBgEFBQcwAYYVaHR0cDovL2U1Lm8ubGVuY3Iu
b3JnMCIGCCsGAQUFBzAChhZodHRwOi8vZTUuaS5sZW5jci5vcmcvMB0GA1UdEQQW
MBSCEmJsb2cuY3V0ZXNuYWtlLnRvcDATBgNVHSAEDDAKMAgGBmeBDAECATCCAQMG
CisGAQQB1nkCBAIEgfQEgfEA7wB1AD8XS0/XIkdYlB1lHIS+DRLtkDd/H4Vq68G/
KIXs+GRuAAABkK1rScIAAAQDAEYwRAIgfb4M6yTf7NZCrElWR1t+dP0UO9l7IuFY
g8XTx10s7IUCIDhlncb/IgMlTL9QpIk3Zqiasaj92gkV9MSUZyYBmqbHAHYA3+FW
66oFr7WcD4ZxjajAMk6uVtlup/WlagHRwTu+UlwAAAGQrWtKiQAABAMARzBFAiEA
qqGlcCP4PWZkDlGyI5qeqeNOoKBLJcp8MuzPVaZERPwCIEOHTpfjZFm3012dYi7G
a7Ywwe1SjXXp/+42Isa4t2LeMAoGCCqGSM49BAMDA2gAMGUCMQCJv31jYRxqhn6n
fdH3ge1MiXlDuSbUV7plNqABosd1HGQsHMoQWF2SqfLkgUV8t3wCMGXjPt6oxAwU
FtSjRaw3F3SdBaOl9ET/uFkZ4rvIATf1ubie4LMbbzrqQ/O/XQ1fmA==
-----END CERTIFICATE-----
[Sun Jul 14 02:46:48 CST 2024] Your cert is in: /root/.acme.sh/blog.cutesnake.top_ecc/blog.cutesnake.top.cer
[Sun Jul 14 02:46:48 CST 2024] Your cert key is in: /root/.acme.sh/blog.cutesnake.top_ecc/blog.cutesnake.top.key
[Sun Jul 14 02:46:48 CST 2024] The intermediate CA cert is in: /root/.acme.sh/blog.cutesnake.top_ecc/ca.cer
[Sun Jul 14 02:46:48 CST 2024] And the full chain certs is there: /root/.acme.sh/blog.cutesnake.top_ecc/fullchain.cer
[root@vultr .acme.sh]# acme.sh --install-cert -d blog.cutesnake.top
[Sun Jul 14 02:47:45 CST 2024] The domain 'blog.cutesnake.top' seems to have a ECC cert already, lets use ecc cert.
[root@vultr .acme.sh]# --key-file /www/server/panel/vhost/cert/cutesnake.top/privkey.pem
-bash: --key-file: command not found
[root@vultr .acme.sh]# --fullchain-file /www/server/panel/vhost/cert/cutesnake.top/fullchain.pem
-bash: --fullchain-file: command not found
[root@vultr .acme.sh]# --reloadcmd "service nginx force-reload"
-bash: --reloadcmd: command not found
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# acme.sh --install-cert -d blog.cutesnake.top --key-file /www/server/panel/vhost/cert/cutesnake.top/privkey.pem --fullchain-file /www/server/panel/vhost/cert/cutesnake.top/fullchain.pem --reloadcmd "service nginx force-reload"
[Sun Jul 14 02:48:34 CST 2024] The domain 'blog.cutesnake.top' seems to have a ECC cert already, lets use ecc cert.
[Sun Jul 14 02:48:34 CST 2024] Installing key to: /www/server/panel/vhost/cert/cutesnake.top/privkey.pem
[Sun Jul 14 02:48:34 CST 2024] Installing full chain to: /www/server/panel/vhost/cert/cutesnake.top/fullchain.pem
[Sun Jul 14 02:48:34 CST 2024] Run reload cmd: service nginx force-reload
Usage: /etc/init.d/nginx {start|stop|restart|reload|status|configtest}
[Sun Jul 14 02:48:34 CST 2024] Reload error for :
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# service nginx force-reload
Usage: /etc/init.d/nginx {start|stop|restart|reload|status|configtest}
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# 
[root@vultr .acme.sh]# vim /usr/local/etc/xray/config.json
[root@vultr .acme.sh]# systemctl restart xray
[root@vultr .acme.sh]# systemctl status xray
● xray.service - Xray Service
   Loaded: loaded (/etc/systemd/system/xray.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/xray.service.d
           └─10-donot_touch_single_conf.conf
   Active: active (running) since Sun 2024-07-14 03:04:41 CST; 9s ago
     Docs: https://github.com/xtls
 Main PID: 23139 (xray)
   CGroup: /system.slice/xray.service
           └─23139 /usr/local/bin/xray run -config /usr/local/etc/xray/config.json

Jul 14 03:04:41 vultr.guest systemd[1]: Stopped Xray Service.
Jul 14 03:04:41 vultr.guest systemd[1]: Started Xray Service.
Jul 14 03:04:41 vultr.guest xray[23139]: Xray 1.8.6 (Xray, Penetrates Everything.) Custom (go1.21.4 linux/amd64)
Jul 14 03:04:41 vultr.guest xray[23139]: A unified platform for anti-censorship.
Jul 14 03:04:41 vultr.guest xray[23139]: 2024/07/14 03:04:41 [Info] infra/conf/serial: Reading config: /usr/local/etc/xray/config.json
[root@vultr .acme.sh]# 

2023C++底层人士面试总集

2023-07-03

水平很次,成绩很差,没有拿到毕业证(差一门课学分要明年重修成功才能拿到),非本专业转码,无项目,找工作也晚,属于debuff拉满的底层人士。可能唯一好点就是学校牌子在这边比较好用(说起这点真是汗颜,高中的努力居然有这么长远的帮助,要说现在我感觉我根本不配这个牌子)。所以主要面的小厂。

卓漫科技 2023.6.29

第一次线下面试,机会由hr主动联系提供,面试岗位是算法工程师。我提前了20分钟到,到了以后给了份个人信息表和一些模型训练相关的问题(全都不会),这时已经感觉很不妙了。等了40分钟面试官才出现。由一个3,40岁天大的学长和hr共同面试,由于我人工智能一窍不通,很明显气氛很尴尬。学长看了我简历半天,问了我几个问题: 1,c和c++有什么区别? 答:c++是c的超集,c++好像还有面向对象特性,其他不知道。 2,c和c++有哪些传值方式,有什么区别? 答:不会。 复盘:值传递,指针传递,引用传递。c没有引用传递。 3,这个是c里面最基础的东西啊……这样吧,我再问问……(考虑一会)算了不问了,好像不太幸运没考到你会的啊。那讲讲你的故事吧,你擅长什么? 答:(支吾)自学英文课程的计算机基础课,考了PAT,主要考试内容是数据结构。 4,你讲那么多我可以概括说英语比较好是吧。 答:嗯,大概是的…… 5,你学过的计算机专业课主要学了什么? 答:数据结构和算法,链表啊,二叉树啊,迪杰斯特拉算法这些。 6,介绍一下链表和跳表吧。 答:链表就是一个个节点连接在一起,跳表不会。 7,(沉默了一会)对我们有什么问题。 问:您前面问的c和c++有什么区别…… 答:(打断)这个我们今天就不讨论技术了吧,主要是你对我们公司有没有什么问题…… 答:没有…… 8,你应该参加面试比较少吧,我给你个建议就是你要好好做好准备再来面试,至少你引导面试官问的东西你得会,不要这样挥霍机会了。 9,hr问了一些问题,略。 10,那就到这里吧,有消息我们会进一步通知你的。(结束了,20分钟不到)

总结:面错岗位了,很难受。上来先给份人工智能的题,什么对什么参数有什么看法,有什么心得之类的,直接交白卷。面试官上来三板斧把我干懵了,我真的对c是一点也不会。传值方式我三种都用了无数遍了,但是我不知道它们具体叫什么……引导也有问题,数据结构与算法里面我比较自信的是dfs这块,链表跳表完全没复习。面试前重点突击c++语言特性继承多态封装一点没问。总的来说还是面错岗位了,气馁了一晚上。

宇视科技 2023.6.30

公司挺大挺正式的,做的是安保方面,有特别的保密要求背包不能带进办公区。 应聘岗:前端一部嵌入式开发

一面

面试官三十岁左右,给我印象挺好的,给了份卷子,有几道题: 1,写出下列数据类型占几个字节:char, int, short,如果在一个struct里,这个struct占几个字节. 答:1,4,2,7 复盘:7不对,应该是12 2,函数传值题 3,简介strncpy和memcpy(不会) 4,简单指针题

做完以后,面试官说大概都是对的(指出了第一题7的错误,然后我想起来应该是最长端对齐)。

做完以后问了点项目,因为我自己也没吃透我简历上的项目,总之就是一问三不知。唉……问题有: 1.内存泄漏了解过吗。 答:指针管理不当会内存泄漏 复盘:内存泄漏(Memory Leak)是指程序中已动态分配的堆内存由于某种原因程序未释放或无法释放,造成系统内存的浪费,导致程序运行速度减慢甚至系统崩溃等严重后果。 2.Linux有哪些操作?怎么删除文件夹?怎么编辑文档。 答:ls列出文档,rm -rf,编辑我一般用vim。 3.介绍一下你简历里面搭建的服务器,有什么功能。 答:(支吾)利用socket,实现一个前端输入命令后端作简单反应的功能。 4.介绍一下socket编程服务端和客户端有什么操作。 复盘:

然后让写个排序吧,随便哪种都行。很意外要写这个,很生疏,写了半天写了个冒泡,因为白纸写code又紧张又不习惯还把判断给漏了,最终也不知道代码写完有没有什么问题。面试官倒是也没说啥。很怪,这种题我平时正眼都不会看一眼的,居然卡得我这么狼狈。 5.有什么问题吗? 问:我看岗位上是前端一部,又是嵌入式开发,这个和前端有什么关系? 答:我们做安保的。比如说监控摄像头,控制它转动,那部分代码就是前端负责的。 问:网络编程在工作中有什么应用? 答:摄像头数据流向后端传播要用到。

二面

面试官很拽。 (问了一些学业方面的问题,以及pat是什么) 1.写下反转链表。力扣有写过吧。 答:力扣写过,原题不记得写没写过了。 (写了很久,快写完时被打断了,说没时间) 2.先序遍历是什么,写一下。 (很快写完) 3.给int a,b;把a的第二个字节赋值给b的第一个字节。 b=(a>>8) & (0xFF)(0xFF那里原来写的是511,面试官说我看不懂你换种写法,然后答错了两遍才答对,忘记F是4个bit了)

PAT2023夏季甲级简略c++题解

2023-06-12

A-1 Trap

分数 20

A robot is designed to move on a map from South toward North. When some obstacle is encountered, the robot can only turn toward West and moves until it can turn toward North and continue.

Given a squared map with n×n blocks, a robot can start from any position below the bottom line (South) and its target is to reach the top line (North). (By the way, kindly remind you that the left-hand-side of the map is West and the right-hand-side is East.)

vim命令速查

2023-01-20

速查常用vim命令 https://vimhelp.org/ :w save :x :wq save and quit :q! quit not save /string find “string”, use n/N to find next/previous one :{作用范围}s/{目标}/{替换}/{替换的标志} 作用范围:%所有行第一次,'<,'>可视范围 替换标志:i 大小写不敏感,I 大小写敏感,g全局 hjklyycopy line p paste u undo ctrl + r redo

2023还是不会的数据结构与算法题集结

2023-01-06

我的力扣主页: https://leetcode.cn/u/cutesnake/ 我的PAT仓库: https://github.com/suchacutesnake/pat

2023.1.1 然而竞赛积分还是掉了1分……做太慢也不行吗……

2023.1.6 花了很多时间,还是好菜,难受~~ PAT 1064 Complete Binary Search Tree https://pintia.cn/problem-sets/994805342720868352/exam/problems/994805407749357568 难点: 1.对于以层序遍历数组表示的树,如何进行各种遍历。 2.对BST,中序(左根右)遍历结果是递增的。 3.对CBST的某一节点i,其左右子树分别表示为2i,2i+1。

Leetcode 1803. Count Pairs With XOR in a Range (hard) https://leetcode.cn/problems/count-pairs-with-xor-in-a-range/ 字典树。答案都看不懂,可以竞争我遇到过最难的力扣题。倒不是不明白字典树这个数据结构,就是想不明白为什么要用字典树???有没有人来教教我啊~~~

2023.1.9 Leetcode 6306. Time to Cross a Bridge (hard) https://leetcode.cn/problems/time-to-cross-a-bridge/ 周赛327场的hard,比起力扣感觉更像PAT的题目,涉及很繁琐的数据结构设计。周赛做完T3只剩10分钟了,时间不够就没做。这种复杂的模拟题对大家来说原来都很困难,头一次见到周赛接近半小时大佬们才全通的。

2023.1.11 Leetcode753. Cracking the Safe(hard) https://leetcode.cn/problems/cracking-the-safe/ 初见欧拉回路题,只能看答案。算法看明白了,但是代码实现是怎么做到的看不明白……

2023.1.14 Leetcode 1819. Number of Different Subsequences GCDs (H) https://leetcode.cn/problems/number-of-different-subsequences-gcds/ 比较有趣的暴力枚举,杂了一点数学

2023.1.16 题外话,前几天折腾xray,第一次GitHub上交了pull request,秒merge了,还挺兴奋的。

2023.1.18 1825. Finding MK Average (H) https://leetcode.cn/problems/finding-mk-average/ 很多讨论的有序集合+队列题, 奋斗数小时后tle,耻辱看答案。不是自己写的代码真的不想cv提交啊,这每日一题打卡不打也罢!明明就是不会嘛,不会的题却显示通过给一种自欺欺人的感觉……评论区acm爷普遍用的树状数组,我什么时候能学学这个数据结构啊……

2023.3.23 https://leetcode.cn/problems/word-ladder-ii/solution/dan-ci-jie-long-ii-by-leetcode-solution/ 要做吐了,错了一遍又一遍,到后面几乎和题解一模一样的写法就差cv了,还是超时。时间复杂度肯定是一样的,卡剪枝了,好难受啊真的好难受。错误的代码先贴着。

class Solution {
public:
    void backtrack(unordered_map<string, unordered_set<string>>& from, vector<vector<string>>& res, vector<string>& cur, string beginWord) {
        for (auto& next : from[cur.back()]) {
            cur.emplace_back(next);
            if (next == beginWord) {
                res.emplace_back(cur);
                reverse(res.back().begin(), res.back().end());
            }
            backtrack(from, res, cur, beginWord);
            cur.pop_back();
        }
    }
    vector<vector<string>> findLadders(string beginWord, string endWord, vector<string>& wordList) {
        unordered_set<string> dict({wordList.begin(), wordList.end()});
        unordered_map<string, int> steps;
        unordered_map<string, unordered_set<string>> from;
        queue<string> q;
        vector<vector<string>> res;
        int ansSize = 0x3f3f3f3f;
        if (dict.find(endWord) == dict.end()) return res;
        q.emplace(beginWord);
        steps[beginWord] = 1;
        int step = 1;
        while (!q.empty()) {
            step++;
            int n = q.size();
            for (int j = 0; j < n; ++j) {
                string s = move(q.front());
                string ss = s;
                q.pop();
                for (char& ch : s) {
                    char temp = ch;
                    for (int i = 0; i < 26; ++i) {
                        ch = i + 'a';
                        if (ch == temp || !dict.count(s) || (steps.count(s) && steps[s] < step)) continue;
                        steps[s] = step;
                        from[s].emplace(ss);
                        if (s == endWord) {
                            break;
                        }
                        q.emplace(s);
                    }
                    ch = temp;
                }
                
            }
            
        }
        vector<string> cur({endWord});
        backtrack(from, res, cur, beginWord);
        return res;
    }
};

力扣每日一题 April, 2022

2022-04-20

我的力扣主页: https://leetcode-cn.com/u/cutesnake/

4.20 388中等 https://leetcode-cn.com/problems/longest-absolute-file-path/ 乍一看简单,仔细一想不会做。本来想用遍历,看了答案知道用哈希表,但还是太难办,写了一个小时,wa一次,有点理解屎山是如何堆成的了……

class Solution {
public:
    int lengthLongestPath(string input) {
        int res = 0, curLen = 0, subCnt = 0, n = input.size();
        bool isFile = 0;
        unordered_map<int, int> subNum;
        for (int i = 0; i < n; ++i) {
            char& ch = input[i];
            if (ch == '\n') {
                isFile = 0;
                subNum[subCnt] = curLen;
                subCnt = 0;
                continue;
            }
            if (ch == '\t') {
                ++subCnt;
            } else {
                if (i && (input[i-1] == '\t' || (input[i-1] == '\n' && subCnt == 0))) curLen = subNum[subCnt-1];
                if (ch == '.') isFile = 1;
                ++curLen;
                if (isFile) res = max(res, curLen + subCnt);
            }
        }
        return res;
    }
};

网站日常维护:Gitee图床崩溃,改用阿里云OSS;维护自动邮件系统

2022-04-19

前几日有朋友来我这留言了,Gmail又发邮件说阻止了可疑的登录,导致应该自动通知我有新回复的SMTP邮件系统又没有工作。上来一看发现Gmail今年5月30日以后就不再支持SMTP等所谓“不安全的应用”了(事实上“允许不安全应用登录”这个按钮我已经手动允许了无数次,每过一段时间它又给我自动关掉,实在太无语了……)。最近美区PayPal也不知道啥原因登不上去了,明明账号密码我都知道,可就是说“不能确定是您本人”,致电过去我又不知道当初乱填了什么样一个英文名……互联网安全已经发展到知道账号密码也无法掌控账号的地步了啊……给我造成了相当的困扰。

于是一口气邮箱改用QQ邮箱,各种开关都很方便,清爽搞定的感觉让我觉得Gmail给人的体验到底是什么垃圾,坚持用Gmail的我是什么傻逼。

维护博客过程中,意外发现所有储存在Gitee图床的图片都无了……网上搜索一番发现最近一两个月内Gitee开启了放盗链……虽然白嫖是不对,但GitHub给人白嫖那么久还一点问题也没呢(可能微软财大气粗不在乎吧)。 https://blog.51cto.com/phyger/5181594 (Gitee图床崩溃的详情)

但好好排版的图文,所有图片都挂了实在是难以接受,我的学习笔记,都是我的心血啊!痛定思痛,还是决定花点钱用上阿里云对象存储OSS(Object Storage Service)。为什么不用腾讯云,因为之前也用过腾讯云的产品,体验并不好……以下是参考,非常有用https://blog.csdn.net/weixin_43876186/article/details/116498692

一口气买了5年40G的存储量,事实上当时想的是45块也不贵啊……但下午一看,存储量要计费,流量居然也要计费,5毛1G,属实让我有点吐血。大概访问图片不会占用太多流量的吧,这样安慰自己。但是速度属实是快到不行,我的引导页终于可以放上背景视频不用卡了!https://cutesnake.top 但是一个1分多钟的1080p的视频,b站上下下来就是30M,转成网页能播放的格式就是80M,好贵,真的有点顶不住。唉,但是耐不住心海真的太好看,不舍得降低画质,为了这个炫酷的引导页更不舍得把视频撤掉……只希望不会有访客专门来我这放视频吧……应该不会有人这么无聊吧……

下一步就是Gitee的内容迁移到阿里云OSS上了,好繁杂的工作,想想就不想干了,害……

CMU15-213 Shell lab

2021-11-20

2021-11-20 20:18:09 星期六 发现我真的是不会c语言……就连最简单的字符串比较都不会,还要上网去查才知道有strcmp这个函数……在对各种c库函数一无所知的情况下,感觉要实现些什么真的举步维艰啊……

不过,也真的觉得这次的lab不是很难(可能经过了pat三十多道题的洗礼有进步了),就愈发想要自己独立完成。然而,越是有这样的心,就越在简单的地方(指知识性的地方,了解过就几行搞定,没了解过就卡住的地方)就进行不下去了,到底还是水平太次了orz

2021-11-20 22:31:11 星期六 看了一下博客,完全是一点也不懂……太硬了,英文课本也看不懂,什么时候才能学下来啊……

2021-11-22 20:49:51 星期一 一个坑:需要到http://csapp.cs.cmu.edu/3e/code.html 把csapp.h的代码复制然后include进来。

开始有点明白了。按着16个trace一步一步走就行。前3个trace照抄课堂上课件的代码即可。 ![]( https://cutesnaketop.oss-cn-beijing.aliyuncs.com/image/gitee-img/Screen Shot 2021-11-22 at 8.48.55 PM.jpg) 到trace05卡住了。理论上./myspin 2 & ./myspin 3 &所分配到的jid应该是1和2,但我这里是2和4。

2021-11-26 15:41:05 星期五 是2和4的原因在于没有waitfg。把waitfg函数完成即可。

2021-11-26 13:20:07 星期五 错误: ![]( https://cutesnaketop.oss-cn-beijing.aliyuncs.com/image/gitee-img/Screen Shot 2021-11-26 at 1.50.14 PM.jpg) Makefile里加上CFLAGS = -Wall -O2 -pthread #include "csapp.h"然后把tsh.c里重复定义的代码都注释掉。

test07:信号掩蔽 exit总是会把主函数return掉,想要杀掉进程而不退出tsh,用kill。csapp.c里面的Kill支持不了-pid参数,只能用kill。在sigint_handler里用了exit(0)的话,会有以下结果(上面是我的输出,下面是参考输出): ![]( https://cutesnaketop.oss-cn-beijing.aliyuncs.com/image/gitee-img/Screen Shot 2021-11-26 at 3.46.22 PM.jpg) 如果不掩蔽,则前后台的process都会terminate掉。

2021-11-27 12:45:43 星期六 ![]( https://cutesnaketop.oss-cn-beijing.aliyuncs.com/image/gitee-img/Screen Shot 2021-11-27 at 12.46.59 PM.jpg) 对test08的jobs命令显示不了Stopped的进程:1,在waitfg里面的waitpid用上WUNTRACED这个option,使得一旦有子进程terminate或者stop都会被watipid捕捉到,再通过WIFSTOPPED(status)(图中用的WIFEXITED,会过不了test07)进行判断,把stopped掉的进程状态设置为ST。 ![]( https://cutesnaketop.oss-cn-beijing.aliyuncs.com/image/gitee-img/Screen Shot 2021-11-27 at 12.53.39 PM.jpg) 2,对应handout PDF的Hints最后一条,在合适的位置加上setpgid(0, 0),使得后台的进程一定拥有一个独立的进程组。