>>Single Point of Failure >>

§ Home § CV § Blog Photography Divagações §

Calendar

May 2012
M T W T F S S
« Apr    
 123456
78910111213
14151617181920
21222324252627
28293031  


Popular Tags


Recent Entries



Categories


Archives


Collecting Linux Distribution

Ξ March 20th, 2011 | → 0 Comments |
Tools |, , |


For me, a really useful tool… I keep it in my dropbox toolbox, always available at ~/bin

#! /usr/bin/env python
#  *************************************************************************
#   Collect the “Release” information for the Linux Distribution
#  *************************************************************************
 
import os
 
issue_redhat = “/etc/redhat-release”
issue_ubuntu = “/etc/issue.net”
issue_debian = “/etc/debian_version”
 
def get_content(file):
    return open(file, “rb”).read()
 
def get_release():
    print ”      System: ” + os.uname()[0]
    print ”     Release: ” + os.uname()[2]
    print “Architecture: ” + os.uname()[4]
    if( os.path.exists(issue_redhat) ):
        distribution = get_content(issue_redhat)
    elif( os.path.exists(issue_ubuntu) ):
        distribution = get_content(issue_ubuntu)
    elif( os.path.exists(issue_debian) ):
        distribution = get_content(issue_debian)
    else:
        distribution = “Unable to find distribution.”
    print “Distribution: ” + distribution
 
if __name__ == “__main__”:
    get_release()

 


Tasks seem out-of-place!

Ξ August 24th, 2010 | → 1 Comments |
Tools |, , , |


“I’m an institution man, now”1. Over the years, I’ve become a big fan (should I say addicted?) to a Google-based workflow. The tools provided by Google are excellent, and still continue to improve on a daily basis. The last updated I’ve noticed were: google talk video (and there goes skype), the multiple account sign-in mechanism (no more two browsers open, one for each account) and the “face-lift” to gmail interface.

Regarding the last item, it seems that Google could have done better regarding tasks management. Mail and Contacts seem very well integrated, but Tasks seem a bit out-of-place. What’s that little pop-up windows all about? I think that’s the only thing that makes me use a “foreign” app in my workflow.

If Tasks were to follow the EverNote or OneNote approach, that would be perfect. And after that… maybe a Google based file syncing service. And them… web-based mind-mapping. And them…

 


1 from “The Shawshank Redemption” (@ imdb)

 

 

 


RAM Disk: A Very Interesting Idea…

Ξ June 29th, 2010 | → 0 Comments |
Tools |, , , |


Simply run:

$ mkfs -q /dev/ram1 8192   # 8192 = 8MB disk capacity
$ mkdir -p /mnt/ramcache
$ mount /dev/ram1 /mnt/ramcache
$ df -H | grep ramcache

to mount your own mini ramdisk.

For more details, here and here are some references I found on the subject.

You might ask yourself “Why does this guy needs a ramdisk?… What a geek!”, and wouldn’t mind. It was kind of a epiphany, when I remembered to use a ramdisk to run a “‘Lack of space’ Test Case” on the application I’m building right now.
After running the application, I just had to copy a mp3 album to occupy the remaining disk space… et voilá, welcome the expected “error message”. No, not a SIGSEGV, a real error dialog!…

 


Redirecting your intents

Ξ June 27th, 2010 | → 0 Comments |
Tools |, , |


command > filename

redirects the stdout from ‘command’ to a file called ‘filename’. The file shall be created if not present, or otherwise overwritten.

> filename
: > filename

are a special case of redirection, creating a zero-lenght file. The ‘:’ is a dummy placeholder that generates no content - usually used when the first form is not allowed by the shell.

command >> filename

also redirects the stdout to file, but the content is appended to file in the file already exists.

note: pre-pending 1, 2 or & will redirect stdout, stderr or both , according to the redirection ‘operator’ (>, >>).

 


Re-builder on X-Emacs

Ξ January 24th, 2010 | → 0 Comments |
Tools |, |


Regular expressions are an important development tool for me. Every day there are patterns to be found on text output (e.g a especific tag on an xml file, or a given value in a csv file) or configuration files.

Until recently, the best tool to find such patterns was egrep, which prints the lines of a text file that match a given pattern. grep can be used to match ’simple text’, but used with option -E (egrep is an alias for grep -E) it searched for regular expressions.

egrep is a very useful tool, but very recently I found out that there is an X-Emacs builtin “regex” builder.


Just activate-it by M-x re-builder. The “regex” builder allows to create the regular expression, while finding the matches in the active buffer. I don’t know any other tool that does that in linux. I love it.

