Your public_html with PHP5 isn’t working in Ubuntu 10.04 Lucid ?

Posted on | March 4, 2010 | No Comments

This weekend I’ve dist-upgraded from Ubuntu 9.10 *Karmic* to Ubuntu 10.04 *Lucid*, but only today I got a problem…

This was a big headache to figure out. First I got uninstallable packages for Apache2. In one or two hours I got the mirror updated and then installed it again, but my public_html with PHP5 stopped working.
I tried many things, like apt-get –reinstall, aptitude -o DPkg::Options::=”–force-confmiss” on apache2 + php5 packages and nothing was solving my problem.

So I’ve investigated a little more.. why the hell my ~userdir isn’t working with PHP5 and keep me asking to download the php source file, when the ‘localhost’ was working perfectly. Damn.. a bad day? ;(

So let’s analyze it..

$ sudo vim /etc/apache2/mods-enabled/php5.conf

    <ifmodule mod_userdir.c>
        <directory /home/*/public_html>
            php_admin_value engine Off
        </directory>
    </ifmodule>

Looks like the php engine was disabled for public_html directories, so we need to change it from Off to On and then: $ sudo service apache2 reload

Still not working.. but after some hours later of investigation, I figured out that if I comment that lines of mod_userdir.c and then: $ sudo service apache2 reload, it will just work like always.

#    <ifmodule mod_userdir.c>
#        <directory /home/*/public_html>
#            php_admin_value engine On
#        </directory>
#    </ifmodule>

Just this ;) Why “php_admin_value engine On” doesn’t work? It was supposed too..

3D Engine v1.0 em C – Trabalho final de 12º ano de TLP

Posted on | February 5, 2010 | 1 Comment

Encontrei uma daquelas relíquias nos meus backups, que é sempre bom partilhar, pois poderá ajudar alguém que precise de umas dicas / ideias para o projecto final de TLP do 12º ano. Ao contrário de alguns colegas meus da altura, em que nada foi partilhado, eu não tenho qualquer problema em fazê-lo, bem porque a minha base serviu na altura para outros colegas.

/*
3D Engine v1.0 em C com duas funções em Assembly! ;-)

Composição de quatro pirâmides pentagonais de base centrada na origem com a altura oito vezes superior a medida da aresta da base.

Por Marco Rodrigues em 2003 – http://Marco.Tondela.org

Requisitos: Turbo C++ 3.0 para Ms-Dos.
Nota: Devido ao Assembly a Instruction Set do compilador tem de ser 80186.
*/

3D Engine v1.0 em C

P.S:. Obrigado Prof. Cortez por toda a ajuda quando precisei.

EnJoY It ;-)

Qmailtoaster change ‘postmaster’ password for all domains

Posted on | February 3, 2010 | No Comments

Last year I needed to change the password of all postmaster accounts at company server and I didn’t googled anything, so I made this script:

#!/bin/bash
#############################################################
# Qmailtoaster change 'postmaster' password for all domains #
#############################################################
# bY Marco Rodrigues (Kmos) in 2k                           #
# http://Marco.Tondela.org                                  #
#############################################################

# Check every directory (domain) recursively and change postmaster password.
for dir in `ls -R`; do
    if [[ $dir =~ [^\.]+\.(com|net|org|pt)$ ]]; then
        /home/vpopmail/bin/vpasswd postmaster@$dir password
        echo "Password changed for postmaster@$dir"
    fi
done

I hope it could help *you* some day :)

Check Machines Network Status

Posted on | January 23, 2010 | 2 Comments

This is a little script I wrote some time ago for a friend in a big ISP. It could be also useful for someone. Feel free to use it.

#!/bin/bash
###################################
# Check Machines Network Status   #
###################################
# bY Marco Rodrigues (Kmos) in 2k #
# http://Marco.Tondela.org       #
###################################

# Results:
# - Answers without problems (UP)
# - Not responding (DOWN)
# - Unknown host (DNS not configured)

# Ask range of machines to ping.
printf "\nPlease enter the hostnames that you want to check: (e.g: console{1..100}.pt1)\n"
read consoles_to_check

# Check hosts and ping results.
for console in `bash -c "echo $consoles_to_check"` ; do
        if [ -x '/bin/ping' ] ; then
                PINGTEST=`/bin/ping -c 1 $console 2>&amp;amp;amp;1`

                if [ -n "`echo $PINGTEST | grep -o '100% packet loss'`" ] ; then
                        result="DOWN"
                elif [ -n "`echo $PINGTEST | grep -o '0% packet loss'`" ] ; then
                        result="UP"
                elif [ -n "`echo $PINGTEST | grep -o 'unknown host'`" ] ; then
                        result="DNS not configured"
                fi
        else
            result="Error: Ping is not correctly installed..."
        fi
        echo $console ":" $result
