Check spelling on multiple LaTeX files using multiple languages

Consider that you have several directories and sub-directories, e.g., the organization of a thesis document in which each chapter has its own directory and several .tex files. And your goal is to check the spelling on all the .tex files in this tree of directories, recursively. Moreover, you want to check the spelling in different languages, some circumstances require that, such as the abstract of the thesis was written in multiple languages. Here is my approach for that, explained step-by-step:

First, in order to check the spelling, we are going to use aspell. Therefore, we rely on its dictionaries, which are packeged on Debian as aspell-[language], e.g., aspell-fr is the package for French dictionary. Install the packages referent to the dictionaries you want. To check which language dictionaries you have installed do:

aspell dump dicts

Then take note of those you gonna use, we gonna need them later on.

Now, back to our .tex spell check. First, lets get the content of all the .tex files, from here on lets consider you are in the root directory of your document’s tree:

find . -name '*.tex' -exec cat {} \;

Second, to spell check the words from text that resulted from the command above using, at the same time, many languages, for example, English from US and Brazilian Portuguese , we use aspell as following:

aspell --lang=en_US -t list | aspell --lang=pt_BR -t list

the -t indicates that we are going to check LaTeX files, i.e., to discard its directives and the list parameter outputs the words that were not found in the dictionary.

A final touch would be write to a file only unique instances of the misspelled words alphabetically sorted, thus the whole command is:

find . -name '*.tex' -exec cat {} \; | aspell --lang=en_US -t list | aspell --lang=pt_BR -t list | sort -u > typo.txt

Now you can proofread the typo.txt file and see if there are problematic words in there.

Wifi Disconnects and it is Unable to Reconnect, “device not ready” on Debian and Ubuntu

On both Ubuntu and Debian I’ve faced a problem with the Wifi that would get disconnected and would not be able to reconnect. On some circumstances, even brand-new Debian Jessie, Network Manager 0.9.8 would show a “device not ready” message instead of a list of wireless networks.

On both Debian Jessie and Ubuntu 10.04 I’ve solved that by removing and reloading modules, though different modules were targeted.

Ubuntu 10.04 (and it will probably work for newer versions):

sudo rmmod iwlagn
sudo rmmod iwlcore
sudo modprobe iwlcore
sudo modprobe iwlagn

Debian Jessie

rmmod iwlmvm
rmmod iwlwifi
modprobe iwlmvm
modprobe iwlwifi lln_disable=1 swcrypto=1

Installing Moodle 1.9 in Ubuntu 12.04

Step 1: Install and set up MySQL

  • sudo apt-get install mysql-server (assuming password ‘123456’)
  • mysql -u root -p123456
    • CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
    • GRANT ALL PRIVILEGES ON moodle.* TO moodleuser@localhost IDENTIFIED BY ‘123456’;
    • GRANT SELECT,LOCK TABLES on moodle.* TO moodlebackup@localhost IDENTIFIED BY ‘123456’;
    • QUIT

Step 2: Install Apache

  • sudo apt-get install apache2
  • sudo gedit /etc/apache2/httpd.conf
    • ServerName localhost
  • sudo chown -R www-data:www-data /var/www/
  • sudo /etc/init.d/apache2 restart

Step 3: Install PHP

  • sudo apt-get install php5-ldap php5-odbc
  • sudo apt-get install libapache2-mod-php5 php5-gd php5-mysql

Step 3: Install Moodle

  • cd /var/www
  • sudo wget
  • sudo tar -zxf moodle-latest-19.tgz
  • sudo mkdir /var/www/moodledata
  • sudo chown -R www-data:www-data /var/www/moodledata
  • sed -i ‘s:/var/www:/var/www/moodle:g’ /etc/apache2/sites-available/default
  • sudo /etc/init.d/apache2 restart
  • sudo chmod -R 755 /var/www/moodle/
  • sudo chown -R www-data:www-data /var/www/moodle

Step 4: Set up Moodle


How to creates a free micro instance at Amazon

Step 1: Creates your AWS account

  1. Enter in
  2. Creates an Amazon account, the same used to purchase books (requires a valid credit card)
  3. 3. Completes the form..
  4. Verifies your telephone

Step 2: Creates a micro instance

  1.  Enter in
  2. Goes in ‘Account’ > ‘AWS Management Console’
  3. Click in EC2 (default hostage: US East N. Virginia)
  4. Click in ‘Launch instance’
  5. Select ‘Classic Wizard’
  6. Choose an image (Ubuntu 12.04 LTS)
  7. Selects instance ‘T1 Micro, 613MB Free Tier’ (On demand)
  8. Skips Advanced Instance Options (choose specific kernetl or RAM disks)
  9. Storage (8 GB)
  10. Skips Tags
  11. Createa key pair named ‘microaws’ (do NOT proceed without a Key Pair)
  12. Skips configure firewall (which will creates group quick-start-1, allowing SSH at 22)
  13. Review instance info and
  14. Launch it

Step 3: Access instance via ssh

  1. Change key pair file permission
    • chmod 600 microaws.pem
  2. Connects to remote host:

Step 4: Enables port 80

  1. Enter in
  2. Goes in ‘Account’ > ‘AWS Management Console’
  3. Click on ‘Security Groups’
  4. Select group ‘quick-start-1’
  5. Click on tab ‘Inbound’
  6. Add rule > Create a new rule > HTTP
  7. Apply Rule Changes
  8. Tests port 80
    • telnet <EC2-HOSTNAME> 80


ADB List of Devices “???????????? no permissions”

Suddenly ADB was not listing my device, and everything I could see with “adb devices” was a bunch of interrogation marks and “no permissions”. It happens while I was coding an Android application with Eclipse.

To solve that go to your “android-sdk-linux” directory, mine is on my home, therefore:

cd ~/android-sdk-linux/platform-tools
./adb devices
List of devices attached
????????????	no permissions # ok, lets fix it

./adb kill-server
sudo ./adb start-server
./adb devices
List of devices attached 
0D3AACA1DDE1001C	device # and here is our device!

That is it.