2021年1月12日 星期二

winscp 連線設定檔摘要及執行方式

設定檔  winscp.ini 內容
[Sessions\test]
HostName=sftp
RemoteDirectory=/user/home
UserName=user
PasswordPlain=password
PortNumber=2021

執行方式
winscp /ini=winscp.ini test

winscp sftp://${u}:${pw}@127.0.0.1:port

2021年1月10日 星期日

bash name variable筆記

p1=1
p2=2
p3=3

pls="p1 p2 p3"
echo p1=$p1 p2=$p2

for i in $pls;do eval "$i=''";done;

echo p1=$p1 p2=$p2

2021年1月7日 星期四

debian 10 X Window 螢幕旋轉設定

顯示輸出裝置的資訊
xrandr 

方向正常
xrandr -o normal

左轉180度
xrandr -o left

右轉180度
xrandr -o right

翻轉180度
xrandr -o inverted

2021年1月4日 星期一

Linux proc hidepid 摘要

hidepid=0 – The default behavior where any user can read the files under /proc/PID/
hidepid=1 – It means users may not access any /proc/PID/ sub-directory except their own. Also files like cmdline, io, sched*, status, wchan are inaccessible to other users.
hidepid=2 – Everything from hidepid=1, plus all /proc/PID/ sub-directories will be hidden to other users.

sudo mount -o remount,rw,hidepid=2 /proc

2020年12月30日 星期三

Debian 10 安裝 dante-server

1. apt-get install dante-server

2.編輯 /etc/danted.conf
mv /etc/danted.conf  /etc/danted.conf.ori
cat >/etc/danted.con <<EOF
# /etc/danted.conf

logoutput: syslog
user.privileged: root
user.unprivileged: nobody

# The listening network interface or address.
internal: 0.0.0.0 port=1080

# The proxying network interface or address.
external: eth0

# socks-rules determine what is proxied through the external interface.
# The default of "none" permits anonymous access.
#socksmethod: username
socksmethod:  none

# client-rules determine who can connect to the internal interface.
# The default of "none" permits anonymous access.
clientmethod: none

client pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect disconnect error
}

socks pass {
        from: 0.0.0.0/0 to: 0.0.0.0/0
        log: connect disconnect error
}
EOF                        

3.systemctl enable danted;systemctl start danted

4.測試
 curl -v -x socks5://192.168.1.1:1080 http://www.google.com/



2020年12月16日 星期三

Debian 10 xfce4 更改 wallpaper 筆記

xfconf-query --channel xfce4-desktop --property  /backdrop/screen0/monitorDisplayPort-1/workspace0/last-image --set  /home/1.jpg

相關指令及檔案
xfconf-query --channel xfce4-desktop --list
/usr/share/desktop-base/profiles/xdg-config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml

xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitorHDMI-1/workspace0/last-image -s /opt/wallpaper/202510-1920x1200.jpg -n -t string

Debian 10 Python 安裝 虛擬環境

apt-get install -y python-libvirt
apt-get install -y libvirt-dev
apt install -y python3-pip
pip3 install virtualenv