done

exit 0

SAPO PunyURL for Ubiquity

Posted on | August 3, 2009 | No Comments

I saw the latest news about Ubiquity and decided to give a try in my Firefox 3.5 / Ubuntu and I notice it can be helpful in various ways. It’s like an keyboard shortcut always there for something we need instantly. So I decided to use my jQuery knowledge and work on something cool in Portugal.

Nothing better to do it with SAPO PunyURL ;-) Just install Ubiquity first and after this. Enjoy =)

SAPO PunyURL PHP Class

Posted on | July 24, 2009 | 2 Comments

O PunyURL é um produto nacional criado no SAPO, e por isso utilize-o até não poder mais :-) senão o esforço que tive em criar a Class será em vão :-P
Agora já podemos adicionar links “curtos” para o twitter (entre outros..) em PHP de uma forma simplificada e rápida.

Como descarregar? fácil.. é só visitar este link no PHP Classes ou este link no github.

Display Comments Statistics Adopted

Posted on | July 12, 2009 | No Comments

Taking the spirit of open-source and to maintain something that I use in my blog / personal website, I’ve adopted Display Comments Statistics plugin for Wordpress.

Display Comments Statistics was originally created by Mário Gamito (R.I.P). I think he deserves someone to maintain it.

” This plugin shows the total number of articles and comments as well as statistics about which platforms and browsers were used in comment writing. It uses icons to identify both platforms and browsers.”

I’ve made some license and code changes, but the original idea and most of the code is there. If you want to help, contact me to be co-maintainer.

More information can be found at http://marco.tondela.org/comments-plugin/

Debian GNU/Linux Lenny is released

Posted on | February 15, 2009 | No Comments

In the first hand I’m announcing that Debian GNU/Linux Lenny is finally released and it’s homepage was updated 6 minutes ago, while I’m writing this post.

Release notes can be view here.

Downloads can be done here.

Let’s keep the good work! Next one is “Squeeze”.

Babiloo – dictionary viewer with multi-languages support

Posted on | February 4, 2009 | 2 Comments

Babiloo is an open source free OS independent dictionary application that works in offline mode.

Features:

* Runs on all the platforms, Windows, Linux, MacOS, Nokia S60 (>1.9).
* Supports dictionaries in SDictionary and StarDict formats.
* HTML displaying for the supported dictionaries.
* Able to download more dictionaries within the application.
* Support for many languages / fonts rendering.
* Don’t convert dictionaries, use originals.
* Phonetic sounds.
* Advanced search.
* Collaborative dictionaries.

Icon design: Nuno from Oxygen-Icons

We currently need peopple for testing and report bugs / features, so we can have the best out there. You can already test it in Windows (version 2.0) and Debian/Ubuntu (version 2.0.1).

Try it here from our PPA in Launchpad (you’ve the instructions in the site). I’ll try to have it the most updated in PPA, so you can see the latest features currently in development.

UPDATE: It was accepted yesterday in Debian with version 2.0.3.1.

Tondela Online renovado em Rails

Posted on | January 24, 2009 | 2 Comments

O meu site de estimação (my pet site), o Portal Tondela Online foi renovado, e desta vez refeito de raíz, mas numa nova linguagem, que estou a aprender, o Ruby on Rails. O alojamento é fornecido gratuitamente pela empresa ClusterCube, que desde já agradeço publicamente.

Espero que gostem e sobretudo o visitem, comentem e dêm a sua opinião. A ideia é fazer algo completamente diferente e de não repetir os conteúdos / serviços do site da Câmara Municipal.

keep looking »

Who Am I ?

Hi!

I'm Marco Rodrigues with 25 years old and I live near Viseu, Portugal.
I usually work as Web Developer / Systems Administrator, specially with Open Source technologies. I'm available to work as freelancer.

Contact me.








Subscribe to my feed

Search


    Writing

    22 articles
    130 comments

      Comments

      platforms
      wp 58
      windows 53
      linux 7
      macos 3
      sun 0

      browsers
      ie 38 
      firefox 20 
      safari 7 
      opera 6 
      chrome 4 
      bonecho 0 
      epiphany 0 
      flock 0 
      konqueror 0 
      iceweasel 0 
      lynx 0 
      netnewswire 0