Linux使用技巧总结(二)

1. How to display the numbers of the row in vieditor?

First open a file with vicommand. Then assure you are in the command mode. Finally, input set nuand press Enter.

2. How to open a word file in linux?

Input openoffice.org fileNamein the command window.

3. Log in the cluster without passwords ?

(单机免密码登陆)

  1. Input ssh-keygen -t rsain the terminal of the local computer, and press Enter3 times;
  2. Input scp ~/.ssh/id_rsa.pub xxx@192.168.1.1:~/, and then input your passwords;
  3. Log in the cluster and cat id_rsa.pub >> .ssh/authorized_keys
  4. You can log in the cluster by input ssh xxx@192.168.1.1without password on your local computer

(多机同时免密码登陆)

  1. 如果此操作影响了在集群不同主机之间的无密码登录,则可以将集群中的id_rsa.pub也加入authorized_keys
    具体做法为:运用cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys命令使得集群中可以有多个免密码登录的许可。
  2. 如果在远程登录时出现提示Agent admitted failure to sign using the key,请重启电脑,或者在本地电脑
    中输入ssh-add ~/.ssh/id_rsa(后一种方法我还没有试过,因为重新启动后问题就解决了)

4. How to install Linux system(Fedora or Ubuntu) on a MacBook Air?

参考网址:http://jingyan.baidu.com/album/4853e1e565dc781908f72657.html?picindex=3

  1. 下载Fedora Workstation iso文件(百度一下就可找到官网下载地址),然后制作dmg文件:Mac终端中
    输入 hdiutil convert -format UDRW -o ~/Downloads/ubuntu-14.10-desktop-amd64 ~/Downloads/ubuntu-14.10-desktop-amd64.iso
    然后会生成一个.dmg文件。
  2. 对Mac进行分区:打开Mac的磁盘工具,点击左边的121.33 GB APPLE SSD SM0128G Media
    然后点击右边的分区,接下力拖动分区布局右下角的按钮,根据你的喜好调整新分区的大小,然后点击应用
  3. 格式化U盘:选中U盘,点击右边面板的Partition标签,从下拉菜单中选择partition,再添加U盘的名字,分区格式为Mac OS扩展 (日志型)
    点击面板左边的的Option并确保分区的模式为GUID Partition Table分区,然后点击应用
  4. 制作“Fedora 启动U盘”:首先,打开Mac终端,输入diskutil list,查看U盘的名称dev/disk###
    再输入diskutil unmountDsik /dev/disk###,即卸载U盘,接着通过终端进入fedora安装包所在目录下,
    输入sudo dd if=NAME OF YOUR dmg FILE of=/dev/disk### bs=10m,然后输入密码,等待很长时间后,制作成功,然后
    输入diskutil eject /dev/disk###
  5. 重启电脑,并长按键盘左侧option键,在之后出现的界面里如果看到U盘图标和Fedora图标或EFI boot,则代表U盘制作成功,且可以选择其一进行fedora安装,安装方法不再赘述,百度一下便能知道。

5. 如何制作和查看PostSctipt文件

1、首先,需要按照.ps文件的格式制作一个.ps文件,具体可以参考一下代码

%!PS
%%BoundingBox: -100 -100 100 100/*图片大小*/
.00 .00 setlinewidth
300 500 translate/*平移命令*/

%画一个圆
newpath
-5	-66 2 0 360 arc
closepath stroke
%画一个三角形
newpath
31	-76	moveto
-63	-83	lineto
-5	-66	lineto
closepath stroke
%结束语
showpage

2、查看方式(假设文件名为file.ps):

(1)用ghostscript软件查看

gs file.ps

(2)将ps文件转换为pdf格式,并查看

ps2pdf file.ps
evince file.pdf

(3)将ps文件转换为epsi格式,并查看

ps2epsi file.ps
evince file.epsi

6. 查看CPU是几核

cat /proc/cpuinfo |grep "cores"|uniq 

7. Chrome快速加载网页中的所有图片并保存的方法

1、通过chrome浏览器下载tampermonkey插件(自行想办法访问,你懂的)

安装成功后插件栏会显示新的图标;

2、安装nolazyload脚本

点击此链接中的“安装此脚本“,会弹出一个新网页,在新弹出的网页中再点击install;

3、打开一个有很多图片的网页(会发现插件栏的tampermonkey显示了下表“1“,说明插件中的脚本开始运行了),稍等片刻后,快速滚动滚轮,
会发现所有图片都已加载完毕。

4、在网页上右键保存网页后,生成一个文件夹和html文件,文件夹里有所有网页上的图片,且是jpg格式,html文件打开后可以查看所有图片。

8. gedit中文乱码解决方法(Ubuntu-14.04)

1、命令行方法

gsettings set org.gnome.gedit.preferences.encodings auto-detected "['GB18030', 'UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']"

实际上就是将’GB18030’放在’UTF-8’前面,应该还有更好的方法,等待探索。

2、dconf-editor图形界面方法

安装编辑器:

sudo apt-get install dconf-editor

打开编辑器:

sudo dconf-editor

依次点开org/gnome/gedit/perferences/encodings,比照1中的命令行方法修改auto-detected中的配置信息

9. ibus拼音输入法混乱解决方法(Ubuntu-14.04)

1、不稳定的解决方法
shell中输入:

ibus-daemon -drx 

然后重启输入法

2、稳定的方法

首先执行系统提示的输入法完善程序,然后就会自动安装SunPinyin,然后在Text Entry Settings...中添加SunPinyin

10. WPS安装(Ubuntu-14.04)

1、安装WPS及字体

cd && wget -O wps-office.deb http://kdl.cc.ksosoft.com/wps-community/download/a21/wps-office_10.1.0.5672~a21_amd64.deb

sudo dpkg -i wps-office.deb

sudo apt-get -f install && rm wps-office.deb

wget -O web-office-fonts.deb http://kdl.cc.ksosoft.com/wps-community/download/fonts/wps-office-fonts_1.0_all.deb

sudo dpkg -i web-office-fonts.deb

rm web-office-fonts.deb

2、添加缺少字体

cd /usr/share/fonts/wps-office

sudo wget https://dl.dropboxusercontent.com/u/7144606/Documentos/wps_symbol_fonts.zip

sudo unzip wps_symbol_fonts.zip

sudo fc-cache -vf

3、此方法只能解决开启WPS时没有字体缺少警告,但是还是无法显示公式,原因是wps_symbol_fonts.zip中的字体打开后仍然是白框框,尚待进一步的解决方案

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值