Pages

Tampilkan postingan dengan label Linux and Open Source. Tampilkan semua postingan
Tampilkan postingan dengan label Linux and Open Source. Tampilkan semua postingan

Minggu, 03 Maret 2013

How to use Zim, a multi-tasking desktop Wiki


Takeaway: Shows you how to get started with Zim, a desktop wiki that accepts much more than text.
Zim presents itself as a “desktop personal wiki”, that is a system to write down and organize texts inside your computer. Its main use cases include Daily Journal (Figure A), GTD time managementand Creative Writing, but my own main reason to present Zim is that it can handle more than text.

Figure A

Inserting pictures from your hard disk, or screenshots made with scrot, only takes a few clicks, even if you want to resize those images or make them links to some other document. What you see in Figure B, however, may be just the most ordinary capability of Zim. If you’re a musician, for example, you may insert scores into a page in Lilypond format! Mathematicians, physicists or others who need complex tables or equations may do the same with LaTeX.

Figure B

Besides (and this is the part I like the most!) Zim can “free” its users from the need of an independent Calculator program. Two of its core plugins (more on this below), called Arithmetic and “Inline Calculator”, recalculate automatically the formulas you had inserted into the current page. If you often do simple calculations while working, studying or taking notes, Zim will save you a lot of time!
The Arithmetic plugin, shown in Figure C, is all you need for numeric or simple literal formulas. Change any of the numbers before the equal sign, or any of the variable assignments, press F5, and all the results will be updated.

Figure C

This is great, even if it does not work exactly as described on the website (at least for Zim 0.59 on Fedora 17/x86_64). Single, purely numeric formulas right after other text (”Fuel” in the screenshot) work, but multiple formulas, or variable assignments on the same line don’t. Zim recalculated the area only when (unlike the example on the website) I put the three height/width/area assignmentseach on a different line, all by itself.
The Inline Calculator (accessible from Tools->Evaluate Math) does more or less the same job, but adding support for the functions defined in the math and cmath Python modules (cos, exp, log10, sqrt…), and then some.
The other thing that Zim does quite well is organization and interconnection of information. Grouping pages hierarchically, by topic, date or any other criteria you may need, is as simple as dragging and dropping them in the left side pane. There is also a built-in search function. As it happens in Web wikis, if you follow the CamelFormat convention for page names, Zim automatically transforms those names in links while typing. Besides, Zim handles both direct andreverse hyperlinks: each “page” automatically shows which other pages link to it. In addition to the page tree in the side pane, the Zim “Link Map” plugin provides a clickable map of the links among the current page (shown in green in Figure D), and all the others in the current Notebook or name space.

Figure D

Installation, configuration, and automation of Zim

Zim should run on any platform that supports Python and the Gtk libraries. You don’t even really need to install it. Zim will run happily even if you just type ./zim.py in the folder you get after downloading the compressed archive from the website. In any case, you should first run ./test.pyat the prompt, to be sure that Zim will find in your computer all it needs to work.
The package includes many “core” plugins, that you must activate going to Edit | Preferences | Plugins. They do all sorts of things, from version control with Git or other systems to scientific plots with Gnuplot, or event logging with Zeitgeist. Some of them, however, will work only if certain third-party tools are already installed. The “Link Map”, for example, requires Graphviz. You may also create Zim Custom Tools: these are simply shell scripts, declared in a way that lets Zim run them on the current page, Notebook or selected text, when you select the corresponding menu entry.

Of course, text editing

Even if it did not have all these “more-than-text” capabilities, Zim would a great little text editor. Zim does not have multiple tabs, but the buttons for the pages already visited in the current session offer almost the same service. The –fullscreen mode, with or without toolbars, will reduce distraction as much as possible. There is a word count pop-up window as functional as the one in LibreOffice/OpenOffice, and plugins to sort lines in alphabetical order or check spelling.
Links to local files are created just dragging and dropping them in the current page. Usage as a To-Do manager is facilitated by support for checkboxes. You can format your text with mouse and keyboard, or write raw Wiki markup (which will be reformatted as soon as you press CTRL-R), but pages are always saved in plain Wiki format:
  [marco@polaris zim-0.59]$ more ~/Notebooks/Notes/Journal/2013/03/11.txt
  Content-Type: text/x-zim-wiki
  Wiki-Format: zim 0.4
  Creation-Date: 2013-02-22T18:58:40+01:00
  ====== Tuesday 11 Mar 2013 ======

What can I do with my ZIM pages and notebooks?

