I was googling and found this link helpful https://serverfault.com/questions/538233/qmail-limit-number-of-emails-sent-by-user-or-domain-per-hour
My OS is Centos with Plesk 11.x + Qmail
I tried my best to follow given directives in the link e.g.
1) I installed spamdkye successfully
2) Created mkdir -p /home/vpopmail/bin/qmail-antispam
3) mkdir -p /etc/qmailadmin/qmail-spam/blacklist
4) crontab -e
*/5 * * * * /home/vpopmail/bin/qmail-antispam >> /var/log/maillog 2>&1
5) I saved script as qmail-antispam as well as moved as blacklist but on both positions it displays:
Code:
# tail -f /var/log/maillog | grep "qmail-antispam"
/bin/sh: /home/vpopmail/bin/qmail-antispam: is a directory
/bin/sh: /home/vpopmail/bin/qmail-antispam: is a directory
Tue Oct 20 12:55:01 CDT 2015 qmail-antispam : Revisando logs
Tue Oct 20 12:55:01 CDT 2015 qmail-antispam : Fin de revision
Tue Oct 20 13:00:01 CDT 2015 qmail-antispam : Revisando logs
Tue Oct 20 13:00:01 CDT 2015 qmail-antispam : Fin de revision
Questions:
Please advise where:
1) where I save this script either in /etc/qmailadmin/qmail-spam/blacklist or /home/vpopmail/bin/qmail-antispam and with which name?
2) MAX_CORREOS=3000 //is that to set maximum limit??
ID_SERVER="ID_SERVER" //May I change this to my server hostname??
CONTACTO=admin#gmail.com //Here I set admin email to send report. Is that right??
Please advise
Thanks in anticipation
vi /home/vpopmail/bin/qmail-antispam
copy & paste the script provided in Link
Edit script and change following:
MAX_CORREOS=100
ID_SERVER="my server hostname"
CONTACTO=admin#gmail.com
# chown root /home/vpopmail/bin/qmail-antispam
# chmod 755 /home/vpopmail/bin/qmail-antispam
and check its working fine:
# tail -f /var/log/maillog | grep "qmail-antispam"
Wed Oct 21 19:20:01 CDT 2015 qmail-antispam : Revisando logs
Wed Oct 21 19:25:01 CDT 2015 qmail-antispam : Revisando logs
Wed Oct 21 19:30:01 CDT 2015 qmail-antispam : Revisando logs
Wed Oct 21 19:35:01 CDT 2015 qmail-antispam : Revisando logs
Wed Oct 21 19:40:01 CDT 2015 qmail-antispam : Revisando logs
Wed Oct 21 19:45:01 CDT 2015 qmail-antispam : Revisando logs
Wed Oct 21 19:50:01 CDT 2015 qmail-antispam : Revisando logs
Wed Oct 21 19:55:01 CDT 2015 qmail-antispam : Revisando logs
Wed Oct 21 20:00:01 CDT 2015 qmail-antispam : Revisando logs
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I have a file which has multiple record of netstat output, my sample file looks something like the one below. I want to search for PID for ex : 3453, part of the output I also want to see snapshot time, so that I can find whether PID was exist part of particular snapshot or not. Any thoughts?
zzz ***Sat Apr 11 03:00:26 UTC 2020
USER PID PPID PRI %CPU %MEM VSZ RSS WCHAN S STARTED TIME COMMAND
test 1234 3445 19 2.4 1.9 4070932 3539756 futex_wait_queue_ S Apr 04 04:00:17 test -quiet
test1 3453 6741 19 2.4 1.9 4070932 3539756 futex_wait_queue_ S Apr 04 04:00:17 test -quiet
zzz ***Sat Apr 11 03:01:26 UTC 2020
USER PID PPID PRI %CPU %MEM VSZ RSS WCHAN S STARTED TIME COMMAND
test 3453 3453 19 2.4 1.9 4070932 3539756 futex_wait_queue_ S Apr 04 04:00:17 test -quiet
test1 7842 8712 19 2.4 1.9 4070932 3539756 futex_wait_queue_ S Apr 04 04:00:17 test -quiet
Expected sample output for search 3453:
zzz ***Sat Apr 11 03:00:26 UTC 2020
test1 3453 6741 19 2.4 1.9 4070932 3539756 futex_wait_queue_ S Apr 04 04:00:17 test -quiet
zz ***Sat Apr 11 03:01:26 UTC 2020
test 3453 3453 19 2.4 1.9 4070932 3539756 futex_wait_queue_ S Apr 04 04:00:17 test -quiet
With GNU sed:
sed -n '/\*\*\*/,/^$/{ /\*\*\*/p; /3453/p }' file
Output:
zzz ***Sat Apr 11 03:00:26 UTC 2020
test1 3453 6741 19 2.4 1.9 4070932 3539756 futex_wait_queue_ S Apr 04 04:00:17 test -quiet
zzz ***Sat Apr 11 03:01:26 UTC 2020
test 3453 3453 19 2.4 1.9 4070932 3539756 futex_wait_queue_ S Apr 04 04:00:17 test -quiet
See: man sed and The Stack Overflow Regular Expressions FAQ
Has anyone tried using the bitbake-env utility lately?
I do not see it installed:
[user#localhost build]$ which bitbake
~/YOCTO/oe_core_embedded/poky/bitbake/bin/bitbake
[user#localhost build]$ which bitbake-env
/usr/bin/which: no bitbake-env in (/home/user/YOCTO/oe_core_embedded/poky/scripts:/home/user/YOCTO/oe_core_embedded/poky/bitbake/bin:/usr/libexec/python2-sphinx:/usr/lib64/qt-3.3/bin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/user/.local/bin:/home/user/bin)
[user#localhost build]$
As well I do not see it in the bitbake command listing:
[user#localhost poky]$ cd bitbake/bin
[user#localhost bin]$ ls -al
total 100
drwxrwxr-x. 2 user user 4096 Oct 18 12:49 .
drwxrwxr-x. 6 user user 4096 Oct 18 12:49 ..
-rwxrwxr-x. 1 user user 2072 Nov 18 11:51 bitbake
-rwxrwxr-x. 1 user user 7228 Oct 18 12:49 bitbake-diffsigs
-rwxrwxr-x. 1 user user 2894 Oct 18 12:49 bitbake-dumpsig
-rwxrwxr-x. 1 user user 4069 Oct 18 12:49 bitbake-layers
-rwxrwxr-x. 1 user user 2109 Oct 18 12:49 bitbake-prserv
-rwxrwxr-x. 1 user user 2128 Oct 18 12:49 bitbake-selftest
-rwxrwxr-x. 1 user user 17866 Oct 18 12:49 bitbake-worker
-rwxrwxr-x. 1 user user 13951 Oct 18 12:49 bitdoc
-rwxrwxr-x. 1 user user 5813 Oct 18 12:49 git-make-shallow
-rwxrwxr-x. 1 user user 8805 Oct 18 12:49 toaster
-rwxrwxr-x. 1 user user 4177 Oct 18 12:49 toaster-eventreplay
[user#localhost bin]$
It still exists/is listed in https://elinux.org/Bitbake_Cheat_Sheet from July 2016.
bitbake-env is a third party utility, and not actually a part of the OpenEmbedded Core hence why you will not see it unless you specifically install it. It is actually an 'improved' version of the bitbake -e flag for bitbake.
bash-4.3$ bitbake --help
Usage: bitbake [options] [recipename/target recipe:do_task ...]
Executes the specified task (default is 'build') for a given set of target recipes (.bb files).
It is assumed there is a conf/bblayers.conf available in cwd or in BBPATH which
will provide the layer, BBFILES and other configuration information.
Options:
...
-e, --environment Show the global or per-recipe environment complete
with information about where variables were
set/changed.
gsutil rsync -C "continue" option is not working from backup_script:
$GSUTIL rsync -c -C -e -r -x $EXCLUDES $SOURCE/Documents/ $DESTINATION/Documents/
From systemd log:
$ journalctl --since 12:00
Jul 25 12:00:14 localhost.localdomain CROND[9694]: (wolfv) CMDOUT (CommandException: Error opening file "file:///home/wolfv/Documents/PC_maintenance/backup_systems/gsutil/ssmtp.conf": .)
Jul 25 12:00:14 localhost.localdomain CROND[9694]: (wolfv) CMDOUT (Caught ^C - exiting)
Jul 25 12:00:14 localhost.localdomain CROND[9694]: (wolfv) CMDOUT (Caught ^C - exiting)
Jul 25 12:00:14 localhost.localdomain CROND[9694]: (wolfv) CMDOUT (Caught ^C - exiting)
Jul 25 12:00:14 localhost.localdomain CROND[9694]: (wolfv) CMDOUT (Caught ^C - exiting)
because owner is root rather than user:
$ ls -l ssmtp.conf
-rw-r-----. 1 root root 1483 Jul 24 21:30 ssmtp.conf
rsyc worked fine after deleting the root-owned file.
This happened on a Fedora22 machine, when cron called backup_script which called gsutil rsync.
Thanks for reporting that problem. We'll get a fix for this bug in gsutil release 4.14.
Mike
While converting the date to +%-m/%-d/%Y using date format in unix, I'm getting dates converted to timezones. HKT or JST timezones to EST, I want the date as is to be converted as mm/dd/yy without this timezone conversion
Example:
$ date -u '--d=Sun Jan 25 08:39:12 JST 2015' +%-m/%-d/%Y
1/24/2015
I also tried with -u -d options
$ date -u -d 'Sun Jan 25 08:39:12 JST 2015' +%-m/%-d/%Y
1/24/2015
Can someone please help me with the solution.
To change the output timezone, you could set TZ envvar:
$ TZ=EST date -d 'Sun Jan 25 08:39:12 JST 2015'
Sat Jan 24 18:39:12 EST 2015
$ TZ=JST date -d 'Sun Jan 25 08:39:12 JST 2015'
Sun Jan 25 08:39:12 JST 2015
To ignore the input timezone or to detect it automatically, a Python script could be used:
#!/usr/bin/env python
"""Change date/time format.
Usage: $ {prog} <input-date-time> <output-format>
Example: $ ./change-date-format 'Sun Jan 25 08:39:12 JST 2015' %-m/%-d/%Y
Output: 1/25/2015
"""
import sys
from dateutil.parser import parse # apt-get install python-dateutil
try:
date_string, date_format = sys.argv[1:]
except ValueError:
sys.exit(__doc__.format(prog=sys.argv[0])) # print usage info
else:
datetime_object = parse(date_string)
print(datetime_object.strftime(date_format))
I'm very (very) new to node.js, and also fairly green when it comes to server side configuration and coding. (I have a long history of client-side programming, most recently with Adobe Flex and ActionScript.)
Anyhow, I asked Rackspace (who manages a Linux server for me) to install node.js and node-postgres.
From the comments in the ticket, that installation went like this:
node.js
Running Transaction
Installing : nodejs-stable-release [1/1]
Installed: nodejs-stable-release.noarch 0:5-3
Complete!
and node-postgres
[root#237175-web2 src]# npm install pg
npm http GET https://registry.npmjs.org/pg
npm http 200 https://registry.npmjs.org/pg
npm http GET https://registry.npmjs.org/pg/-/pg-0.6.17.tgz
npm http GET https://registry.npmjs.org/generic-pool/1.0.9
npm http 200 https://registry.npmjs.org/generic-pool/1.0.9
npm http GET https://registry.npmjs.org/generic-pool/-/generic-pool-1.0.9.tgz
pg#0.6.17 install /usr/src/node_modules/pg
node-waf configure build || (exit 0)
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr
Checking for program pg_config : /usr/bin/pg_config
'configure' finished successfully (0.051s)
Waf: Entering directory `/usr/src/node_modules/pg/build'
[1/2] cxx: src/binding.cc -> build/Release/src/binding_1.o
[2/2] cxx_link: build/Release/src/binding_1.o -> build/Release/binding.node
Waf: Leaving directory `/usr/src/node_modules/pg/build'
'build' finished successfully (0.745s)
pg#0.6.17 ./node_modules/pg
+-- generic-pool#1.0.9
More info:
[root#237175-web2 ~]# ls -la /usr/src/node_modules/pg
total 68
drwxr-xr-x 9 root root 4096 Apr 26 22:34 .
drwxr-xr-x 3 root root 4096 Apr 26 22:34 ..
drwxr-xr-x 2 root root 4096 Apr 26 22:34 benchmark
drwxr-xr-x 4 root root 4096 Apr 26 22:34 build
drwxr-xr-x 3 root root 4096 Apr 26 22:34 lib
-rw-r--r-- 1 root root 5618 Apr 26 22:34 .lock-wscript
-rw-r--r-- 1 root root 1269 Feb 23 23:58 Makefile
drwxr-xr-x 3 root root 4096 Apr 26 22:34 node_modules
-rw-r--r-- 1 root root 21 Mar 3 15:19 .npmignore
-rw-r--r-- 1 root root 962 Apr 26 22:34 package.json
-rw-r--r-- 1 root root 6843 Mar 27 09:30 README.md
drwxr-xr-x 2 root root 4096 Apr 26 22:34 script
drwxr-xr-x 2 root root 4096 Mar 21 23:37 src
drwxr-xr-x 5 root root 4096 Apr 26 22:34 test
-rw-r--r-- 1 root root 990 Feb 23 23:58 wscript
[root#237175-web2 ~]#
A little “Hello world” node.js example works fine (hooray!), but a simple Postgres example fails on the require('pg') statement, saying that the module cannot be found. I've looked on the server and can't find a pg.js file anywhere.
Any clue as to why the node-postgres build failed?
Install it globally:
npm install -g pg
You may need to become root, e.g. with
sudo npm install -g pg