debian

Find all instances of word occurring in a file

让人想犯罪 __ 提交于 2019-12-22 18:31:56
问题 Using bash I was wondering how I can find all instances of a word which starts with text, store it as a variable and print it out. For example if this was my file test.conf $temp_test test $1234_$temp $temp_234 My output would be as follows: $temp_test $temp_234 Can anyone tell me how this might be possible? This is the closest I could get so far. while read NAME do echo "$NAME" done < test.conf 回答1: You can just use grep with right regex: grep '^ *$temp' test.conf $temp_test $temp_234 UPDATE

Why can't Celery daemon see tasks?

南笙酒味 提交于 2019-12-22 18:25:06
问题 I have a Django 1.62 application running on Debian 7.8 with Nginx 1.2.1 as my proxy server and Gunicorn 19.1.1 as my application server. I've installed Celery 3.1.7 and RabbitMQ 2.8.4 to handle asynchronous tasks. I'm able to start a Celery worker as a daemon but whenever I try to run the test "add" task as shown in the Celery docs, I get the following error: Received unregistred task of type u'apps.photos.tasks.add'. The message has been ignored and discarded. Traceback (most recent call

debian 9 双显卡安装NVIDIA显卡驱动

半世苍凉 提交于 2019-12-22 14:37:17
https://www.cnblogs.com/hellxz/p/7865790.html 原文链接 http://blog.sina.com.cn/s/blog_67ea5c2b0102vjce.html https://blog.csdn.net/mhlwsk/article/details/51713530 本文最后编辑日期为2018.09.08 晚8点半,因为之前写的内容不够准确,而且官方wiki又在今年8月更新了内容,所以这里对之前的内容进行大幅修改,仅保留正确可行的方法------N卡独显的安装! 2018.09.27 update ! this article just suitable debian-live iso , if you use 650M iso, you will get a error "can't load kernel modules". Please certain you iso image ,good luck! 1、打开终端,root登录,使用如下命令查看自己的显卡型号 $ lspci -nn | egrep -i "3d|display|vga" 2、记下Nvidia显卡的型号与最前边的编号,比如下边是我的输出,标红处为需要记下的,请参考 00:02.0 VGA compatible controller [0300]: Intel

Debian - /usr/bin/env: 'php\r': No such file or directory

喜你入骨 提交于 2019-12-22 11:29:06
问题 So go straight to the problem, when I run ./yii seems I got that error from Debian:stretch that I ran from Docker. However when I run /usr/bin/env php -v I got the correct output and there's no problem on it. Seems there's a problem on new line being translated as string and I have no idea how to fix it. Sorry if my English a bit messy and thanks in advance. Just note: I've been trying to edit that file using nano within debian but it's useless. I'm getting the same error. I've check php file

MongoDB errors: couldn't connect to server … open/create failed in createPrivateMap

心不动则不痛 提交于 2019-12-22 11:28:02
问题 Due to lack of memory mongod shut down automatically. (Debian) ~# reboot ~# mongo MongoDB shell version: 2.0.6 connecting to: test Thu Aug 2 13:12:26 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:8 4 exception: connect failed ~# mongo 127.0.0.1:27017 MongoDB shell version: 2.0.6 connecting to: 127.0.0.1:27017/test > use database > db.repairDatabase() { "errmsg" : "exception: file /var/lib/mongodb/$tmp_repairDatabase_0/datab ase.1 open/create failed in createPrivateMap (look in

PHP Sessions across sub domains 2

大城市里の小女人 提交于 2019-12-22 11:07:14
问题 This is a complement of PHP Sessions across sub domains I tried what is indicated on that question, and I see that the issue wasn't given. So I need to have sessions across sub-domains ( www.example.com to forum.example.com ) What I did on www.example.com is session_name("a_name"); session_set_cookie_params(0, '/', '.example.com'); session_start(); echo session_id(); $_SESSION['test'] = 123; On forum.example.com session_name("a_name"); session_set_cookie_params(0, '/', '.example.com');

Pytest Version Conflict Error

淺唱寂寞╮ 提交于 2019-12-22 09:19:33
问题 After update of Debian (Jessie), pytest doesn't work : #py.test Traceback (most recent call last): File "/usr/bin/py.test", line 5, in <module> sys.exit(load_entry_point('pytest==2.4.2', 'console_scripts', 'py.test')()) File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 348, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2311, in load_entry_point return ep.load() File "/usr

Integrating new version of PHP in NetBeans

耗尽温柔 提交于 2019-12-22 09:05:33
问题 A month ago PHP 7.1 was released. I've just installed it in my system, running '#php -version' returns me 'PHP 7.1.0' so everything is working fine. But at the time to create a new project in NetBeans, it only allows me '7.0' and the lower 5.X versions I've been looking for an option to update the new version of PHP in NetBeans but I didnt get a thing. Other details: Debian 8 stable system. PHP7.0 and previous 5.X versions had been installed through 'apt-get', but PHP7.1 through './configure

how to include a directory in the package debuild

自作多情 提交于 2019-12-22 05:25:08
问题 a Simple Debian package would be created in following steps, the following steps would be tutorial for beginners consider i have a file lets say test.sh which would just print test on the screen #!/bin/sh set -e echo "this is sample debian package created " >&2 What should be the output after installing the debian package? A)I want to place the above file which i named as test.sh in /home/bla/Desktop/ after installing the package using "dpkg -i test-1.0.deb" In order to achieve above process

Docker Login: Error when manually logging into private Registry

心已入冬 提交于 2019-12-22 05:11:41
问题 I can't manually log into my private GitLab Docker Registry from CLI: # docker login -u "${DOCKER_USER}" -p "${DOCKER_PASS}" "${DOCKER_URL}" error getting credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY` System info: Ubuntu 18.04 docker-ce 18.03.1~ce~3-0~ubuntu (from official repo, without install script) There is no ~/.docker/config.json for any users and I'm executing the docker login as root. On Google, I just find recommendations to export DISPLAY ...