Archives

Send email with the date in the subject using mutt

Send yourself a copy of the network interfaces file within the body of the email, using mutt and including the current date automatically:

1
mutt -s "$(date) Network Interfaces File" user@example.com < /etc/network/interfaces

To send the same email, and attach the file:

1
echo "" | mutt -s "$(date) Network Interfaces File" -a /etc/network/interfaces -- user@example.com

The resulting email looks like:

———- Forwarded message ———-
From: root
Date: Wed, Jul 30, 2014 at 2:40 AM
Subject: Wed Jul 30 02:40:26 EDT 2014 Network Interfaces File

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

Command to determine speed of Network Interface Card (NIC)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
root@x61:~# ethtool eth0
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: off (auto)
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: yes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[root@compaq ~]# ethtool eth0
Settings for eth0:
 Supported ports: [ TP MII ]
 Supported link modes: 10baseT/Half 10baseT/Full
 100baseT/Half 100baseT/Full
 Supported pause frame use: No
 Supports auto-negotiation: Yes
 Advertised link modes: 10baseT/Half 10baseT/Full
 100baseT/Half 100baseT/Full
 Advertised pause frame use: No
 Advertised auto-negotiation: Yes
 Link partner advertised link modes: 10baseT/Half 10baseT/Full
 100baseT/Half 100baseT/Full
 Link partner advertised pause frame use: Symmetric
 Link partner advertised auto-negotiation: Yes
 Speed: 100Mb/s
 Duplex: Full
 Port: MII
 PHYAD: 32
 Transceiver: internal
 Auto-negotiation: on
 Supports Wake-on: pumbg
 Wake-on: d
 Current message level: 0x00000007 (7)
 drv probe link
 Link detected: yes

Mysql create user and database:

1
2
3
4
5
CREATE DATABASE db_name;
 
GRANT ALL PRIVILEGES ON db_name.* TO db_user @'localhost' IDENTIFIED BY 'db_passwd'; 
 
FLUSH PRIVILEGES;
This entry was posted on July 26, 2014, in Syntax and tagged .