Archive for the ‘Linux’ Category

Como reduzir o tamanho de um arquivo VDI (VirtualBox)

Monday, June 6th, 2011

Resumidamente:
Estas instruções funcionam se o seu guest é Linux, em um host Windows.
O disco virtual deve ser criado como dinamicamente expansível.

Instale o zerofree:

apt-get install zerofree

entre em um terminal (não é remoto!) e execute:

telinit 1
mount -o remount,ro /nome_da_pasta
df (serve para identificar o nome do dispositivo)
zerofree /dev/sda1 (nome do dispositivo, repita para todos os discos virtuais)
shutdown -h now (desligue a máquina virtual)

Então, acesse a pasta do VirtualBox (use o comand prompt – no windows 7: shift click na pasta)
no prompt digite:

vboxmanage modifyvdi x:\path\to\image\file.vdi compact

Essa ação pode demorar alguns minutos (horas se seu HD for lento), mas pode lhe salvar muito espaço em disco. ;-)

Montando pastas compartilhadas no Debian Lenny x VirtualBox

Wednesday, June 1st, 2011

como configurar o Debian Lenny para usar pastas compartilhadas no VirtualBox 4

Click to continue reading “Montando pastas compartilhadas no Debian Lenny x VirtualBox”

How to migrate a website from a Plesk backup

Sunday, May 15th, 2011

I had to move a few websites from a Plesk backup, which gave me only a file named www.domain.com_YYYY.MM.DD-HH-mm, with no other hint about its filetype.
Here comes the solution, from Parallel’s knowledge base: http://kb.parallels.com/en/1757.
In short, yo uhave to install an app called munpack in your server and run the command:
zcat your_plesk_backup | munpack
After that, you’ll have several files in the same directory. At first, we are interested in a few files to import to our server:

  • anything.httpdocs: tar/gzipped copy of the httpdocs directory, containing all web files;
  • anythinghttpsdocs: tar/gzipped copy of the httpsdocs directory, containing all web files. Usually empty;
  • anything.mysql: textfile containing a dump for the database named anything;
  • email@yourdomain.com.mdir: tar/gzipped containing the emails from this account. You can create this email user in your server, copy the files to the appropriate directory and change the ownership to each email user.

So these are the steps I needed to migrate a few sites. As these sites didn’t have any CGI scripts, I haven’t tried to copy them too.

Setting a default charcode for an Apache2 webserver

Monday, February 2nd, 2009

If you have problems in your Apache (or Apache2) server not showing ISO characters in your webpages, even if the charset is set in the pages, it’s probably a missing line in your httpd.conf file.

In Apache2 servers, the file is at /etc/apache2/apache2.conf

Open it and look for

#AddDefaultCharset ISO-8859-1"

and remove the # character. (this means uncommenting the line, for the newbies :)

Restart the server by typing:

sudo /etc/init.d/apache2 restart

And your webpages shoud now look good.

how to mount ext2 / ext3 filesystems under Windows?

Sunday, February 1st, 2009

I needed to mount an ext3 filesystem in my windows, in order to share some files (my development scripts and databases) from my Windows setup and my Debian install.

Falko Timme has presented us another great tutorial about this:
http://www.howtoforge.com/access-linux-partitions-from-windows

Debian Etch “io scheduler cfq registered (default)”

Saturday, January 31st, 2009

I am installing a Debian 4.0 Etch into my notebook, and it hung loading “io scheduler cfq registered (default)”.

The solution was to type after boot: “install noapic acpi=off fb=false”  without quotes, and it then started installing the system.

Just for reference, I found this tip at LinuxQuestions. Thanks, guys!