Wednesday, November 25, 2009

No more bootmisc.sh in Karmic Koala

Until 9.04, /etc/init.d/bootmisc.sh was used to provide automatic initialization to several services. It was invoked from /etc/rcS.d/S55bootmisc.sh, before X starting.

In 9.10, it does not work anymore, and I still do not know why. So, /etc/rc.local may be a replacemente for it. For instance, I have some VirtualBox shared folders I want to be available as soon as Karmic server is ready to work. So my /etc/rc.local now is like:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Shared Folders Mounts
if [ -z "$(grep '/media/SwitchFiles' /proc/mounts)" ]; then
/bin/mount -t vboxsf SwitchFiles /media/SwitchFiles
fi

# Shared Folders Mounts
if [ -z "$(grep '/var/cache/apt/archives' /proc/mounts)" ]; then
/bin/mount -t vboxsf AptArchives /var/cache/apt/archives
fi

exit 0

Some interestings notes:
- I do not trust /etc/mtab, but I'd rather believe in /proc information;
- Shared folders will just work if they are not mounted yet.
- The module vboxsf was provided by Virtualbox compilation process.

This procedure complements this article. Do not forget to comment and to tell if this was useful or not.

Monday, November 23, 2009

MSN forced update

Until some days ago, My MSN Live was always reminding me to update. But, as lots of guys, I didn't. Right now, it refused to work until I accepted to update. I don't know what for, I did not received any comment about it, I did not authorized any download. But anyway, they did it again.

I am not one of the Linux evangelists anymore, I do agree with interoperability, I do think it is necessary. But I paid any single cent for my computer, so I am the one to decided what will be in it or not.

The reason I left MS Vista HP in my Toshiba was: it is legal. After some years only working with Linux in home and XP in the office left me behind in several topics. I tried to give MS a chance.

But they keep wandering around in my laptop, in and out, without telling why or when. It is just like this is not my laptop. I am aware that they allowed me to use Vista, and that I do not own it. Okay!!! But the laptop is still mine, I own it, I must decide what I want or not! and also when!!
Up here they allow me to choose yes (Sim) or no (Não) as an answer to "May I (MS) install the software I (MS) downloaded in your laptop (the sucker's laptop)? ".

They "offered" some stuff to install, and I answered them "no,thanks". Since I have no choice (not democratic!), just give me Live MSN, thanks. But they warned it would cost 160MB. Awful!

Not only this, but there is an interesting translating problem: Silverlight's is in English !!! Here in Brazil they always complained about our poor translation. But that, years ago. Now, in 2009, they did the same ? Shame on you ...

After, I spent some minutes to overview the contract, and there they told me:
- I cannot use the service in a "harmful way" (my translation) to MS or to the announcers. So, I can't use MSN to complain about my insatisfaction with MS? Is that correct ?
- I agree that they may use whatever I type in MSN, almost in the way they understand they should.
- In case of being prejudiced, the MS can refund me as compensation no more than the value I pay monthly. Not even a penny more. Also, it doesn't matter whether MS knew or should know about anything that could prejudice me!!!
- This contract is eletronic, but I can not copy/paste it or at least perform a search in it. And if I need to find any word in it? no way!
- MS does not guarantee anything. Software SHOULD work, OS SHOULD work. And where is the problem in using free software ? It is also not guaranteed.
- In my case, as it is for everyone who lives in any country of South America, most problems related to the service should be resolved in Washington. If I am complaining, and if in Brazil we have MS offices also, why in the world should I go to Washington ?

For now, I had to accept this all. I will still try to evaluate if it is really worthy to use a licensed Windows copy. I am not speaking about piracy. I am speaking about free software, mainly Ubuntu.

Friday, November 20, 2009

Root Security in Ubuntu

Most of my Linux students always question about Ubuntu's root password. "It is not comfortable, it is unnecessary", and many more excuses. That led me to start changings in my Linux study-pack, in User Administration chapter.

Why ?