Zim can export single pages or whole notebooks, complete with index, to HTML (including S5 presentations!), LaTeX, Markdown or RST. In the first case (Figure E), you can preview your pages with the Zim embedded Web Server. The links in full notebooks export to HTML, however, will work only if you explicitly set their Document Root in the Zim Notebook Properties window (also shown in Figure E).

Figure E

Printing is not directly supported: File | Print to Browser only opens the HTML version of the current page in your browser and you must use the latter to finish the job. Considering how much ZIM can do, it’s not a big deal, is it now?

Kamis, 17 Mei 2012

Automatically analyze text with these simple, command line tools


Takeaway: Marco Fioretti suggests some free tools you can use to check and improve your own writing style as well as analyze other types of text. Here are some tips on how to use them.
The world of Free Software is full of little-known programs that are completely irrelevant for many users, but lifesavers for others. If only those other users knew that such programs exist! This thought is what led me to the topic of this post.
Computers surely aren’t better than humans at recognizing which texts are well written and which ones are not. Text analysis software, however, can detect many trivial, but very common errors and bad practices automatically.

Enter diction and style

Automatic style checking using only Free Software is possible with two almost unknown GNU tools, old but still available as binary packages for the most popular distributions: diction and style. The first program detects verbose and commonly misused phrases; the second tries to evaluate readability. At the moment, they officially support only English, German, and Dutch. However, several features will work, at least approximately, in any language.
What you can do with GNU style and diction? Well, you can:
  • check for wordy, trite, clichéd, or misused phrases in a text
  • check for double words
  • measure the readability of a text, according to several formulas
  • calculate other style-related statistics, like the number of questions and imperatives in a text
The man pages of diction and style explain their options well, and several recipes in the Linux Cookbook already show with basic examples how to use these programs at the prompt.

The benefits of “large scale” text analysis

If good introductions to those programs already exist, what is the point of this post?
Easy: it is to highlight what is, in my opinion, the most important and lesser known point about the GNU style and diction utilities. I refer to how much and why these programs can be powerful and save your time, when you connect them with other software.
The output of GNU style and diction can (at least) provide some helpful instruction for those trying to improve their writing style.
Within the limits I already mentioned, teachers (and head-hunters…) may save time with style-checking software in another, even more important way: first-level evaluation. If a computer finds that your students repeatedly make the same grammar errors, you will realize, without effort, what you should explain again!
In the same way, finding which applicants for a PR job can’t write sentences with less than 70 words will tell you who you should interview last. Even political activists may use text analysis software, to find which candidates speak to their voters more clearly. The possibilities are endless.

How to analyze many documents automatically

First of all, being traditional Unix programs, style and diction can work in pipe with other programs. This makes it is very easy to write scripts that find all the text files in a directory, calculate the readability index of each file, and then find its average value for each topic or user.
In the second place, while diction and style only work on plain text, almost every text-baseddocument can be automatically converted to such a format on Linux. You have to evaluate a bunch of papers in MS Office or OpenDocument formats? No problem! Unoconv can feed their plain text version to style or diction. This is how you would get the Fog Index numeric value of all the .odt files in the current directory:
  for FILE in `find . -type f -name "*.odt"`
  do
    echo -n "$FILE:   "
    unoconv --stdout $FILE | style | grep Fog | cut -d: -f2
  done
Doing the same thing with PDF files is equally easy (unless they have multi-column or irregular layouts) with converters like pdftotext. You may also analyze automatically single Web pages or entire websites in this way! In the first case, you should pass those pages to style or diction with a command line browser like w3m. Want some fun? Type this at a command prompt:
w3m -dump http://www.gnu.org/gnu/manifesto.html | diction -s
And watch a GNU program like diction suggest (-s) better wording for… the GNU Manifesto.
Automatic analysis of whole websites could be performed in two steps: first, mirror them on your hard drive with wget, then run a loop that uses w3m and style or diction as needed.
The third and final reason why at least one of these two programs is much more powerful than you may suspect is how easy it is to extend it. Look at the first lines of the diction database:
  # cat /usr/share/diction/en | more
   a considerable amount of   much
   a large number of  many
   a lot of   Often obsolete, should sometimes be replaced by "many"
   a majority of  most
   a man who
   a matter of concern    (cliche, avoid)
See what I mean? Although undocumented, the format is simple enough that it’s not a problem to create your own database and load it instead of the standard one: creating one per line, write words or phrases that you want to avoid, followed by one tab character, followed by a suggestion. You can make your own style guide.

