Saturday, September 1, 2012

Use Pandoc to Easily Convert Text File To PDF or eBook Format

By 



In the last article, we learned how Markdown can quickly help you produce clean HTML code to be used in a website or blog. But what if you also want to produce an ebook using the same content as you have on the web? While the Markdown tool set is targeted at creating web content, there is another tool that allows you to take Markdown and turn it into OpenOffice/LibreOffice documents, PDF’s, or even e-books suitable for a Kindle or other e-reader – Pandoc.

Installing the pandoc package on an Ubuntu system is dead simple with the following command:

sudo apt-get install pandoc

Once installed, you can immediately use Pandoc in place of Markdown to create HTML with the following command:

pandoc -r markdown -w html -o *yourfilename*.html *yourfilename*.md

The syntax and flags are as follow:
  • “-r” – read format
  • “-w” – write format
  • “-o” – filename of the output
What the above command do is to read from a markdown file and output the file in HTML format with the same filename.
The above example outputs the file in HTML format, but you can use Pandoc to generate other formats as well.

Open Document Text Format (ODT)

If you’ll need to exchange your document with people using a more generic office suite, such as OpenOffice/LibreOffice or Microsoft Office, you can convert it to ODT format using Pandoc. If you think you’ll do this often, it’s useful to set up a template beforehand. Firstly, create a simple document (such as a header and a line or two of text) in Markdown and convert it to ODT with the following command:

pandoc -r markdown -w odt -o pandoctemplate.odt *yourfilename*.md

Then, open the “pandoctemplate.odt” file in Open/LibreOffice to change the fonts, spacing, margins, etc… to your liking. Be sure to use Styles to configure this – some details on the use of styles are available here. Once your document is set up to your liking, you can use it as a template for creating ODT files from Markdown in the future by adding it to the above command:

pandoc -r markdown -w odt --reference-odt=pandoctemplate.odt -o *yourfilename*.odt *yourfilename*.md

Now when you convert a Markdown file to ODT, it will automatically be formatted with the styles you have created earlier. Pandoc also supports conversion to the new (version 2007 and later) Microsoft Word format with the flag “--reference-docx=templatefile.docx“.

pandoc-odt-template-in-markdown

pandoc-odt-template-in-odt2

pandoc-odt-converted-with-template

Portable Document Format (PDF)

When I need to generate PDF files from Markdown, I’ll most often convert it ODT, and use either LibreOffice’s Export to PDF function, or if it’s a large group of files, the “unoconv” command line utility. If you’re a LaTeX user, and have a number of packages installed (this section of the Pandoc documentation describes what’s required), you can output PDF’s with the following command:

pandoc -r markdown -o *yourfilename*.pdf *yourfilename*.md

Note the absence of the “-w” flag in this case.

ePub e-Books

To publish e-books suitable for most electronic readers (ePub is a format handled by almost all readers), you may want to have some items specific to that format prepared in advance. These include:
  • A stylesheet, written in CSS, that describes how the ePub will look
  • Metadata, such as the creator, description, rights to the work, and language
  • A cover image
If you don’t have these, however, Pandoc will use some reasonable defaults. The following command will convert your Markdown document to an ePub:

pandoc -r markdown -w epub --epub-metadata=*metadatafile*.xml --epub-cover-image=*coverimage*.jpg --epub-stylesheet=*stylesheet*.css -o *yourfilename*.epub *yourfilename*.md

Additional Markdown Tips

Here are some additional tips and tricks I use in the course of using Markdown for my writing tasks:
  • Since it’s plain text, if you use DropBox to keep files in sync between devices, you can use the built-in text editor to create or update your Markdown documents on the Web. There are also editors available for Linux (I happen to like ReText a lot) and Android (I’ve been switching between Writer, Epistle, and the code editor DroidEdit lately).
  • Also, since it’s plain text, concurrent versioning systems (such as Subversion) do an excellent job of tracking versions and showing the differences between them.
  • Once you’ve converted a couple of documents, and know which flags you need for all the formats you want, you can create a simple shell script that will output them all at once.
I’ve found Markdown to be an excellent way to draft content, in a “distraction-free” environment (most plain text editors are), that supports output to multiple formats, yet doesn’t require any dedicated applications.

