Send mail via sendmail

vi /tmp/email.txt


Subject: Terminal Email Send
Email Content line 1
Email Content line 2


sendmail < /tmp/email.txt

Quick and dirty, with subject only:

mail -s "Test Subject" < /dev/null

Faking Mails with cutomized sender:

mail -s "Everything possible" < /dev/null

*Will be delivered into spamfolder or not delivered cause SPF checks that mailsender is not authorized sender of the maildomain –> only if accurate spamsolution/SPF is implemented on recipient side

Install/Config sendmail
for just relay edit /etc/mail/ and add:

"Smart" relay host (may be null)

or if ip based:

"Smart" relay host (may be null)

of course relay host must permit this.


If you ever wanted an automation when a process is not running it is just a small script helping to achieve this: (dont forget to make it executable)

check_process() {
  echo "$ts: checking $1"
  [ "$1" = "" ]  && return 0
  [ `pgrep -f $1` ] && return 1 || return 0 
#pgrep -n if process-name match exactly

while [ 1 ]; do
  # timestamp
  ts=`date +%T`
  echo "$ts: begin checking..."
  check_process ""
  [ $? -eq 0 ] && echo "$ts: not running, restarting..." && `/usr/bin/perl /home/me/ >/dev/null`
sleep 10


You can also send yourself a mail instead of just starting process instead of

/usr/bin/perl /home/me/


echo "Subject: Process is stopped" | sendmail

If you want to run this in background do

nohup &

or you can put this on startup via cronjob

crontab -e

@reboot root /home/me/



Lack of free space? just type in

du -sk *|sort -n

on /

or any folder you like. You will get an information about space occupation where you can investigate further.

Sample output:

0 fastboot
0 proc
0 sys
4 boot
4 dev
4 lib64
4 media
4 mnt
4 srv
8 aquota.user
8 home
16 lost+found
120 tmp
644 run
6080 bin
7244 sbin
8544 etc
29076 lib
1345892 opt
1364796 usr
3028736 root
12280360 var

The Yellowdog Updater, Modified (YUM) is a libre and open-source command-line packagemanagement utility for computers running the GNU/Linux operating system.
Display yum commands and options
yum help
List all available packages
yum list available
List all installed packages
yum list installed
List installed and available packages
yum list all
List installed and available kernel packages
yum list kernel
List info about vsftpd package
yum info vsftpd
List dependencies and packages providing them
yum deplist nfs-utils
Show package that contains top command
yum provides “*bin/top”
Find packages with samba in name or description
yum search samba
Get info on available security updates
yum updateinfo security

Query repositories for available package updates

yum check-update
Download (no install) vsftpd package to cache (/var/cache/yum/arch/prod/repo/)
yum install --downloadonly vsftpd
Install the vsftpd package
yum install vsftpd
Update the httpd package (if available)
yum update httpd
Apply security-related package updates
yum update --security
Remove httpd and other unneeded packages
yum autoremove httpd
Remove the vsftpd package and dependencies
yum remove vsftpd
Downgrade the abc package to an earlier version
yum downgrade abc
Delete packages saved in cache
yum clean packages
List installed RPM packages and statistics

Informix never forget 😉

Creation/Manipulation of tables:

CREATE TABLE tabelle (nummer int, text char(10), time datetime, date date);
DROP table tabelle;
ALTER TABLE table_name MODIFY (name char(100));
ALTER TABLE table_name ADD column_name column-definition;

can be positioned with AFTER/BEFORE

Unloading tables:

unload to '/home/content.csv'
delimiter ';'
SELECT * FROM content

Transactional Stuff:


Query Time:

FROM table (WHERE)
GROUP BY columnname
ORDER BY columnname (ASC|DESC), ....
INTO TEMP tablename


bla (NOT) BETWEEN bla AND 
bla (NOT) IN (List, of, bla)
bla (NOT) LIKE "bla"

to combine multiple selects


TO_CHAR transformation for query:

SELECT nr FROM numbers WHERE nr MATCHES "38*"
Error 219: Wildcard matching may not be used with non-character types.


If you want to manipulate DNS-Entries before and without ISP-DNS Resolution you can do it with extra DNS-Server at your site. Best thing would be putting this DNS in DMZ-Zone.

e.g. Youre hosting WebEx and have one Public-URL to connect. Your Internal Clients will always route the traffic via Internet. To avoid this you can override the DNS – Resolving at your ISP with an own DNS. It’s also possible with your own Windows-DNS but… I like Linux 😉

Here I did with Linux, because its free:

Install BIND and configure named.conf

// named.conf
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
// See /usr/share/doc/bind*/sample/ for example named configuration files.
options {
        listen-on port 53 {;; };
        listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { localhost;;; };
        recursion yes;
        //dnssec-enable yes;
        //dnssec-validation yes;
        //dnssec-lookaside auto;
        /* Path to ISC DLV key */
        //bindkeys-file "/etc/named.iscdlv.key";
        //managed-keys-directory "/var/named/dynamic";
        forwarders {;; };
logging {
        channel default_debug {
                file "data/";
                severity dynamic;
//zone "." IN {
//      type hint;
//      file "";
include "/etc/named.rfc1912.zones";

Important parts of config:

Who is allowed to query this DNS?

 allow-query { localhost;;; };

Forward-Adresses for DNS-Requests which cannot be handled/resolved by the local DNS

forwarders {;; };

For your linking your own zones:

include "/etc/named.rfc1912.zones";

If you do changes, dont forget to restart

/etc/init.d/named restart
If you now want to override some URLS you have to create a link inside of /etc/named.rfc1912.zones
zone "" IN {
type master;
file "";
allow-update { none; };

and of course a file in /var/named called (in our example)

$TTL 86400 @       IN SOA  @       root (                                         2013111501      ; serial                                         1D              ; refresh                                         1H              ; retry                                         1W              ; expire                                         3H )            ; minimum @        IN NS          localhost. @        IN A 

When you now put this DNS Server in your Active-Directory DNS as a forwarder every Request which goes to will be resolved with which us a total different site.

How-To change Forwarder in Active Directory-DNS:
in DNS Console right click the DNS and choose Properties.
Then navigate to forwarders tab and enter the IP-Adress of the new DNS, usually you have there your ISP-DNS or Google DNS servers.