Definitively, it is really dangerous to use any OS with an administrative account. At any moment, you can be called to do something else, or for a phone call, or even something that only you can do (and since you work with computers, you ALWAYS forget to do!!!).

Anyway, if this happen, and you need to leave the workstation, maybe you are not editing a file or doing something more complex, or you are doing one of those heavy duties. If you aren't involved with this, that's okay.

If you are, you will either remember to lock your graphic desktop (or CLI environment) or not. If you remember, that's okay.

If you don't, someone else can do anything as the administrator. This is really unwanted. And worst, commands issued are not logged. Some of them may write something. But not them all.

One more thing, and I really dislike this: I do not want to give away root permission to my team. Root password (when exists) should be known by few members, all of them with administrative corporative responsibilities.

SUDO

Ubuntu Server root account has no valid password, by default. Since this is the only account common to all Linux distro, nobody will be able to access it. Since it is needed to know an account, system gets little bit less unsafe.

“sudo” allows a user to execute commands as any other, mostly administrative commands. At first, the user created at install time is included in this "administrative staff". This user can do anything with sudo, as root. The configuration file is /etc/sudoers. This is written upon Karmic Koala (Ubuntu 9.10).

Including an Administrative account

If I want to include Thomas Martin (let's suppose his account is tmartin) as an administrative user, all I have to do is to add him to "admin" group:

sudo adduser tmartin admin

From now on, he can do anything as root. But, whatever he does will be registered in /var/log/auth.log. Watch this example from user "teste":

Nov 13 21:55:14 fw-tosh sudo: teste : TTY=tty1 ; PWD=/home/teste ;
USER=root ; COMMAND=/usr/bin/aptitude install vim

He installed (or tried to install) vim in Nov 13, at 21:55, in TTY1, he was in his home directory when issued this command, and it ran with "root" id We can also see that this happened in “fw-tosh” host.

What this line does not tells me is if his operation was well succeeded or not. But there are other log files, such as /var/log/dpkg.log that really help.



Wednesday, November 18, 2009

Shared Folders in VirtualBox with Ubuntu Server

I really enjoy VirtualBox. After knowing it a little, I quit thinking about VMWare, for my Linux courses. Now, there is something really necessary when you work with more than one Virtual Machines: a shared folder.

A shared folder exists in the host system, and accessed by one or more guest systems. Thus, if VM1 needs to copy a file to VM2, just copy it to that folder. Easy like that.

Defining the Shared Folders
First, in Virtualbox console, you set one or more folders to be shared, as shown:

In the right panel above, you can see "Shared Folders". In this example there are already 2 shared folders. Click "Shared Folders", written in blue.

All shared folders are listed here. To add one more, click the folder with a "plus" signal, at the right side.

Write the host's folder full location, at "Folder Path" field. Optionally, this folder can be set as Read Only.

Virtualbox will suggest a name according to the folder's name, as you can see above.

Preparing Virtualbox Software
Now, let's make it available in our virtualized Ubuntu Server. First, we need to install it:

$ sudo aptitude install build-essential dkms

After that, "install Guest Additions" in "Devices" menu. It is an ISO image, and will work as if it is a CD.

Let's access it's contents

$ sudo mount /media/cdrom
$ cd /media/cdrom

In this folder there are several scripts, one for each system. You need to know wich version you have. Type the following:

$ uname -m
x86_64

My VM is a 64 bits. In my case I should type the following:

$ sudo ./VBoxLinuxAdditions-amd64.run

If the answer is "i686", the script must be "VBoxLinuxAdditions-x86.run". Any of them will first verify it's integrity, and after start some compilations. It will take a couple of minutes. Since we are using Ubuntu Server, a message warns that "X Window drivers will not be installed".

Building VirtualBox Kernel Modules
After all that, we are ready to build Virtualbox kernel modules, which is a really simple step. First, you will need to install kernel headers. Verify your kernel version with the command

$ uname -r

My system is kernel "2.6.31-14-server". My kernel is "server" type, so my kernel headers are installed with the following command:

$ sudo aptitude install linux-headers-server

It is a good idea to always update your kernel. When the headers installation ends, type the following command:

$ sudo invoke-rc.d vboxadd setup

After recompiling, Virtualbox recommends you to reboot. As you know, few operations require a system reboot, and most of them are kernel changings.

Mounting Shared Folders
We can now access it normally by mounting, using the module vboxsf (VirtualBox Shared Folders). To mount it manually, we need to know the Shared Folders' name, which is "Example". I choose "/mnt" as mount point.

$ sudo mount -t vboxsf Example /mnt

After that, you can copy files to and from /mnt folder. All these files will be available to the host system (in my case, Windows Vista System). If you want, with Windows Explorer you can access these files.

You can also configure Linux to automatically mount this directory. As "root" user, edit /etc/rc.local and add the following lines by the end of the file:

if [ -z "$(grep '/media/SwitchFiles' /proc/mounts)" ]; then
/bin/mount -t vboxsf SwitchFiles /media/SwitchFiles
fi

/proc/mounts show all mount points. If "/media/SwitchFiles" is not listed there it will be mounted. Of course, you should create this directory, case it does not exist yet.

My application
Since I have many VMs with Ubuntu Server and Ubuntu Desktop working toghether, frequently I have to install some packages, thus downloading them. With shared folders, I can download once, through any VM and use it in all the others VMs. My "/var/cache/apt/archives" is the mount point of a shared folder in Windows, in "/etc/fstab" in all VMs, as follows:

if [ -z "$(grep '/var/cache/apt/archives' /proc/mounts)" ]; then
/bin/mount -t vboxsf AptArchives /var/cache/apt/archives
fi

Of course, in my Virtualbox console, I have created "AptArchives" shared folder in each VM.

Do not forget to comment and to tell if this was useful or not.

Thursday, November 12, 2009

ODT being read in MS Word

Maybe I am late with this, but ...

Until 2 weeks ago, I could not have my ODT document edited in MS Word 2007. All of a sudden, I open my work with Vista Home Premium (Legal Copy), and I saw my work with MS Word Icon. WOW!!! These last couple of days, Vista has warned several times it needed to restart, because of updates, and things like that. I understand updates, but I don't agree with all that everlastings restartings.

Anyway, I tried to watch the way MS Word understood my book. In past days, OpenOffice tried to understand DOC documents, but several troubles of formatting always were there, for
sarcasm of all: "it is awful, it will never do it, you will loose your work", and on.








MS did a really good job, except for some details:




1) Headings got off the margin:












