表单: LinuxNotes
用户: dreamable
创建日期: 2021-09-08 13:25:30 UTC
更新日期: 2021-09-08 13:25:30 UTC
引用:(Table ID 28, Record ID 8)

标题 :
AWS Elastic IP
笔记 :
  • 保留IP,最多5个
  • 这样EC2重启后IP地址不再变化
  • 有些区域的可以设定reverse DNS,对发送email有帮助
标签:
表单: LinuxNotes
用户: dreamable
创建日期: 2021-08-23 00:18:58 UTC
更新日期: 2021-08-23 00:19:06 UTC
引用:(Table ID 28, Record ID 7)

标题 :
gio mount smb
笔记 :
gio mount smb://<servername>/<sharename>
# enter password
# once the mount is created it will create a temporary path located at  the following path, for example:
# /run/user/1000/gvfs/smb-share\:server\=host.domain.com\,share\=files/
ln -s /run/user/<userid>/gvfs/smb-share\:server\=<servername>\,share\=<sharename>/ ~/<mountpoint>
标签:
表单: LinuxNotes
用户: dreamable
创建日期: 2021-08-22 22:48:47 UTC
更新日期: 2021-08-22 22:59:21 UTC
引用:(Table ID 28, Record ID 6)

标题 :
Ubuntu disable sleep
笔记 :
 sudo -H gedit /etc/systemd/logind.conf
 HandleLidSwitch=ignore
 sudo service systemd-logind restart
 # Still sleep after idle
 sudoedit /etc/UPower/UPower.conf
 Change IgnoreLid to IgnoreLid=true
 service upower restart
# also in /etc/systemd/logind.conf
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
HandleHibernateKey=ignore
HandleSuspendKey=ignore
IdleAction=ignore
IdleActionSec=0
 # Still sleep after idle
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
标签:
表单: LinuxNotes
用户: dreamable
创建日期: 2021-08-22 22:00:21 UTC
更新日期: 2021-08-22 22:00:21 UTC
引用:(Table ID 28, Record ID 5)

标题 :
内网穿透
笔记 :

路由器NAT映射端口,尝试并成功

  1. ssh
  2. rdesktop
  3. smb
标签:
表单: LinuxNotes
用户: dreamable
创建日期: 2021-08-22 21:59:39 UTC
更新日期: 2021-08-22 21:59:39 UTC
引用:(Table ID 28, Record ID 4)

标题 :
Basic HTTP File Server
笔记 :

python3 -m http.server

标签:
表单: LinuxNotes
用户: dreamable
创建日期: 2021-05-12 11:21:28 UTC
更新日期: 2021-05-12 11:21:39 UTC
引用:(Table ID 28, Record ID 3)

标题 :
How do I resolve a ssh connection closed by remote host due to inactivity?
笔记 :

source

  • Add to .ssh/config
TCPKeepAlive yes
ServerAliveInterval 30
  • In command line
ssh -o TCPKeepAlive=yes user@some.host.com
ssh -o ServerAliveInterval=30 user@some.host.com

TCPKeepAlive: This uses the KEEPALIVE option of the TCP/IP protocol to keep a connection alive after a specified interval of inactivity. On most systems, this means 2 hours. So, with the TCPKeepAlive option passed to SSH, the SSH client will send an encrypted packet to the SSH server, keeping your TCP connection up and running.

ServerAliveInterval: This sets a timeout interval in seconds, which is specified by you, from which if no packets are sent from the SSH client to the SSH server, SSH will send an encrypted request to the server for a TCP response. To make that request every 30 seconds:

标签:
表单: LinuxNotes
用户: dreamable
创建日期: 2021-03-19 01:29:17 UTC
更新日期: 2021-03-19 02:11:18 UTC
引用:(Table ID 28, Record ID 2)

标题 :
Mongo DB dump with compress and archive
笔记 :

source

mongodump --db country --gzip --archive=country.archive
mongorestore --gzip --archive=country.archive

NOTE: The archive is mongo-specific format, can't be opened by other tools e.g. tar

标签:
表单: LinuxNotes
用户: dreamable
创建日期: 2021-02-07 08:10:06 UTC
更新日期: 2021-02-07 08:10:06 UTC
引用:(Table ID 28, Record ID 1)

标题 :
How to run a cron job using the sudo command
笔记 :

guide

sudo crontab -e
@hourly rm somefile
标签: