Warlock Fish Welcome To Here 2017-11-22T12:52:47.812Z http://warlockfish.xyz/ Warlock Fish Hexo ubuntu强制清除垃圾回收站 http://warlockfish.xyz/2017/11/22/ubuntu强制清除垃圾回收站/ 2017-11-22T12:38:23.000Z 2017-11-22T12:52:47.812Z 强制清除垃圾回收站

问题

我遇到了无法在Ubuntu 16.04中清空回收站的问题。我右键回收站图标并选择清空回收站,就像我一直做的那样。我看到进度条显示删除文件中过了一段时间。但是它停止了,垃圾站中有些文件删除了,但有些文件还是没有删除。在看了文件夹后原来没有权限。

方案

Ubuntu 16.04的回收站路径为

1
$HOME/.local/share/Trash/

然后用以下命令即可清空回收站

1
sudo rm -fr $HOME/.local/share/Trash/files/*
]]>
<h1 id="强制清除垃圾回收站"><a href="#强制清除垃圾回收站" class="headerlink" title="强制清除垃圾回收站"></a>强制清除垃圾回收站</h1>
ubuntu配置 http://warlockfish.xyz/2017/10/29/ubuntu配置/ 2017-10-29T13:55:50.000Z 2017-10-31T08:31:35.062Z ubuntu16.04安装后配置

0.更新源

更换阿里云的源

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# deb cdrom:[Ubuntu 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

list文件在/etc/apt/sources.list

然后更新源和软件

1
2
sudo apt-get update
sudo apt-get dist-upgrade

1.更换显卡驱动

显卡更换

ubuntu上有nvidia的驱动

2.同步时间

使用双系统时间不同,故要使用

1
sudo timedatectl set-local-rtc 1

3.安装软件

3.1 删除亚马逊链接

1
sudo apt-get remove unity-webapps-common

3.2 安装vim

sudo apt-get install vim

3.3 安装git和vpnc

sudo apt-get install vpnc git

3.4 安装ExFat文件系统驱动

Ubuntu默认不支持exFat文件系统的挂载,需要手动安装exfat的支持

sudo apt-get install exfat-fuse

3.5 修复分区

sudo ntfsfix /dev/sda8

3.6安装atom

官网下载最新版本 atom

3.7 uget+aria2下载工具

安装uget和aria2

1
sudo apt-get install uget aria2

配置

a.打开uget。

b.打开界面的编辑—>设置—>插件,插件匹配顺序:aria2 。

c.打开界面的分类—>默认一般设置。调整最大连接数(建议在5)。设置一下下载文件夹。

在火狐中使用Flashgot扩展就可以。

3.8 安装shadowsocks-qt5

  • 添加源安装
1
2
3
sudo add-apt-repository ppa:hzwhuang/ss-qt5
sudo apt-get update
sudo apt-get install shadowsocks-qt5

3.9 安装wine/TIM

使用 wine staging ( 开发版本的 wine )安装详细教程 https://wine-staging.com/installation.html

1
2
3
4
5
6
7
8
sudo dpkg --add-architecture i386
#add the repository:
wget -nc https://dl.winehq.org/wine-builds/Release.key
sudo apt-key add Release.key
sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/
#install
sudo apt-get update
sudo apt-get install --install-recommends winehq-staging

去qq官网下载TIM 我使用的是TIM1.2。

安装wine后 ,命令执行winecfg然后会安装一些插件,选择安装它们。然后拷贝windows字体(不安装字体会使一些字无法查看)。

windows字体在c:\windows\fonts

把这个目录下字体全部复制到wine下的设置目录下:

~/.wine/drive_c/windows/Fonts/

重载所有wine的配置wineboot
再次打开wine winecfg配置如图

wine 设置

然后重启一下wine wineboot 。安装tim时,使用Wine Windows Program Loader 打开TIM。然后就是windows下安装程序——点点点。

备注:此方法有个bug 当TIM打开讨论组时会是TIM崩溃。

建立桌面快捷方式

1
2
3
4
5
6
7
8
9
10
11
12
[Desktop Entry]
Encoding=UTF-8
Version=1.2
Name[en_US]=TIM
Name[zh_CN]=腾讯TIM
Exec=env LC_ALL=zh_CN.utf8 wine /home/h/.wine/drive_c/Program\ Files\ \(x86\)/Tencent/TIM/Bin/TIM.exe
Icon=/home/h/we/electronic-wechat-linux-x64/photo/TIM.ico
Terminal=false
NoDisplay=false
StartupNotify=true
Type=Application
Categories=Network;InstantMessaging;

3.10 安装electronic-wechat

项目在 github 上 。
我使用源码安装失败了,npm总是出错,不知为什么。(如果你使用源码安装成功,请求教)最后使用安装版,见此 https://github.com/geeeeeeeeek/electronic-wechat/releases

在桌面上建立图标

1
2
3
4
5
6
7
8
9
10
[Desktop Entry]
Encoding=UTF-8
Name=微信
Comment=electronic-wechat
Exec=/home/h/we/electronic-wechat-linux-x64/electronic-wechat
Icon=/home/h/we/electronic-wechat-linux-x64/photo/icon.png
Terminal=false
StartupNotify=true
Type=Application
Categories=Application

3.11 安装最新的python3

首先下载最新的python版本,这个在python官网上下载python官网

解压 进入其目录

1
2
3
./configure
make
make install

安装完后检查二进制文件的位置

1
2
which python3
python3 -V #V是大写的

3.12安装最新版本的npm 和 nodejs

首先安装npm和 nodejs

1
2
sudo apt-get install nodejs-legacy
suao apt-get install npm

ubuntu上安装时npm和nodejs都是低版本。

  • 升级npm

    1
    sudo npm install npm -g
  • 升级node.js

    1
    2
    sudo npm install -g n
    sudo n stable

4.gnome3的安装和配置

]]>
<h1 id="ubuntu16-04安装后配置"><a href="#ubuntu16-04安装后配置" class="headerlink" title="ubuntu16.04安装后配置"></a>ubuntu16.04安装后配置</h1>
github+hexo 搭建博客 http://warlockfish.xyz/2017/10/15/github-hexo-搭建博客/ 2017-10-15T15:04:53.000Z 2017-10-29T13:54:08.715Z

前言

本文章讲述如何利用 github pageshexo 建博客

准备环境

  • 有一个github账号,没有的话去 github https://github.com/ 注册一个;
  • 安装node.js、npm
  • 安装git
  • 安装hexo

本文所使用的环境:

  • ubuntu 16.04
  • node.js 8.6.0
  • git 2.7.4
  • hexo 3.3.9

搭建github博客

创建仓库

在注册完github帐号后,新建一个名为用户名.github.io的仓库,比如说,如果你的github用户名是test,那么你就新建test.github.io的仓库(必须是你的用户名,其它名称无效),将来你的网站访问地址就是 http://test.github.io

由此可见,每一个github账户最多只能创建一个这样可以直接使用域名访问的仓库。

几个注意的地方:

  1. 注册的邮箱一定要验证,否则不会成功;
  2. 仓库名字必须是:username.github.io,其中username是你的用户名;

创建成功后,默认会在你这个仓库里生成一些示例页面,以后你的网站所有代码都是放在这个仓库里啦。

node.js&&npm 安装

ubuntu下安装

1
sudo apt-get install nodejs && npm

git 安装

其实ubuntu下直接安装就好:

1
sudo apt-get install git

配置SSH key

为什么要配置这个呢?因为你提交代码肯定要拥有你的github权限才可以,但是直接使用用户名和密码太不安全了,所以我们使用ssh key来解决本地和服务器的连接问题。

用git bash执行如下命令:

1
$ cd ~/. ssh #检查本机已存在的ssh密钥

如果提示:No such file or directory 说明你是第一次使用git。

1
ssh-keygen -t rsa -C "邮件地址"

然后连续3次回车,最终会生成一个文件在用户目录下,打开用户目录,找到.ssh\id_rsa.pub文件,记事本打开并复制里面的内容,打开你的github主页,进入个人设置 -> SSH and GPG keys -> New SSH key:

将刚复制的内容粘贴到key那里,title随便填,保存。

测试是否成功

$ ssh -T git@github.com # 注意邮箱地址不改

如果提示Are you sure you want to continue connecting (yes/no)?,输入yes,然后会看到:

Hi liuxianan! You’ve successfully authenticated, but GitHub does not provide shell access.

看到这个信息说明SSH已配置成功!

此时你还需要配置:

1
2
$ git config --global user.name "liuxianan"// 你的github用户名,非昵称
$ git config --global user.email "xxx@qq.com"// 填写你的github注册邮箱

配置完之后输入:

1
$ git config --list #查看已设配置

查看username,email是否正确

使用hexo写博客

hexo简介

Hexo是一个简单、快速、强大的基于 Github Pages 的博客发布工具,支持Markdown格式,有众多优秀插件和主题。

官网: http://hexo.io
github: https://github.com/hexojs/hexo

原理

由于github pages存放的都是静态文件,博客存放的不只是文章内容,还有文章列表、分类、标签、翻页等动态内容,假如每次写完一篇文章都要手动更新博文目录和相关链接信息,相信谁都会疯掉,所以hexo所做的就是将这些md文件都放在本地,每次写完文章后调用写好的命令来批量完成相关页面的生成,然后再将有改动的页面提交到github。

安装

1
$ npm install -g hexo

初始化

在电脑的某个地方新建一个名为hexo的文件夹(名字可以随便取)

1
2
3
$ cd ~/hexo/
$ hexo init #初始化文件夹
$ npm install #安装包

hexo安装成功后,hexo文件夹目录为:

1
2
3
4
5
6
7
8
.
├── _config.yml // 网站的配置信息,你可以在此配置大部分的参数。
├── package.json
├── scaffolds // 模板文件夹。当你新建文章时,Hexo会根据scaffold来建立文件。
├── source // 存放用户资源的地方
| ├── _drafts
| └── _posts
└── themes // 存放网站的主题。Hexo会根据主题来生成静态页面

具体内容可见hexo建站

然后输入下面:

1
2
$ hexo g # 生成public文件夹(浏览器访问资源)
$ hexo s # 启动服务

执行以上命令之后,hexo就会在public文件夹生成相关html文件,这些文件将来都是要提交到github去的

hexo s是开启本地预览服务,打开浏览器访问 http://localhost:4000 即可看到内容,很多人会碰到浏览器一直在转圈但是就是加载不出来的问题,一般情况下是因为端口占用的缘故,因为4000这个端口太常见了,解决端口冲突问题请参考这篇文章:

http://blog.liuxianan.com/windows-port-bind.html

第一次初始化的时候hexo已经帮我们写了一篇名为 Hello World 的文章,默认的主题比较丑,打开时就是这个样子:

配对ssr

打开~\Hexo 文件夹中的_config.yml文件,填写内容

1
2
3
4
5
6
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: git
repository: git@github.com:WarlockFish/WarlockFish.github.io.git #填入你的github链接,我填的是我的
branch: master

修改主题

默认主题很丑,可以来替换一个好看点的主题。这是 官方主题 链接

我使用的是 next .
喜欢使用可以安装:

1
$ git clone https://github.com/iissnan/hexo-theme-next themes/next

记住要在hexo目录中执行上面指令。

修改hexo目录中的_config.yml中的theme: landscape改为theme: next,保存退出,
然后执行hexo g来重新生成文件。

1
2
3
4
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: next

写博客

hexo

1
hexo n "name of the new post"

~/hexo/source/_posts下会生成一份博客,Hexo使用MarkDown写作语法。写完后可以使用

1
2
hexo g
hexo s

然后可以在本地访问 http://localhost:4000 查看效果,便于更改

更新Github

进入目录

1
2
3
$ cd ./hexo
$ hexo g #编译本地内容
$ hexo d #上传到github上

这样就发布成功了,可以在网络上访问了。

谢谢阅读!!

]]>
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="330" height="86" src="//music.163.com/outchain/player?type=2&id=439915614&auto=0&height=66"></iframe> <h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p> 本文章讲述如何利用 <a href="https://github.com/" target="_blank" rel="external">github pages</a> 和 <a href="https://hexo.io/" target="_blank" rel="external">hexo</a> 建博客</p>
my-first-blog http://warlockfish.xyz/2017/10/07/my-first-blog/ 2017-10-07T14:03:57.000Z 2017-10-08T05:19:56.791Z

前言

使用github pages服务搭建博客的好处有:

  1. 全是静态文件,访问速度快;

  2. 免费方便,不用花一分钱就可以搭建一个自由的个人博客,不需要服务器不需要后台;

  3. 可以随意绑定自己的域名,不仔细看的话根本看不出来你的网站是基于github的;

  4. 数据绝对安全,基于github的版本管理,想恢复到哪个历史版本都行;

  5. 博客内容可以轻松打包、转移、发布到其它平台;

  6. 等等;

]]>
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="330" height="86" src="//music.163.com/outchain/ player?type=2&id=28138493&auto=0&height=66"></iframe> <h1 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h1><p>使用github pages服务搭建博客的好处有:</p> <ol> <li><p>全是静态文件,访问速度快;</p> </li> <li><p>免费方便,不用花一分钱就可以搭建一个自由的个人博客,不需要服务器不需要后台;</p>
Hello World http://warlockfish.xyz/2017/10/07/hello-world/ 2017-10-07T02:00:00.000Z 2017-10-07T11:36:42.405Z Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

]]>
<p>Welcome to <a href="https://hexo.io/" target="_blank" rel="external">Hexo</a>! This is your very first post. Check <a href="https://hexo.