2) Bullets were not correctly interpreted








3) Background images were not imported. In this image, there is a wall image behind the text "notas importantes", but it was not imported. Notice that, when I wrote this box, I inserted the image in the original ODT file. Also the watermark I defined (a Creative Commons license, converted to JPG) was not imported.




Other features I used in OOWrite worked perfectly. After all, opening ODT files in this updated version of Word was not as complicated as opening old DOCs format in OOWriter, but it was not perfect. Anyway, it is a good step for MS, having in mind interoperactivity.

If you know about more details, let me know. Also, do not forget to comment and to tell if this was useful or not.

Update:
MSWord also does not natively export to PDF documents.

Wednesday, October 7, 2009

Colored man pages

I found a really interesting post about in a brazilian site named DICAS-L, and thought it would be really helpful to have it here, for me or anyone else. Man pages may be read with colored keywords, what helps understanding the (usually complicated) text within.


Pagers
It should be good to first understand the idea behind pagers. They are tools that ease the reading of long texts, as man pages are.

For Unix, probably the oldest pager is more, created by Daniel Halbert, in 1978. With ENTER the text is rolled up line by line, with SPACE we can read the next page, and for search the "/" character is used, as it is in vim. Thus, more became very important for Unix operator.

After, less was created by Mark Nudelman, from 1983 to 1985, offering more resources than more. The names were meant to be a joke, obviously. less allows the use of arrow keys for "navigating" the document, and much more interesting features than it's predecessor.

And finally, John Davis, from MIT, creates most, a pager with more features than the well known less. It is the basis of our article.

