diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/exim.html | 223 | ||||
-rw-r--r-- | core/index.html | 35 | ||||
-rw-r--r-- | core/tar.html | 119 | ||||
-rw-r--r-- | core/vim.html | 159 |
4 files changed, 233 insertions, 303 deletions
diff --git a/core/exim.html b/core/exim.html new file mode 100644 index 0000000..bf31a00 --- /dev/null +++ b/core/exim.html @@ -0,0 +1,223 @@ +<!DOCTYPE html> +<html dir="ltr" lang="en"> + <head> + <meta charset='utf-8'> + <title>2.5. Exim</title> + </head> + <body> + <a href="index.html">Core OS Index</a> + <h1>2.5. Exim</h1> + + <h2 id="conf">2.5.1. Exim Configuration</h2> + + <p>Exim come with default configuration we will change to mach system settings + <a href="../conf/etc/exim/aliases">/etc/exim/exim.conf</a>.</p> + + <h2 id="cert">2.5.2. Certificates</h2> + + <p>Create private key;</p> + + <pre> + $ sudo mkdir /etc/ssl/keys + </pre> + + <pre> + $ sudo openssl req -x509 -newkey rsa:2048 -keyout /etc/ssl/keys/exim.key -out /etc/ssl/certs/exim.cert -days 9000 -nodes + Generating a 2048 bit RSA private key + ...........................................+++ + ..............+++ + writing new private key to '/etc/ssl/keys/exim.key' + ----- + You are about to be asked to enter information that will be incorporated + into your certificate request. + What you are about to enter is what is called a Distinguished Name or a DN. + There are quite a few fields but you can leave some blank + For some fields there will be a default value, + If you enter '.', the field will be left blank. + ----- + Country Name (2 letter code) [AU]:PT + State or Province Name (full name) [Some-State]: + Locality Name (eg, city) []: + Organization Name (eg, company) [Internet Widgits Pty Ltd]: + Organizational Unit Name (eg, section) []: + Common Name (e.g. server FQDN or YOUR name) []:c13.nark.biz.tm + Email Address []:c1admin@c13.nark.biz.tm + # + </pre> + + <pre> + # chown mail:mail /etc/ssl/keys/exim.key + # chmod 644 /etc/ssl/keys/exim.key + # chmod 644 /etc/ssl/certs/exim.cert + </pre> + + <h2 id="alias">2.5.3. Aliases</h2> + + <p>Exim come with default aliases we will change to mach system settings + <a href="../conf/etc/exim/aliases">/etc/exim/aliases;</a></p> + + <pre> + # Default aliases file, installed by Exim. This file contains no real aliases. + # You should edit it to taste. + + # The following alias is required by the mail RFCs 2821 and 2822. + # Set it to the address of a HUMAN who deals with this system's mail problems. + + postmaster: c1admin@localhost + + # It is also common to set the following alias so that if anybody replies to a + # bounce message from this host, the reply goes to the postmaster. + + mailer-daemon: postmaster + + # You should also set up an alias for messages to root, because it is not + # usually a good idea to deliver mail as root. + + root: postmaster + + # It is a good idea to redirect any messages sent to system accounts so tha + # they don't just get ignored. Here are some common examples: + + bin: root + daemon: root + ftp: root + nobody: root + operator: root + uucp: root + + # You should check your /etc/passwd for any others. + + # Other commonly enountered aliases are: + # + # abuse: the person dealing with network and mail abuse + # hostmaster: the person dealing with DNS problems + # webmaster: the person dealing with your web site + + #### + </pre> + + <h2 id="smarthost">2.5.4. Smarthost</h2> + + <p>Tony Finch publish a nice + <a href="http://www-uxsup.csx.cam.ac.uk/~fanf2/hermes/conf/exim/etc/etc.cam/configure">configuration reference</a>. + </p> + + <p>File /etc/exim/alias rewrite addresses when receiving, + return_path and headers_rewrite rewrite addresses in header + (envelop) while main rewrite apply rewriting to all.</p> + + <p>Test sender rewriting;</p> + + <pre> + # exim -brw bob@box + # exim -brw bob@remote.com + </pre> + + <p>Test routing;</p> + + <pre> + # exim -bt bob@box + # exim -bt bob@remote.com + </pre> + + <h2 id="fetchmail">2.5. Fetchmail</h2> + + <pre> + $ prt-get depinst fetchmail + </pre> + + <pre> + $ sudo su + # mkdir /var/lib/fetchmail + # mkdir /var/run/fetchmail + # useradd -r fetchmail + # chown fetchmail /var/lib/fetchmail + # chown fetchmail /var/run/fetchmail + </pre> + + <p>Create /etc/rc.d/fetchmail and add fetchmail to /etc/rc.conf;</p> + + <pre> + #!/bin/sh + # + # /etc/rc.d/fetchmail: start/stop fetchmail daemon + # + + SSD=/sbin/start-stop-daemon + PROG=/usr/bin/fetchmail + PID=/var/run/fetchmail/fetchmail.pid + IDS=/var/lib/fetchmail/.fetchids + PUID=45 + PGID=100 + OPTS="-f /etc/fetchmailrc -i $IDS --pidfile $PID --syslog -v" + + case $1 in + start) + $SSD --chuid $PUID:$PGID --user $PUID --exec $PROG --start -- $OPTS + ;; + stop) + $SSD --stop --remove-pidfile --retry 10 --pidfile $PID + ;; + restart) + $0 stop + $0 start + ;; + reload) + $SSD --stop --signal HUP --pidfile $PID + ;; + status) + $SSD --status --pidfile $PID + case $? in + 0) echo "$PROG is running with pid $(head -1 $PID)" ;; + 1) echo "$PROG is not running but the pid file $PID exists" ;; + 3) echo "$PROG is not running" ;; + 4) echo "Unable to determine the program status" ;; + esac + ;; + *) + echo "usage: $0 [start|stop|restart|reload|status]" + ;; + esac + # End of file + </pre> + + <p>Create /etc/fetchmailrc;</p> + + <pre> + # This file must be chmod 0600, owner fetchmail + + set daemon 300 # Pool every 5 minutes + set syslog # log through syslog facility + set postmaster admin@box + + set no bouncemail # avoid loss on 4xx errors + # on the other hand, 5xx errors get + # more dangerous... + + ########################################################################## + # Hosts to pool + ########################################################################## + + # Defaults =============================================================== + # Set antispam to -1, since it is far safer to use that together with + # no bouncemail + defaults: + timeout 300 + antispam -1 + batchlimit 100 + + poll pop.remote.com protocol POP3 user "drbob@remote.com" there with password "secretpass" is "bob@box" here + </pre> + + <a href="index.html">Core OS Index</a> + <p> + This is part of the c9 Manual. + Copyright (C) 2016 + Silvino Silva. + See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a> + for copying conditions.</p> + + + + </body> +</html> diff --git a/core/index.html b/core/index.html index 94e1f19..fce7170 100644 --- a/core/index.html +++ b/core/index.html @@ -101,37 +101,22 @@ <li><a href="tty-terminal.html">2.4. Terminals and shells</a> <ul> - <li><a href="dash.html">2.4.1. Dash</a> - <li><a href="bash.html">2.4.2. Bash</a> - <li><a href="tmux.html">2.4.3. Tmux</a> + <li><a href="dash.html">2.4.1. Dash</a></li> + <li><a href="bash.html">2.4.2. Bash</a></li> + <li><a href="tmux.html">2.4.3. Tmux</a></li> </ul> </li> - </ul> - - <h2>3. System Tools</h2> - - <ul> - <li><a href="tar.html">3.1. Tar</a> + <li><a href="exim.html">2.5. Exim</a> <ul> - <li><a href="tar.html#tarbkup">3.1.1. Create Backup</a></li> - <li><a href="tar.html#tarview">3.1.2. View content of tar</a></li> - <li><a href="tar.html#tarextract">3.1.3. Extract content from tar</a></li> - <li><a href="tar.html#taradd">3.1.4. Add content to tar</a></li> - <li><a href="tar.html#tarrm">3.1.5. Remove content from tar</a></li> + <li><a href="exim.html#conf">2.5.1. Exim Configuration</a></li> + <li><a href="exim.html#cert">2.5.2. Certificates</a></li> + <li><a href="exim.html#alias">2.5.3. Aliases</a></li> + <li><a href="exim.html#smarthost">2.5.4. Smarthost</a></li> + <li><a href="exim.html#fetchmail">2.5.5. Fetchmail</a></li> </ul> </li> - <li><a href="vim.html">3.2. Vim</a> - <ul> - <li><a href="vim.html#vimrc">3.2.1. Vim RC</a></li> - <li><a href="vim.html#color">3.2.2. Color schemes</a></li> - <li><a href="vim.html#spacetab">3.2.3. Spaces and tabs</a></li> - <li><a href="vim.html#block">3.2.4. Editing Files</a></li> - <li><a href="vim.html#spellcheck">3.2.5. Spell check</a></li> - <li><a href="vim.html#plugin">3.2.6. Plugins</a></li> - </ul> - </li> - </ul> + </ul> <p> This is part of the c9-doc Manual. Copyright (C) 2016 diff --git a/core/tar.html b/core/tar.html deleted file mode 100644 index 876065a..0000000 --- a/core/tar.html +++ /dev/null @@ -1,119 +0,0 @@ -<!DOCTYPE html> -<html dir="ltr" lang="en"> - <head> - <meta charset='utf-8'> - <title>1. Tar</title> - </head> - <body> - - <a href="index.html">Systolls Index</a> - <h1>2. Tar</h1> - - - <h2 id="tarbkup">2.1. Create Backup</h2> - - <p>Script in core/scripts/<a href="scripts/backup-system.sh">backup-system.sh</a> use tldp - <a href="http://tldp.org/LDP/lame/LAME/linux-admin-made-easy/server-backup.html">server backup</a> - and <a href="http://tldp.org/LDP/lame/LAME/linux-admin-made-easy/server-restore.html">restore</a> - as a reference.</p> - - <pre> - #!/bin/sh - - echo -n "root directory you want backup (/mnt/): " - read ROOT_DIR - - echo -n "where you want to save (/home/user): " - read DEST_DIR - - echo -n "backup name (system_name): " - read BCK_NAME - - echo $DES_DIR - echo $ROOT_DIR - - tar --xattrs -zcpf $DEST_DIR/$BCK_NAME-`date '+%Y-%j-%H-%M-%S'`.tar.gz \ - --directory=$ROOT_DIR \ - --exclude=srv \ - --exclude=var/ports \ - --exclude=var/run \ - --exclude=usr/src \ - --exclude=mnt \ - --exclude=home \ - --exclude=dev \ - --exclude=run \ - --exclude=tmp \ - --exclude=proc \ - --exclude=sys . - </pre> - - <h2 id="tarview">1.2. View content of tar</h2> - - <p>List files inside tar;</p> - - <pre> - $tar -tvf backup.tar.gz - </pre> - - <p>To restore is better to use first t flag and then x, - this prevents any --absolute-paths problem;<p> - - <pre> - $ tar -ztvpf full-backup-11-November-2045.tar.gz > file.lst - </pre> - - <h2 id="tarextract">1.3. Extract content from tar</h2> - - <p>If you want to extrat to different directory;</p> - - <pre> - $ tar xf full-backup-11-November-2045.tar.gz --directory=/mnt - </pre> - - <p>If path is fine, extract everything;</p> - - <pre> - $ tar --xattrs -xpvf full-backup-11-November-2045.tar.gz - </pre> - - <p>Extract just one file;</p> - - <pre> - $ tar --extract --file=core.tar.gz libidn#1.32-1.pkg.tar.gz - </pre> - - <h2 id="taradd">1.4. Add content to tar</h2> - - <p>Only uncompressed tar can append files without having - to extract and compress again.</p> - - <p>First create a tar with all files in the current directory;</p> - - <pre> - $ tar cpf core.tar *.tar.gz - </pre> - - <p>List files before appending new file and after;</p> - - <pre> - $ tar -tvf core.tar - $ tar --append --file=core.tar libidn#1.32-1.pkg.tar.gz - $ tar -tvf core.tar - </pre> - - <h2 id="tarrm">1.5. Remove content of tar</h2> - - <pre> - $ tar -tvf core.tar - $ tar --delete --file=core.tar libidn#1.32-1.pkg.tar.gz - $ tar -tvf core.tar - </pre> - - <a href="index.html">Systolls Index</a> - <p> - This is part of the c9-doc Manual. - Copyright (C) 2016 - Silvino Silva. - See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a> for copying conditions.</p> - </body> -</html> diff --git a/core/vim.html b/core/vim.html deleted file mode 100644 index e633670..0000000 --- a/core/vim.html +++ /dev/null @@ -1,159 +0,0 @@ -<!DOCTYPE html> -<html dir="ltr" lang="en"> - <head> - <meta charset='utf-8'> - <title>5. Vim</title> - </head> - <body> - - <a href="index.html">Systools Index</a> - <h1 id="vim">5. Vim</h1> - - <p><leader> with default configuration is key \, so when - you see <leader>-W means pressing \W</p> - - <h2 id="vimrc">5.1. Vim RC</h2> - - <p>Read - <a href="http://dougblack.io/words/a-good-vimrc.htm">"A good vimrc"</a> - for more information.</p> - - <dl> - <dt>/usr/share/vim/vimrc</dt> - <dd>System wide Vim initializations.</dd> - <dt>~/.vimrc</dt> - <dd>Your personal Vim initializations.</dd> - </dl> - - <p>Copy vimrc skeleton example, so that each user have a base to start - personalizing it;</p> - - <pre> - $ sudo cp ~/sysdoc/conf/etc/skel/.vimrc /etc/skel/ - $ sudo mkdir /etc/skel/.vim - $ sudo mkdir /etc/skel/.vim/swap - $ sudo mkdir /etc/skel/.vim/views - $ sudo mkdir /etc/skel/.vim/undodir - $ sudo mkdir /etc/skel/.vim/backup - $ wget -O wombat256mod.vim http://www.vim.org/scripts/download_script.php?src_id=4055 - $ mv wombat256mod.vim /usr/share/vim/colors/ - </pre> - - <h2 id="color">5.2. Color schemes</h2> - - <p>Default vimrc skeleton is configured to use wombat256mod, - which is installed by adduser skeleton.</p> - - <h2 id="spacetab">5.3. Split and tab</h2> - - <p>:sp</p> - - <h2 id="edit">5.4. Editing files</h2> - - <h3>Modes</h3> - - <p>To enter visual block mode press ctrl-v. To insert block - first select area then press I, insert text normally, when - you pres ESC the text will be inserted on previously selected - area.</p> - - <p>Come from background;</p> - - <pre> - $ fg - </pre> - - <h3>Moving in vim</h3> - - <p>Moving page up and page down;</p> - - <dl> - <dt>[Control][b]</dt> - <dd>Move back one full screen</dd> - <dt>[Control][f]</dt> - <dd>Move forward one full screen</dd> - <dt>[Control][d]</dt> - <dd>Move forward 1/2 screen</dd> - <dt>[Control][u]</dt> - <dd>Move back (up) 1/2 screen</dd> - </dl> - - <h3>How to use vim</h3> - - <p>In vim you can apply predefined number of times to a operator, - selection or object. For example to delete the next - two words press: d + 2 + w. List of important operators objects, - selections;</p> - <pre> - - <pre> - operator + count + object - </pre> - - <p>Operator;</p> - - <dl> - <dt>d</dt> - <dd>Delete</dd> - <dt>c</dt> - <dd>Change (d + i)</dd> - <dt>y</dt> - <dd>Copy</dd> - <dt>v</dt> - <dd>Visual Select</dd> - </dl> - - <p>Objects;</p> - <dl> - <dt>w</dt> - <dd>Word</dd> - <dt>s</dt> - <dd>Sentences</dd> - <dt>p</dt> - <dd>Paragraphs</dd> - <dt>t</dt> - <dd>Tags</dd> - </dl> - - <p>Selections are like objects, for example d + i + w - will delete "inner" word, c + a + w do the same plus - the space;</p> - - <dl> - <dt>a</dt> - <dd>All</dd> - <dt>i</dt> - <dd>in</dd> - <dt>t</dt> - <dd>Until</dd> - <dt>f</dt> - <dd>Find forward</dd> - <dt>F</dt> - <dd>Find backward</dd> - </dl> - - <p>Selection of useful combinations;</p> - <dl> - <dt>vat</dt> - <dd>Select whole tag block.</dt> - <dt>cit</dt> - <dd>Change inside tag.</dt> - <dt>yat</dt> - <dd>Copy whole tag.</dd> - </dl> - - <h2 id="spellcheck">5.5. Spell check</h2> - - <p>Press z= over the bad written word and select desired one.</p> - - <h2 id="plugin">5.6. Plugins</h2> - - <a href="index.html">Systools Index</a> - <p>This is part of the c9-doc Manual. - Copyright (C) 2016 - Silvino Silva. - See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a> - for copying conditions.</p> - - </body> -</html> |