Project Sputnik: Dell plans Ubuntu laptop aimed at developers


Takeaway: Dell, in partnership with Canonical, has announced a serious effort to create an Ubuntu-based ultrabook aimed specifically at developers.
Dell Director of Marketing Barton George announced in a blog post this week that Dell has launched a new effort called Project Sputnik that aims to serve a specific audience: developers.
And what better way to do that than beginning with a laptop that is both highly mobile and extremely stylish, running the 12.04 LTS release of Ubuntu Linux.
Counter to its spotty efforts of the past to get the general consumer interested in low-budget, Linux-installed hardware, this time around Dell is honing its approach by identifying a group of users who are much more likely to embrace the Linux OS.
The open source laptop is based on Ubuntu 12.04 (which TechRepublic’s Jack Wallen gave a stellar review) and Dell’s XPS13 Ultrabook. George goes on to point out some of the areas where Dell is currently experiencing some “pain” points and their efforts to resolve them, most notably hardware enablement issues such as drivers for things like touchpad and multi touch support. As Ars Technica writer Ryan Paul points out, this is the area of concern that will make or break this project:
Linux users want computers with known-good hardware configurations that they can continue to support themselves without having to rely on binary blobs from Dell that may or may not continue to work in the future. A major player like Dell has the resources and clout to start addressing that problem in a serious and meaningful way.
George also remarks on the larger vision that Canonical’s Mark Shuttleworth has for this Dell partnership effort.
Where it got really interesting for him was when this laptop was optimized for DevOps. In this scenario we would have a common set of tools from client, to test, to production, thereby tying Sputnik via a common tool chain to a cloud backend powered by OpenStack. Developers could create “micro clouds” locally and then push them to the cloud writ large.
At this point Project Sputnik is still just that — an ongoing project and not a done deal. However, the serious work that has already gone into this six-month-old experiment is a pretty good sign that both Dell and Canonical do, indeed, have big plans for it.

Using version control with the LyX document preparation program


Takeaway: Scott Reeves introduces the LyX document prep program with a GUI front-end that makes formatting easy.
Document preparation programs such as LyX and LaTeX have been used in the scientific, engineering and mathematics communities for a while. They are particularly well-suited for presenting technical and scientific documents where the proper formatting for mathematical equations is needed. For this reason, they are superior to the standard word-processing programs. LyX is essentially a GUI front end to LaTeX and has the added advantage that it does most of the formatting for you. As someone who writes regularly in my spare time, I prefer to useLyX. The uses of LyX are not limited to writing theses or scientific papers, however. As the web page says, you could use it to write a book or a theater play. I have not written either, but I have used it to construct other documents, including several of my posts to this website.
My introduction to LyX came via using LaTeX. The reason I used LaTeX in the first place was LaTeX’s superior capacity in typesetting mathematical formulas and equations. LyX has a large number of templates. A few well-known ones are the thesis and IEEE templates, but there are also templates for articles, letters and even presentations. With LyX you do not have to worry about the formatting, leaving you to (hopefully) concentrate on the content.
LyX is very useful in being able to export files into other formats. I frequently export a document into portable document format for printing. You can, if you want, export to Open Document, Word, HTML, or plain text formats.
A feature I really like about LyX is the integration with Revision Control System (RCS). I will assume most people will have some familiarity with RCS. RCS (along with CVS and SVN) is a version control system. This is handy for software developers (for whom it was originally developed). However, version control systems are also very useful for other purposes; in this case, checking in revisions of documents.
RCS can be used on the command line; the two commands that are probably all you will ever need to use are ci (for Check In) and co (for Check Out). If you were to use it on the command line you would use co with a -l option. The -l option locks the file, preventing other users from accessing it. Checking in a file is easy as well; you can put comments stating, in brief, any changes made. The LyX GUI runs the ci and co commands in the background, which makes the process much simpler.
Here is a short rundown on how to check in a file and check it out using LyX. The menu items to follow for checking in a document are File | Version Control | Register. This brings up the dialog box shown in Figure A. You can type in a description in the dialog box, such as “First Edit”. Each check in will allow you to enter a short description of changes made.

Figure A

Click to enlarge.
Once you have saved a document, you can then check it in. The menu commands to use are File | Version Control | Check in Changes. If you want to check it out again, then File | Version Control | Check out for Edit enables you to start editing the file. There are other options under Version Control, such as checking out previous versions or comparing different versions of a document. This can be very useful if you want to revert to a previous version in a hurry.
Overall, LyX is a better-than-handy tool for documentation. Its features let you get on with the job of writing. The ability to integrate version control using RCS makes it much easier to control your documentation. It is something I cannot imagine not having since I started using it.