Image credit: Typewriter closeup shot, concept of Chapter one by Big Stock Photo.

Source: Maketecheasier

How to Boost Your Writing Efficiency With Markdown Content


markdown-textformatting

There are many tools available on Linux to create text-based content: text editors, word processors, content management systems, and desktop publishing applications. The most appropriate one will depend on how your content will be distributed, whether on paper, electronically in a format such as PDF, or online.

But traditionally, the process of drafting this content is often different from the final layout, as evidenced by the recent popularity of “distraction-free” editors (such as WriteRoom for Mac OS X and iOS or the cross-platform FocusWriter). One advantage of these is that you can draft your work in plain text, which is a great format for a number of reasons:
  • Using plain text lets you concentrate on the words, rather than their formatting
  • It’s one of the most portable formats out there
  • You can use lots of tools to help you manage it, such as DropBox, which comes with its own built-in text editor, or concurrent versioning systems (such as Subversion, as described here) as you make changes
The problem lies when you need to transform those plain-text words into something nicely-formatted and readable. Fortunately, Linux provides two programs that allow you to draft in plain text, then convert to other, more graphical formats.

Markdown Syntax

Markdown is what is called a “lightweight mark-up language.” It’s similar to HTML (and, in fact, allows you to insert HTML directly in your Markdown documents), and if you install the companion program, you can convert what you create into clean HTML. But you just need to know a little bit of the syntax in order to start writing in Markdown with any text editor:
  • Heading (e.g. Level 1, Level 2, etc…) lines begin with a hash tag (#), one for each level of the heading (i.e. a Level 3 heading needs three hash tags)
  • Text in bold should be enclosed with two underscores or asterisks, **like this**
  • Text in italics should be enclosed in one underscore or asterisk, *like this*
  • Bulleted items begin the line with a dash (-), a plus (+), or a single asterisk (*), followed by a single space.
  • Numbered items begin the line with a number, followed by a period and a single space (e.g. “1. “). Note that the actual numbers you use don’t matter, so don’t worry about making sure they’re in order – I use all 1′s when doing these lists.
  • When inserting a hyperlink, put the text to be linked in [square brackets], followed immediately by the URL to link to (in parentheses).
With these few items, it’s entirely possible to draft up blog posts without having to worry about HTML tags (more information on formatting, such as inserting images, tables, and references throughout the Markdown content, can be found on the project’s home page).

Markdown Conversion Tool

To convert this to HTML (to be pasted into a CMS, for example, the command to install this in Linux is as follows:

sudo apt-get install</span> markdown

Once installed, converting content in Markdown to HTML is as simple as the following command:

markdown \path-to-file-to-be-converted > \path-to-converted-file.html

The HTML you get from this command can be easily pasted into blogging and content management systems – some of them (like WordPress and Movable Type) even have plugins that will handle the formatting when you place Markdown directly into the editor. On its own, Markdown is an excellent way to quickly draft web-based content. In my next article, I will discuss how to pair Markdown with the tool Pandoc to convert your Markdown content to other formats including OpenDocument Text format (.odt), Microsoft Word (.docx), ePub, PDF, and typesetting formats such as LaTeX. By the way, this post was drafted in, and converted by, Markdown.

Source: Maketecheasier

How to Play Atari 2600 Games on Ubuntu

By 


If you saw our post on how to run old DOS games from your youth on Linux, and you happened to be an Atari brat while you were growing up, then you’re not left out in the cold. With the right software, you can relieve your 8-bit glory days on your Linux machine.

To play your Atari games, the best emulator on any platform is Stella. Stella is an Atari 2600 emulator that works on Linux, Mac OS X, Windows and even more obscure systems like IRIX. It provides a very accurate emulation of the classic gaming system, and plays nearly every game ever released for it.
To install Stella, you can either install it from the Software Center or use this command:

sudo apt-get install stella

The official Ubuntu repositories lag somewhat behind the Stella project’s version, so if you absolutely must have the latest and greatest version, you can download the .deb package and install it manually.

Stella Berzerk screenshot

To do that, just navigate to the directory you downloaded the .deb file and issue this command:

sudo dpkg -i stella_3.7.2-1_i386.deb

This example shows the i386 version. If you’re running a 64-bit system, jut replace “i386″ with “amd64″.

You can then launch Stella in the usual way you’d launch any other Ubuntu app. When you first start it up, you’ll have to point Stella to where you keep your Atari games. You’re on your own for actually getting them, though, as they’re still under copyright. On the other hand, there haven’t been a whole lot of RIAA-style lawsuits over these games.

You’ll also have a number of options available. The most important is between software and hardware rendering for OpenGL. Even though these are 8-bit games from the ’80s, you’ll get a smoother experience using your video card to do most of the work. You’ll also have the option of choosing from a variety of effects meant to simulate the look of an old CRT TV to play your games. Many of the games were designed specifically to take advantage of the way those old TVs worked. Remember, LCDs and plasma screens weren’t available in the ’80s.

You can also set up how the controls work. In the default settings, the function keys control the game reset, game select, black-and-white/color, difficulty, etc. The arrow keys control the joystick, and the mouse controls the paddle for games like “Breakout” and “Kaboom!” The defaults work pretty well, though you’re always free to customize. You might want to tweak the mouse sensitivity if you keep missing the ball in “Breakout,” though.

Stella launcher

Once you’ve got everything set up, you can then start your game by double-clicking on it in the launcher.

With the right hardware, however, you can plug in real Atari controllers. The Stelladaptor plugs into your USB port to let you have something closer to the real Atari experience. Of course, you could dig out your real console, but who knows how 30+-year-old hardware is going to work. On the other hand, those old cartridges are pretty hardy.

If you’re pining for your Atari 2600 but it’s pining for the fjords, if you’re a Linux fan, you can play games like “Pitfall” again using some free software.

Source: Maketecheasier

How To Play Your Old DOS Games In Linux

By 


Old stuff rock again! The Hipster community is growing, Amiga is proposing a new computer (running Linux), vintage cars are trendy, etc. To follow the stream, nothing can beat the emulation of old games. Take a break from the most recent FPS and go back to the origin. What made video games what they are today? Story, game play, graphics, soundtrack? The best way to remember is to play again. And why not start with DOS games?

DOSEMU

DOSEMU is not an emulation software. It is more of a virtualization software. It may not be the best for video games, but it is much lighter than real emulation and is more complete in terms of DOS system. Not only the graphic and the sound, but also the network and even the printer emulation are included. Of course, there is a downside to this. As I said, it is not real emulation, in the sense that the processor is not simulated. Your physical processor is used for the instructions and that means only a IBM PC Compatible will do the trick. In other words, your PC has to be equipped with a x86 architecture for DOSEMU to work. Also DOSEMU does not run DOS directly. It creates a proper environment for it to run. By default, it comes with FreeDOS, but you can install MS-DOS if you still have your floppy disks.

To install DOSEMU in Ubuntu:

sudo apt-get install dosemu

After the installation, the hidden directory “~/.dosemu/” will be created. Inside of it, you will find the folder “drive_c/” which represents C: in DOS. It contains the autoexec.bat file that you can edit and configure. This can become useful when you want to mount your game on a particular directory. By default, DOSEMU will try to launch /media/cdrom. If you prefer to use a ROM (not everyone still has a floppy disk drive), my personal method is to place its content straight in “~/.dosemu/drive_c/”.

Note: Despite the plethora of website available to download free DOS ROMs, most of them are still under copyright and you cannot use them unless you have the original copy of the game.

dos_games-dosemu_megamanx

You can then launch and setup the game normally. The only problem that I encountered is the lack of sound. DOSEMU is supposed to emulate a SoundBlaster 16, but despite all my tries, I did not succeed in getting any sound while testing Megaman X.

DOSBox

On the other hand, DOSBox is a real emulator, designed specially for gaming. The good thing about an emulator is that it will work on any computer. Since it is an emulator, you can change its speed to fast forward the game. It can also record sound and video from the game, and supports the mouse capture. On the downside, since it is created just for gaming, you will not have any printer emulation like for DOSEMU.

Install it with:

sudo apt-get install dosbox

You can then use it from any directory and it will be mounted as C:. For that, use the command

dosbox ./

To get a short intro and help, simply type “intro” from the command line. It will explain you how to mount a CD, the basic commands, and the necessary shortcuts.

dos_games-dosbox_launch

Before you try anything, I advise you to remember that Ctrl+F10 is the shortcut for releasing the mouse. Without it, you will have no control over the rest of your computer.

dos_games-dosbox_keys

The game worked properly this time, with the sound. The quality and the speed was the same, but it is true that an old computer can experience some lag.

Conclusion

DOSEMU and DOSBox are both very good software for playing old DOS game. Many prefer DOSBox for its gaming experience and the ability to use it on any computer, whereas DOSEMU is good for PCs that are too slow to run a full emulation. DOSBox also encapsulate the IPX protocol in UDP, which means that you can use it to play games over the Internet. In other words, it supports the creation and connection to DOS games servers for multiplayer gaming experience.

Source: Maketecheasier

Linux Humor : 5 Reasons Not To Take Linux Too Seriously

By 


No, no please don’t shoot! Of course, all Linux distro are great and should be taken seriously. But Linux is also different in many ways, especially when it comes to jokes and pranks. For this article, I will show you a short list of examples of this “Linux Humor.”

1. Killing Daemons

You probably know that we do not “terminate” a process in Linux. Instead, we “kill” it. It is crude, and kind of funny in itself, but no one perceives the humor anymore because it is so widespread. However, you should also know that a process which is launched at boot is called a “daemon.” Still not smiling? OK, what happens when you want to terminate a process that has been launched at boot? Yes, you kill a daemon. Now, if you appreciate RPG like I do, you should be more receptive. If you want to see it by yourself, Xscreensaver has an option in its menu called “Kill the daemon.”

linux_humor-killing_daemon

2. Avoiding Zombies

There is another funny case about processes, it is called zombie process. A zombie process is exactly what is sounds like: the remnant of a bug or a poorly programmed software which makes a supposedly killed process stay around. Normally, after killing a process, its status become EXIT_ZOMBIES, and it will be removed from the process list. But sometimes, the parent process does not do its job properly and its child stays as a zombie. Of course, it is no use trying to kill such a process: it is already dead (see the humor there?). Well, in fact, a zombie does not affect your system. The only problem it can create is in case of huge proliferation. Since a 32-bit system is limited to 32767 PIDs, if you have too many zombies, you will be unable to launch anything. But this is an extreme case and there are two easy solutions to prevent that: ask the parent to kill its zombie child with
kill -s SIGCHLD [parent's pid]
or just kill the parent (what a bunch of awful solutions when you think about it). And to keep track of how many zombie process you currently have, the command

top

is the easiest way.

linux_humor-zombie

3. Insulting Intruders

You may still be unaware of it, but the Linux universe is a violent jungle. Just to remind you, Linux’s mascot is that, and he is the chief architect for the Linux kernel. So if you want to stick to this nice mentality, there is a hidden option that you can activate so that intruders who try to guess the super user’s password get what they deserve: insults. For that, simply type

sudo visudo

and find the line which begins with “Defaults.” Append to it “insults,” after a comma. For example, mine looks like that:

Defaults env_reset,insults

And that’s all! Now, at every missed password, the system will find a new way to “encourage” the intruder. But beware, because in most cases, you will be the one to get the insults more than any intruder.

linux_humor-sudo_insults

4. Weird Package Managers

In general, developers have their own sense of humor. If you tried TTYtter, the software to tweet from the command line, you may have seen some jokes in the documentation. But Linux developers also like to give strange names to their system, and especially to the package manager of their distribution. Ubuntu is kind of an exception, but if you take a look at some of the major distributions, the software which install programs is not named from nowhere: openSUSE uses the command “zypper,” Fedora and CentOS share the Yum package manager, Archlinux prefers Pacman and Yaourt, PuppyLinux works with PET packages, Sabayon uses Equo, etc. My personal favorite is Source Mage, a source based distribution, with its package manager called Sorcery. So to install a package, you do

cast [name of the package]

and to remove it

dispel [name of the package]

Interesting, isn’t it?

5. Terminal Jokes

Finally, we all know them, but their existence is the very proof that Linux Humor exists: the terminal jokes. It is easy to get, type stupid command and make a joke out of the error message. For example, try

make love

the computer will return

make: *** No rule to make target 'love'. Stop.

Now you know why we are geeks. But there is a lot of them, that I encourage you to try yourself, like:

\(-
^How did the sex change go?^
%blow
drink matter
ar m god
man woman
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc

Conclusion

We all have our hobbies. But developing for Linux will never cut you from your sense of humor. You will notice that behind every aspect that we evoked, there was matter to learn. Linux Humor makes you study the nomenclature, how to deal with zombies, find Easter eggs, etc. And most of all, it brings that sympathetic feeling towards Linux, the feeling of a funny and distracting community.

Do you know any other funny points about Linux? There is a lot of them, so feel free to leave a comment.

Image credit: Penguin by BigStockPhoto

Source: Maketecheasier

Apa Batasan Inovasi, Inspirasi dan Plagiat?


Desain tipis dari MacBook Air memang boleh dikatakan sebagai penginspirasi banyak perusahaan laptop untuk membuat produk mirip dengan ciptaan Apple tersebut.

Cnet (30/08) menyebutkan setidaknya terdapat 3 laptop yang memiliki warna, desain dan penataan keyboard serta touch-padnya mirip dengan Apple. Memang Cnet tidak serta merta memberitahukan yang mana MacBook Air. Mereka sengaja memberikan sebuah pertanyaan agar pembacanya menebak sendiri laptop mana yang asli besutan Apple.

Satu hal yang dapat ditarik dari gambar milik Cnet tersebut adalah inovasi dan plagiat saat ini sangat tipis batasannya. Menurut perkataan beberapa pakar, banyak inovasi teknologi yang juga terinspirasi dari desain dan segala hal produk sebelumnya.

Memang tidak dapat dikatakan bahwa inovasi, inspirasi serta plagiat tersebut adalah satu hal yang sama. Namun, merujuk kepada pergulatan Apple dan Samsung di pengadilan memberikan satu pemikiran bahwatiga hal tersebut hampir tidak mempunyai batasan yang pasti. Bagaimana menurut Anda? [das]

Sumber

Pemeritah: Korelasi Internet Erat dengan Pendapatan Per Kapita

mastel.or.id

Jakarta - Sekretaris Jenderal Kementerian Komunikasi dan Informasi Basuki Yusuf Iskandar mengatakan, korelasi antara pengguna internet dengan pendapatan per kapita di suatu daerah atau wilayah di Indonesia ternyata berkaitan erat. "Korelasi antara pengguna internet dalam ICT (teknologi komunikasi dan informasi) dengan tingkat pendapatan per kapita sangat erat," kata Basuki Yusuf Iskandar dalam acara Indonesia International Infrastructure Conference and Exhibitions (IICE) 2012 yang digelar di Jakarta, Kamis (30/8).

Basuki memaparkan, indikasi dari hal tersebut dapat dilihat dari daerah provinsi yang memiliki tingkat pendapatan per kapita yang tinggi ternyata penggunaan ICT juga semakin banyak.

Ia mengutarakan harapannya agar di masa mendatang, penggunaan ICT menjadi kebutuhan dasar di berbagai daerah di Indonesia sehingga tidak lagi bergantung kepada tingkat pendapatan per kapita. "Kalau berbicara mengenai infrastruktur secara keseluruhan, maka ICT adalah anak bungsu dari keluarga besar infrastruktur," katanya.

Sejak ICT diakui sebagai bagian yang penting dalam infrastruktur, ujar Basuki, maka barulah hal itu berdampak antara lain kepada dunia usaha yang memfokuskan dirinya pada ICT secara seimbang dengan bidang-bidang lainnya dalam infrastruktur.

Menurutnya, meski ICT merupakan "anak bungsu", tetapi efek atau implikasi yang dihasilkan oleh ICT menghasilkan sesuatu yang sangat luar biasa. "Berbeda dengan infrastruktur untuk jalan, listrik, dan air, ICT menyampaikan sesuatu yang bersifat informasi," katanya.

Basuki juga menuturkan, ICT membawa informasi yang dapat dimodifikasi menjadi sebuah pengetahuan yang dapat menjadi pola pikir suatu masyarakat bahkan hingga bangsa sehingga dapat membangun sebuah peradaban.

Proses integrasi dunia secara global baik dampaknya yang bagus maupun yang buruk, lanjutnya, akan dipercepat dengan ICT sehingga hal tersebut merupakan sesuatu hal yang tidak bisa kita elakkan. [EL, Ant]

Sumber