debian

How can I delete specific lines using awk/sed based on the contents of another file

北战南征 提交于 2019-12-11 11:19:47
问题 How can I delete a specific lines from a file based on line numbers that are contained in another file? I know how to delete specific lines by just providing them on the command line, but I do not know how to delete specific lines based on lines numbers that are contained in another file. The file containing the line numbers is in the following format: 15768 15775 15777 15782 15784 15789 15791 15798 15800 15807 15809 15815 15817 15824 15826 There are 2073 lines total that I need to remove. I

cron job to remove old data from postgres on debian

不羁岁月 提交于 2019-12-11 10:59:56
问题 I need to create a cron that runs every night and remove some of the data (older ones) from my database. I am running postgres on debian. How do I do that? My server is tomcat6. Does anyone have a step by step instruction including script to do that? 回答1: in most cases, I prefer a shell script with an here-document. (shell-variables expand nicely in here-documents): #!/bin/sh PSQL=/local/postgres/bin/psql SOME_VALUE=123 $PSQL my_database <<THE_END DELETE FROM my_table WHERE my_column <= $SOME

Redhat镜像-RHEL-官方镜像下载大全

无人久伴 提交于 2019-12-11 09:40:32
Redhat镜像-RHEL-官方镜像下载大全 转载 weixin_30911451 发布于2019-05-30 15:24:00 阅读数 4316 收藏 展开 原网站内容链接:https://pan.baidu.com/s/12XYXh#list/path=%2F 已经存在自己的云盘上了 转载于:https://www.cnblogs.com/yr1126/p/10949794.html Linux操作系统各版本ISO镜像下载(包括oracle linux\redhat\centos\ubuntu\debian等) 2015年2月25日, 下午7:49 1、Oracle Linux( 下载地址 ) (1)OracleLinux-Release6-Update0-x86_64-dvd.iso (2)OracleLinux-Release6-Update1-x86_64-dvd.iso (3)OracleLinux-Release6-Update2-x86_64-dvd.iso (4)OracleLinux-Release6-Update3-x86_64-dvd.iso (5)OracleLinux-Release6-Update4-x86_64-dvd.iso (6)OracleLinux-Release6-Update5-x86_64-dvd.iso (7)OracleLinux

Most efficient way to grep files in directories for deletion using bash/aliases

北城余情 提交于 2019-12-11 07:49:19
问题 I have a Debian Virtual Private Server that hosts several virtual domains and users. It was configured so in order to host multiple domains and have multiple email addresses (users or accounts) under each domain name. I do get spam quiet often, and did not have the time to look on SpamAssasin on how to filter certain emails based on matched string in the email's body. Instead, the following function was added to the .bash_aliases and it was aliased for quick access use my_new_del() { echo "0:

Library for querying installed (Debian) packages in C?

馋奶兔 提交于 2019-12-11 07:35:25
问题 I need to check whether certain Debian packages are installed on a system in my C program. I could use external shell scripts which do grep magic of apt-cache output with system(), but it seems a bit inelegant and hackish, as well as the fact that it won't work if the user's installed language is different. Is there a C library I can hook into to query package installations? 回答1: I don't think you'll find a shipped library that meets your criteria, however, the dpkg program internally does

List all Linux users without systen users

回眸只為那壹抹淺笑 提交于 2019-12-11 07:28:54
问题 I would like to list all users in Linux without showing systen-user. How can I make this only the username . For example cut -d: -f1 /etc/passwd , I can see all users + system users. 回答1: This shows all users with uid less than 999: awk -F':' '$3>999 {print $1 " uid: " $3}' /etc/passwd | column -t | grep -v nobody EDIT: With cut showing only human users: cut -d: -f1,3 /etc/passwd | egrep ':[0-9]{4}$' | cut -d: -f1 回答2: You can try this : awk -F: '$6 ~ /\/home/ {print}' /etc/passwd 来源: https:/

How can I automatically answer yes in python?

安稳与你 提交于 2019-12-11 07:27:00
问题 Say I have a script that runs apt upgrade -y later on I'll need to manually answer these questions for different packages. How can I automatically do that? Setting up virtualbox-guest-x11 (5.0.32-dfsg-0ubuntu1.16.04.2) ... Configuration file '/etc/X11/Xsession.d/98vboxadd-xclient' ==> File on system created by you or by a script. ==> File also in package provided by package maintainer. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N

Error: Could not find CSR for: domain when using puppet cert sign

蹲街弑〆低调 提交于 2019-12-11 07:17:27
问题 I'm trying to sign my node (for a puppetmaster) only whatever I do I'm getting the error below: Error: Could not find CSR for: [domain name] The node is indeed listed under puppet cert list —all 回答1: You may need to remove the cert from the puppet directory(generally located in /etc/puppetlabs/puppet/ssl ) and re-issue it. From my experiences, this always works. The Puppet documentation covers this rather well. 回答2: Even I faced same problem, but resolved by giving complete hostname. Run this

Restore postgresql from files [closed]

一世执手 提交于 2019-12-11 07:12:15
问题 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 6 years ago . I have a big problem - I managed to accidentally uninstall the whole PostgreSQL DBMS from my hard drive. I also lost my database and haven't made any dumps of the containing data. I do, however, have a backup of all files from the server. Is it possible to somehow restore the database from these files? The OS I

Can't install ggplot2 at debian 7.6 in R

时间秒杀一切 提交于 2019-12-11 06:46:51
问题 Today i'm trying to install a good library for visualization and create graphics, named " ggplot2 ", but i actually have a problems with installation! There what i have in output: Installing package into ‘/home/hamsternik/R/x86_64-pc-linux-gnu-library/3.1’ (as ‘lib’ is unspecified) also installing the dependencies ‘munsell’, ‘scales’, ‘testthat’ trying URL 'http://cran.rstudio.com/src/contrib/munsell_0.4.2.tar.gz' Content type 'application/x-gzip' length 91026 bytes (88 Kb) opened URL =======