Reputation
523
Top tag
Next privilege 1,000 Rep.
See vote count; VIP usercard
Badges
4 15
Impact
~16k people reached

Mar
6
comment Bash evaluation baffling
Your cat | sed | awk abomination seems to only pick out the decimal part of the load average and using it as an integer. The diagnostics you show are not consistent with this. Are you sure this is the code you are actually running?
Mar
6
comment Load users environment variables in a cronjob
Added stuff from stackoverflow.com/a/15574078/874188 -- thanks @FedericoSierra.
Mar
6
comment Load users environment variables in a cronjob
Oh, if the Bash start-up files contain Bash-only syntax, that won't work either -- you'll get export: command not found instead. Better really to put these in a Bash script and call that from Cron. Updated answer.
Mar
6
comment Load users environment variables in a cronjob
You forgot to fix the source: command not found error. Sorry about not mentioning it in my very initial answer.
Mar
6
comment Resolve packages not found and errors during configure,make,make install in a script
This has been resolved multiple times by multiple packaging systems already. The approach taken by both RPM and Debian is to create a build wrapper which reads the dependencies from a simple spec file. This needs to be maintained by hand for every package, but there are so many other things you need to tweak anyway that this is a minor nuisance.
Mar
6
comment Bash: Output of a command is written only to screen and not to another file while using tee, what could be the reason?
You are also using double redirection. print_log appends to $log and then you pipe to tee -a $log as well. The pipe will never receive any input so you could simply remove it; or for consistency, you could change the function so it just logs to stdout. The whole thing would be more elegant if you just added done | tee -a "$log" at the end of the loop, rather than redirect every command inside the loop. Then you can fix wget by just adding 2>&1 there.
Mar
6
comment Exim4 configuration to use several external ip for mail sending
You are just digging yourself deeper into the hole if you try to evade their policy restrictions. See what you can do to simply send less email into Gmail, or get a proper agreement with them to have you exempted from the restriction.
Mar
6
comment Issue with Bash Script On FreeBSD
As an aside, collecting the output from find into a variable only to print the value of that variable is rather pointless. Just run the find command after the headers and have it print its output into the report. Somewhat similarly, grep 'interactive/pam' /var/log/auth.log avoids a completely useless cat and drops the (here) redundant -E flag.
Mar
6
comment Issue with Bash Script On FreeBSD
I would add head -n 2 /var/log/auth.log; tail -n 2 /var/log/auth.log to get an idea of what's in the log file at the time the script runs.
Mar
6
comment Issue with Bash Script On FreeBSD
The parentheses around (true) are useless.
Mar
6
comment Should I be adding aliases to /etc/profile instead of /etc/basrhc?
You should be using shell functions, not aliases. Aliases are less featureful, more brittle, and offer no advantages over shell functions.
Mar
6
comment how to filter sar -d disk output tidily
Did you try tr -d '\015' as suggested on SO?
Jan
26
comment Comparison of methods to send Postfix emails to Procmail
Instead of updating the question, post an answer and mark it as accepted. That way, this question will no longer show up as unresolved. Thanks.
Dec
28
comment postfix fails to send mail with “fatal: unknown service: smtp/tcp”
Looks vaguely like you have something odd in your master.cf...?
Dec
9
comment postfix/procmail - preventing duplicate email in procmailrc
That's just a workaround. The real solution is to handle transport in transport. See porkmail.org/era/procmail/mini-faq.html#virtdom
Nov
19
comment Procmail: Inject sender address into the message body
If you want the sender's email terminus and nothing else (i.e. just parsley@graceland.example.net pro Elvis (the King) Parsley <parsley@graceland.example.net>), remember also the slightly tricky formail -rtzxTo: which generates a reply message's headers, then extracts the To: address from them. (The -t option creates a preference for e.g. the Reply-To: address which may or may not be what you want. Both -r and -rt are decidedly more complex than just extracting the value of From:.)
Aug
23
comment How do I deal with a compromised server?
Given the choice between an anonymous Python script and a documented, (somewhat) supported, well-understood standard solution, you are hoping they will pick the former?
Aug
10
comment Need linux milter solution to log email body into database
No, but it will have To: set up to reply back to your system; that's the whole point of this set-up. Have the email delivered to the database, then maybe run a trigger of some sort to have the system process it.
Aug
6
comment Need linux milter solution to log email body into database
That's not how you do it. You'd run the script on whichever box is already processing your email. Send the email (with the proper Bcc: or similar to make sure it reaches the correct inbox) and the script will run.
Jul
22
comment Perform an exact match on the email address in From: header using procmail
Incidentally, by commenting here, you will reach approximately two readers (me and the OP); a new question will reach a significantly larger number of eyeballs.