unix

amazon SES on Google Cloud Computing instance VM using postfix

扶醉桌前 提交于 2020-01-13 11:52:15
问题 can anyone help me configure postfix to use with amazon ses please.. i can successfully follow instructions here using sendgrid https://developers.google.com/compute/docs/sending-mail and it is working fine using sendgrid.. But i would like to adjust settings to use amazon SES instead of sendgrid, I am not even sure if that is possible seems google has blocked all smtp ports. any help greatly appreciated... I have tried these.. http://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html

Human readable, recursive, sorted list of largest files

旧街凉风 提交于 2020-01-13 09:42:47
问题 What is the best practice for printing a top 10 list of largest files in a POSIX shell? There has to be something more elegant than my current solution: DIR="." N=10 LIMIT=512000 find $DIR -type f -size +"${LIMIT}k" -exec du {} \; | sort -nr | head -$N | perl -p -e 's/^\d+\s+//' | xargs -I {} du -h {} where LIMIT is a file size threshold to limit the results of find. 回答1: This uses awk to create extra columns for sort keys. It only calls du once. The output should look exactly like du . I've

Human readable, recursive, sorted list of largest files

自闭症网瘾萝莉.ら 提交于 2020-01-13 09:42:28
问题 What is the best practice for printing a top 10 list of largest files in a POSIX shell? There has to be something more elegant than my current solution: DIR="." N=10 LIMIT=512000 find $DIR -type f -size +"${LIMIT}k" -exec du {} \; | sort -nr | head -$N | perl -p -e 's/^\d+\s+//' | xargs -I {} du -h {} where LIMIT is a file size threshold to limit the results of find. 回答1: This uses awk to create extra columns for sort keys. It only calls du once. The output should look exactly like du . I've

Remove lines which are between given patterns from a file (using Unix tools)

社会主义新天地 提交于 2020-01-13 09:07:30
问题 I have a text file (more correctly, a “German style“ CSV file, i.e. semicolon-separated, decimal comma) which has a date and the value of a measurement on each line. There are stretches of faulty values which I want to remove before further work. I'd like to store these cuts in some script so that my corrections are documented and I can replay those corrections if necessary. The lines look like this: 28.01.2005 14:48:38;5,166 28.01.2005 14:50:38;2,916 28.01.2005 14:52:38;0,000 28.01.2005 14

Remove lines which are between given patterns from a file (using Unix tools)

可紊 提交于 2020-01-13 09:07:08
问题 I have a text file (more correctly, a “German style“ CSV file, i.e. semicolon-separated, decimal comma) which has a date and the value of a measurement on each line. There are stretches of faulty values which I want to remove before further work. I'd like to store these cuts in some script so that my corrections are documented and I can replay those corrections if necessary. The lines look like this: 28.01.2005 14:48:38;5,166 28.01.2005 14:50:38;2,916 28.01.2005 14:52:38;0,000 28.01.2005 14

Split text file into multiple files

醉酒当歌 提交于 2020-01-13 08:15:30
问题 I am having large text file having 1000 abstracts with empty line in between each abstract . I want to split this file into 1000 text files. My file looks like 16503654 Three-dimensional structure of neuropeptide k bound to dodecylphosphocholine micelles. Neuropeptide K (NPK), an N-terminally extended form of neurokinin A (NKA), represents the most potent and longest lasting vasodepressor and cardiomodulatory tachykinin reported thus far. 16504520 Computer-aided analysis of the interactions

How to delete 5 lines before and 6 lines after pattern match using Sed?

核能气质少年 提交于 2020-01-13 06:02:16
问题 I want to search for a pattern "xxxx" in a file and delete 5 lines before this pattern and 6 lines after this match. How can i do this using Sed? 回答1: This might work for you (GNU sed): sed ':a;N;s/\n/&/5;Ta;/xxxx/!{P;D};:b;N;s/\n/&/11;Tb;d' file Keep a rolling window of 5 lines and on encountering the specified string add 6 more (11 in total) and delete. N.B. This is a barebones solution and will most probably need tailoring to your specific needs. Questions such as: what if there are

计算机与操作系统

旧城冷巷雨未停 提交于 2020-01-13 04:05:50
概念 如图1-1给出了一个逻辑上的简化视图,图的底部是硬件,硬件包括芯片、电路板、磁盘、键盘、显示器以及类似的设备,在硬件的顶部是软件。 多数计算机有两种运行模式:内核态和用户态。软件中最基础也是最核心的部分是操作系统,它运行在内核态,在这个模式中,操作系统具有对所有硬件的安全访问权,可以执行机器能够运行的任 何指令;软件的其余部分运行在用户态下,只使用机器指令中的一个子集;用户接口程序如GUI处于用户态程序中最低层次,允许用户使用或运行其他程序,诸如web浏览器等。 如图1-1所示,操作系统运行在裸机之上,为所有软件提供基础的运行环境。 操作系统与普通软件区别 1、用户不喜欢某个普通软件,如XX阅读器,他可以换或者自己写一个;操作系统是很难编写的,操作系统源代码有500万行甚至更高数量级的。 2、操作系统更加大型、复杂、长寿;普通软件更加小型、简单、寿命周期短。 操作系统定义 操作系统定义:是一种运行在内核态的软件,是一组控制和管理计算机软硬件资源,同时为用户提供使用计算机应用程序的集合。 操作系统的两大基本职能:面向机器管理计算机;面向用户使用计算机。 主要两大作用:管理和使用计算机 主要特征:并发性;共享性;虚拟性和不确定性 操作系统的主要功能有:进程管理;存储管理;设备管理;文件管理,用户接口等等。 计算机与操作系统的发展史 第一台真正纯机械的数字计算机

What does “BUS_ADRALN - Invalid address alignment” error means?

北战南征 提交于 2020-01-13 02:43:08
问题 We are on HPUX and my code is in C++. We are getting BUS_ADRALN - Invalid address alignment in our executable on a function call. What does this error means? Same function is working many times then suddenly its giving core dump. in GDB when I try to print the object values it says not in context. Any clue where to check? 回答1: You are having a data alignment problem. This is likely caused by trying to read or write through a bad pointer of some kind. A data alignment problem is when the

How do I find my program's main(…) function?

删除回忆录丶 提交于 2020-01-12 16:21:08
问题 I am currently porting a project with a few hundred code files and dependencies onto several third-party libraries to Mac Os. I've finally gotten to the point where the program compiles without warnings or errors, but it does not seem to execute my own main function. Instead it seems to execute some other main function which seems to belong to a third party. This function writes some diagnostic-looking data to the console and exits afterwards: (gdb) continue Current language: auto; currently