/etc/msmtprc defaults
maildomain example.net
syslog LOG_MAIL
aliases /etc/aliases
account default
host mail.example.net
port 587
from srv7@example.net
auth on
user user@example.net
password ********
tls on
tls_starttls on
#tls_certcheck off
tls_fingerprint DB:A0:2A:07:00:F9:E3:23:7D:07:E7:52:3C:95:9D:E6:7E:12:54:3F
Your alias file
# /etc/aliases default: me@example.net
A php script to send mail
#!/usr/bin/php
<?php
define('TAB',"\t");
$user = $_SERVER['LOGNAME'];
$host = exec("hostname -f");
$from = $user.'@'.$host;
$to = 'sweety@example.net';
$subject = 'Testing msmtp';
$message = 'hello from '. $host;
$headers = 'From: '.
#!/bin/bash SENDMAIL=/usr/sbin/sendmail RECIPIENT=tosomeone@example.com FROM=me@example.com cat <<EOF | $SENDMAIL -t ${RECIPIENT} From: ${FROM} To: ${RECIPIENT} Subject: testmail some test text as body of the email. EOF
Common: “ ” ‘ ’ – — … ‐ ‒ ° © ® ™ • ½ ¼ ¾ ⅓ ⅔ † ‡ µ ¢ £ € « » ♠ ♣ ♥ ♦ ¿ �
Math: - × ÷ ± ∞ π ∅ ≤ ≥ ≠ ≈ ∧ ∨ ∩ ∪ ∈ ∀ ∃ ∄ ∑ ∏ ← ↑ → ↓ ↔ ↕ ↖ ↗ ↘ ↙ ↺ ↻ ⇒ ⇔
Find and chmod files or folders find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
Find a directory and display on screen find . -type d -name 'linux' 2>/dev/null
Find/Grep for a string across multiple files with different extensions find . -name "*.php" | xargs grep -niP 'thingy'
find \( -name "*js" -o -name "*jsp" -o -name "*jspf" \) | xargs grep -niP 'thingy'
Find and replace find .
Create a public ssh key, if you haven’t one already. Look at ~/.ssh. If you see a file named id_dsa.pub then you obviously already have a public key. If not, simply create one.
ssh-keygen -t dsa ItemMake sure your .ssh dir is 700:
chmod 700 ~/.ssh Get your public ssh key on the server you want to login automatically.
scp ~/.ssh/id_dsa.pub remoteuser@remoteserver.com: Append the contents of your public key to the ~/.
The Google Earth .DEB still depends on ia32-libs, but ia32-libs has been removed as part of the transition to multiarch, so it won’t install.
Steps Download the 64-bit google earth .deb file from http://www.google.com/earth mkdir earth dpkg-deb -R google-earth*.deb earth edit the file earth/DEBIAN/control and replace the Depends line as shown below dpkg-deb -b earth earth.deb dpkg -i earth.deb apt-get install -f Replace
Depends: lsb-core (>= 3.2), ia32-libs with
If you ever work on a remote servers network settings then this script may safe you from having to call support, and waiting on them.
When started/executed it
Sleeps first for 1 hour Then it renames the ”/etc/network/interfaces” file by adding the current time stamp to the end of the file It renames a file called ”/etc/network/interfaces.org” to ”/etc/network/interfaces” And finally it restarts the server. It also warns you a couple minutes before it does all that so you can terminate the program.