MAN pages
I strongly believe that MAN pages are simultaneously the best and the worst Unix documentation source, because (generally) they are written by the software author, but at the same time, not only it does not offers (many) examples, as it mostly make wide use of technical jargon, which can be complicated to newbies. Another good point is that most of man pages are written in English, and usually not localized, or at least as it should.

As said before, man pages are huge, and a pager should be a great help. pager is the default pager, and it is a symlink to some pager, as we can see:
$ whereis pager
pager: /usr/bin/pager
$ file /usr/bin/pager
/usr/bin/pager: symbolic link to `/etc/alternatives/pager'
$ file /etc/alternatives/pager
/etc/alternatives/pager: symbolic link to `/usr/bin/less'
We will replace less by most. What we need to do is to declare it with the environment variable MANPAGER.

Installation
As usual, installing a software is really easy, specially in Debian-based distros:
sudo aptitude install most
Configuration
To manualliy configure most as man pager, type the following:
$ export MANPAGER="/usr/bin/most -s"
But, by finishing your user session, this configuration vanishes. We really need to make it permanent, and we do so making smooth changes to start scripts:

If this pager must be ready only for the current user:
$ echo 'export MANPAGER="/usr/bin/most -s"' >> ~/.bashrc
If this pager must be ready for all users:
$ sudo su -
# echo 'export MANPAGER="/usr/bin/most -s"' >> /etc/profile
# exit
From now on, man pages are all colored. Some tips about most
  • b - bottom of the text
  • t - top of the text
  • / - search for
  • q - quit the text

Of course, we should always try to edit the files above (~/.bashrc or /etc/profile) and add those lines manually, with correct comments, and on. Enjoy it !

Don't forget to let down here what you thought about this article: useful, interesting or unuseful for you ?
Comments are welcome.


Tuesday, September 22, 2009

My old Acer has finally gone ...

After almost 5 years wth me, my Acer laptop (Celeron) has been sold. Since it's arrival, it has mostly worked with Ubuntu in a partition, and Windows XP in another.

After some months, only Ubuntu, and until last month, Ubuntu 9.04. I bought a brand new one (thanks, Lon !!!) from Toshiba. And a friend of us asked me that laptop for his son. I told him to keep Ubuntu, for it is better, safer, and all the stuff we know about it.

- No, because he will have to learn lots of new concepts, and on.

And that is for studying only. After some words, I finally gave up, and had to start reinstalling Windows XP on it. Vista would not work well. My first problem was with drivers, since I didn't have them. Not that difficult, Acer's site is really a breeze. I downloaded almost 10 drivers and started a painful path of OS rebuilding. More than 8 reboots after, I had a fully functional Windows: sound, video and anything useful else. Typical. No Compiz, jelly windows, cube desktop, or many other useful stuffs. Hummm ... I mentioned it was only a Celeron with 1G ?

Office, Avira, hotfixes, all this stuff to be installed AFTER ending OS on Partition. More than 1:30 hours, My future ex-Acer is ready to serve someone else: a teenager ... (brrr).

One week after, all the system was compromised with "some" viruses. Now, after all that problems, he'll give Linux a chance. I'll let you know about it after.

Sunday, May 3, 2009

Speed up your Internet in Ubuntu

Where I live, fast Internet is a dream for most users. So, I need to do something to make my Internet speed increase. We will read here how to make a good use of the advantages offered by a Linux Distro as Ubuntu.

The scenario
I am using a 3G modem. Unfortunately here it does not work as it should, being unstable and slow, most of time. Only 10% of the full contrated speed is guaranteed. It still is expensive, but for mobility, it is what it is. One other detail: I am always in the same sites. A great number the sites, but usually the same.

The solution
A proxy is the best way to make it go faster. According to wikipedia, a proxy is "a server (a computer system or an application program) that acts as a go-between for requests from clients seeking resources from other servers".

Thus, every web access will be requested to the proxy, and it will fetch it in Internet. This web page will remain a little in the system, because if it is requested again, some components will already be downloaded. That means that your browser will show the page faster.