Games, Sputnik, and robots: The week in open source


Takeaway: It was a fairly exciting week for Linux and open source. Jack Wallen shares some of the highlights, from games, to robotics, to servers.
A lot went on, during the past week, in the world of Linux and open source. So much so, I couldn’t figure out which to focus on. So, instead, I am going to give you the highlights of what I think to be some of the exciting moments  of the week that came down the pike for open source!
Project Sputnik and Dell
Computer giant, Dell, has announced a new initiative to place into the hands of designers and developers, an Ultrabook geared specifically towards the web and mobile developers. What is significant about this new Ultrabook is that it will come pre-installed with Ubuntu Linux and plenty of exciting tools for designers and developers. Using this Ultrabook, designers and developers can then download specific profiles from GitHub. The first profiles to be available will be for Android, Ruby and JavaScript. But there will be plenty more profiles to come.
IBM and Linux
Not to be outdone by Dell, IBM announced a new line of Linux servers –the Power 7 rack and blade servers that run Linux, and only Linux. Although the Power systems do not really save the consumer much in the way of cost, there is the new Flex System p24L Compute Node blade for the new PureFlex system and the IBM PowerLinuxTM 7R2 rack server. Both of these servers are dedicated Linux-only with 2 Power 7 6/8 core, 4 threads/core processors. To make the pot even sweeter, these server will be shipped with unlimited licenses for IBM’s PowerVM hypervisor.
Ubuntu news
There were a few interesting notes from the Ubuntu-verse. After releasing what will most likely be one of their biggest hits to date (Precise Pangolin), a few more bits of noteworthy news came out of Canonical. First and foremost was the announcement of the possibility of a GNOME-based Ubuntu release. This pure GNOME release will coincide with the release of Ubuntu 12.10 and will be GNOME Shell based (not Classic GNOME based).
If you weren’t looking closely, you probably missed the inclusion of two EA Games in the Ubuntu Software Center. Both Lord of Ultima and Command & Conquer Tiberium Alliances were added to the software repositories. Yes, these are both nothing more than web apps, but EA Games has recognized Ubuntu as a really exciting channel to deliver their content. This should be seen as a test on EA Games’ part to find out how well they are received by the Ubuntu crowd. The games are free from the Ubuntu Software Center. I’ve installed Ultima and find it to be a very well done game. Give them both a try so EA Game’s knows it has a welcome home on Ubuntu.
Canonical also announced they would be creating a new rootfs builder in order to make an absolute minimal filesystem for Ubuntu to run on devices with minimal disk space. Does this herald the possibility of Canonical making a serious move into the mobile space? Might we see a Ubuntu Phone in the future?
Willow Garage launches Open Source Robotics Foundation
For those who like to geek out on robotics — this will be right up your servo (Tom Servo, that is).The Open Source Robotics Foundation is an independent, non-profit organization founded by members of the global robotics community whose mission is to support the development, distribution, and adoption of open source software for use in robotics research, education, and product development. The foundation includes a veritable “who’s who” among the robotics world, including: Wolfram Burgard, Ryan Gariepy, Brian Gerkey, Helen Greiner, and Sam Park.
Linux seems to be gaining grounds on all fronts. It’s an exciting time to be an advocate for Linux and open source. These types of events and announcements will only continue to pour in as more and more users adopt Linux for their servers and their desktops.
What about you? Do you have a bit of Linux or open source news you would like to share with your fellow TechRepublic readers? If so, share in the comments.

Set up a free and secure Terminal Server with Linux


Takeaway: Jack Wallen suggests ditching the Windows Terminal Server and migrating to using a Linux box. Learn how to set up and use NX Free, a tool that can help with this task.
I have worked with a lot of clients who require Terminal Server. Many of these clients use the Terminal Server as a way to centralize application and file hosting. Many of them wind up paying a lot of money for Windows Terminal Server (and the necessary licensing) to see their users only firing up email, office suites, and maybe on occasion a specialized piece of software or financial software. A quick way to save your company cash is to ditch the Windows Terminal Server and migrate to using a Linux box.
On some levels, this is an incredibly easy task. Linux is already a multi-user operating system that allows for more than one user to be logged in at a time, so any user who has an account on a machine can have access to that machine. Although most modern Linux desktops make it a breeze to share out a desktop, that’s not the route we want to take — what we want is a system that will allow any user on a system to log in remotely and securely. If you’ve done any admin work with Linux, you know you can tunnel X11 (graphical applications) through secure shell. This is a secure method, but not a method you can take advantage of for everyday users. Fortunately, there’s a free tool by NoMachine called NX Free that can connect to a complete remote desktop session through ssh (secure shell).
Note: The free version of the application used here for the vnc server has a limitation of only two users. If you have a need for more than two users, you can purchase the premium edition of the software or look to other options such as TightVNCxrdp, or vncserver. Although these servers aren’t as easy to set up as NXFree, you will enjoy unlimited users at no cost.

