linux中host配置

访问/etc/hosts

1
35.185.44.232 similarsu.gitlab.io

注:操作前备份该hosts文件

如何按列去除重复数据(linux)

背景

1
2
3
将oui.csv文件内容导入数据库,将Assignment字段作为主键,
发现该列数据有重复,导入失败,
需要对该文件按指定列进行去重在进行导入。

文件内容如下,展示10行

1
2
3
4
5
6
7
8
9
10
Registry,Assignment,Organization Name,Organization Address
MA-L,E043DB,Shenzhen ViewAt Technology Co.,Ltd. ,9A,Microprofit,6th Gaoxin South Road, High-Tech Industrial Park, Nanshan, Shenzhen, CHINA. shenzhen guangdong CN 518057
MA-L,2405F5,Integrated Device Technology (Malaysia) Sdn. Bhd.,Phase 3, Bayan Lepas FIZ Bayan Lepas Penang MY 11900
MA-L,3CD92B,Hewlett Packard,11445 Compaq Center Drive Houston US 77070
MA-L,9C8E99,Hewlett Packard,11445 Compaq Center Drive Houston US 77070
MA-L,B499BA,Hewlett Packard,11445 Compaq Center Drive Houston US 77070
MA-L,1CC1DE,Hewlett Packard,11445 Compaq Center Drive Houston US 77070
MA-L,3C3556,Cognitec Systems GmbH,Großenhainer Str. 101 Dresden Saxony DE 01127
MA-L,0050BA,D-Link Corporation,2F, NO. 233L-2, PAO-CHIAO RD. TAIPEI TW 0000
MA-L,00179A,D-Link Corporation,No. 289, Sinhu 3rd Rd., Neihu District, Taipei TW 114
阅读更多

linux服务器如何实现免密登录

I、背景

1
2
以从IP为20.1.1.1的客户端登录到IP为10.1.1.1的服务端为例
其中,客户端用户名为client,服务端用户名为server

II、服务端

1、生成密钥对

1
ssh-keygen -t rsa

2、将生成的公钥加入到authorized_keys中

1
cat id_rsa.pub >> authorized_keys
阅读更多

修复输入法fcitx开机无法自启

编辑~/.profile文件,加入如下内容

1
2
3
4
5
export LC_ALL=zh_CN.utf8
export XMODIFIERS=@im=fcitx
export QT_IM_MODULE=xim
export GTK_IM_MODULE=xim
fcitx -d

修复vi按键错乱

原因:ubuntu vi 默认是安装 vim-tiny

1、卸载

1
sudo apt-get remove vim-common

2、安装

1
sudo apt-get install vim