Forum Index


Board index » All Posts




Re: ssh tunnel ssh 心跳
#41
Just can't stay away
Just can't stay away


ssh 心跳
ssh -o ServerAliveInterval=36 -o ServerAliveCountMax=5

Posted on: 2022/1/23 12:04
Top


Re: Wireguard ddns ip check
#42
Just can't stay away
Just can't stay away


[Interface]
# Name = relay1.wg.example.com
Address 192.0.2.1/24
ListenPort 
51820
PrivateKey 
oJpRt2Oq27vIB5/UVb7BRqCwad2YMReQgH5tlxz8YmI=
DNS 1.1.1.1,8.8.8.8
PostUp 
iptables -A FORWARD -i wg0 -j ACCEPTiptables -t nat -A POSTROUTING -o eth0 -j MASQUERADEip6tables -A FORWARD -i wg0  -j ACCEPTip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown 
iptables -D FORWARD -i wg0 -j ACCEPTiptables -t nat -D POSTROUTING -o eth0 -j MASQUERADEip6tables -D FORWARD -i wg0 -j ACCEPTip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
# Name = peer1.wg.example.com
PublicKey I+hXRAJOG/UE2IQvIHsou2zTgkUyPve2pzvHTnd/2Gg=
AllowedIPs 192.0.2.2/32

Posted on: 2022/1/22 11:30
Top


ssh 卡顿打字慢 ssh反应慢 ssh local echo
#43
Just can't stay away
Just can't stay away


ssh断线 ssh卡死
ssh 打字卡顿打字慢 ssh反应慢

ssh local echo
ssh local line editing

解决方案 : 使用 mosh
服务器端客户端都安装 mosh
sudo apt install mosh

ufw allow 60000
:60009/udp


mosh root@xlxz.org


Posted on: 2022/1/20 16:12

Edited by eyex on 2022/12/9 11:04:19
Edited by eyex on 2023/8/10 13:52:03
Top


ubuntu mosh mosh-server needs a UTF-8 native locale to run
#44
Just can't stay away
Just can't stay away


安装 mosh

服务器和客户端都需要安装
sudo apt install  mosh


开启防火墙
sudo ufw allow 60000:61000/udp


连接服务器
mosh  root@10.10.0.1


Mosh的连接错误
The locale requested by LANG=C.UTF-8 isn't available here.
Running `locale-gen C.UTF-8' 
may be necessary.

The locale requested by LANG=en_US.UTF-8 isn't available here.
Running `locale-gen en_US.UTF-8' 
may be necessary.

mosh-server needs a UTF-8 native locale to run.

Unfortunatelythe local environment (LANG=C.UTF-8specifies
the character set 
"US-ASCII",

The client-supplied environment (LANG=en_US.UTF-8specifies
the character set 
"US-ASCII".

localeCannot set LC_ALL to default localeNo such file or directory
LANG
=en_US.UTF-8
LANGUAGE
=en_US:en
LC_CTYPE
="en_US.UTF-8"
LC_NUMERIC=zh_CN.UTF-8
LC_TIME
=zh_CN.UTF-8
LC_COLLATE
="en_US.UTF-8"
LC_MONETARY=zh_CN.UTF-8
LC_MESSAGES
="en_US.UTF-8"
LC_PAPER=zh_CN.UTF-8
LC_NAME
=zh_CN.UTF-8
LC_ADDRESS
=zh_CN.UTF-8
LC_TELEPHONE
=zh_CN.UTF-8
LC_MEASUREMENT
=zh_CN.UTF-8
LC_IDENTIFICATION
=zh_CN.UTF-8
LC_ALL
=
Connection to  xlxz.org closed.
/
usr/bin/moshDid not find mosh server startup message. (Have you installed mosh on your server?)

mosh-server needs a UTF-8 native locale to run
解决方案
LC_ALL="en_US.UTF-8" mosh  root@xlxz.org

Posted on: 2022/1/19 16:10

Edited by eyex on 2022/1/20 10:37:17
Top


win11 iso
#45
Just can't stay away
Just can't stay away


https://software-download.microsoft.com/pr/Win11_Chinese(Simplified)_x64v1.iso?t=aa0083d9-2020-44f2-9507-d6e3ef001591&e=1637474818&h=774e5d43378ae60b90749081600732e8

Posted on: 2021/11/20 14:20
Top


mysql 导出 excel
#46
Just can't stay away
Just can't stay away


Mysql数据库导出到文件,提示The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

一些版本的mysql对通过文件导入导出作了限制,默认不允许,
查看配置,执行mysql命令
SHOW VARIABLES LIKE "secure_file_priv";
如果value值为null,则为禁止,如果有文件夹目录,则只允许改目录下文件(测试子目录也不行),如果为空,则不限制目录;

SHOW VARIABLES LIKE "secure_file_priv";




select into outfile '/var/lib/mysql-files/ok.xls' from oktable   order by cat_id desc limit 0,20;


Posted on: 2021/11/8 17:41

Edited by eyex on 2023/8/20 19:09:10
Top


ubuntu docker IP修改 端口映射修改
#47
Just can't stay away
Just can't stay away


docker ip 修改
docker 端口映射修改
方法一 重建容器
docker stop test01
docker commit test01 test02
docker run -p 8080:8080 -td test02
docker rm test01


方法二 修改容器配置文件,重启docker服务

docker inspect <container_name>
docker stop <container_name>
snap stop docker
vim 
/var/snap/docker/common/var-lib-docker/containers/<hash_id>/hostconfig.json  //  "PortBindings":{"8090/tcp":[{"HostIp":"127.0.0.1","HostPort":"8090"}]}

snap start docker
docker start 
<container_name>

Posted on: 2021/11/5 11:23
Top


ubuntu 修改时区
#48
Just can't stay away
Just can't stay away


ubuntu 修改时区

change timezone in Ubuntu 20.04 server

sudo dpkg-reconfigure tzdata



Posted on: 2021/11/3 9:38
Top


springboot jpa 表前缀
#49
Just can't stay away
Just can't stay away


jpa 添加 表前缀

package my.app;

import org.hibernate.boot.model.naming.Identifier;
import org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl;
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;

public class 
PrefixPhysicalNamingStrategy extends PhysicalNamingStrategyStandardImpl {

    
/**
     * TODO Make this an injectable application property
     */
    
public static final String TABLE_NAME_PREFIX "MY_PREFIX_";

    @
Override
    
public Identifier toPhysicalTableName(Identifier nameJdbcEnvironment context) {
        
Identifier newIdentifier = new Identifier(TABLE_NAME_PREFIX name.getText(), name.isQuoted());
        return 
super.toPhysicalTableName(newIdentifiercontext);
    }
}



application.properties

spring.jpa.hibernate.naming.physical-strategy=my.app.PrefixPhysicalNamingStrategy


Posted on: 2021/11/1 15:14
Top


tmux 后台运行 ctrl + b , d
#50
Just can't stay away
Just can't stay away


tmux后台运行程序!!!
ctrl + b , d


tmux 进入后,后台不会断
ctrl + d ,断了这个windows

将一个tmux 进程放到后台,
ctrl + b , d

tmux a , 最近的一个tmux进程

多个tmux选择时,ctrl + b , s

Posted on: 2021/10/28 18:07
Top



TopTop
« 1 2 3 4 5 6 7 8 ... 11 »



friend links
Themes

(2 themes)
Login
Username:

Password:


Lost Password?
Register now!
Categories
Xoops (11)
--Modules (2)
--Themes (0)
Article (8)