小编u12*_*123的帖子

如何在 Bash 提示中显示带有颜色的 git 分支?

在 git 存储库中工作时,我正在使用本指南在 gnome 终端(Ubuntu 15.10)中显示分支名称。基于以上内容,我现在在 ~/.bashrc 文件中有以下内容:

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes 
Run Code Online (Sandbox Code Playgroud)

...

# Add git branch if its present to PS1
parse_git_branch() {
 git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes …
Run Code Online (Sandbox Code Playgroud)

command-line bash git

192
推荐指数
5
解决办法
25万
查看次数

创建文本后如何在 Pinta 中编辑或移动文本?

我在 Ubuntu 20.10 上使用 Pinta 1.7。

当我创建文本并完成它时,我无法再编辑我创建的文本或移动它。如果我尝试编辑它,它只会将新文本写入现有文本之上。

那么如何编辑我创建的现有文本或将其移动到另一个位置?

这:

https://www.pinta-project.com/user-guide/text/

不涵盖此用例。

pinta

7
推荐指数
0
解决办法
986
查看次数

www-data 用户的主目录?

据我了解,www-data用户是拥有 apache 服务的用户。

从/etc/passwd我有的文件:

www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
Run Code Online (Sandbox Code Playgroud)

所以www-data的主目录是:/var/www但如果我检查该文件夹的权限,我会得到:

/var/www $ ll
total 12
drwxr-xr-x  3 root root 4096 Mar 20 19:42 ./
drwxr-xr-x 12 root root 4096 Mar 20 19:42 ../
drwxr-xr-x  2 root root 4096 Mar 20 19:42 html/
Run Code Online (Sandbox Code Playgroud)

所以看起来root拥有该文件夹。为什么拥有/var/www目录(其主目录)的不是www-data用户?

permissions apache2

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

无法在 jenkins shell 脚本中激活 python 虚拟环境

我已经在 ubuntu 15.10 上安装了 Jenkins。在 shell 构建步骤中,我试图创建一个 Python 虚拟环境并激活它: 在此处输入图片说明

但是当我运行作业时出现以下错误:

/tmp/hudson4515625893361069094.sh: 9: /tmp/hudson4515625893361069094.sh: source: not found
Run Code Online (Sandbox Code Playgroud)

更多来自日志:

[django-demo] $ /bin/sh -xe /tmp/hudson4515625893361069094.sh
+ virtualenv --no-site-packages virtual_django
New python executable in virtual_django/bin/python2
Also creating executable in virtual_django/bin/python
Installing setuptools, pip...done.
Running virtualenv with interpreter /usr/bin/python2
+ cd virtual_django/bin
+ pwd
/var/lib/jenkins/workspace/django-demo/virtual_django/bin
+ dir
activate      activate.fish easy_install      pip   pip2.7  python2
activate.csh  activate_this.py  easy_install-2.7  pip2  python  python2.7
+ source activate
/tmp/hudson4515625893361069094.sh: 9: /tmp/hudson4515625893361069094.sh: source: not found
Build step 'Execute shell' marked build as …
Run Code Online (Sandbox Code Playgroud)

python command-line bash jenkins

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

标签 统计

bash ×2

command-line ×2

apache2 ×1

git ×1

jenkins ×1

permissions ×1

pinta ×1

python ×1