小编Sou*_*abh的帖子

UTF-8 字符在 tmux 中未正确显示

?在我的zsh主题中使用字符来提示。但是在 tmux 中,我的提示表现得很奇怪,显示了额外的空格,如下所示:

? ~   I can type from here
? ~ Instead of here like in zsh, and sometimes when I do stuff like cd
? ~   cd ~
? ~ cdcd /
? ~ ^^These 2 chars just show up but are not actually part of command and not delete-able
Run Code Online (Sandbox Code Playgroud)

我最近发现我可以通过 .tmux 将 tmux 编码设置为 utf8 set-window-option -g utf8 on。这样做,空间问题消失了,但?字符变为_. 我怎样才能?回来tmux

我的 zsh 主题:

PROMPT='%{$fg_bold[cyan]%} …
Run Code Online (Sandbox Code Playgroud)

prompt utf-8 tmux

33
推荐指数
2
解决办法
2万
查看次数

从可用空间创建分区 - 不能创建超过 4 个分区

我是双启动 Ubuntu 和 Win 8。

安装Ubuntu的时候忘记格式化90GB的分区了。

现在,当我尝试创建分区(在 gparted 中)时,出现此错误

不能创建超过 4 个主分区

如果你想要更多的分区,你应该首先创建一个扩展分区。这样的分区可以包含其他分区。由于扩展分区也是主分区,因此可能需要先删除主分区。

这是一个屏幕截图:

sda1是 windows 喜欢创建的小空间,原因我不清楚

sda2sda4是 windows 8 驱动器 C: 和 E:

sda3是我的 linux 驱动器

最后一个未分配的 10.2MB?我不知道这是从哪里来的。

但是为什么 Ubuntu 将 Window 的驱动器视为主要驱动器?

但更重要的是,我怎样才能恢复那 90GB,Win8 磁盘管理也给出了一些错误:(

partitioning dual-boot gparted

9
推荐指数
2
解决办法
4万
查看次数

为什么我会收到错误 101?我的 DNS 如何参与?

我开始Update information is outdated警觉了。我试过sudo apt-get update并得到这些错误:

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/Release.gpg  Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::13). - connect (101: Network is unreachable) [IP: 2001:67c:1562::13 80]
W: Failed to fetch http://repository.spotify.com/dists/stable/Release.gpg  Something wicked happened resolving 'repository.spotify.com:http' (-11 - System error)
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/main/i18n/Translation-en_IN  Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::13). - connect (101: Network is unreachable) [IP: 2001:67c:1562::13 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/main/i18n/Translation-en  Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::13). - connect …
Run Code Online (Sandbox Code Playgroud)

apt

6
推荐指数
2
解决办法
7734
查看次数

缺少 Apache2 停止命令

如何停止我的本地 apache 服务器?

/etc/init.d/apache2并且service apache2只给出 3 个选项 -- restartstartstatus


我重新启动了我的系统,现在sudo /etc/inid.d/apache stop可以工作,但没有提供stop选项TAB

httpd丢失了所以我做了sudo ln -s /usr/sbin/apachectl /etc/init.d/httpd- 在某个论坛上阅读

httpd 服务现在提供startstatus选项(再次,没有stop

sudo /etc/init.d/httpd status

Looking up localhost
Making HTTP connection to localhost
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://localhost/server-status
'www-browser -dump http://localhost:80/server-status' failed.
Maybe you need to install a package providing www-browser or …
Run Code Online (Sandbox Code Playgroud)

apache2

6
推荐指数
2
解决办法
1万
查看次数

在 Ubuntu 13.04 中重命名计算机

如何重命名我的计算机?重命名它/etc/hosts/etc/hostname做一些奇怪的事情。在重命名之前,我可以使用 sublime 打开这些文件

sudo subl /etc/hosts
Run Code Online (Sandbox Code Playgroud)

但是当我重命名我的计算机(使用 nano)并使用打开任何这些文件时subl,我收到以下消息:

No protocol specified

(sublime_text:20071): Gtk-WARNING **: cannot open display: :0.0
Run Code Online (Sandbox Code Playgroud)

所以我想在上述文件中重命名并不是我唯一要做的事情。

PS:如果我使用 sublime 重命名,在重命名其中一个文件后,当我尝试打开其他文件时会收到相同的消息

hosts sublime-text 13.04

5
推荐指数
1
解决办法
8297
查看次数

rm -I 防止意外 rm

我只是alias rm="rm -I"为了防止意外rm命令而创建的。

-I     prompt  once before removing more than three files, or when removing recursively.
       Less intrusive than -i, while still giving protection against most mistakes
Run Code Online (Sandbox Code Playgroud)

但它不起作用。我在使用时没有得到任何提示rm -rf

rm coreutils

5
推荐指数
2
解决办法
518
查看次数

为 virtualenv 名称编辑 ZSH 主题

我使用 zsh 主题intheloops。当没有虚拟环境时,主题看起来像这样。活跃

-- an empty line --
[sourabh@skynet] ~/Code/django_apps/cope (master) ? 
?
Run Code Online (Sandbox Code Playgroud)

当一个环境。活跃,

(env name)
[sourabh@skynet] ~/Code/django_apps/cope (master) ? 
?
Run Code Online (Sandbox Code Playgroud)

当某些 virtualenv 处于活动状态时,我可以使它看起来像这样吗

-- empty line --
(env name) [sourabh@skynet] ~/Code/django_apps/cope (master) ? 
?
Run Code Online (Sandbox Code Playgroud)

.zsh-theme 文件

local return_status="%{$fg[red]%}%(?..?)%{$reset_color%}"

local host_color="green"
if [ -n "$SSH_CLIENT" ]; then
  local host_color="red"
fi

PROMPT='
%{$fg_bold[grey]%}[%{$reset_color%}%{$fg_bold[${host_color}]%}%n@%m%{$reset_color%}%{$fg_bold[grey]%}]%{$reset_color%} %{$fg_bold[blue]%}%10c%{$reset_color%} $(git_prompt_info) $(git_remote_status)
%{$fg_bold[cyan]%}?%{$reset_color%} '


RPROMPT='${return_status}%{$reset_color%}'

ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}(%{$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}) %{$fg[pink]%}?%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[grey]%})"
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="%{$fg_bold[magenta]%}?%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE="%{$fg_bold[magenta]%}?%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="%{$fg_bold[magenta]%}?%{$reset_color%}"
Run Code Online (Sandbox Code Playgroud)

themes zsh prompt virtualenv

3
推荐指数
1
解决办法
6048
查看次数

Ralink 蓝牙在 Ubuntu 13.04 中不起作用

我的蓝牙在 Ubuntu 13.04 中不起作用。我无法打开它,而且蓝牙图标没有显示在顶部栏中。

我在#ubuntu IRC 上询问了这个问题,他们说我缺少它的专有驱动程序。没有什么在其他驱动程序软件和更新

当我从 DVD/USB 启动 Ubuntu 时,蓝牙确实可以“尝试 Ubuntu 模式”。

如何获得所需的驱动程序?

bluetooth ralink drivers

2
推荐指数
1
解决办法
1万
查看次数