NOTE: This feature did not always work in X-Emacs (it wasn’t fully compatible since it was primarily developed for Emacs). I’m using the current Ubuntu 9.10 packages.

 


I tried it… and liked it!

Ξ January 16th, 2010 | → 1 Comments |
Tools |, , |


Firefox is an excellent web browser (my first choice!), but there is so much fuss around Google Chrome. A friend suggested the change, but it wasn’t until now that I had a go at the ‘new’ web browse.

If you don’t know, Google Chrome is based on an open source project called Chromium. Apart from the icons - which have a slightly different colors - the browsers are essentially the same. So, I went for the it and installed the ‘original’ Chromium web browser in my Ubuntu desktop, with the following steps:

1) Add the new repository to source.list file.

  deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main
  deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main

2) Add the GPG key for the repository

  sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 0xfbef0d696de1c72ba5a835fe5a9bf3bb4e5e17b5

3) Update the source list

  sudo apt-get update

4) Finally, install the web browser

  sudo apt-get install chromium-browser

First, the usability is was amazing - the interface is very compact, but the more noticeable effect was navigation speed. It may have been the sense of “Ha!!” but the pages were loaded really, really fast.

I really recommend it! Firefox is still my first choice, but I was impressed by Chromium’s performances. At least for my EEE Pc, I’m
thinking of converting to Chromium.

Next, I’ll be trying the Chromium OS. There, I really don’t think there is a change over Ubuntu.

 


Solving online…

Ξ December 4th, 2009 | → 0 Comments |
Mathematics, Tools |, , , |


There are several online Math tools to do all sorts of things like: plotting graphs, applying operations on matrices… but there is one that I’ve enjoying a while now.

Using Wolfram’s WolframAlpha to solve analyze functions/solve equations (just to make sure the result is correct) is an excellent experience. Just type:

solve  4x^3 - (2 + x^2)x^2 = -3x

and in a second you get the equations solutions and the related plot. This tools is also able to do symbolic derivatives and integrations. See more examples here.

 


Emptying a file

Ξ November 8th, 2009 | → 0 Comments |
Tools |, , , |


To empty an existing file, without having to recreate it, one can simply

> file

There are other ways to do the same, but none of the them are as simple. One can

cat /dev/null > file
echo -n > file

If the goal is only to change the file access timestamp, them you can simply

touch file

 


J2SE and J2EE

Ξ August 20th, 2009 | → 0 Comments |
Tools |, , |


The other day, talking with a friend, the discussion turned to the actual meaning of J2SE and J2EE. Although both of us know Java quite well, none of us was able to specify the meaning of these acronyms. We were close, though.

The term J2SE (standing for Java2 platform, Standard Edition) is no longer in use, and (starting at Java 1.6) JSE should be used whenever referring to the “Java Standard Edition”.

The term J2EE (standing for Java2 platform, Enterprise Edition), has been replaced by the short version JEE with means “Java Enterprise Edition”. The JEE edition is more complete that the simplistic JSE, and contains Enterprise Java Beans components, Java Servlets API and JavaServer Page.

There is also a micro edition, called JME (Java Micro Edition), which is oriented to support handheld devices such as PDAs and smart phones.

The one term me and my colleague agreed upon was JDK, which stands for Java Development Kit. JDK is available for free download at Sun’s Java homepage.

The next time I get into “acronyms battle” I’ll take a look here.

 


Windows Doesn’t Have a Shell

Ξ June 13th, 2009 | → 0 Comments |
Tools |, , , , |


Being a Linux fan doesn’t mean that all my work gets done in Debian, Ubuntu, Red Hat, Fedora or Suse. Most of the times a simple execution of the Virtual Box is enough to write that document in Word or prepare that presentation in Powerpoint. But some times, work demands a true change of pace and there I go back to Windows (usually the stable XP version, available in any dual boot machine near you…). For example when you need to use Microsoft Visual Studio, DOORS (a requirements management system, for those how never has the pleasure) or even Enterprise Architect, you’ll need the good ol’ Windows operating system.

This is not a complaint about developing software in a Windows environment, but there are somethings you grow accustomed after a while developing in Linux. For me the greatest difference is the shell, or the lack of it in Windows. The shell is my favorite tool to inspect the details of my build artifacts.

I make a few searches on the web but couldn’t find a real replacement for the simple bash shell available at any basic Linux system. There are some possibilities, but none of them are the same as running the “real thing”:

- install Cygwin
you might have this already installed  if you need an XServer to run remote DISPLAY applications, although XMing is a better (lighter) choice for that matter

- install andLinux, but I felt the system performance degrading by the minute

- install Portable Ubuntu [1,2] (my favorite choice!)

 


On the nightstand...



Entries | Comments
«« Previous Entries