Software and users

Before we get into the setup and usage of NX Free, let’s discuss the server’s setup. The first thing you should know is remote users will be able to use any user-level software on the machine. So, if there is software you don’t want remote users to access (such as games), remove it. Since we are dealing with a different platform, there might be software that doesn’t run natively. For those applications, I recommend running them with the help of Wine. The software capable of running under this tool is fairly significant.
Although ssh is a very secure protocol, when dealing with multiple users logging on and with the possibility of critical or sensitive data involved, you will want an added layer of security on the remote connections. I recommend installing Fail2ban; this will block IP addresses that show signs of malicious activity (such as too many unsuccessful login attempts or exploits).
You should make sure that every user who needs to get onto the machine has an account, a home directory, and a strong password. Setting up the user accounts is simple — and is also where I veer away from the traditional school of thought with UNIX/Linux terminal servers. I recommend setting up your Terminal Server with a graphical front end because every aspect of the Terminal Server will be much easier to maintain. You will have all the GUI tools you need to set up users, software, security, printing, etc.

Installing NX Free Server and Client

Download the NX Free server for Linux that matches your package management system (.rpm or .deb), and then install it with the following command (I will demonstrate on a Ubuntu machine — the installation on an .rpm-based machine will be different):
sudo dpkg -i nxserver_XXX_ZZZ.deb
XXX is the release number, and ZZZ is the architecture (i386 or x64).
If you’re installing on an .rpm-based machine, the command (to be run as the root user) is:
rpm -ivh nxserver_XXX_ZZZ.rpm
XXX is the release number, and ZZZ is the architecture (i386 or x64).
Once installed, the server will be up and running and ready for connections. All that is left is to install the client and connect.
Let’s connect to the new Linux Terminal Server from a Windows 7 machine. To do this, you must install the NX Client for Windows. After the client is installed, you can start it up by going to Start | All Programs | NX Client For Windows | NX Connection Wizard. When this tool starts up, you are ready to set up the connection.

Setting up the connection

This step should be done on all client machines that need to connect to the Terminal Server. When you fire up the Connection Wizard, you will be able to define the options necessary to connect to the server. I will assume you have the server set up on a static IP address.
The first screen of the wizard is the welcome screen. Click Next to move to the first interactive screen (Figure A).
Figure A
You can select the speed of your connection by dragging the slider to the associated type.
In the first screen, enter a human readable name for the Session and the address of the Terminal Server in the host. Leave the port set at the default and click Next.
The next screen allows you to specify the desktop settings (Figure B). From here, you can select:
  • Platform type: You’ll want to select Unix
  • Desktop type: KDE, GNOME, CDE, XDM, or Custom
  • Size of the desktop: This will depend upon your screen size
Figure B
You can disable encryption, but that would defeat the security of the system.
If you select Custom for the desktop type, you will need to configure the following (Figure C):
  • Application: Console, Default X script, or custom script
  • Options: Floating window or new virtual desktop
Figure C
Some configurations will not allow you to customize the size of the remote desktop.
Click the Next button to continue to the final screen.
The last step asks if you want a desktop icon for the connection and if you want to set up the advanced configuration dialog. The advanced configuration allows you to set up the following:
  • Network options (such as proxy)
  • System settings (such as grabbing the keyboard when client has focus)
  • Printing (enable local printing)
  • Environment (such as the mapping the local directory and font server)
You will be presented with the login window (Figure D). Enter a user’s credentials and once authentication has succeeded you will presented with the Terminal Server window. The user can now perform their duties as if they were logged on directly to the remote machine.
Figure D
You can have multiple sessions set up and then select which one you want to connect to (allowing you to use one NX Client for multiple connections).

Bottom line

This Terminal Server might not offer you everything you need (if you need QuickBooks, you better look the other way), but it is a solution that can work in many situations. Give this a try before you spend money on Microsoft Terminal Server and the necessary CALS.