We will see some changes to be made in proxy server, and some others in browser.

The Software
We'll be using Squid, a well-known proxy server, famous, free and widely used. This configuration is not difficult, but requires attention. You should know how to use vim.

Squid installation
As usual, installing a sofware in Ubuntu is a breeze. We will work using CLI, instead of GUI. I recommend you to copy the commands written here and paste them in BASH, to avoid typos.

First, let's assure that Ubuntu has informtion about the most recent packages. Open the CLI, and paste the following lines:
sudo aptitude update
sudo aptitude install squid
Remeber that if you want, you can dispose the whole squid configuration with the following lines:
sudo chattr -i /etc/squid/squid.conf.original
sudo rm
/etc/squid/squid.conf.original
sudo aptitude purge squid
You need vim to be installed. If you are not sure about it, copy this line and paste it on Bash:
sudo aptitude install vim
Squid Configuration

First of all, let's do a backup copy of it's configuration file:
sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.original
sudo chattr +i /etc/squid/squid.conf.original
Squid Configuration file has lots of comments. They are really helpful, but can be annoying sometimes. So we will "clean" it all:
sudo egrep -v "^$|^ *#" \
/etc/squid/squid.conf.original > /etc/squid/squid.conf
We must know the version of our software. This is how I can identify squid version:
sudo dpkg -p squid

