Technical Recipes

Friday 18, May 2012

Once you have been created your RST files is time to build your HTML or PDF output. The following steps show you how to do that using Sphinx:

Create a new directory for your RST files:

$ mkdir mydocs

Run Sphinx quick start command:

$ sphinx-quickstart

Create a source/index.rst file for your output document. The next one is a simple example:

.. Contents:

.. toctree::
:maxdepth: 2
file1.rst
file2.rst

Copy your RST files to source/ directory.

Your HTML file will be created through the following command:

$ make html

Creating the PDF file format through the next command:

$ make latexpdf

Your HTML file will be in build/html/ directory and the PDF in the build/latex/ directory.

tags: sysadmin

Monday 7, May 2012

Creating a ZIP file containing all your files for latest commit is very simple, just execute the next command:

$ git archive -o myproject.zip --prefix=myproject/ HEAD
tags: git

Friday 27, April 2012

Some users prefer to send e-mail from command line. It could be very usefull and fast for small messages. To do that you need to configure a MTA and use some client such as mail. For our example, we're going to use Postfix and mail on Fedora.

First of all, we should install Postfix:

$ yum install postfix

Then, we need to configure Postfix editing /etc/postfix/main.cf file and adding the following lines:

relayhost = [mysmtp.server]:25
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_use_tls = yes

The next step will be to configure user/passwd through /etc/postfix/sasl_passwd file:

[mysmtp.server]:25 myuser:mypassword

Be careful, we're using a plain password so it's better to limit access to the mentioned file:

$ sudo chmod 600 /etc/postfix/sasl_passwd

Now it's time to reload configuration and restart Postfix:

$ sudo postmap /etc/postfix/sasl_passwd
$ sudo service postfix start

We're ready to send e-mails! Check it out using the following command:

$ echo "This is the body" | mail -s "Subject" recipient@domain

Done!

tags: sysadmin

Wednesday 25, April 2012

If you need to add a remote repository to your local git repository, you can do it executing the following command:

$ git remote add origin <remote URL>

For example:

$ git remote add origin http://github.com/bsnux/vim-kit.git

Then you should push your changes:

$ git push -u origin master
tags: git

Tags

My latest tweets

tweet Only one week for Fedora 17! #fedora
tweet At Least 100,000 March in Spain Over Austerity http://t.co/LIvRCkTO
tweet Hoy es el día: Protesta como un ciudadano o calla como un súbdito. Tú eliges #12m15m
tweet Somos campeones!! #atleti
tweet Dell is working on a new laptop designed for developers with Ubuntu http://t.co/CemtM2fw
tweet Good tutorial about Flask, how to get up and running a web application with Python http://t.co/RtcW4f9d
Buy me a coffee!! Coffee cup

Advertisment