debian

How to get the installed apt packages with Ansible?

你。 提交于 2020-01-07 04:10:28
问题 I am trying to list all installed packages on my Debian 7/8/9 machines. There are easy ways dealing with it using apt or dpkg but I could not find a proper way to do this with ansible out of the box. Is there a nice and smooth way to do this? For RHEL machines I found this Post: How to get the installed yum packages with Ansible? 回答1: It doesn't look like Ansible provides any modules that would support this. You'll have to use shell or command . - name: Get packages shell: dpkg-query -f '$

Google Cloud VM when sudoing asks for password

断了今生、忘了曾经 提交于 2020-01-07 03:12:25
问题 I've been working with a Google Cloud debian VM and had no problem at all doing super user tasks using sudo (sudo was not asking for password). Today I connected via SSH as usual and when I try to sudo something it started asking for password: We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password

Change niceness of all processes by niceness [closed]

浪子不回头ぞ 提交于 2020-01-06 06:38:19
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am using Debian, is there a way to change the niceness of all running process based on their current niceness? For instance change all currently running processes that have a niceness of -20 or -19 to -10. Renice can change a process, and processes for certain users. But as far as I can tell it can't do it

How to handle bounce email with postfix and php?

最后都变了- 提交于 2020-01-06 05:43:11
问题 Using Postfix and PHP i would like to handle bounce email. I first build a postfix server like this : https://www.digitalocean.com/community/tutorials/how-to-set-up-a-postfix-e-mail-server-with-dovecot then master.cf configuration from https://thecodingmachine.io/triggering-a-php-script-when-your-postfix-server-receives-a-mail I'm able to send all outgoing email content to my php script, but how can i only send bounce email to this script ? Mail sender: $headers[] = 'MIME-Version: 1.0';

ncurses program won't run on debian armv7

末鹿安然 提交于 2020-01-06 04:35:21
问题 Can somebody here help me with ncurses for armv7 (x86)? I just want to run on Debian my C++ program uses ncurses It has error "Error opening terminal: xterm." I used this installation guide: http://soft-dev-pro.blogspot.ru/2014/07/cross-compile-ncurses-for-arm.html If i type which in console, it shows this: which $TERM /usr/bin/xterm It seems initscr() function won't start curses mode 回答1: Your ncurses program is looking for /usr/arm-linux-gnueabihf/share/terminfo and not finding that. If you

ncurses program won't run on debian armv7

半城伤御伤魂 提交于 2020-01-06 04:35:09
问题 Can somebody here help me with ncurses for armv7 (x86)? I just want to run on Debian my C++ program uses ncurses It has error "Error opening terminal: xterm." I used this installation guide: http://soft-dev-pro.blogspot.ru/2014/07/cross-compile-ncurses-for-arm.html If i type which in console, it shows this: which $TERM /usr/bin/xterm It seems initscr() function won't start curses mode 回答1: Your ncurses program is looking for /usr/arm-linux-gnueabihf/share/terminfo and not finding that. If you

[Debian] 硬盘安装Debian

眉间皱痕 提交于 2020-01-06 01:10:05
硬盘安装Debian   环境:Windows XP ,只有一块硬盘。    1 下载Debian   只要下载第一张CD就行了,不需要下载DVD,因为一张DVD的ISO会大于4G(FAT32不支持超过4G的文件)。    将下载的ISO放到一个FAT32格式的分区根目录下,比如E盘。    2 下载安装引导文件   一定要下载和安装镜像版本相同的引导文件,我下载的6.0.1a,就要6.0.1a的引导文件。下载地址: http://debian.cn99.com/debian/dists/Debian6.0.1/main/installer-i386/current/images/hd-media/ 。其他版本的从这个目录找: http://debian.cn99.com/debian/dists/ 。引导文件在 /版本号/main/installer-CPU架构/current/images/hd-media/下。   将下载的3个文件复制到FAT32格式分区的目录下 ,比如E盘。这里要知道在分区在Linux下的表示方式。因为我们使用最新的grud2启动管理器,所以E盘的表示方式为(hd0,6) ,C盘为(hd0,1),D盘为(hd0,5),旧的grud启动管理器E盘为(hd0,5) C为(hd0,1) D为(hd0,4)。当然也可以不记

Debian Linux下的Python学习——函数

谁说胖子不能爱 提交于 2020-01-06 01:07:46
python函数通过 def 关键字 定义 。 def 关键字后跟一个函数的 标识符 名称,然后跟一对圆括号。圆括号之中可以包括一些变量名,该行以冒号结尾。接下来是一块语句,它们是函数体。 1.无参数函数(函数不带参数) 代码: 运行: 2.带参函数 形参:函数中的参数名称(例如下面代码中的a,b) 实参:提供给函数调用的值(例如下面代码中的x,y) 2.1带普通参数函数 代码: 运行: 2.2 带默认参数函数(下面代码中b是默认参数) 代码: 运行: 当给形参指定了默认参数值,在调用函数的时候,可以不用给默认参数传递值。例如上面代码中,函数Add,当传递x,y给它的时候,它将x,y的值相加,当只传递x的时候,它将x和默认的参数值相加。 注意: 只有在形参表末尾的那些参数可以有默认参数值,即你不能在声明函数形参的时候,先声明有默认值的形参,然后再声明没有默认值的形参。 因为赋给形参的值是根据位置而赋值的。例如, def Add(a, b=1) 是有效的,但是 def Add(a=1, b) 是无效的。 2.3 带关键参数函数 关键参数:我们使用参数名字(关键字)而不是位置来给函数指定实参,这样做有两个优点:1不必担心参数的顺序,使用函数变得更加简单了,2.可以只给我们想要的那些参数赋值。 代码: 运行: 3.如果想要函数有返回值在函数里面添加 return 语句 代码: 运行:

debian ssh设置root权限登陆 Permission denied, please try again

亡梦爱人 提交于 2020-01-06 01:01:35
1.安装ssh服务 root@debian:/# apt-get install ssh 2.进入/etc/ssh/修改sshd_config配置文件,让其可以root权限登陆该服务器 # $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin # The strategy used for options in the default sshd_config shipped with # OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options override the # default value. Port 22 #AddressFamily any #ListenAddress 0.0.0.0

PhantomJS arguments.js example UTF-8 not working

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-05 08:43:29
问题 NOTE : This might be related to the question I already asked Highcharts export server special characters replaced with question mark. The PhantomJS arguments.js example returns the parameters you give. Example : phantomjs arguments.js a b c Returns : 0: arguments.js 1: a 2: b 3: c On Mac OS X with PhantomJS 1.9.0 installed, I have no problem returning arguments with special characters. But on the remote server I'm working with (Linux Debian 6), it does not work as expected : phantomjs