Package: squid
Priority: optional
Section: web
Installed-Size: 1748
Maintainer: Ubuntu Core Developers
Architecture: i386
Version: 2.7.STABLE3-4.1ubuntu1
Replaces: squid-novm
Depends: libc6 (>= 2.4), libcomerr2 (>= 1.01), libdb4.7, libkrb53 (>= 1.6.dfsg.2), libldap-2.4-2 (>= 2.4.7), libpam0g (>= 0.99.7.1), netbase, adduser, logrotate (>= 3.5.4-1), squid-common (>= 2.7.STABLE3-4.1ubuntu1), lsb-base (>= 3.2-14), ssl-cert (>= 1.0-11ubuntu1)
Pre-Depends: debconf (>= 1.2.9) | debconf-2.0
Suggests: squidclient, squid-cgi, logcheck-database, resolvconf (>= 0.40), smbclient, winbind
Conflicts: sarg (<<>
This another way to do te same:
sudo dpkg -l | grep squid
In my system, this was the result:
ii squid 2.7.STABLE3-4.1ubuntu1 Internet object cache (WWW proxy cache)
Note that if your version is different, may ther be some differences.

Finally, let's start with the changes in Squid:
sudo vim /etc/squid/squid.conf -c ":set number"
I did the following changes:
...
35 icp_access deny all
36 http_port 127.0.0.1:3128
37 hierarchy_stoplist cgi-bin ?
...
48 extension_methods REPORT MERGE MKACTIVITY CHECKOUT
49 dns_nameservers 200.169.116.23 200.169.116.22
50 hosts_file /etc/hosts
Line 36 makes my Ubuntu more secure. In line 49 I stated both DNS IPs from my provider. acrescentei a linha 49, com os IPs do DNS do meu provedor. If you don't know about these IPs (they should be given by your ISP), you may see them in your Ubuntu system:
sudo cat /etc/resolv.conf
In my system, I had the following:
nameserver 200.255.121.39
nameserver 200.169.117.14
After these changes, we need to restart squid. So, let's do it:
sudo /etc/init.d/squid reload
To assure it is working, we can search the open ports. Squid uses port 3128:
sudo netstat -ltnp | grep -i squid
In my system:
tcp 0 0 127.0.0.1:3128 0.0.0.0:* OUÇA 3216/(squid)
What is bold in this line, is the same content of line 36 of squid's configuration file.

Browser configuration
The changes in our browser will be much easier. Let's do it in Firefox, which is already present in Ubuntu:






Let's first access Preferences, in edit menu.














After, we need to push Advanced button. In network tab, click on CONFIGURE.
















Do the same changes I did in this screen. Mine is in Brazilian Portuguese, but the fields are in the same place.











It is done. Proxy server installed and configured, and browser configured to talk to proxy server. In my computer, in about 8 days of use, I had the folowing use of HD:
sudo du -sh /var/spool/squid/
32M /var/spool/squid/
You should always control the space used by squid. If it increases too much, you can empty this cache. Type the following:
sudo squid -z
Don't forget to answer our poll, saying if this was useful, interesting or unuseful.

Monday, April 27, 2009

More security problems in Windows 7

In spite of the announced increase on security levels, a problem discovered in 2007 in Vista is still causing complications, this time on Windows 7. In 2007, Bruce Schneier points out the problem with the following:
Experts say that the fundamental problem that this highlights is that every stage in Vista's booting process works on blind faith that everything prior to it ran cleanly. The boot kit is therefore able to copy itself into the memory image even before Vista has booted and capture interrupt 13, which operating systems use for read access to sectors of hard drives, among other things.
Interestingly, 2 years after, Windows 7 keep almost the same problems. During HITB (Hack In The Box), wich is a security event, the researchers Vipin Kumar and Nitin Kumar demonstrate here how to gain control of a Windows 7 virtual machine, while during the boot.
It's a design problem," Vipin Kumar said, explaining the software exploits the Windows 7 assumption that the boot process is safe from attack. While VBootkit 2.0 shows how an attacker can take control of a Windows 7 computer, it's not necessarily a serious threat. For the attack to work, an attacker must have physical access to the victim's computer. The attack can not be done remotely.

Not only this, but Nitim says that there is nothing to be done, because this is a project problem, where is presumed that during the boot the OS is safe against attacks.
"There's no fix for this. It cannot be fixed. It's a design problem," Vipin Kumar said (..)
VBootKit 2.0 is only 3 Kb !!!

Sunday, April 26, 2009

Reinstalling our best tools in Ubuntu 9.04

Finally, Ubuntu 9.04 is right on the way. Since 8.10 version, I have installed lots of tools, and now it is time to install this 9.04 pearl. But, of course I get worried of wasteing some of the tools I was allways making use of. Here I'll show what to do to get all them again.


Levantamento de Software Instalado
I have been using aptitude instead of apt-get for some time, for it is already in the system by the default, in any Debian variant, as Ubuntu is. Besides, aptitude records in log every action. This log file is /var/log/aptitude.log.

Thus, the folowing line will reveal back all tools that have been installed by aptitude, in Ubuntu:
sudo cat /var/log/aptitude | grep "\[INSTALAR\]" |\
cut -d" " -f2 > ~/Desktop/Inst.txt
sudo zcat /var/log/aptitude*gz | grep "\[INSTALAR\]" |\
cut -d" " -f2 >> ~/Desktop/Inst.txt
Consider the "\" by the end of 1st and 3rd lines. It tells BASH that the following line is the continuation of the actual line. Thus I can assure that there are only 2 lines of CLI code. Instead of having them typed, I strongly suggest you to copy and paste them both on BASH CLI.

A file Inst.txt will pop up in the Desktop, and in it a list of the installed files. This is the content of my file:
alien-arena
avant-window-navigator
build-essential
chromium
compizconfig-settings-manager
debian-keyring
dia
extremetuxracer
exuberant-ctags
fdutils
ffmpeg
flashplugin-nonfree
frozen-bubble
gdm-themes
gnochm
gnome-ppp
gpaint
hping2
htop
idle
iftop
imagemagick
ipcalc
iptraf
k3b
mozilla-plugin-vlc
mpg123
msttcorefonts
nmap
p7zip
python3
rails
rar
smplayer
sox
ssh
sun-java6-jre
swat
traceroute
transcode
tree
unrar
vim
virtualbox-ose
vlc
wireshark
I removed the dependencies, because they will automatically be installed, but you don't need to.

So, after installing the new Ubuntu version , I will be able to install my stuff with this following line:
aptitude install $(cat ~/Desktop/Inst.txt)
Of course, this only applies to packages installed via aptitude. tar.gz and other ways of installation usually does not apply, because they are not logged by aptitude log file.

Tuesday, April 21, 2009

The top 10 Linux commands on BASH, and more ...

I recognize I am an almost 100% Ubuntu user, either in home or working. But even with all the resources ready to use in a Ubuntu Desktop, and the usability it provides, I am frquently in a CLI (Command Line Interface).

Thus, almost with a new version of Ubuntu, the 9.04, I am searching for all the stuff I have installed in my 8.10, because I will probably reinstall them. Of course, registering this here will help others, and myself.

But, in the warmth of the battle, I questioned myself: what was the command I used the most ? "Googling" the web, I found a post written by MySurface, that shows a soberb pipeline :
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | \
column -c3 -s " " -t | sort -nr | nl | head -n10
Ok, great and terrible, Godzilla is a tiny and cute gecko, and so on. I assure you, it will not bite you, nor melt your CPU. What it will really do is to show the top ten commands you've issued in BASH. Copy it from here and paste on your console. The result in my root account was:
1 73 14.6% ls
2 37 7.4% ufw
3 37 7.4% cd
4 25 5% iptables
5 23 4.6% aptitude
6 18 3.6% ifconfig
7 14 2.8% man
8 13 2.6% tail
9 13 2.6% du
10 11 2.2% host

That means ls is my most used command: it represents 14.6% of all: it was issued 73 times, in different conditions. This pipeline researched my command history and gave me this results.

I have made a simple modification to see the whole list:
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | \
column -c3 -s " " -t | sort -nr | nl | less
In this case, press q to finish.

Conclusions

After that, I could see that:
  • To have a better information, I should no use sudo for my administration tasks. Instead, I should login to root ($ sudo su -). Now every command issued by root account will be stored in its history. Guys on Ubuntu does warn that this may be harmful, that's why they provide a so complete sudo resource. So be advised: USE IT WITH CARE! :)
  • Ubuntu default size for History File is 500 lines. I changed this to 1000 lines in ~root/.bashrc, adding the line HISTSIZE=1000 in this file.

Sunday, April 19, 2009

MSN Messenger access Microsoft secretly

At least, most of MSN Messenger does not know that ...

Recently I was called by a friend, to help him in his computer problems. A reasonable desktop box, with Windows XP and ESET anti-virus.

MSN 2009 had been installed, but just was not working. I started ESET firewall, and set him to block data traffic, incoming or outgoing. This way I could watch any MSN access. Unfortunatelly, it did not worked at all, so I started working in some others tries, but left Firewall working in the same way. Searching on Internet, I found this page, with older versions of MSN.

After downloading 8.5, I started removing the 2009 version. Surprisingly, ESET Firewall blocked an access try to the Software Vendor. And more than 3 times !!! I cannot understand this. If I was uninstalling the software, why to contact Microsoft ?

I immediately thought of VLC, as shown in this popup. This just did not happened with MSN. The software did not warned me of this, just did it. this is disgusting. They could at least prompt the user about what was about to be done.

After this bad experience, after breathing deeply, I decided to continue, of course. Having installed 8.5 version, I started it, and I was prompted by a warning of a new version to be installed. Of course, I denied, and ... nothing happened. Twice, 3 times, and nothing happened. That means, get the new verson, it is an order. Or else just does not use it.

Wow! Those guy are really bold!! The computer is owned by the one who bought it, if he wants to use it with an older version, it is his business, not Microsoft business.

Mais uma vez fiquei tremendamente irritado. O computador pertence ao seu dono, ou seja, a quem desembolsou dinheiro para o comprar, e o fornecedor do software se acha no direito de impôr suas decisões sobre qual versão do software o usuário tem que usar. It was his own money!!!

Went for a little (a lotta) water, to cool my hatred. I found some tricks to apply on Register (nothing that easy, as many says) and MSN 2009 (after being re-downloaded) was ready to be used. That's okay, it is a Beta version. It will be fixed.

But, I ask any of you: Why does it must be this way ? please, technical answers, and not those built upon a "I think" basis.