分类 Linux 下的文章

SSH用户枚举漏洞(CVE-2018-15473)

检查SSH版本ssh -V

OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017

这是ubuntu 18.04.2/3自带的ssh版本,据说7.7及以前版本都有这个问题,需要升级解决

Ubuntu 16.04.2 LTS - OpenSSH_7.2p2 Ubuntu-4ubuntu2.10, OpenSSL 1.0.2g 1 Mar 2016
Ubuntu 20.04 LTS - OpenSSH_8.2p1 Ubuntu-4ubuntu0.1, OpenSSL 1.1.1f 31 Mar 2020

尝试解决
sudo apt-get update
sudo ls /var/cache/apt/archives/
sudo apt-get -d install openssh-server
sudo mv /var/cache/apt/archives/*.deb .
没有新版
openssh-server_1%3a7.6p1-4ubuntu0.3_amd64.deb

- 阅读剩余部分 -

redis批量导入

cat test.txt
a,1
b,2
c,3
cat test.txt | awk -F "," '{print $1" "$2" "$3" "$4}'
a 1
b 2
c 3
cat ../test.txt | awk -F "," '{print $1" "$2}' | xargs -n4 sh -c 'src/redis-cli set $1 $2' sh
cat ../test.txt | awk -F "," '{print "set "$1" "$2}' | src/redis-cli --pipe
cat ../f0.txt | awk -F "," '{print "set "$1" "$2}' | src/redis-cli --pipe
time cat ../f0.txt | awk -F "," '{print "set "$1" "$2}' | src/redis-cli -n 0 --pipe

挂载exFat分区

原来也不是直接可以挂载的,还要装点儿东西
sudo apt-get install exfat-fuse
然后就可以挂啦
sudo mount /dev/sda /mnt/usb_flash

单机HBase

http://www.apache.org/dyn/closer.cgi/hbase/
https://mirror.bit.edu.cn/apache/hbase/
https://mirrors.tuna.tsinghua.edu.cn/apache/hbase/
wget https://mirrors.tuna.tsinghua.edu.cn/apache/hbase/hbase-1.3.6/hbase-1.3.6-bin.tar.gz
tar zxf hbase-1.3.6-bin.tar.gz
mv hbase-1.3.6 hbase

sudo vi /etc/profile 添加

export HBASE_HOME=/home/user/hbase
export PATH=$HBASE_HOME/bin:$PATH

source /etc/profile
hbase version
HBase 1.3.6

Source code repository git://Sakthis-MacBook-Pro-2.local/Users/sakthi/dev/hbase revision=806dc3625c96fe2cfc03048f3c54a0b38bc9e984
Compiled by sakthi on Tue Oct 15 01:55:41 PDT 2019
From source with checksum d587feefff2057a2e5001da5db4a6fac

JDK要配好java -version

vi /home/user/hbase/conf/hbase-env.sh

export JAVA_HOME=/home/user/miku/jdk
export HBASE_MANAGES_ZK=true

vi /home/user/hbase/conf/hbase-site.xml

<configuration>
    <property>
        <name>hbase.rootdir</name>
        <value>file:/home/user/miku/data</value>
    </property>
    <property>
        <name>hbase.zookeeper.property.dataDir</name>
        <value>file:/home/user/miku/data/zookeeper</value>
    </property>
</configuration>

/home/user/hbase/bin/start-hbase.sh # stop-hbase.sh 停止
hbase shell

status
create 'table1','field1'
t1 = get_table('table1')
t1.put 'row1', 'field1:qualifier1', 'value1'
t1.scan

参考:
https://blog.csdn.net/ouzhuangzhuang/article/details/89876152

Binary file (standard input) matches

执行命令:

cat 文件名 | grep 'test'

报错:

Binary file (standard input) matches

搜索一番,意思是二进制文件不能直接grep。

解决方法:

cat 文件名 | grep -a 'test'

参考:
https://www.liudon.org/1282.html