Ubuntu:Feisty pt

From

* Em tradução * Brevemente Guia Completo *

Ubuntuguide_logo.png

Guia não oficial para iniciantes do Ubuntu 7.04 (Feisty Fawn)

O Ubuntu 7.04 (Feisty Fawn) foi lançado a 19 de Abril de 2007. Este guia está em constante evolução. A sua ajuda a melhorar e testar este guia é essencial.

Este guia foi começado por Chua Wen Kiat (Kuala Lumpur, Malásia). Neste momento está a ser mantido pela Universidade da Letónia e todos estão convidados a contribuir.

Este guia pode ser discutido no fórum oficial UbuntuGuide.org Forum em ubuntuforums.org. Entre na discussão.


Pode encontrar no GuiaUbuntuPT.org um wiki com mais guias e informações para o ajudar.


Para editar páginas precisa de se registar -- register

Se tiver alguma dúvida, envie um e-mail para ubuntuguide -at- ubuntuguide.org

捐助者 MikrobartOrvilsQuashJiyuu0CargoGabemorrBytecopekrampoSimosStubbyeljacoshaiThunderMHasileadammichaelroachBelisarivsCheatorHankKaotikssoniahKutanMehdirichuxShadymanHavarillLouisShadymanshanlot751EtienneRabid9797Mantas Smelevičiusperspectoffphloseadogsmalugo2debugPakosRedBassCyberAngelCogeeldineroycorreUficAntidrugueVahidLouis KingRsinghBorut-TCinglallsTownraypete alleboneGreenstarThe TurkRonBCompotatojoMbrasigma80Karthikeyanemorrp1Th0rv4ldand other friends of our community edit


Contents


Versões Anteriores

  • Ubuntu 5.04 em Búlgaro: http://www.ubuntuguide.hit.bg/

Se utiliza uma versão mais antiga do Ubuntu (Breezy, Dapper, Edgy), é aconselhável a actualização para o Feisty. Veja aqui como proceder: [Como actualizar de Hoary Hedgehog -> Breezy Badger -> Dapper Drake]

Notas Gerais

  1. Este é o guia não-oficial do Ubuntu 7.04 (Edgy Eft) para iniciados. Não é associado com Ubuntu nem com a Canonical Ltd..
  2. Este guia pode ser discutido no fórum oficial UbuntuGuide.org Forum em ubuntuforums.org. Entre na discussão.
  3. Se vir uma caixa delimitada, significa que tem de executar o comando em questão no modo Consola (Aplicações - Ferramentas do sistema - Consola) ou usar o conteúdo da caixa consoante o pedido..
  4. Para evitar erros de escrita, copie e cole os comandos para o modo Consola (Clique botão direito nos comandos ->"Copiar" ou "Colar". Também pode usar Ctrl+c para copiar e Shift+Insert para Colar)
  5. "sudo" significa "superuser do" ( SuperUtilizador faz ). "sudo" vai pedir "Password:". Por favor insira Password do utilizador
  6. Se quiser mais informação sobre algum comando, simplesmente procure nas páginas do manual referente usando o comando “man”. Por exemplo, “man sudo” vai mostrar a página do manual referente ao comando “sudo”.
  7. Se está cansado de escrever "apt-get" todas as vezes, Leia ##Como apt-get the easy way (Synaptic)
  8. "apt-get" e "wget " requerem uma ligação à Internet para instalar/actualizar/download dos programas.
  9. Todas as referências a "apt-get" foram substituidas por "aptitude". Pode continuar a usar "apt-get" se assim desejar. Este ponto pode ser discutido em Ubuntu Forums
  10. Para fazer download a um ficheiro, clique com o botão direito do rato -> Seleccione "Salvar link como..." -> Verifique que o nome e extensão do ficheiro estão correctos
  11. Se deseja ajudar a traduzir o Ubuntu para a sua língua ou ajudar o Ubuntu de outra maneira, visite https://launchpad.net/
  12. Que o espírito "humanidade para com os outros" esteja sempre consigo....


Se está a usar a versão 64-bit substitua qualquer "i386" por "amd64"

Para Começar

Onde ver alguns Screenshots do Ubuntu:

  • Ubuntu 7.04(Feisty Fawn) Screenshots
  • Ubuntuclips.org - tutoriais em vídeo para seres humanos
  • Ubuntu Video - vídeos sobre linux para seres humanos

Onde ver screenshots / screencasts do Xubuntu

  • Official Xubuntu screenshots


Onde procurar por novos programas

  • http://gnomefiles.org/
  • http://www.kde-apps.org/
  • http://freshmeat.net
  • http://sourceforge.net/

Onde procurar customizações para o desktop

  • http://art.gnome.org/
  • http://www.gnome-look.org/
  • http://www.kde-look.org/
  • http://xfce-look.org/

Existem outros guias *buntu?

  • http://xubuntuguide.org
  • Ubuntu Step By Step Guides For Ubuntu UsersWebsite da comunindade de utilizadores de Ubuntu


Upgrade do Ubuntu Edgy para o Ubuntu Feisty

  • Guia passo a passo de upgrade, com screenshots

Como adicionar repositórios extra

  • Leia #Notas Gerais
  • Pode adicionar repositórios extra utilizando a aplicação Canais de Software, que pode ser encontrada no menu: Sistema -> Administração -> Canais de Software. Active os repositórios que lhe vão fazer falta (main, universe, restricted, multiverse). Provavelmente não precisará do repositório "sources". Este é o método recomendado para adicionar repositórios:


  • Pode utilizar outro método para adicionar repositórios, fazendo os passos seguintes (faça isto por sua conta e risco):
  • Criar um backup da lista de "sources" dos repositórios.
sudo cp -p /etc/apt/sources.list /etc/apt/sources.list_backup
  • Abrir a lista de "sources" num editor de texto
Utilizadores Ubuntu (GNOME):
sudo gedit /etc/apt/sources.list
Utilizadores Kubuntu (KDE):
sudo kate /etc/apt/sources.list
Outros utilizadores (se os acima não funcionarem):
sudo nano /etc/apt/sources.list
  • Usar as linhas seguintes como um template para o guiar na edição dos repositórios no ficheiro sources.list:
Pode tentar susbtituir as linhas actuais do sources.list pelas linhas seguintes
Para tirar partido de mirrors nacionais adicione "pt." antes de archive.ubuntu.com, onde pt = código de Portugal
e.g. deb http://pt.archive.ubuntu.com/ubuntu edgy main restricted universe multiverse

Internacional

## Ler http://help.ubuntu.com/community/UpgradeNotes para ver como fazer upgrade
## para novas versões da distribuição.
## Adicinar sinal de comentário (##) no início de qualquer linha para não ser verificada.   
## Usar a seguinte sources.list por sua conta e risco.  
## Uncomment deb-src if you wish to download the source packages
## If you have a install CD you can add it to the reposity using 'apt-cdrom add'
## which will add a line similar to the following:
#deb cdrom:[Ubuntu 7.04 _Feisty Fawn_ - Beta i386 (20070322.1)]/ feisty main restricted
deb http://us.archive.ubuntu.com/ubuntu/ feisty main restricted
#deb-src http://us.archive.ubuntu.com/ubuntu/ feisty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ feisty-updates main restricted
#deb-src http://us.archive.ubuntu.com/ubuntu/ feisty-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://us.archive.ubuntu.com/ubuntu/ feisty universe
#deb-src http://us.archive.ubuntu.com/ubuntu/ feisty universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ feisty multiverse
#deb-src http://us.archive.ubuntu.com/ubuntu/ feisty multiverse
## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse
#deb-src http://us.archive.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu feisty-security main restricted
#deb-src http://security.ubuntu.com/ubuntu feisty-security main restricted
deb http://security.ubuntu.com/ubuntu feisty-security universe
#deb-src http://security.ubuntu.com/ubuntu feisty-security universe
deb http://security.ubuntu.com/ubuntu feisty-security multiverse
#deb-src http://security.ubuntu.com/ubuntu feisty-security multiverse
## PLF REPOSITORY (Unsupported.  May contain illegal packages.  Use at own risk.)
## Medibuntu - Ubuntu 7.04 "feisty fawn"
## Please report any bug on https://launchpad.net/products/medibuntu/+bugs
deb http://medibuntu.sos-sts.com/repo/ feisty free non-free
#deb-src http://medibuntu.sos-sts.com/repo/ feisty free non-free
## CANONICAL COMMERCIAL REPOSITORY (Hosted on Canonical servers, not Ubuntu
## servers. RealPlayer10, Opera, DesktopSecure and more to come.) 
deb http://archive.canonical.com/ubuntu feisty-commercial main

Nacional

##Portuguese Sources.list
## MAIN
deb http://pt.archive.ubuntu.com/ubuntu feisty main restricted universe multiverse
deb-src http://pt.archive.ubuntu.com/ubuntu feisty main restricted universe multiverse
## MAJOR BUG FIX UPDATES produced after the final release
deb http://pt.archive.ubuntu.com/ubuntu feisty-updates main restricted universe multiverse
deb-src http://pt.archive.ubuntu.com/ubuntu feisty-updates main restricted universe multiverse
## UBUNTU SECURITY UPDATES
deb http://pt.archive.ubuntu.com/ubuntu feisty-security main restricted universe multiverse
#deb-src http://pt.archive.ubuntu.com/ubuntu feisty-security main restricted universe multiverse
## BACKPORTS REPOSITORY (Unsupported.  May contain illegal packages.  Use at own risk.)
#deb http://pt.archive.ubuntu.com/ubuntu feisty-backports main restricted universe multiverse
#deb-src http://pt.archive.ubuntu.com/ubuntu feisty-backports main restricted universe multiverse
## Proposed Repository ( Repositorio com pacotes propostos para o Ubuntu pela comunidade )
## Descomentar se quiser usar
#deb http://pt.archive.ubuntu.com/ubuntu feisty-proposed main restricted universe multiverse
#deb-src http://pt.archive.ubuntu.com/ubuntu feisty-proposed main restricted universe multiverse
## Internacional
## Medibuntu - Ubuntu 7.04 "feisty fawn"
## Please report any bug on https://launchpad.net/products/medibuntu/+bugs
deb http://medibuntu.sos-sts.com/repo/ feisty free non-free
#deb-src http://medibuntu.sos-sts.com/repo/ feisty free non-free                                          
## Internacional
## CANONICAL COMMERCIAL REPOSITORY (Hosted on Canonical servers, not Ubuntu
## servers. RealPlayer10, Opera and more to come.) 
deb http://archive.canonical.com/ubuntu feisty-commercial main


  • Grave o ficheiro editado
  • Adicione as chaves gpg necessárias; use o seguinte comando para adicionar a chave gpg do Repositório medibuntu:
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add -
  • Actualizar lista de pacotes:
sudo aptitude update


  • Pode também gerar o seu próprio sources.list e encontrar outros repositórios em: http://www.ubuntulinux.nl/source-o-matic
  • Modifique o sources.list original somente se tiver a certeza daquilo que está a fazer. Misturar repositórios pode quebrar o seu sistema.

Updates Ubuntu

Básicos sobre o Apt, Software e Pacotes

Aqui pode encontar algumas noções básicas de como utilizar o sistema de gerenciamento de pacotes Apt.

  • Instalar pacotes
sudo aptitude install <nome_pacote>

Exemplo:

sudo aptitude install mpd sbackup
  • Remover pacotes
sudo aptitude remove <nome_pacote>

Exemplo:

sudo aptitude remove mpd sbackup
  • Procurar por pacotes
sudo aptitude search <palavras_chave>

Exemplos:

sudo aptitude search Music MP3
sudo aptitude search "Text Editor"
  • Actualizar a base de dados do Apt (utilizado depois de adicionar/remover repositórios Apt )
sudo aptitude update
  • Actualizar pacotes
sudo aptitude upgrade
  • Actualizar distribuição completa
sudo aptitude dist-upgrade
  • Instalar pacotes Ubuntu (Debian) (.deb)
sudo dpkg -i pacote.deb
  • Remover um pacote Ubuntu (Debian)
sudo dpkg -r pacote
  • Reconfigurar/Reparar pacote instalado
sudo dpkg-reconfigure pacote

Exemplo:

sudo dpkg-reconfigure mpd
  • Usar Arquivos ".tar.gz" (Tar/GZip)

Para extrair:

tar xvzf package.tar.gz

Para criar:

tar cvfz package.tar.gz folder
  • Usar Arquivos ".tar.bz" (Tar/BZip)

Para extrair:

tar xvjf package.tar.bz

Para criar:

tar cvjf package.tar.bz folder
  • Extrair Arquivos ".bz"
bunzip2 file.bz
  • Extrair Arquivos ".gz"
gunzip file.gz
  • Compilar pacotes a partir do source

Confirme se tem instaladas todas as ferramentas de desenvolvimento necessárias (i.e. bibliotecas, compiladores, headers)

sudo aptitude install build-essential
sudo aptitude install linux-headers-`uname -r`

Extrair o pacote (como indicado acima)

tar xvzf package.tar.gz

Iniciar a compilação

cd /caminho/para/ficheiro/extraido
./configure
make
make install

Se a compilação for bem sucedida, pode fazer um pacote Ubuntu (Debian) (.deb) para uso futuro:

Instalar ferramentas de pacotes:

sudo aptitude install checkinstall

Recompilar o pacote utilizando o parâmetro "checkinstall":

cd /caminho/para/ficheiro/extraido
./configure
make
checkinstall

Guarde o ficheiro ".deb" para uso futuro. Pode ser instalado usando:

sudo dpkg -i package.deb

Nota: Estas são instruções básicas e genéricas, e podem não funcionar sempre. Alguns pacotes requerem dependências adicionais e outros parâmetros para poderem ser compilados com sucesso.

Como actualizar manualmente o Ubuntu

sudo aptitude update
sudo aptitude upgrade
sudo aptitude dist-upgrade

OU

Use o Gestor de actualizações: Sistema -> Administração -> Gestor de actualizações

Métodos Automatizados

Automatix2

  • Obtenha o pacote(Tenha em conta que a versão do pacote pode mudar, veja a última versão Aqui):
  • http://www.getautomatix.com/apt/dists/feisty/main/binary-i386/automatix2_1.1-3.6-7.04feisty_i386.deb
  • Instale com este comando:
sudo dpkg -i automatix2_1.1-3.6-7.04feisty_i386.deb
  • Automatix2 está disponível em Aplicações > Ferramentas de Sistema > Automatix
  • Guia de instalação Automatix2 com Screenshots

Aplicações Extra

Java & Non-Media Browser Plug-ins

Como instalar o J2SE Runtime Environment com plugin para Firefox

sudo aptitude install sun-java6-jre sun-java6-plugin
  • Quando perguntar, aceitar com a licença DLJ

Como instalar o Macromedia Flash Plugin para Firefox

Nota: A melhor forma de instalar o plugin do Macromedia flash para o Firefox é visitar Adobe.com: Versão de teste para Adobe Flash Player. Depois irá aparecer um aviso sobre um plugin em falta. Clique nesse aviso e siga os passos. O Firefox irá instalar o plugin automaticamente quando carregar "Instalar agora".

Também pode ser instalado usando o Gestor de Pacotes:

sudo aptitude install flashplugin-nonfree
  • Reiniciar Firefox

Nota: Se o som no Plugin não estiver activo (Por exemplo no Youtube)

sudo aptitude install alsa-oss
gksudo gedit /etc/firefox/firefoxrc

Trocar a linha:

FIREFOX_DSP=""

Para:

FIREFOX_DSP="aoss"
  • Reiniciar o Firefox. O som agora já deve Funcionar..

Como instalar P2P BitTorrent Client (Azureus)

sudo aptitude install azureus
  • Iniciar o programa em: Aplicações -> Internet -> Azureus

Como instalar o cliente de bittorrent (Deluge)

  • Forma recomendada:

Fazer o download dos ficheiros de instalação AQUI se a sua máquina for i386 ou AQUI se for amd64 e faça duplo clique sobre eles, depois do download efectuado.

  • OU

Fazer download das dependências, obter a última source, compilar a source e instalar

sudo aptitude install subversion build-essential python-all-dev python-all \
python-support libboost-dev libboost-thread-dev libboost-date-time-dev \
libboost-filesystem-dev libboost-serialization-dev \
libboost-program-options-dev libboost-regex-dev zlib1g-dev && \
svn checkout http://deluge-torrent.org/svn/trunk deluge && \
cd deluge && python setup.py build && sudo python setup.py install
  • Remover ficheiros de instalação
cd .. && rm -Rf deluge/
  • Faça download de plugins para o Deluge (Opcional)


  • Iniciar o programa em: Aplicações -> Internet -> Deluge BitTorrent Client

Como instalar a ferramenta de pesquisa do Corão (zekr)

Zekr é uma ferramenta open source que permite estudar o Corão. Está planeada para ser uma ferramenta open source, livre e universal, que proporcione uma base de estudo do Corão. A ideia é criar uma plataforma o mais generalizada possível, de modo a aceitar recursos de diferentes sítios.

Actualmente o Zekr tem os seguintes pacotes de língua: Inglês, Persa, Francês, Alemão, Árabe, Indonésio, Russo, Holandês, Curdo, Malaio, Turco e Urdu. Adicionalmente, inclui traduções do Corão em Inglês, Persa e Russo.

  • Verifique que o Sun JRE é o ambiente JRE default (o zekr também funciona com a nova versão do gij).
  • Nesta release, os problemas com os alfabetos Árabes resolve-se com a instalação da fonte Scheherazade e utilizá-la como a fonte default do programa. Se está a fazer upgrade de uma versão anterior, é só fazer:
mv ~/.zekr ~/zekr-backup
sudo dpkg --purge zekr
  • Fazer download e instalar zekr:
wget http://easynews.dl.sourceforge.net/sourceforge/zekr/zekr_0.5.0-1_i386.deb
sudo dpkg -i zekr_0.5.0-1_i386.deb
  • Para mais informações ver http://siahe.com/zekr/

FALTA ADICIONAR MAIS APLICAÇÕES

(...)

Outors ambientes de trabalho

Como instalar KDE

sudo aptitude install kubuntu-desktop
Nota: Esta instalação irá precisar de ~400MB de espaço no disco
  • Sistema -> Sair -> Log Out
  • Para fazer iniciar a sessão no KDE, clique em Sessões e escolha KDE

Como instalar XFCE

sudo aptitude install xubuntu-desktop
  • Sistema -> Sair -> Log Out
  • Para fazer iniciar a sessão no XFCE, clique em Sessões e escolha XFCE

Como instalar FluxBox

  • Fluxbox é um gestor de janelas (Window Manager) minimalista.
sudo aptitude install fluxbox
Começar o Fluxbox quando inicia a sessão pelo GDM
echo "exec startfluxbox" > ~/.xinitrc
Activar o som de login
sudo aptitude install sox
gedit ~/.fluxbox/startup
  • Procure esta linha:
exec /usr/local/bin/fluxbox
  • Adicione a linha seguinte, acima da linha acima mencionada
play /usr/share/sounds/login.wav > /dev/null 2>&1 &
  • Ouça o som ao iniciar a sessão.

Como Montar Partições do Windows

Como Montar Partições NTFS

Guia passo a passo como montar partições Windows no Feisty

Eye Candy

Como instalar Compiz (Nvidia)

  • Como permitir Compiz no Feisty Tutorial simples sobre como permitir compiz com drivers Nvidia

Como instalar o Beryl (Nvidia)


  • Confirmar que todos os pacotes estão actualizados:
sudo aptitude update
sudo aptitude dist-upgrade
  • Fazer um Backup do xorg.conf:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
gksudo gedit /etc/X11/xorg.conf
  • Instalar o Driver para a placa grafica Nvidia
    • Sistema -> Administração -> Gestor de Controladores restritos

Activar os Drivers Nvidia

Ctrl+Alt+Backspace ,para confirmar se os Drivers estão a funcionar correctamente.

  • Instalar Beryl
sudo aptitude install beryl emerald-themes beryl-manager
  • Iniciar Beryl
beryl-manager
  • Iniciar Emerald (Se ele não iniciar automaticamente)
emerald --replace
  • Colocar o Beryl e Emerald no inicio da Sessão
    • Sistema -> Preferências -> Sessões
    • Aplicações de Arranque -> Adicionar
beryl-manager

e

emerald --replace
    • Se, ao reiniciar, os menus dos programas não estiverem a ser mostrados de forma correcta (não consegue vê-los quando os selecciona porque estão a ser mostrados atrás da janela) então clique com o botão direito do rato no ícone 'Beryl Manager' que está no painel (o ícone da jóia vermelha) e seleccione 'Reload Window Manager'. O problema deve ficar resolvido na próxima vez que reiniciar.

Como melhorar a apresentação sub-pixel das fontes para Feisty

Isto irá melhorar a aparência das fontes, comparativamente à instalação base numa instalação Ubuntu. As bibliotecas alteradas são compiladas usando o Freetype 2.3.x (não disponível no Feisty) e incluiem os patches sub-pixel do David Turner

  • Para i386 adicione os repositórios seguintes a /etc/apt/sources.list
deb http://www.telemail.fi/mlind/ubuntu feisty fonts
deb-src http://www.telemail.fi/mlind/ubuntu feisty fonts
  • Para AMD64/EMT adicione os repositórios seguintes a /etc/apt/sources.list
deb http://raof.dyndns.org/falcon feisty experimental
deb-src http://raof.dyndns.org/falcon feisty experimental
  • Os pacotes que irão ser actualizados são libfreetype6, libcairo2 and libxft2
sudo aptitude update
  • Depois da instalação, poderá querer reconfigurar as definições das fontes. As seguintes definições funcionam bem: Native, Automatic, No bitmapped fonts.
sudo dpkg-reconfigure fontconfig-config
sudo dpkg-reconfigure fontconfig
  • Se tiver erros relativos à falta de uma gpg key
gpg --keyserver subkeys.pgp.net --recv-keys 937215FF
gpg --export --armor 937215FF | sudo apt-key add -
  • GPG key nos repositórios para os AMD64/EMT packages
wget http://ubuntu.moshen.de/2F306651.gpg -O- | sudo apt-key add -
  • Finalmente, pode reiniciar o computador or reiniciar o X (Ctrl-Alt-BackSpace) para ver se as alterações tiveram efeito.


Nota: Se decidir voltar aos packages de origem do Ubuntu, deve fazer downgrade a todos os tres packages instalados


source: http://ubuntuforums.org/showthread.php?t=343670

Aplicações Comerciais

Como instalar Windows 9X/ME/2000/XP (Win4Lin)

  • http://www.win4lin.com

Como instalar Aplicações Windows (VMWare Workstation)

  • Com o VMware pode-se criar uma máquina virtual, simulando um computador onde pode instalar o Windows e instalar as aplicações.
http://www.vmware.com
  • Converta vmwareworkstation_5.5.3-34868_i386.rpm para vmwareworkstation_5.5.3-34868_i386.deb usando o Allen e instale o .deb.
  • Depois de instalar a aplicação, vá ao destino da instalação e corra o ficheiro *.config para definir as opções.
  • Corra-o

Como instalar Aplicações Windows (CrossOver Office)

  • http://www.codeweavers.com

Como instalar Windows Games (Cedega)

  • http://www.transgaming.com

Alternativa

  • Uma alternativa gratuita e Software Livre é o Wine
  • http://www.winehq.org
  • http://www.guiaubuntupt.org/wiki/index.php?title=Wine

Administração de Utilizadores

Como definir/mudar/activar a password do utilizador root

sudo passwd root

Como desactivar a conta de root

sudo passwd -l root

Como autorizar o utilizador root a fazer login para o GNOME

Separador Segurança -> Segurança -> Permitir inicio de sessão local pelo administrador (Escolhido)

Como mudar para o utilizador root em modo Consola

sudo -s -H
Password: <especifique password do Utilizador>

Como adicionar/editar/apagar utilizadores do sistema

  • Ler #Notas Gerais
  • Sistema -> Administração -> Utilizadores e Grupos
  • Utilizadores e Grupos
Adicionar Utilizador.../Propriedades/Apagar
ou
sudo useradd joao
sudo userdel joao
  • Para mais informações ler
man usermod

Como adicionar/editar/apagar grupos de sistema

  • Ler #Notas Gerais
  • Sistema -> Administração -> Utilizadores e Grupos

Utilizadores e Grupos

Gerir Grupos ->  Adicionar Grupo.../Propriedades/Apagar

Como iniciar a sessão automaticamente no GNOME (Inseguro)

  • Ler #Notas Gerais
  • Sistema -> Administração -> Janela de Inicio de Sessão
Separador Segurança -> Activar Início de Sessão Automático (Escolhido)
Agora escolha um utilizador da lista.

Como permitir mais sudoers

EDITOR=gedit sudo visudo
  • Adicione a seguinte linha no final do ficheiro:
system_username	ALL=(ALL) ALL
  • Grave o ficheiro editado

OU desde que todos no grupo admin possam usar sudo:

sudo adduser a_username admin

This appends the admin group to the user's supplementary group list. They will now have sudo access.

Como usar o "sudo" sem pedir a password (Inseguro)

EDITOR=gedit sudo visudo
  • Encontre esta linha
...
system_username	ALL=(ALL) ALL
...
  • Substitua pela seguinte linha:
system_username	ALL=(ALL) NOPASSWD: ALL
  • Grave o ficheiro editado

Como terminar explicitamente uma sessão de “sudo”

sudo -K

Como alterar as permissões de ficheiros/pastas

Right click on files/folders -> Propriedades
Separador Permissões -> Leitura/Escrita/Executar (Confira as permissões para Dono/Grupo/Outros)

Como alterar o dono de ficheiros/pastas

sudo chown system_username /location_of_files_or_folders

Se quiser alterar recursivamente a posse do conteúdo de todos os ficheiros e pastas, use a opção -R igual a isto:

sudo chown -R system_username /location_of_files_or_folders

Como alterar o grupo dono de ficheiros/pastas

sudo chgrp system_groupname /location_of_files_or_folders

Se quiser alterar recursivamente a posse de grupo do conteúdo de todos os ficheiros e pastas, use a opção -R igual a isto:

sudo chgrp -R system_username /location_of_files_or_folders

Hardware

Ratos

Activar os botões laterais do rato no FireFox

Basta adicionar duas linhas ao xorg.conf para activar os botôes laterais do rato no fireFox. Deve funcionar com quase todos os ratos de 5 botôes. Eis uma lista de ratos que funcionaram com este método.

  • Logitech MX310
  • Logitech MX510
  • Logitech MX518
  • Logitech MX700
  • Intellimouse Explorer (first edition)
  • Razer Copperhead


Backup do ficheiro de configuração X.org

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak

Modificar o ficheiro de configuração X.org

gksudo gedit /etc/X11/xorg.conf

Encontre a secção "Input Device" do rato e adicione as duas linhas como mostrado em baixo. Pode também aumentar o número de botões se o seu rato tem mais que 7, para isso basta configurar o resto da secção de acordo com o número de botões. (recorde que back/forward, wheel click & tilt left/right contam todos como botões)

Mude de:

Section "InputDevice"
	Identifier "Configured Mouse"
	Driver "mouse"
	Option "CorePointer"
	...
	Option "Protocol" "ExplorerPS/2"
	...
	Option "Emulate3Buttons"       "true"
EndSection

para:

Section "InputDevice"
    Identifier     "Configured Mouse"
    Driver         "mouse"
    Option         "CorePointer"
    Option         "Device" "/dev/input/mice" 
    Option         "Protocol" "ExplorerPS/2"
    Option         "ZAxisMapping" "4 5"
    Option         "Emulate3Buttons" "true"
    Option         "Buttons" "7" 
    Option         "ButtonMapping" "1 2 3 6 7"
EndSection

Se preferir que o scroll do FireFox seja feito pela roda de scroll ao invés dos botões laterais faça "ZAxisMapping" "6 7" e "ButtonMapping" "1 2 3 4 5".

Neste momento pode reiniciar o computador ou apenas o X (Ctrl-ALt-Backspace) para ver se os botões forward/back ficaram a funcionar no FireFox. Os botões nao vão funcionar no Nautilus enquanto nao instalar o imwheel dameon.

Instalar e Configurar o IMWheel

  • Instalar o IMWheel
sudo apt-get install imwheel
  • Modificar o ficheiro de configuração do IMWheel
gksudo gedit /etc/X11/imwheel/imwheelrc
  • Insira o seguinte no final do ficheiro ja existente
".*"
None, Up, Alt_L|Left
None, Down, Alt_L|Right 
"(null)"
None, Up, Alt_L|Left
None, Down, Alt_L|Right


  • Criar um start-up script para o IMWheel
sudo mkdir /home/login
gksudo gedit /home/login/mouse
  • Inserir o seguinte no novo ficheiro
#!/bin/sh
exec xmodmap -e "pointer = 1 2 3 6 7 4 5" &
exec imwheel -k -b "67" &
exec $REALSTARTUP
  • Permitir a execução do ficheiro por todos os utilizadores
sudo chmod +x /home/login/mouse
  • Configurar o script para que este seja executado no start-up
    1. Select 'System' > 'Preferences' > 'Sessions'
    2. Click the StartUp tab
    3. Click Add, then input: /home/login/mouse
    4. Click OK, then Close
  • Reinicie o computador ou apenas o X (Ctrl-Alt-Sapce) e teste os botões forward/back no Nautilus

(Não sei porquê mas o método acima funcionou na perfeição com o Dapper mas não no Feisty, para funcionar no feisty tive que adicionar um espaço entre o 6 e 7 na linha exec imwheel -k -b "67" & espero que ajude)

Como configurar o Mighty Mouse da Apple

Apple Mighty Mouse works out of the box, this how to should cover setting up of horizontal scrolling using ball and sidebuttons.

This is placeholder only. Please, provide working howto.

Graphics Card

Como instalar Drivers de Video (NVIDIA)

sudo apt-get install nvidia-glx nvidia-kernel-common
sudo nvidia-xconfig
  • Se o método acima não activar o novo driver, pode fazê-lo manualmente abrindo o ficheiro de configuração do X:
sudo gedit /etc/X11/xorg.conf
  • e na secção "Device" trocar o "nv" para "nvidia"
  • Active o XvMC criando o ficheiro de configuração nVidia XvMC
sudo gedit /etc/X11/XvMCConfig
  • Insira a seguinte linha no novo ficheiro, para dizer aos jogadores o nome da biblioteca partilhada nVidia XvMC:
libXvMCNVIDIA_dynamic.so.1
  • Para acelerar a reprodução de vídeo através do XvMC use as seguintes linhas. Ver [[1]] para mais detalhes.
xine -V xxmc filename.ts
mplayer -vo xvmc -vc ffmpeg12mc filename.ts

Como instalar Drivers de Vídeo Beta (NVIDIA)

  • AVISO este método é muito dado a erros.. o melhor método é usar o programa do Alberto Milone, Envy; http://albertomilone.com/nvidia_scripts1.html
  • Obrigado Alberto Milone
  • Os drivers nVidia foram separados em dois ramos; latest e new legacy (novos e ultimos). Ver http://us.download.nvidia.com/XFree86/Linux-x86/1.0-9755/README/appendix-a.html para descobrir que driver deve usar. Latest=97xx / New legacy=96xx
sudo gedit /etc/apt/sources.list
  • Adicione UMA das seguintes linhas de acordo com a sua arquitectura
deb http://www.albertomilone.com/drivers/edgy/latest/32bit binary/
deb http://www.albertomilone.com/drivers/edgy/latest/64bit binary/
deb http://www.albertomilone.com/drivers/edgy/newlegacy/32bit binary/
deb http://www.albertomilone.com/drivers/edgy/newlegacy/64bit binary/
  • Guarde o ficheiro editado
  • Adicione a chave GPG
wget http://albertomilone.com/drivers/tseliot.asc
gpg --import tseliot.asc
gpg --export --armor albertomilone@alice.it | sudo apt-key add -
  • Actualize e Instale
sudo apt-get update
sudo apt-get install nvidia-glx
sudo apt-get upgrade
  • O upgrade deve actualizar os seus pacotes linux-restricted-modules e linux-restricted-modules-common.
sudo nvidia-xconfig
  • Adicione um menu de opções para as definições nVidia
sudo gedit /usr/share/applications/NVIDIA-Settings.desktop
  • Insira as seguintes linhas no novo ficheiro e guarde
[Desktop Entry]
Name=NVIDIA Settings
Comment=NVIDIA Settings
Exec=nvidia-settings
Icon=
Terminal=false
Type=Application
Categories=Application;System;
  • Reinicie o computador e os novos drivers devem estar instalados.
  • Teste a instalação com estes 2 programas:
glxinfo
glxgears

How to setup pivot (screen rotation) with default X.org NVIDIA drivers

  • Some LCD monitors are equipped with the pivot feature, to take advantage of it the display has to be rotated 90 degrees. The default nVidia drivers shipped with X.org ("nv") support software screen rotation. Note that it's unaccelerated and can be slow, read #How to install Graphics Driver (NVIDIA) if you decide to install the proprietary driver.
  • To rotate the screen find the "Device" section for the "nv" driver in the /etc/X11/xorg.conf file:
Section "Device"                                                                
       Identifier      "NVIDIA Corporation NV34 [GeForce FX 5200]"
       Driver          "nv"
  • Add the following options to this section:
       Option "Rotate" "CW"

Where the "Rotate" option has two possible values (depending on the orientation of the monitor):

  1. CW - rotate the display clockwise (right).
  2. CCW - rotate the display counterclockwise (right).

How to setup pivot (screen rotation) with proprietary NVIDIA drivers

  • Some LCD monitors are equipped with the pivot feature, to take advantage of it the display has to be rotated 90 degrees. The proprietary nVidia drivers support hardware rotation with the Xrandr extension.
  • To enable rotation support find the "Device" section for the "nvidia" driver in the /etc/X11/xorg.conf file:
Section "Device"                                                                
       Identifier      "NVIDIA Corporation NV34 [GeForce FX 5200]"
       Driver          "nvidia"
  • Add the following option to this section:
       Option          "RandRRotation" "on"
  • Then the display can be rotated (direction depends on the orientation of the monitor) by:
  1. Setting the "Rotation" property to either "Left" or "Right" in the "System > Preferences > Screen Resolution" dialog.
  2. Issuing either "xrandr -o left" or "xrandr -o right" command.

Como desligar o logo da NVIDIA ao ligar o GNOME

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
gksudo gedit /etc/X11/xorg.conf
  • Procurar
 ...
Section "Device"
	Identifier	"NVIDIA Corporation NV11 [GeForce2 MX/MX 400]"
	Driver		"nvidia"
	BusID		"PCI:1:0:0"
...
  • Adicionar a seguinte linha em baixo
   Option		"NoLogo"

Como instalar Drivers de Vídeo (ATI)

  • Ver Unofficial ATI Linux driver wiki
  • Ou Ubuntuforums.org
  • Ou PenLUG.org

Como Corrigir a Resolução do Ecran (Intel)

  • Os chipsets gráficos Intel 915g, 945g, etc. só têm um número muito limitado de resoluções instalado por defeito, mesmo que o driver correcto esteja em funções.
  • Instalar a ferramenta para a alteração da resolução:
sudo apt-get install 915resolution
  • Correr a seguinte linha num terminal para ver os modos disponiveis:
915resolution -l
  • Escolha uma resolução que não necessite e substitua, o exemplo seguinte muda de 1920x1440 para 1920x1200
915resolution 5c 1920 1200
  • Isto deve adicionar a opção para esta resolução á ferramenta "Sistema>Preferências>Resolução do Ecran".
  • Se funcionar correctamente pode fazer a mudança permanentemente:
sudo gedit /etc/rc.local
  • Simplesmente adicione o comando que acabou de escrever antes de:
exit 0

Como mostrar a temperatura de um GPU nvidia (nvidia-settings)

Num terminal, escreva

nvidia-settings

Detectar a temperatura do CPU, velocidade das ventoinhas e voltagens (lm-sensors)

sudo apt-get install lm-sensors

criar um ficheiro chamado mkdev.sh, com o seguinte conteúdo:

#!/bin/bash
# Here you can set several defaults.
# The number of devices to create (max: 256)
NUMBER=32
# The owner and group of the devices
OUSER=root
OGROUP=root
# The mode of the devices
MODE=600
# This script doesn't need to be run if devfs is used
if [ -r /proc/mounts ] ; then
if grep -q "/dev devfs" /proc/mounts ; then
echo "You do not need to run this script as your system uses devfs."
exit;
fi
fi
i=0;
while [ $i -lt $NUMBER ] ; do
echo /dev/i2c-$i
mknod -m $MODE /dev/i2c-$i c 89 $i || exit
chown "$OUSER:$OGROUP" /dev/i2c-$i || exit
i=$[$i + 1]
done
#end of file

Criar um executável apartir do ficheiro anterior e por a correr:

sudo chmod +x mkdev.sh
sudo ./mkdev.sh

Para detectar os sensores. Responda a todas as perguntas

sudo sensors-detect

para carregar os modulos manuais:

sudo /etc/init.d/module-init-tools

faça load dos modulos para o kernel:

sudo sensors -s

E veja o output

sudo sensors

Como controlar a velocidade das ventoinhas (fan's) (lm-sensors)

Instalar e configurar primeiro lm-sensors, ver na secção anterior. Depois executar pwmconfig para testar as ventoinhas (fans).

pwmconfig

Criar o seguinte ficheiro: /etc/init.d/fancontrol, com o seguinte conteúdo:

#!/bin/sh
#
# Fancontrol start script.
#
set -e
# Defaults
DAEMON=/usr/sbin/fancontrol
PIDFILE=/var/run/fancontrol-pid
PATH=/sbin:/bin:/usr/sbin:/usr/bin
test -f $DAEMON || exit 0
. /lib/lsb/init-functions
case "$1" in
       start)
               log_begin_msg "Starting fancontrol daemon..."
               start-stop-daemon --start -o -q -m -b -p $PIDFILE -x $DAEMON
               log_end_msg $?
               ;;
       stop)
               log_begin_msg "Stopping fancontrol daemon..."
               start-stop-daemon --stop -o -q -p $PIDFILE
               log_end_msg $?
               ;;
       force-reload|restart)
               sh $0 stop
               sh $0 start
               ;;
       *)
               log_success_msg "Usage: /etc/init.d/fancontrol {start|stop|restart|force-reload}"
               log_success_msg "  start - starts system-wide fancontrol service"
               log_success_msg "  stop  - stops system-wide fancontrol service"
               log_success_msg "  restart, force-reload - starts a new system-wide fancontrol service"
               exit 1
               ;;
esac
exit 0

Na consola:

Agora torne-o num executável:

sudo chmod +x /etc/init.d/fancontrol

Só para testar escreva

/etc/init.d/fancontrol start

e

/etc/init.d/fancontrol stop

Se tudo funcionar bem, então faça-o iniciar-se automaticamente no inicio de sessão. Em /etc/rc.local, antes do "exit 0" escreva a seguinte linha:

/etc/init.d/fancontrol start

Como controlar as temperaturas do CPU e da GPU, velocidades das ventoinhas e voltagens (GKrellM)

  • Instalar o hddtemp para controlar as temperaturas do disco rígido
sudo apt-get install hddtemp

GKrellM é um controlador de hardware que pode mostrar as temperaturas do CPU e da GPU, a velocidade das ventoinhas, voltagens, o load do CPU, o load da network, a actividade dos discos e a sua temperatura e o uso da memoria do swap. A instalação é muito facil e a configuração necessita apenas de alguns clicks. Pode definir alarmes para avisar o sobre-aquecimento do CPU, ou se há uma falha nalguma ventoinha. O hddtemp funciona com o GKrellM para permitir que este consiga saber as temperaturas do disco para os manter sempre frescos (p.e a menos de 40ºC) para que tenham um tempo de vida maior do que se correm constantemente a uma temperatura elevada (p.e., acima de 50ºC).

sudo apt-get install gkrellm

Para correr o programa

Click Applications -> System Tools -> GKrellM

Para o configurar,

Right click on GKrellM -> Configuration

Eu estive a tentar funcionar com o lm_sensors, mas ele não me detectava todos os sensores do computador. Mais tarde, econtrei o "GKrellM". Funciona prefeitamente com a minha nVidia 6600 GT. O GKrellM também possui plugins para mostrar informações metereologicas, definir lembretes, etc.

Adicionar um alerta sonoro (Opcional): Aqui esta uma maneira para conseguir por alertas sonoros quando o CPU esta muito quente ou quando uma venotinha falha. Primeiro, pé preciso gravar a mensagem audio (Eu usei o Audacity). Depois é ir a:

Configuration -> Builtins folder (Left side)-> Sensors -> Temperatures folder (Right side)-> CPU -> Alerts Button

Cole UMA das seguintes linhas numa janela do Terminal para testar o som. Se tiver duas placas de som, pode usar a opção "-ao oss:/dev/dsp1" para fazer com que o som seja desviado para a 2ª placa. Modifique o caminho do ficheiro e o nome para que aponte correctamente para o ficheiro. Se conseguir ouvir o som, então copie a linha de comando para a caixa de texto na janela dos Alertas do GKrellM.

mplayer /home/myfolder/alert_messages/heat_alert.mp3
mplayer -ao oss:/dev/dsp1 /home/myfolder/alert_messages/heat_alert.mp3

CPU

Como Activar as funções de poupança de energia/redução de frequência do seu CPU

Entre na BIOS da sua motherboard durante o boot e certifique-se de que tanto o ACPI como o Cool'n'Quiet (AMD) ou o SpeedStep (Intel) estão activos. Algumas BIOS não a opção. Se for esse o caso provavelmente está activo por defeito. Outras BIOS podem ter a opção mas está com outro nome. Leia o manual de instruções neste caso.

  • 2º Passo: Remover o software de redução de frequência Userspace

powernowd

sudo apt-get remove powernowd

cpudyn

sudo apt-get remove cpudyn
  • 3º Passo: Instalar o modulo do CPU

Identifique o seu CPU correndo o seguinte comando

cat /proc/cpuinfo

Pode também procurar num dos seguintes links Lista de CPUs AMD - [[2]] Lista de CPUs Intel - [[3]]

AMD Sempron/Athlon/MP ( K7 )

Socket Types: A, Slot A

sudo modprobe powernow-k7

AMD Duron/Sempron/Athlon/Opteron 64 ( K8 )

Socket Types: 754, 939, 940, S1 ( 638 ), AM2 ( 940 ), F ( 1207 )

sudo modprobe powernow-k8

Intel Core Duo

sudo modprobe speedstep-centrino

Intel Pentium M

sudo modprobe speedstep-centrino

Intel Pentium 4

sudo modprobe p4_clockmod

Others (Unknown)

Não estou 100% certo acerca de que CPUs suportam este modo. Se o seu CPU não funcionar com nenhum dos métodos acima tente este.

sudo modprobe acpi-cpufreq
  • 4º Passo: Modos de Redução de frequência
sudo modprobe cpufreq_conservative
sudo modprobe cpufreq_ondemand
sudo modprobe cpufreq_powersave
sudo modprobe cpufreq_stats
sudo modprobe cpufreq_userspace
  • 5º Passo: Teste/Configuração

Mostrar métodos disponiveis

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

Deve obter um resutado como este

powersave conservative ondemand performance
  • 6º Passo: Correr o modulo no start-up

Add the following lines to the end of /etc/modules

cpufreq_conservative
cpufreq_ondemand
cpufreq_powersave
cpufreq_stats
cpufreq_userspace

Adicione também o modulo que escolheu no 3º passo

  • 7º Passo: Instalar o cpufrequtils

This is a simple, effective tool for using the modules from the command line.

sudo apt-get install cpufrequtils

Test that it's working.

cpufreq-info
  • 8º Passo: Escolha um métodos

The different governors control how the CPU speed is scaled. Your choices are:

ondemand

A frequência do CPU é alterada consoante a utilização do mesmo.

conservative

O método "consrvative", muito como o "ondemand", aplica a a frequencia de que necessita num determinado momento. Difere no comportanmento já que este aumenta e reduz a velocidade do CPU em vez de alternar entre velocidade máxima e mínima. Este comportamento encaixa melhor num ambiente de poupança de energia.

performance

O CPU corre na sua máxima velocidade independentemente da utilização.

powersave

O CPU corre á mínima frequência independentemente da utilização.

Ver [[4]] para mais detalhes.

Eu uso "ondemand" geralmente, nunca falta velocidade e poupa-se muita energia (e produz muito menos calor quando em Idle).

Experimente:

cpufreq-set -g ondemand

Em sistemas com mais que um CPU tem que repetir o ultimo comando para todos os CPUs que tiver com o parametro -c (CPU). para activar o comando no segundo CPU escreva:

cpufreq-set -c 1 -g ondemand

Para ver quantos CPUs possui escreva:

ls /sys/devices/system/cpu/ 
  • 9º Passo: Configure o cpufrequtils para automaticamente utilizar o método que escolheu no start-up

Edite o ficheiro /etc/default/cpufrequtils. Mude a linha:

ENABLE="false"

para

ENABLE="true"

Mude o valor do GOVERNOR para o nome do método que escolheu no 8º passo.

Fontes: [[5]] [[6]]

Modems / Rede

Como identificar o chipset do Modem

wget -c http://easylinux.info/uploads/scanModem.gz
gunzip -c scanModem.gz > scanModem
chmod +x scanModem
sudo cp scanModem /usr/bin/
  • Para identificar o Chipset do Modem
sudo scanModem
gedit Modem/ModemData.txt

Como instalar Drivers Wireless Windows (Ndiswrapper)

  • Ler #Notas Gerais
  • Para instalar o ndiswrapper vai precisar de uma cópia das drivers do windows para o dispositivo ethernet Wireless.
  • Isto só tem significado em ser instalado se a placa não for suportada pelo Ubuntu, consulte a lista de placas wireless suportadas para Ubuntu.
  • Consulte a lista ndiswrapper de placas wireless suportadas se a sua placa não for suportada, visite lista oficial Ndiswrapper de placas suportadas
  • Verifique se tem o módulo acx carregado. Porque o módulo acx interfere com a driver do windows, é necessário remover caso seja encontrada.
lsmod | grep acx
  • Remover o módulo acx se for encontrado. Poderia também ser acx_pci ou similar. Nota: Novo update ao kernel irá auto carregar novamente o módulo acx. Por isso repita os seguintes dois comandos todas as vezes que o kernel for actualizado.
sudo rmmod acx
sudo nano /etc/modprobe.d/blacklist
  • Adicionar uma nova lista no fim do ficheiro tal como está:
# drivers wireless ACX
blacklist acx
  • Instalar o ndiswrapper e as drivers (devido a um erro no Edgy, vai ser necessário especificar ndiswrapper-utils-1.8)
sudo apt-get install ndiswrapper-utils-1.8
sudo ndiswrapper -i /location_of_your_wireless_driver/your_driver.inf
sudo ndiswrapper -l
sudo modprobe ndiswrapper
  • Introduzir ndiswrapper para carregar no arranque
sudo ndiswrapper -m
gksudo gedit /etc/modules
  • Adicione o seguinte módulo à lista
ndiswrapper
  • Agora pode configurar a placa wireless através do ifconfig e iwconfig.
Ex: Supondo que wlan0 é o dispositivo wireless.
sudo iwconfig wlan0 essid "AP" key ababababababababab mode Managed
iwconfig
  • Agora é capaz de ver o endereço MAC do access point e o sinal de acesso.

Ndiswrapper for Broadcom 43xx wireless chipset

  • The Broadcom 43xx (bcm43xx) wireless chipset is one of the most common chipsets, so special scripts have been written for it.
  • Only follow this if you have a bcm43xx device. To check in the Terminal type:
lspci | grep Broadcom\ Corporation

If it displays a line similar to this,

0000:02:02.0 Network controller: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 03)

you have a Broadcom wireless chipset. Please proceed with the instructions.

  • Put the Ubuntu CD that you installed Ubuntu with in the CD drive.
  • Download this to the desktop (the Firefox default, so if you haven't changed it, that's where it went/will go).
  • In a terminal type
cd ~/Desktop (or wherever you downloaded the file)
tar -xf bcm4318*.tar.gz
sudo ./ndiswrapper_setup_Feisty

Your wireless chipset should now work. Try rebooting if you have problems. Please see this thread if you have problems: http://ubuntuforums.org/showthread.php?t=197102&highlight=install+ndiswrapper

How to enable WPA with Ndiswrapper driver

  • First, make sure the Ndiswrapper driver works by itself without encryption.
  • Create a file called /etc/wpa_supplicant.conf, and paste in the following. Modify the ssid and psk values.
ctrl_interface=/var/run/wpa_supplicant
 network={
   ssid="YourWiFiSSID"
   psk="YourWiFiPassword"
   key_mgmt=WPA-PSK
   proto=WPA
   pairwise=TKIP
 }
  • Test it. Make sure your router is broadcasting its SSID.
sudo wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -dd
  • If your WPA works. Load it automatically when you reboot.
gksudo gedit /etc/network/interfaces
  • Change your wlan0 section to the following.

If you are using static IP:

auto wlan0
iface wlan0 inet static
address 192.168.1.20
netmask 255.255.255.0
gateway 192.168.1.1
pre-up wpa_supplicant -Bw -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant

or this, if you are using dhcp.

auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -Bw -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant


  • Reboot

Como instalar Driver Modem (SmartLink)

uname -r (must be 2.6.10-5-386)
wget -c http://easylinux.info/uploads/sl-modem-modules-2.6.10-5-386_2.9.9a-1ubuntu2+2.6.10-34_i386.deb
sudo dpkg -i sl-modem-modules-*.deb
sudo apt-get install sl-modem-daemon

Palm

Como configurar aparelhos PalmOS

gksudo gedit /etc/udev/rules.d/10-custom.rules
  • Insira a seguinte linha no novo ficheiro
BUS="usb", SYSFS{product}="Palm Handheld*", KERNEL="ttyUSB*", NAME{ignore_remove}="pilot", MODE="666"
  • Grave o ficheiro editado
  • Add the pilot-applet to the Taskbar by Right-Clicking on an empty spot
  • Siga as intruções que aparecem no ecrã

Hard Drive

Como listar a tabela de Partições

sudo fdisk -l
  • Também pode usar Sistema -> Administração -> Discos

Como mostrar a utilização do espaço de disco do sistema

df -Th
  • Também pode usar Sistema -> Administração -> Discos

Como listar os dispositivos/discos montados

mount

Como re-montar o /etc/fstab sem reiniciar

sudo mount -a

USB

Como listar dispositivos USB

lsusb

Workaround for random device disconnections

Random disconnection is a kernel bug that is not fixed yet. Some users report randomly disconnecting USB devices, especially external hard drives. One solution is to start the system with the option "irqpoll" in grub, but this doesn't work for everybody, and is believed to make the whole system slower. The other solution is to disable USB 2.0. This will result in way slower read/write, but the connection remains stable.

To disable USB 2.0, type this in the terminal:

sudo modprobe -r ehci_hcd

Test if the copy/write process is stable, and if you want to disable USB 2.0 upon boot, type:

sudo sh -c 'echo blacklist ehci_hcd > /etc/modprobe.d/blacklist-ehci'
sudo update-initramfs -u -k `uname -r`

Optical Drives

Como acelerar o CD/DVD-ROM

e.g. Assumindo que /dev/cdrom é a localização do CD/DVD-ROM
sudo hdparm -d1 /dev/cdrom
sudo cp /etc/hdparm.conf /etc/hdparm.conf_backup
gksudo gedit /etc/hdparm.conf
  • Adicione as linhas seguintes ao final do ficheiro
/dev/cdrom {
    dma = on
}
  • Grave o ficheiro editado

Como montar/desmontar CD/DVD-ROM manualmente, e mostrar todas os ficheiros/pastas escondidos

e.g. Assumindo que /media/cdrom0/ é a localização do CD/DVD-ROM
  • Para montar CD/DVD-ROM
sudo mount /media/cdrom0/ -o unhide
  • Para desmontar CD/DVD-ROM
sudo umount /media/cdrom0/

Como forçar o desmontar do CD/DVD-ROM manualmente

e.g. Assumindo que /media/cdrom0/ é a localização do CD/DVD-ROM
sudo umount /media/cdrom0/ -l

Monitores / Displays

Como activar Suporte Large Widescreen

  • Monitores widescreen 24/23" por vezes tem problemas a funcionar em 1920x1200.
  • Exemplos incluíndo: Dell 2405, HP 2335 ou Apple Cinema Display.
sudo gedit /etc/X11/xorg.conf
  • Adicione a seguinte linha para a secção "Monitor" apropriado
Modeline	"1920x1200" 154 1920 1968 2000 2080 1200 1203 1209 1235
  • Por exemplo o HP2335 deve agora ficar parecido:
Section "Monitor"
	Identifier	"hp L2335"
	Option		"DPMS"
	Modeline	"1920x1200" 154 1920 1968 2000 2080 1200 1203 1209 1235
EndSection

Como ligar o sinal CRT (monitor externo/projector) para portáteis (Intel)

Nota: Válido apenas para placas gráficas baseadas em chipsets Intel®

sudo apt-get install i810switch

Ligar o sinal CRT

i810switch crt on

Desligar o sinal CRT

i810switch crt off

Som

Como configurar colunas em surround (5.1 e outros) com o ALSA

  • Edite o ficheiro ~/.asoundrc, crie-o se não existir:
gedit ~/.asoundrc
  • Adicione a seguinte secção:
pcm.!default {
    type plug
    slave.pcm "surround51"
    slave.channels 6
    route_policy duplicate
}
  • Isto permitirá reproduzir som surround e duplicar o stereo por todos os 6 canais (não apenas os frontais).


Como modificar a placa de som por defeito

  • Ver placas de som disponiveis
sudo asoundconf list
  • Deve obter algo como isto
Names of available sound cards:
  Live
  V8237
  • Troque a placa de som, com "exemplo" sendo o nome da placa de som que escolheu
sudo asoundconf set-default-card exemplo

Misc

Como listar os periféricos PCI

lspci

How to install a Wacom tablet

For a detailed guide with screenshots about how to configure the "Extended input devices" in your graphic applications, please follow the official Dapper guide at https://wiki.ubuntu.com//Wacom

With the version of the Linux Wacom driver (0.7.2) in Ubuntu 6.06 Dapper Drake, if you unplug you tablet, it won't function when you plug it back in and you will have to restart X. For this reason, it is best to leave the tablet plugged in. This limitation will be removed when the 0.7.4 version of the driver is included in Ubuntu.

  • 1. Using Synaptic package manager, check if the packages xserver-xorg-input-wacom and wacom-tools are already installed - if not, install them. If you prefer using the command line, you can also execute :
     sudo apt-get install xserver-xorg-input-wacom wacom-tools
  • 2. Save a copy of your /etc/X11/xorg.conf :
      sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
  • then edit it with the command line :
      gksudo gedit /etc/X11/xorg.conf
  • and change all /dev/wacom occurences into /dev/input/wacom (created by wacom-tools udev scripts), then save the file.
  • You should be ready to go after you have restarted X. Remember to configure the "Extended input devices" in your graphic applications (Gimp, Inkscape), however you can already check if it's working by moving your stylus on the tablet : the mouse cursor should go through the whole screen.


CD/DVD Burning

Como apagar um CD-RW/DVD-RW

e.x. Assumindo que /dev/cdrom é a localização do CD/DVD-ROM
sudo umount /dev/cdrom
cdrecord dev=/dev/cdrom blank=fast

Como gravar ficheiros/pastas num CD/DVD

Locais -> Criador de CD/DVD 
  • Arraste ficheiros/pastas para a janela
Ficheiro -> Gravar no disco... -> Gravar

Como gravar ficheiros Imagem (ISO) num CD/DVD

Clique direito no ficheiro Imagem (ISO) -> Gravar no disco... -> Gravar

Como copiar um CD/DVD?

Como criar ficheiros Imagem (ISO) apartir dum CD/DVD

e.x. Assumindo que /dev/cdrom é a localização do CD/DVD-ROM
sudo umount /dev/cdrom
dd if=/dev/cdrom of=file.iso bs=1024

Como criar ficheiros Imagem (ISO) apartir de pastas

mkisofs -r -o ficheiro.iso /localização_da_pasta/

Como criar ficheiros de verificação de integridade MD5?

md5sum ficheiro.iso > ficheiro.iso.md5

Como verificar a integridade MD5 de ficheiros?

e.x. Assumindo que o ficheiro.iso e o ficheiro.iso.md5 estão na mesma pasta
md5sum -c ficheiro.iso.md5

Como montar/desmontar ficheiros de imagem (ISO) sem gravá-los?

sudo mkdir /media/iso
sudo modprobe loop
sudo mount ficheiro.iso /media/iso/ -t iso9660 -o loop
  • Para desmontar um ficheiro de imagem (ISO)
sudo umount /media/iso/

Como definir/alterar a velocidade de gravação de um gravador de CD/DVD?

  • Ler #Notas Gerais
  • Aplicações > Ferramentas de Sistema -> Editor de Configuração
  • Editor de Configuração
/ -> apps -> nautilus-cd-burner -> default_speed (set/change the burn speed)

Como activar o burnproof para o gravador de CD/DVD?

  • Ler #Notas Gerais
  • Aplicações > Ferramentas de Sistema -> Editor de Configuração
  • Editor de Configuração
/ -> apps -> nautilus-cd-burner -> burnproof (Checked)

Como activar o overburn para gravador de CD/DVD?

  • Ler #Notas Gerais
  • Aplicações > Ferramentas de Sistema -> Editor de Configuração
  • Editor de Configuração
/ -> apps -> nautilus-cd-burner -> overburn (Checked)


Networking

  • Tutorial Completo sobre Redes em Ubuntu- Ingles, Guia passo-a-passo sobre redes para utilizadores iniciantes e avançados.

Como configurar o Google Talk

  • Veja a resposta em Google Talk Help Center

Como activar/desactivar as ligações de rede

  • Ler #Notas Gerais
  • Sistema -> Administração -> Rede
  • Definições de Rede
Separador Ligações -> Escolher "Ligação com fios" -> Activar modo roaming

ou usando o Network Manager que está no systray.

Como configurar ligações a rede

  • Ler #Notas Gerais
  • Sistema -> Administração -> Rede
  • Definições de Rede
Separador Ligações -> Escolher "Ligação com fios" -> Propriedades
Desactivar modo roaming
Connection -> Enable this connection (Checked)
Definições de ligação -> Configuração: Escolher "DHCP/Static IP address"
Separador DNS -> Servidores DNS -> Adicionar/Apagar

Como configurar ligações Dialup

sudo pppconfig
  • Para ligar dialup

sudo pon provider_name

  • Para desconectar dialup

sudo poff

OU

  • Sistema -> Administração -> Rede
  • Definições de Rede
Separador Ligações -> Escolher "Ligação por modem" -> Propriedades

Como configurar ligações ADSL

sudo pppoeconf

Como mudar o nome do computador

  • Ler #Notas Gerais
  • Sistema -> Administração -> Rede
  • Definições de Rede
Separador Geral -> Definições de Máquina -> Nome da máquina (Hostname): Especificar nome do computador
  • Reiniciar o computador

Como mudar a descrição do computador

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Procure esta linha
...
  server string = %h server (Samba, Ubuntu)
...
  • Substitua pela linha seguinte
  server string = nova_descricao_computador
  • Grave o ficheiro editado
sudo testparm
sudo /etc/init.d/samba restart

Como mudar o domínio/grupo de trabalho (Domain/Workgroup) do computador

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo gedit /etc/samba/smb.conf
  • Procure esta linha
...
  workgroup = MSHOME
...
  • Substitua pela linha seguinte
  workgroup = novo_dominio_ou_grupo_de_trabalho
  • Grave o ficheiro editado
sudo testparm
sudo /etc/init.d/samba restart

Como designar o Hostname de uma máquina local com IP dinâmico, usando um serviço de DynDNS gratuito

sudo apt-get install ipcheck
gksudo gedit /etc/ppp/ip-up.d/dyndns_update
  • Insira as linhas seguintes no ficheiro novo, alterando "meuutilizador" and "minhapassword" pelo seu utilizador e password e myhostname pelo seu do registo dyndns.
 #!/bin/sh
 USERNAME=meuutilizador
 PASSWORD=minhapassword
 HOSTNAME=myhostname.dyndns.org
 cd /root/
 if [ -f /root/ipcheck.dat ]; then
  ipcheck -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME
 else
  ipcheck --makedat -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME
 fi
  • Grave o ficheiro editado
sudo chmod 700 /etc/ppp/ip-up.d/dyndns_update
sudo sh /etc/ppp/ip-up.d/dyndns_update

Como partilhar pastas de forma fácil

Right click on folder -> Share folder
Shared folder -> Share with: Select "SMB"
Share properties -> Name: Specify the share name

Como ver os computadores na rede

Exemplo: Assumindo que as ligações de rede foram bem configuradas
Se as pastas dos computadores ou de rede não forem encontradas, tente aceder directamente a elas
Ler #Como aceder a pastas de rede sem as montar
  • Locais -> Rede

Como aceder a pastas de rede sem as montar

Exemplo: Assumindo que as ligações de rede foram bem configuradas
IP do computador na rede: 192.168.0.1
Nome da pasta partilhada: linux
  • Pressione em 'Alt+F2' (Executar Aplicação...):
smb://192.168.0.1/linux

Como montar/desmontar manualmente pastas de rede, e permitir que todos os utilizadores as possam ler

Exemplo: Assumindo que as ligações de rede foram bem configuradas
IP do computador na rede: 192.168.0.1
Utilizador do computador na rede: myusername
Password do computador na rede: mypassword
Nome da pasta partilhada: linux
Local de montagem da pasta: /media/sharename
  • Para montar pasta de rede
sudo mkdir /media/sharename
sudo mount //192.168.0.1/linux /media/sharename/ -o username=myusername,password=mypassword
  • Para desmontar pasta de rede
sudo umount /media/sharename/

Como montar/desmontar manualmente pastas de rede, e permitir que todos os utilizadores as possam ler/escrever

Exemplo: Assumindo que as ligações de rede foram bem configuradas
IP do computador na rede: 192.168.0.1
Utilizador do computador na rede: myusername
Password do computador na rede: mypassword
Nome da pasta partilhada: linux
Local de montagem da pasta: /media/sharename
  • Para montar pasta de rede
sudo mkdir /media/sharename
sudo mount //192.168.0.1/linux /media/sharename/ -o username=myusername,password=mypassword,dmask=777,fmask=777
  • Para desmontar pasta de rede
sudo umount /media/sharename/

Como montar pastas de rede no arranque, e permitir que todos os utilizadores as possam ler

Exemplo: Assumindo que as ligações de rede foram bem configuradas
IP do computador na rede: 192.168.0.1
Utilizador do computador na rede: myusername
Password do computador na rede: mypassword
Nome da pasta partilhada: linux
Local de montagem da pasta: /media/sharename
sudo mkdir /media/sharename
gksudo gedit /root/.smbcredentials
  • Insira as linhas seguintes no ficheiro novo.
username=myusername
password=mypassword 
  • Guarde o ficheiro editado
sudo chmod 700 /root/.smbcredentials
sudo cp /etc/fstab /etc/fstab_backup
gksudo gedit /etc/fstab
  • Adicione a linha seguinte ao final do ficheiro
//192.168.0.1/linux    /media/sharename smbfs  credentials=/root/.smbcredentials    0    0

Como montar pastas de rede ao iniciar, e permitir que todos os utilizadores as possam ler/escrever

Exemplo: Assumindo que as ligações de rede foram bem configuradas
IP do computador na rede: 192.168.0.1
Utilizador do computador na rede: myusername
Password do computador na rede: mypassword
Nome da pasta partilhada: linux
Local de montagem da pasta: /media/sharename
sudo mkdir /media/sharename
gksudo gedit /root/.smbcredentials
  • Insira as linhas seguintes no ficheiro novo.
username=myusername
password=mypassword
  • Guarde o ficheiro editado
sudo chmod 700 /root/.smbcredentials
sudo cp /etc/fstab /etc/fstab_backup
gksudo gedit /etc/fstab
  • Adicione a linha segunte ao final do ficheiro
//192.168.0.1/linux    /media/sharename smbfs  credentials=/root/.smbcredentials,dmask=777,fmask=777  0    0

Como ter ipw2200 e wpa a funcionar

  • Funciona no Ubuntu Feisty de base.

Como ter ipw3945 e wep/wpa a funcionar

  • Instalar o pacote linux-restricted-modules para o seu kernel
sudo apt-get install linux-restricted-modules-$(uname -r)
Reinicie o seu sistema e já deverá ter Wireless.

Como configurar e iniciar PPTP tunnels (VPN)

  • Ler #Notas Gerais
  • Use estas instruções para instalar o Cliente PPTP automaticamente
OU
  • Instale manualmente
wget -c http://linux.edu.lv/uploads/content/pptp.tar.gz
tar zxvf pptp.tar.gz
cd ./pptp/
sudo sh ./pptp/install
cd ..
  • Para configurar o Cliente PPTP
gksudo gedit /usr/share/applications/pptpconfig.desktop
  • Substitua o conteúdo desse ficheiro com as seguintes linhas
[Desktop Entry]
Name=PPTP Client
Comment=Configure and start PPTP tunnels (VPN)
Categories=Application;Network
Encoding=UTF-8
Exec=gksudo pptpconfig
Icon=gnome-remote-desktop.png
StartupNotify=true
Terminal=false
Type=Application
  • As linhas acima mudam o ficheiro que vem por defeito de três maneiras: a aplicação é colocada na categoria Aplicações/Internet, gksudo vai fazer com que a aplicação seja executada como superuser e nós pomos um ícone bonito que aparece no menu.
  • Inicie o cliente com Aplicações > Internet -> PPTP Client
OU

Pode recorrer a um método diferente no caso de utilizar o NetworkManager

  • Configurar VPN com o Network Manager
sudo apt-get install network-manager-pptp

Tem que reiniciar após a instalação.

Para configurar uma VPN clique no ícone NetworkManager no tabuleiro VPN Connections->Configure VPN Use the defaults and be sure to check the box: Refuse EAP under the Authentication tab. To get my connection to work I also had to check Require MPPE Encryption under Compression & Encryption

  • A Nice tutorial here

How to Configure Ubuntu/Kubuntu with WPA using Network-Manager

>> This section should probably be removed? Network manager w/ WPA support is standard in Feisty?

Ubuntu Dapper in typical cases can configure WPA to work out of the box with minimal hassle. You'll need to install network-manager.


For Ubuntu:

sudo apt-get install network-manager-gnome

For Kubuntu (will install knetworkmanager):

sudo apt-get install network-manager-kde

Logout/Reboot.

Ubuntu users should now see the NetworkManager Applet in the Gnome notification area. Kubuntu users will probably have to run knetworkmanager before they see NetworkManager in the systray.

If instead, you get a "The NetworkManager applet could not find some required resources. It cannot continue." message, then:

sudo gtk-update-icon-cache -f /usr/share/icons/hicolor

Once Network-Manager is installed, click on the NM icon in the notification area (default is at the top right of Ubuntu/Gnome). Choose your network, then enter your passphrase. Type a password for the keyring, and you're set.

If you don't see your network, click "Create New Wireless Network...", type your essid/networkname, then choose "WPA Personal" for wireless security.

  • Note: If you installed Kubuntu then installed ubuntu-desktop & network-manager-gnome, you may not be able to use network-manager in Gnome, if at all. In this case, you may have to use WPA Supplicant and do some manual editing of conf files to get WPA up and running.
  • Note: When you first log into Gnome/KDE, the keyring application will ask for a password. Future revisions of Network-Manager should resolve this.

Como instalar uma chave GPG com Seahorse e Evolution

apt-get install seahorse
  • Aplicações > Acessórios > Palavras-chave e Chaves de Encriptação
  • Chave > Criar Nova Chave
  • Seleccione "Chave PGP", depois preencher toda a informação. Assegure-se que usou o seu endereço de correio electrónico real.
  • Espere que a chave termine de gerar.
  • Pode agora clicar com botão direito do rato na chave de entrada para exportar, sincronizar ou publicar a chave.
  • Evolution deve agora ter esperança de ver a chave transparente.

How to Setup BIND DNS Server

Reference: copied from http://ubuntuforums.org/showthread.php?t=236093

  • Install bind 9:
sudo apt-get install bind9
  • Configure the main Bind files. Usually, if you install Bind from the source code, you will have to edit the file named.conf. However, Ubuntu provides you with a pre-configured Bind, so we will edit another file:
sudo vi /etc/bind/named.conf.local

This is where we will insert our zones. By the way, a zone is a domain name that is referenced in the DNS server Insert this in the named.conf.local file:

# This is the zone definition. replace example.com with your domain name
zone "example.com" {
       type master;
       file "/etc/bind/zones/example.com.db";
};
# This is the zone definition for reverse DNS. replace 0.168.192 with your 
# network  address in reverse notation - e.g my network address is 192.168.0
zone "0.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";
};
  • Ok, now, let's edit the options file:
sudo vi /etc/bind/named.conf.options
  • We need to modify the forwarder. This is the DNS server to which your own DNS will forward the requests he cannot process.
forwarders {
      # Replace the address below with the address of your provider's DNS server
      123.123.123.123;
};
  • Now, let's add the zone definition files (replace example.com with your domain name:
sudo mkdir /etc/bind/zones
sudo vi /etc/bind/zones/example.com.db
  • The zone definition file is where we will put all the addresses / machine names that our DNS server will know. You can take the following example:
// replace example.com with your domain name. do not forget the . after the domain name!
// Also, replace ns1 with the name of your DNS server
example.com.      IN      SOA     ns1.example.com. admin.example.com. (
// Do not modify the following lines!
                                                        2006081401
                                                        28800
                                                        3600
                                                        604800
                                                        38400
 )
// Replace the following line as necessary:
// ns1 = DNS Server name
// mta = mail server name
// example.com = domain name
example.com.      IN      NS              ns1.example.com.
example.com.      IN      MX     10       mta.example.com.
// Replace the IP address with the right IP addresses.
www              IN      A       192.168.0.2
mta              IN      A       192.168.0.3
ns1              IN      A       192.168.0.1
  • Now, let's create the reverse DNS zone file:
sudo vi /etc/bind/zones/rev.0.168.192.in-addr.arpa
  • Copy and paste the following text, modify as needed:
//replace example.com with yoour domain name, ns1 with your DNS server name.
// The number before IN PTR example.com is the machine address of the DNS server. in my case, it's 1, as my IP address is 192.168.0.1.
@ IN SOA ns1.example.com. admin.example.com. (
                        2006081401;
                        28800; 
                        604800;
                        604800;
                        86400 
)
                     IN    NS     ns1.example.com.
1                    IN    PTR    example.com
  • Ok, now you just need to restart bind:
sudo /etc/init.d/bind9 restart
  • We can now test the new DNS server...
  • Modify the file resolv.conf with the following settings:
sudo vi /etc/resolv.conf
  • enter the following:
// replace example.com with your domain name, and 192.168.0.1 with the address of your new DNS server.
search example.com
nameserver 192.168.0.1
  • Now, test your DNS:
dig example.com

Remote Access

Remote Login via XDMCP

What is XDMCP?

GNOME windows can support several different users simultaniously. Unlike vncviewer that just duplicates the current screen on a remote system, XDMCP allows several different users to login and run different GNOME sessions at the same time. So if you have a fast computer runing Ubuntu, several users can use their slow machines to login and run heavy applications only available on the fast machine.

How to turn on the XDMCP feature

To turn on the XDMCP feature on the fast computer, click the menu

Sistema -> Administração -> Login Window 

In the Login Window Preferences dialog window, select

Remote Tab -> Style: Same as Local ->  Close the dialog window -> Restart the PC
How to login from another PC running Ubuntu
1. Reboot the slow PC and stop at the login screen
2. Click Options at the lower left corner of the login screen
3. Select "Remote Login via XDMCP"
4. On the dialog window, type in the host name or ip of the fast computer you want to login to


Remote Desktop Sharing/Duplication via VNC

How to configure remote desktop (not secure)
Warning! Remote Desktop will only work if there's a GNOME login session
Leaving computer with an unattended GNOME login session is not secure
Use (System -> Lock Screen) and switch off the monitor when computer is left unattended
  • Sistema -> Preferencias -> Remote Desktop
  • Remote Desktop Preferences
Sharing ->
Allow other users to view your desktop (Checked)
Allow other users to control your desktop (Checked)
Security ->
Ask you for confirmation (Un-Checked)
Require the user to enter this password: (Checked)
Password: Specify the password
How to connect into remote Ubuntu desktop
e.g. Assumed that remote Ubuntu machine have configured Remote Desktop
Read #How to configure remote desktop (not secure)
Remote Ubuntu machine: 192.168.0.1
vncviewer -fullscreen 192.168.0.1:0
  • To quit vncviewer
Press 'F8' -> Quit viewer
How to connect into remote Ubuntu desktop via Windows machine
e.g. Assumed that remote Ubuntu machine have configured Remote Desktop
Read #How to configure remote desktop (not secure)
Remote Ubuntu machine: 192.168.0.1
  • If you have a router remember to open the appropiate port. The default one is 5900
This process is called port forwarding port forwarding
  • Download DotNetVNC: Here or RealVNC Here
this is a free DotNet version that require the DotNet framework available from microsoft here
The RealVNC website was created and maintained by the original developers of VNC during their time at AT&T. RealVNC comes in Free, Personal, and Enterprise editions - the latter two costing money.
  • Open the VNC client you have chosen, and insert the connection string formatted like this <LINUX BOX IP><:DESKTOP NUMBER>|<::PORT>
In example use: 192.168.1.2:0 or 192.168.1.2::5900 to connect to desktop 0, to connect to desktop 1 use 192.168.1.2:1 or 192.168.1.2::5901 and so on
How to connect into remote Ubuntu desktop via OSX
e.g. Assumed that remote Ubuntu machine have configured Remote Desktop
Read #How to configure remote desktop (not secure)
Remote Ubuntu machine: 192.168.0.1
  • If you have a router remember to open the appropiate port the default one is 5900
This process is called port forwarding port forwarding
  • Download ChickenOfTheVNC: Here
  • Open ChickenOfTheVNC, and insert the host (IP address of remote machine), the display number (0 is default and is port 5900) and the password.
In example use: Host: 192.168.0.1, Display 0, Password: password


Windows

Como fazer o mount/unmount de partições Windows (NTFS) manualmente, permitindo apenas o modo de leitura

e.g. Assumindo que /dev/hda1 é a localização da partição do Windows (NTFS)
Pasta de montagem: /media/windows
  • Para montar a partição do Windows
sudo mkdir /media/windows
sudo mount /dev/hda1 /media/windows/ -t ntfs -o nls=utf8,umask=0222
  • Para desmontar a partição do Windows
sudo umount /media/windows/

Como fazer mount/unmount de partições Windows (FAT) manualmente, e permitir leitura/escrita a todos os utilizadores

e.g. Assumindo que /dev/hda1 é a localização da partição do Windows (FAT)
Pasta local para mount: /media/windows
  • Para fazer o mount da partição Windows
sudo mkdir /media/windows
sudo mount /dev/hda1 /media/windows/ -t vfat -o iocharset=utf8,umask=000
  • Para fazer o unmount da partição Windows
sudo umount /media/windows/

Como montar partições de Windows (NTFS) no arranque e permitir modo de leitura apenas

e.g. Assumindo que /dev/hda1 é onde está a sua partição do Windows (NTFS)
Local de montagem da pasta: /media/windows
sudo mkdir /media/windows
sudo cp /etc/fstab /etc/fstab_backup
gksudo gedit /etc/fstab
  • Adicionar ao final do ficheiro
/dev/hda1    /media/windows ntfs  nls=utf8,umask=0222 0    0

Como montar partições de Windows (FAT) no arranque, permitindo a leitura/escrita a todos os utilizadores

e.g. Assumed that /dev/hda1 is the location of Windows partition (FAT)
Local mount folder: /media/windows
sudo mkdir /media/windows
sudo cp /etc/fstab /etc/fstab_backup
gksudo gedit /etc/fstab
  • Append the following line at the end of file
/dev/hda1    /media/windows vfat  iocharset=utf8,umask=000  0    0

Como montar partições de Windows (NTFS) no arranque, permitindo a leitura/escrita a todos os utilizadores

  • Para poder escrever em NTFS é preciso instalar o Driver Ntfs-3G

Limitações: - Aceder a ficheiros encriptados - Escrever em sistemas comprimidos ( pode-se ler ) - Alterar permissoes e dono

Instalação via Consola:

sudo apt-get install ntfs-3g ntfs-config

Instalação Graficamente:

  • Aplicações -> Adicionar/Remover Programas -> Pesquisar por NTFS -> Instalar a Ferramenta de Configuração NTFS


Para activar:

  • Aplicações -> Ferramentas de Sistema -> Ferramenta de Configuração NTFS -> Activar suporte a escrita

Segurança

What are the basic things I need to know about securing my Ubuntu

  • Ler #Notas Gerais
  • Assegurar-se que o disco rígido é o primeiro na sequência de arranque na BIOS
    • Para impedir que os utilizadores maliciosos usem um CD de instalação de Linux que permiti-lhes-ia aceder à conta de utilizador root
    • Para impedir que os utilizadores maliciosos usem um CD Live de Linux (por ex: UBUNTU/KNOPPIX/MEPIS) que permiti-lhes-ia destruir/navegar/partilhar todo o disco rígido
    • Para impedir que os utilizadores maliciosos de instalar outro Sistema Operativo
  • Assegurar-se que a BIOS tem Password activada
    • Para impedir que os utilizadores maliciosos de modificar a sequência de arranque na BIOS
  • Assegurar-se que o computador está localizado num lugar seguro
    • Para impedir que os utilizadores maliciosos de remover o disco rígido do computador que permiti-lhes-ia destruir/navegar/partilhar todo o disco rígido num outro computador
    • Para impedir que os utilizadores maliciosos de remover a pilha da motherboard do computador que lhes permitiria limpar a password da BIOS
  • Assegurar-se que as passwords usadas no sistema não sejam facilmente adivinhadas
    • Para impedir que os utilizadores maliciosos de crackar o ficheiro de password utilizando ataques de força bruta (por ex: John the Ripper)
    • Criar uma password com o comprimento mínimo de 8 caracteres
    • Criar uma password com uma mistura de caracteres/numeros, e também maiúsculas/minúsculas
  • Ensure interactive editing control for GRUB menu is disabled
  • Ensure history listing is disabled in Console mode
  • Ensure Ctrl+Alt+Del is disabled in Console mode
    • To prevent trespassers from restarting the system without permission in Console mode
    • Ler [[#How to disable Ctrl+Alt+Del from restarting computer in Console mode]]
  • Ensure interactive option is set for remove, copy and move of files/folders in Console mode
  • For day to day usage, login as a normal user
  • Disable root user account, use "sudo" instead
    • To reduce the amount of time spent with root privileges, and thus the risk of inadvertently executing a command as root
    • "sudo" provides a more useful audit trail (/var/log/auth.log)
    • Ler #How to disable root user account
  • Install a Firewall
  • Perform vulnerability test

Como desactivar a edição interactiva do menu do GRUB?

  • Corra na consola o seguinte comando:
grub
grub> md5crypt
Password: ****** (ubuntu)
Encrypted: $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (password encriptada)
grub> quit
  • Faça uma cópia de segurança do ficheiro de configuração do grub
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
sudo gedit /boot/grub/menu.lst
  • Procure esta secção
...
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
#   password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
...
  • Adicione a seguinte linha por baixo, com password encriptada dadá anteriormente
password --md5 $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (password encriptada dadá anteriormente)
  • Procure a secção semelhante a esta - Anteção as parte "Recovery mode" e "Single"
...
title		Ubuntu, kernel 2.6.10-5-386 (recovery mode)
root		(hd0,1)
kernel		/boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro single
initrd		/boot/initrd.img-2.6.10-5-386
savedefault
boot
...
  • Adicione lock entre as linhas do title e root:
...
title		Ubuntu, kernel 2.6.10-5-386 (recovery mode)
lock
root		(hd0,1)
...
  • Guarde o ficheiro editado
  • Desta forma, para editar o Grub será necessário password, e os modos de recuperação só iram funcionar com a introdução da password.

Para aceder as opções do grub, siga as instruções no final do ecrá do grub.

Como desactivar o histórico no modo consola

rm -f .bash_history
gedit ~/.bash_profile
  • Adicione as linhas seguintes:
export HISTFILESIZE=4
unset HISTFILE=5
# Change this to a reasonable number of lines to save, I like to save only 100.
export HISTSIZE=100
# Ignores duplicate lines next to each other
export HISTCONTROL=ignoredups

This will disable Bash history for the user, retaining keystroke history and recall to use while limiting recall history to 100 lines. This will also not record duplicate lines next to each other.

Como impedir as teclas Ctrl+Alt+Del de reiniciarem o computador no modo Consola

sudo cp /etc/inittab /etc/inittab_backup
gksudo gedit /etc/inittab
  • Procure a seguinte linha
...
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
...
  • Substitua pela linha seguinte
#ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
  • Grave o ficheiro editado
sudo telinit q

Como activar a confirmação antes de remover/alterar ficheiros/pastas no modo Consola

sudo cp /etc/bash.bashrc /etc/bash.bashrc_backup
gksudo gedit /etc/bash.bashrc
  • Adicione as linhas seguintes ao final do ficheiro
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
  • Grave o ficheiro editado

How to setup a LoJack system for your laptop


What: Quote from Wikipedia: "LoJack is an aftermarket vehicle tracking system that allows cars to be tracked by police after being stolen. The manufacturer claims a 90% recovery rate. The name "LoJack" is a play on the word "hijack," meaning the theft of a vehicle through force."

Why: If your laptop is ever stolen and connected to the Internet. You will be able to find out from what IP it connects to the Internet from and contact the authorities.

How:

  • Get a free dynamic IP account from one of the many providers. Here we will use DynDNS.
sudo apt-get install ddclient 
  • Edit the configuration file /etc/ddclient.conf using you fevorite text editor (emacs, gedit, kedit or even vi)
sudo emacs /etc/ddclient.conf
  • Make it look like this:
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf
pid=/var/run/ddclient.pid
protocol=dyndns2
use=web
server=members.dyndns.org
login=YourNameHere
password='YourPasswordHere'
YourHostNameHere.gotmyip.com
NOTE:
* Make sure that you use the web IP detection method.
* Specify your own user id instead of the place holder YourNameHere.
* Specify your own password instead of the place holder YourPasswordHere, make sure to surround it with single quotes.
* The last line should specify the hostname you registered with the dynamic IP service.
  • You can now start the ddclient daemon, or wait until your next reboot.
sudo /etc/init.d/ddclient start
  • The hostname you registered with your dynamic IP service should be updated. You can test it with the ping command:
ping YourHostNameHere.gotmyip.com
Even if your laptop has a firewall that prevents pings the hostname should resolve to the IP of the network gateway that your laptop is connected to.
Now all that is left is for someone to steal your laptop.....

References:

  • http://ddclient.sourceforge.net/index.php

Boot Menu

How to gain root user access without login

  • Ler #Notas Gerais
  • Easiest method (will not work if GRUB menu password is set)
    • Boot-up computer
    • If GRUB menu is hidden, press 'Esc' to enter the GRUB menu
    • Select
Ubuntu, kernel 2.6.10-5-386 (recovery mode)

How to modify kernel boot-up arguments, to gain root user access

  • Ler #Notas Gerais
  • Boot-up computer
  • If GRUB menu is hidden, press 'Esc' to enter the GRUB menu
  • If GRUB password is set, press 'p' to unlock the GRUB menu
  • Select
Ubuntu, kernel 2.6.10-5-386
  • Press 'e' to edit the commands before booting
  • Select
kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro quiet splash
  • Press 'e' to edit the selected command in the boot sequence
  • Add "rw init=/bin/bash" to the end of the arguments
grub edit> kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro quiet splash rw init=/bin/bash
  • Press 'b' to boot

How to use Ubuntu Installation CD, to gain root user access

  • Ler #Notas Gerais
  • Boot-up computer into Ubuntu Installation CD
  • At "boot:" prompt, add "rescue" to the argument
boot: rescue
  • Follow the instructions on screen

How to change root user/main user password if forgotten

# passwd root
  • To change main user password
# passwd system_main_username

How to change GRUB menu password if forgotten

grub
grub> md5crypt
Password: ****** (ubuntu)
Encrypted: $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password)
grub> quit
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
gksudo gedit /boot/grub/menu.lst
  • Procure a seguinte linha
...
password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
...
  • Substitua pela linha seguinte
password --md5 $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password above)
  • Grave o ficheiro editado

How to restore GRUB menu after Windows installation

Super Grub Disk
  • Use Super Grub Disk
  • More info on how to use it here
Grub

If you have booted your linux distro with Super Grub Disk, or a live CD and want to restore your grub, follow the below instructions:

  • As root (or with sudo), type grub
  • When at the grub prompt, type find /boot/grub/stage2
  • This will return something like (hd0,2)
  • To setup the boot partition boot type root (hd0,2). This is the harddrive and the partition your linux is installed on...
  • And then to configure grub type setup (hd0)
  • Now you're done, so exit with quit

How to identify the name of the boot drive (hd0, hd1, hd2, etc)

Press "c" on boot menu. If you don't see a boot menu, press ESC key first when booting to show the boot menu.

Type:

root (hd0,0)

Most likely you will get "(hd0,0) ext2fs", which should be your current Linux drive. Now change hd0 to hd1 to see what is there.

root (hd1,0)

If you get "(hd1,0) filesystem type unknown, partition type 0x7", then hd1 is a Windows drive.

Now change hd1 to hd2, keep going until you reach hd7.

How to add Windows entry into GRUB menu

e.g. Assumed that /dev/hda1 is the location of Windows partition
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
gksudo gedit /boot/grub/menu.lst
  • Adicione as linhas seguintes ao final do ficheiro
title		Microsoft Windows
root		(hd0,0)
savedefault
makeactive
chainloader	+1
  • Grave o ficheiro editado


How to boot into Windows installed on a seperate SATA drive

This configuration applies to people who have Linux installed on a IDE drive, and Windows installed on a seperate SATA. The IDE drive boots first, so we need to add an entry to the boot menu on the Linux disk. Here we assume the name of your Windows drive is hd1. If you are not sure, click the link above to find out.

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
gksudo gedit /boot/grub/menu.lst
  • Adicione as linhas seguintes ao final do ficheiro.
title           Windows XP on SATA drive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader (hd1,0)+1
  • Grave o ficheiro editado

How to read Linux partitions (ext2, ext3) in Windows machine

ou
  • See www.fs-driver.org


Tips And Tricks

How to enable lame for FFMPEG (needed to encode FLV with sound)

KINO FLVs silent? You need to recompile FFMPEG with LAME enabled. FFMPEG can be installed via apt-get as a package, but is not able encode MP3, which is the audio stream in FLV video (like Google & YouTube).

  • Ler #Como adicionar repositórios extra
  • Ensure Ubuntu Universe repository is not preceded by # in /etc/apt/sources.list
  • Download and install lame liblame-dev and gcc packages (mp3 encoder + GNU compiler collection)
sudo apt-get build-dep ffmpeg
sudo apt-get install liblame-dev libfaad2-dev libfaac-dev libxvidcore4-dev liba52-0.7.4 \
liba52-0.7.4-dev libx264-dev checkinstall build-essential gcc
  • Download and extract FFMPEG source to current working directory
sudo apt-get source ffmpeg
  • Compile FFMPEG from source
cd ffmpeg-*
sudo ./configure --enable-gpl --enable-pp --enable-vorbis --enable-libogg \
--enable-a52 --enable-dts --enable-dc1394 --enable-libgsm --disable-debug \
--enable-mp3lame --enable-faad --enable-faac --enable-xvid --enable-pthreads \
--enable-x264
maybe try instead = 
sudo ./configure --enable-gpl --enable-pp --enable-libvorbis --enable-libogg \
--enable-liba52 --enable-libdts --enable-dc1394 --enable-libgsm --disable-debug \ 
--enable-libmp3lame --enable-libfaad --enable-libfaac --enable-xvid --enable-pthreads \
--enable-x264
sudo make
sudo checkinstall [accept defaults, set version to 3:0.cvs20060823-3.1ubuntu2]

If an application you are using employs FFMPEG to encode FLV, it should now work properly. You can also call FFMPEG directly from the command line. The extension/suffix of the outfile tells FFMPEG which audio or video format to encode to.

ffmpeg [-i infile] [outfile]

How to enable smooth fonts

gedit ~/.fonts.conf
  • Paste in this text:
<?xml version=”1.0” ?>
<!DOCTYPE fontconfig SYSTEM “fonts.dtd”>
<fontconfig>
<match target=”font”>
<edit name=”autohint” mode=”assign”>
<bool>true</bool>
</edit>
</match>
</fontconfig>
  • You’ll have to log out and back in to see the difference.

Como reiniciar o GNOME sem reiniciar o computador

  • Guarde e encerre todas as aplicações em execução
Pressione 'Ctrl + Alt + Backspace'
ou
sudo /etc/init.d/gdm restart
ou
Se estas dicas não tiverem ajudado, ler: #System requests (What to do if your system is unresponsive)

How to turn on Num Lock on GNOME startup

sudo aptitude install numlockx
sudo cp /etc/X11/gdm/Init/Default /etc/X11/gdm/Init/Default_backup
gksudo gedit /etc/X11/gdm/Init/Default
  • Procure a seguinte linha
...
exit 0
  • Add the following lines above it
if [ -x /usr/bin/numlockx ]; then
 /usr/bin/numlockx on
fi

How to remap the Caps Lock key as another Control key

gksudo gedit /etc/console-tools/remap

In the Console

  • Change
#s/keycode  58 = Caps_Lock/keycode  58 = Control/;

to

s/keycode  58 = Caps_Lock/keycode  58 = Control/;
  • Save your work
sudo /etc/init.d/console-screen.sh
  • Try using it

In X Windows

gksudo gedit ~/.Xmodmap
  • Add this:
keycode 66 = Control_L
clear Lock
add Control = Control_L
  • Now, apply the changes.
xmodmap ~/.Xmodmap
  • To apply them on startup
    • If ~/.xinitrc does not exist,
cp /etc/X11/xinit/xinitrc ~/.xinitrc
  • In all cases
gedit ~/.xinitrc
  • Make the first line this:
xmodmap ~/.Xmodmap
  • Restart X (Ctrl - Alt - Backspace)
  • Log In, a dialog should pop up, add .Xmodmap to the left side with the add button, and Save.

How to run programs on startup when login into GNOME

  • Sistema -> Preferencias -> Sessions
  • Sessions
Startup Programs Tab -> Add/Edit/Delete

How to speed-up your Ubuntu box

  • Read the following post: http://ubuntuforums.org/showthread.php?t=189192

How to switch to Console mode in GNOME

  • To switch to Console mode
Press 'Ctrl + Alt + F1' (F2 - F6)
  • To switch between consoles in Console mode
Press 'Alt + F1' (F2 - F6)
  • To switch back to GNOME mode
Press 'Alt + F7'

How to disable Ctrl+Alt+Backspace from restarting X in GNOME and KDE 3.5.x

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup
gksudo gedit /etc/X11/xorg.conf
  • Adicione as linhas seguintes ao final do ficheiro
Section "ServerFlags"
	Option		"DontZap"		"yes"
EndSection

Como fazer o Ctrl+Alt+Del abrir o System Monitor no GNOME

gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_9 "<Control><Alt>Delete"
gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_9 "gnome-system-monitor"

Como fazer refresh ao ambiente de trabalho do GNOME

killall nautilus

Como actualizar o painel do GNOME

killall gnome-panel


How to enable autosave in Gedit and disable creation of some_file~ files

  • Applications -> System Tools -> Configuration Editor
  • Configuration Editor
/ -> apps -> gedit-2 -> preferences -> editor -> save -> create_backup_copy (Unchecked)
/ -> apps -> gedit-2 -> preferences -> editor -> save -> auto_save (Checked)

How to show all hidden files/folders in Nautilus

  • Places -> Home Folder
  • To temporary show all hidden files/folders in Nautilus
Press 'Ctrl + H'
  • To permanently show all hidden files/folders in Nautilus
Edit Menu -> Preferences
Views Tab -> Default View -> Show hidden and backup files (Checked)

How to browse files/folders as root user in Nautilus

  • To install File Browser (Root)
gksudo gedit /usr/share/applications/Nautilus-root.desktop
    • Insert the following lines into the new file
[Desktop Entry]
Name=File Browser (Root)
Comment=Browse the filesystem with the file manager
Exec=gksudo "nautilus --browser %U"
Icon=file-manager
Terminal=false
Type=Application
Categories=Application;System;
  • To browse files/folders as root user in Nautilus
    • Applications -> System Tools -> File Browser (Root)

How to install a "View in Terminal" Menu for Nautilus

sudo aptitude install nautilus-open-terminal
  • Nautilus -> Right-click on folder or background -> Open in Terminal

How to change default file type "Open with" program

Right click on file -> Properties
Open With Tab -> Add
Select "Open with" program
Select "Open with" program (Checked)

Como alterar o cliente de e-mail predefinido para o Mozilla Thunderbird

Mail Reader Tab -> Default Mail Reader -> Command: mozilla-thunderbird %s

How to open files as root user via right click

gedit $HOME/.gnome2/nautilus-scripts/Open\ as\ root
  • Insert the following lines into the new file
for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
	gksudo "gnome-open $uri" &
done
  • Grave o ficheiro editado
chmod +x $HOME/.gnome2/nautilus-scripts/Open\ as\ root
Right click on file -> Scripts -> Open as root

How to disable beep sound in Terminal mode

Not for Dapper---- firingstone

  • Applications -> Accessories -> Terminal
  • Terminal
Edit Menu -> Current Profile...
General Tab -> General -> Terminal bell (Un-Checked)

How to handle mms protocol in Mozilla Firefox


  • Open your firefox.
  • Type as url: about:config

Now just right click somewhere into the main window. A little box with options to choose will appear. Choose "new", then "string". Then copy the following line into the appearing text field:

network.protocol-handler.app.mms

Into the next text field copy this:

/usr/bin/X11/vlc

Now you do the same thing again, but this time you do not choose "string" but "boolean", and the line to copy is:

network.protocol-handler.external.mms

Then set

true

How to handle rtsp (realmedia) protocol in Mozilla Firefox


  • Open your firefox.
  • Type as url: about:config

Now just right click somewhere into the main window. A little box with options to choose will appear. Choose "new", then "string". Then copy the following line into the appearing text field:

network.protocol-handler.app.rtsp

Into the next text field copy this:

/usr/bin/X11/realplay

Now you do the same thing again, but this time you do not choose "string" but "boolean", and the line to copy is:

network.protocol-handler.external.rtsp

Then set

true

How to load Web site faster in Mozilla Firefox

  • Speed Up Firefox Web Browser Tips
  • Applications -> Internet -> Firefox Web Browser
  • Mozilla Firefox
Address Bar -> about:config
Filter: ->
network.dns.disableIPv6 -> true
network.http.pipelining -> true
network.http.pipelining.maxrequests -> 8
network.http.proxy.pipelining -> true
  • Restart Mozilla Firefox

How to disable beep sound for link find function in Mozilla Firefox

  • Applications -> Internet -> Firefox Web Browser
  • Mozilla Firefox
Address Bar -> about:config
Filter: -> accessibility.typeaheadfind.enablesound -> false
  • Restart Mozilla Firefox

How to apt-get the easy way (Synaptic)

  • Step By Step Synaptic Package Manager Tutorials with Screenshots
  • Sistema -> Administração -> Synaptic Package Manager
  • To enable the extra Universe and Multiverse repositories
    1. Settings -> Repositories
    2. In the Installation Media tab, click Add. There are three separate repositories; Dapper Drake, Security Updates and Updates. Select each repository and check Officially supported, Restricted copyright, Community maintained (Universe) and Non-free (Multiverse). Ensure you click OK between each repository to save your changes
    3. You should now see those three repositories under Channels. Make sure Officially supported, Restricted copyright, Community maintained (Universe) and Non-free (Multiverse) appears under each repository
  • To add backports and PLF (new versions of many applications. Unsupported. May contain illegal packages. Use at own risk.)
    1. Settings -> Repositories
    2. Click on Add and then Custom
    3. Paste the following four lines into the box and click Add Repository, one line at a time:
deb http://archive.ubuntu.com/ubuntu feisty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu feisty-backports main restricted universe multiverse
deb http://medibuntu.sos-sts.com/repo/ feisty free
deb http://medibuntu.sos-sts.com/repo/ feisty non-free
deb-src http://medibuntu.sos-sts.com/repo/ feisty free
deb-src http://medibuntu.sos-sts.com/repo/ feisty non-free
  • To refresh the list of known packages (equivalent to apt-get update)
Edit Menu -> Reload Package Information
  • To install all possible upgrades (equivalent to aptitude upgrade)
Edit Menu -> Mark All Upgrades... -> Default Upgrade
Edit Menu -> Apply Marked Changes
  • To search for a package (equivalent to aptitude search package_name)
Edit Menu -> Search... Specify the package name
  • To install the selected package (equivalent to aptitude install package_name)
Select "package_name"
Package Menu -> Mark for Installation
Edit Menu -> Apply Marked Changes
  • To remove installed package (equivalent to aptitude remove package_name)
Select "package_name"
Package Menu -> Mark for Removal
Edit Menu -> Apply Marked Changes

What packages do the extra repositories provide

  • The PLF repository provides
    1. DVD playback support (libdvdcss2)
    2. Skype
    3. Sun Java SDK (Software Development Kit) and JRE (Java Runtime Environment)
    4. Opera Web browser
    5. RealPlayer 10
    6. Win32 binary multimedia codecs

Como instalar/desinstalar ficheiros .deb

  • Para instalar ficheiros .deb
sudo dpkg -i package_file.deb
  • Para desinstalar ficheiros .deb
sudo dpkg -r package_name

Como descobrir a versão instalada de determinado pacote

dpkg -l nome_do_pacote

Como converter de .rpm para .deb

sudo alien -d nome_do_pacote.rpm

How to compile .deb files from source

  • Ler #Como adicionar repositórios extra
  • There are various programs available to help automate the process of create .deb files from source. For more information, see the links at the end of this section. A basic well tested method is described here.
  • Install the necessary software to build the source (build-essential may be all that is necessary, though there may be other dependencies) and checkinstall (which creates deb files).
sudo aptitude install checkinstall build-essential
  • In the directory where you have extracted the source, after you have run ./configure and make you can create a .deb file and install it with either of the following commands. The second -D option creates a .deb file in the directory that you can share with others or install without needing the source.
sudo checkinstall

or

sudo checkinstall -D
  • For more info go to CheckInstall home page and the Installing software on Ubuntu page. Autodeb uses a modified version of AutoApt to complete the entire process above including extraction from the .tar.gz file, however it is still in an early stage of development.

How to rename all files in directory at once

  • To install "mvb" file name renamer
wget -c http://easylinux.info/uploads/mvb_1.6.tgz
sudo tar zxvf mvb_1.6.tgz -C /usr/share/
sudo chown -R root:root /usr/share/mvb_1.6/
sudo ln -fs /usr/share/mvb_1.6/mvb /usr/bin/mvb
  • To rename all files in directory at once
mvb NEW_NAME

How to manipulate all image files in directory at once

sudo aptitude install imagemagick
wget -c http://easylinux.info/uploads/bbips.0.3.2.sh
sudo cp bbips.0.3.2.sh /usr/bin/bbips
sudo chmod 755 /usr/bin/bbips
  • To manipulate all image files in directory at once
bbips

How to set System-wide Environment Variables

sudo cp -p /etc/profile /etc/profile_backup
gksudo gedit /etc/profile
  • Append the System-wide Environment Variables at the end of file
  • Grave o ficheiro editado

How to save "man" outputs into files

man command | col -b > file.txt

How to hide GRUB menu on boot-up

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
gksudo gedit /boot/grub/menu.lst
  • Procure a seguinte linha
...
#hiddenmenu
...
  • Substitua pela linha seguinte
hiddenmenu
  • Grave o ficheiro editado

How to change the timeout seconds for GRUB menu on boot-up

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
gksudo gedit /boot/grub/menu.lst
  • Procure a seguinte linha
...
timeout     3
...
  • Substitua pela linha seguinte
timeout     X_seconds
  • Grave o ficheiro editado

How to change default Operating System boot-up for GRUB menu

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
gksudo gedit /boot/grub/menu.lst
  • Procure a seguinte linha
...
default     0
...
  • Substitua pela linha seguinte
default     X_sequence
  • Grave o ficheiro editado

How to display Splash Image for GRUB menu on boot-up

e.g. Assumed that hd0,1 is the location of Ubuntu boot partition
wget -c http://easylinux.info/uploads/ubuntu.xpm.gz
chmod 644 ubuntu.xpm.gz
sudo mkdir /boot/grub/images
sudo cp ubuntu.xpm.gz /boot/grub/images/
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup
gksudo gedit /boot/grub/menu.lst
  • Procure esta secção
# menu.lst - See: grub(8), info grub, update-grub(8)
#      grub-install(8), grub-floppy(8),
#      grub-md5-crypt, /usr/share/doc/grub
#      and /usr/share/doc/grub-doc/.
...
  • Add the following line below it
splashimage (hd0,1)/boot/grub/images/ubuntu.xpm.gz
NOTE: If you have seperate boot partition use this line: splashimage (hd0,1)/grub/images/ubuntu.xpm.gz
  • Grave o ficheiro editado

How to convert Wallpaper to Splash Image for GRUB menu

e.g. Assumed that wallpaper.png is the Wallpaper to be converted to Splash Image
splashimage.xpm.gz is the Splash Image for GRUB menu
ImageMagick is installed
convert -resize 640x480 -colors 14 wallpaper.png splashimage.xpm && gzip splashimage.xpm

How to display only one kernel on GRUB menu

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup-`date +%F`
gksudo gedit /boot/grub/menu.lst
  • Procure a seguinte linha
...
# howmany=all
...
  • Substitua pela linha seguinte
# howmany=1

Where 1 means to keep the last kernel, 2 to keep the last 2 kernels, etc. Do not delete the # symbol. The menu will be updated once a new kernel will be updated by the system, not before.

  • Grave o ficheiro editado

How to force GDM to system beep when login screen ready

  • This is useful on computers where headphones are usually plugged in, allowing them to utilize the speakers for this attention-getting task.
echo foo >> ~/foo.wav
  • Sistema -> Administração -> Login Window -> Accessibility

Now make sure the "Login Screen Ready" check mark is checked. Click on the folder icon and navigate to your home folder and select "foo.wav".

rm foo.wav

The drop down menu should now say "(None)"

How to temporary skip boot-up services

Press 'Ctrl + C'

Clean up Ubuntu GNU/Linux System

  • Clean up Ubuntu GNU/Linux System - This is very Detailed step by step procedure how to Clean up Ubuntu GNU/Linux System with different tools.

How to permanently disable/enable boot-up services

How to clean /tmp/ folder contents on shutdown

sudo cp /etc/init.d/sysklogd /etc/init.d/sysklogd_backup
gksudo gedit /etc/init.d/sysklogd
  • Procure esta secção
...
 stop)
  log_begin_msg "Stopping system log daemon..."
  start-stop-daemon --stop --quiet --oknodo --exec $binpath --pidfile $pidfile
  log_end_msg $?
...
  • Add the following line below it
  rm -fr /tmp/* /tmp/.??*
  • Grave o ficheiro editado

How to scroll up and down to view previous outputs in Console mode

  • To scroll up to view previously outputs
Press 'Shift + Page Up'
  • To scroll down to view previously outputs
Press 'Shift + Page Down'

HComo saber a versão do Ubuntu que está a utilizar

cat /etc/issue

How to set up (automatic) background/wallpaper-changer application for GNOME

  • To install the script into a different location than your home directory, replace "~" with your path
cd ~
wget http://members.chello.at/horst.jens/files/wallpaperchanger.py
chmod +x wallpaperchanger.py
~/wallpaperchanger.py
gedit ~/.wallpaperchanger/wallpaperchangerconfig.py
  • Edit all the lines not beginning with an "#" according to your needs. Save the file and close gedit.
  • To create an menu entry for wallpaperchanger:
Click the menuitems: Applications -> Accessoires -> Alacarte Menu Editor -> File -> New Entry:
Name: wallpaperchanger
command: ~/wallpaperchanger.py
  • To change desktop background every time you reboot your computer:
Click the menuitems: Sistema -> Preferencias -> Session -> Startup Programs -> Add:
~/wallpaperchanger.py

How to set up automatic background change (KDE)

  • Go to K-menu -> System Settings -> Desktop -> Background
  • Choose Slide Show
  • Press Setup...
  • Press Add... to add pictures you wish to see as desktop background
  • Set 'Change picture after' to desired picture rotation interval.
  • Press 'OK'

How to add keyboard layouts for other languages

  • Go to Sistema -> Preferencias -> Keyboard
  • Choose Layouts
  • Press Add... to add the secondary keyboard layout. It is simpler to have two layouts; the maximum is currently four for Xorg.
  • Choose Layout Options
  • Expand option Group Shift/Lock behaviour
  • Choose the key combination that enables you to switch between keyboard layouts. The default is by pressing both Alt keys at the same time. A common alternative is to use Alt+Shift.
  • Press Close.

See #How to add the Keyboard (Layout) Indicator applet to add the Keyboard Indicator applet.

How to add keyboard layouts toggle for other languages (Xfce)

  • use *.lst files on /etc/X11/xkb/rules to select 2nd_laguage_code
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,2nd_laguage_code
  • you can add it to a startup file, which will be set to be executed on startup, with the following lines (remember to 'chmod +x' the file):
#!/bin/tcsh
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,il

How to add the Keyboard (Layout) Indicator applet

  • Right-click on empty space on the top panel so that you see the pop-up menu.
  • Click Add to Panel...
  • Choose Keyboard Indicator (it is under the Utilities section, at the end)

The Keyboard Indicator applet appears on the panel. The default language should be USA for U.S. English. You can either right-click on this applet for more options or see above on how to configure.

How to type extended characters

  • Add the keyboard layout US English International (with dead keys)
  • Make US English International (with dead keys) the default keyboard layout.

The key marked ['"] is now a dead key. When you press it, nothing happens. However if you press a consonant immediately afterwards, the consonant appears with an accent.

  • ' + a = á
  • ' + e = é
  • and so on for i-í, o-ó, y-ý, c-ć, z-ź, n-ń, l-ĺ, u-ú, r-ŕ
  • " + a = ä
  • " + e = ë
  • and so on for y-ÿ, u-ü, i-ï, o-ö

Similarly, ` and a consonant generates à, è, ù, ì, ò. Similarly, ~ and a consonant generates ã, ũ, ĩ, õ, ñ.

To type ' and ", press RightAlt+' and RightAlt+" respectively. To type ' and ", you may also press '+<space> and "+<space> respectively.

There are more characters available by keeping RightAlt pressed and typing a character. Therefore,

  • RightAlt+q = ä
  • RightAlt+w = å
  • RightAlt+e = é
  • RightAlt+r = ®
  • RightAlt+t = þ
  • RightAlt+y = ü
  • RightAlt+u = ú
  • RightAlt+i = í
  • RightAlt+o = ó
  • RightAlt+p = ö
  • RightAlt+[ and ] for « and » respectively.
  • RightAlt+a = á
  • RightAlt+s = ß
  • RightAlt+d = ð
  • RightAlt+l = ø
  • RightAlt+; = ¶
  • RightAlt+: = °
  • RightAlt+z = æ
  • RightAlt+c = ©
  • RightAlt+n = ñ
  • RightAlt+m = µ
  • RightAlt+, = ç
  • RightAlt+/ = ¿
  • RightAlt+1 = ¡
  • RightAlt+2 = ²
  • RightAlt+3 = ³
  • RightAlt+4 = ¤
  • RightAlt+5 = €
  • RightAlt+6 = ¼
  • RightAlt+7 = ½
  • RightAlt+8 = ¾
  • RightAlt+9 = ‘
  • RightAlt+0 = ’
  • RightAlt+- = ¥
  • RightAlt+= = ×
  • RightAlt+! = ¹
  • RightAlt+@, then o = ő (and Ő).
  • RightAlt+#, then a = ā (and Ā). Similarly for ēĒ, ūŪ, īĪ, ōŌ.
  • RightAlt+$ = £
  • RightAlt+% =
  • RightAlt+^ =
  • RightAlt+& =
  • RightAlt+*, then a = ą (and Ą). Similarly for ęĘ, įĮ.
  • RightAlt+(, then a = ă (and Ă)
  • RightAlt+(, then g = ğ (and Ğ)
  • RightAlt+), then a = å (and Å)
  • RightAlt+_ =
  • RightAlt++ = ÷

How to set the Compose key to type special characters

  • Click System, Preferences, Keyboard.
  • Under Layout Options, expand on Compose key position.
  • Choose Right-Win key is compose, click Close.

Now you can type extended characters using the RightWin key (next to AltGr), according to this keyboard settings file. Specifically, the lines that start with GDK_Multi_key are those that we can use here. The Compose key is actually GDK_Multi_key.

Some examples,

  • RightWin + C + = produces €
  • RightWin + = + C produces €
  • RightWin + C + O produces ©
  • RightWin + O + C produces ©
  • RightWin + a + ' produces á
  • RightWin + a + " produces ä
  • RightWin + a + ` produces à
  • RightWin + a + ~ produces ã
  • RightWin + a + * produces å
  • RightWin + a + ^ produces â
  • RightWin + a + > produces â
  • RightWin + a + , produces ą
  • RightWin + e + - produces ē
  • RightWin + S + 1 produces ¹
  • RightWin + S + 2 produces ²
  • RightWin + S + 3 produces ³

How to install ubuntu-title font used in Ubuntu logo

sudo aptitude install ttf-ubuntu-title

Now you can use this font in your favorite applications

How to associate Adobe Reader with files in Nautilus

Now when you double-click on a .pdf file, it will be opened with Adobe Reader.

How to print from Adobe Reader

/usr/bin/lp -d FS-1010

How to pull apart and combine pdf files

sudo aptitude install pdftk
cd
mkdir bin
cd bin
gedit pdftk_burst
  • add the following text to pdftk_burst:
#!/bin/bash
cd ${1%/*}
/usr/bin/pdftk "$1" burst
rm doc_data.txt
  • save and close pdftk_burst
gedit pdftk_cat
  • add the following text to pdftk_cat:
#!/bin/bash
cd ${1%/*}
outfile="00out.pdf"
if [ -f $outfile ] ; then
    rm -f $outfile
fi
/usr/bin/pdftk *.pdf cat output $outfile
  • save and close pdftk_cat
chmod u+x pdftk_burst pdftk_cat
  • open Nautilus (Places -> Desktop) and browse to a .pdf file
  • right-click the .pdf file, select Properties, go to the Open With tab, click Add, click Use a Custom Command, click Browse, browse to pdftk_burst. Do the same with pdftk_cat.

Now, when you right-click on a .pdf file, you'll get two extra options:

  • Open With -> pdftk_burst which will convert a 30 page pdf file to 30 x 1 page pdf files
  • Open With -> pdftk_cat which will join together all the pdf files in the same directory, and create a file called 00out.pdf

Note: this won't work with pdfs with any type of protection - read man pdftk for more command line options.

How to remove jedit when Synaptic package manager fails after install

sudo dpkg --remove --force-depends --force-remove-reinstreq jedit

Now, you can use your Synaptic package manager again.

How to compile a kernel the Ubuntu Way

http://www.howtoforge.com/kernel_compilation_ubuntu

System requests (What to do if your system is unresponsive)

You can "talk" to the kernel directly via system requests: Press "ALT" + "sysreq-key" + "one of the keys" listed below (The sysreq-key is also known as the 'print screen' key):

(Taken from /usr/src/linux/Documentation/sysrq.txt)

  • 'r' - Turns off keyboard raw mode and sets it to XLATE.
  • 'k' - Secure Access Key (SAK) Kills all programs on the current virtual console.
  • 'b' - Will immediately reboot the system without syncing or unmounting your disks.
  • 'c' - Will perform a kexec reboot in order to take a crashdump.
  • 'o' - Will shut your system off (if configured and supported).
  • 's' - Will attempt to sync all mounted filesystems.
  • 'u' - Will attempt to remount all mounted filesystems read-only.
  • 'p' - Will dump the current registers and flags to your console.
  • 't' - Will dump a list of current tasks and their information to your console.
  • 'm' - Will dump current memory info to your console.
  • 'v' - Dumps Voyager SMP processor info to your console.
  • '0'-'9' - Sets the console log level, controlling which kernel messages will be printed to your console. ('0', for example would make it so that only emergency messages like PANICs or OOPSes would make it to your console.)
  • 'f' - Will call oom_kill to kill a memory hog process
  • 'e' - Send a SIGTERM to all processes, except for init.
  • 'i' - Send a SIGKILL to all processes, except for init.
  • 'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system will be non-functional after this.)
  • 'h' - Will display help ( actually any other key than those listed above will display help. but 'h' is easy to remember :-)

Note that you may have to enable system requests. Read "/usr/src/linux/Documentation/sysrq.txt" for details. By default it is enabled though.

How to add locales to Ubuntu the command line way

  • Open up a terminal
  • Generate a /var/lib/locales/supported.d/local from /usr/share/i18n/SUPPORTED:
cat /usr/share/i18n/SUPPORTED | grep "en\|ru" > /var/lib/locales/supported.d/local

This example shows all Russian (ru) and English (en) locales being chosen. Look through /usr/share/i18n/SUPPORTED to find the ones for you, then put them in a list, replacing en\|ru and separating each language with a \| (backslash, bar). If you only want one language, just put it in quotes.

  • Then regenerate all of the locales:
dpkg-reconfigure locales
  • Then set your locale:
update-locale LANG=en_US.UTF-8

In this step, make sure to choose the language and country that you would like your computer to think it is in. Here, I choose en_US, the United States version of English. Once again, look at your /var/lib/locales/supported.d/local or /usr/share/i18n/SUPPORTED for the one right for you. You may also want to research locales, using the Internet.

That was easy, now the command
lxterm
will open up the Unicode version of xterm or your translated software will display things properly, like vim.

How to set default Terminal App window size

The size for a gnome terminal session can be passed through the geometry parameter, specifying columns and rows like 80x40. The default geometry is 80x25.

  • First way is to add the following parameter to gnome-terminal launcher:
--geometry 100x40
  • Other way is to change this parameter globaly for all gnome-terminal launcher's. Go to /usr/share/applications/gnome-terminal.desktop and edit the EXEC line like this:
Exec=gnome-terminal --geometry=120x30

Using VI editor

A few very simple tricks of using basic but strong unix editor called vi can be found here.

How to play DVD's

  • Install the codecs:
sudo aptitude install libdvdnav4 libdvdplay0 libdvdread3 libdvdcss2
  • Use totem-xine instead of the default "totem-gstreamer":
sudo aptitude remove --purge totem totem-gstreamer
sudo aptitude install totem-xine

How to install Gmail Notifier alternative (CheckGmail)

  • Add the following sources to the repository list:
deb http://asher256-repository.tuxfamily.org dapper main dupdate french
deb http://asher256-repository.tuxfamily.org ubuntu main dupdate french
  • Install the application
sudo aptitude install checkgmail
  • Go to 'System/Preferences/Sessions/Startup Programs' and add the following path to start notifier automatically
Image:Sessions.png
Sessions windows


Image:Add startup program.png
Add startup program window


/usr/bin/checkgmail

After this the program will appear in your notification area.

How to emulate Mac OS X Spotlight (Deskbar)

  • Right click to your panel and select 'Add to panel...'. Now choose 'Deskbar' applet and click 'Add' button.
  • Install 'Beagle' packet to enable data indexing on your computer

How to make Ubuntu look like Mac OS X

  • Detailed instruction can be found here.

How to remove temporary files on shutdown

  • Backup sysklogd file
sudo cp /etc/init.d/sysklogd /etc/init.d/sysklogd_backup
  • Edit sysklogd file
gksudo gedit /etc/init.d/sysklogd
  • After the following lines...
stop)
log_begin_msg "Stopping system log daemon..."
start-stop-daemon --stop --quiet --oknodo --exec $binpath --pidfile $pidfile
log_end_msg $?
  • Add this line:
rm -fr /tmp/* /tmp/.??*

How to tile windows in gnome

First, download the wmtile debian package here.

If you are not running i386, the project's homepage is here.

  • Double click the package and install it.
  • Login as root and browse to /usr/share/tile/
  • Open the rc file in gedit
  • Change the second option to read "multi-desktop netwm"
  • Save the rc file

Now, create a launcher:

  • Right-click on the gnome panel (the taskbar at the top of the screen) and choose "Add to Panel"
  • Select "Custom Application Launcher" and fill in these values:
    • Type: Application
    • Name: Tile Windows Vertically
    • Command: tile -v -w
  • You can also select an icon to use with the launcher.
  • Click "OK"

Now open a couple windows and click your new launcher button to test it. This works great with two or three windows, but it can get a bit strange with more.

If you want to create another launcher that tiles windows horizontally, just follow the same directions, but use the command "tile -h -w"


Servidores

Ubuntu Feisty LAMP Servidor

  • Ubuntu Feisty LAMP Servidor Installation with Screenshots Simple Step by Step Installation Guide
  • Ubuntu Edgy LAMP Servidor Installation with Screenshots Simple Step by Step Installation Guide for Ubuntu Users

Servidor AntiVirus

Como instalar o Servidor ClamAV AntiVirus

sudo apt-get install clamav

Como definir a procura por vírus automaticamente em ficheiros/ pastas

por exemplo: Procurar por vírus diariamente à meia noite
* * * * * significam minutos horas dia mês ano
 export EDITOR=gedit &&  sudo crontab -e
  • Adicione a linha seguinte no final no ficheiro
00 00 * * *  sudo clamscan -r /localizacao_dos_ficheiros_pastas
  • Grave o ficheiro editado

Monitorizar Servidor

Se o pretendido é monitorizar o seu Clientes e Servidores Ubuntu quanto à quantidade de memória usada, nível processamento, Load average, espaço de disco ocupado, Mysql, internet, processos activos, siga o link

[http://www.debianadmin.com/monitor-servers-and-clients-using-munin-in-ubuntu.html Monitorizar Clientes e Servidores usando Munin ]

Servidor Impressão (cupsd)

Como instalar cupsd

Cupsd deverá ser automaticamente instalado durante a instalação normal. Confira se o ficheiro se encontra em "/etc/init.d/cupsys". Se pretender instalar manualmente, pode fazê-lo com os seguintes comandos
 sudo apt-get install cupsys*

Como adicionar uma impressora

  • Aceda a Sistema -> Administração -> Impressoras
  • Escolha "Add printer".
  • "Add printer wizard" deverá começar e instrui-lo nos próximos passos.

Como imprimir numa máquina Ubuntu remota a partir de outra máquina Ubuntu

  • Confirma que a impressora local está bem configurada.
  • Habilitar a partilha da impressora local - Sistema -> Administração -> Impressoras -> Global Settings menu -> Share printers
  • Servidor IP: 192.168.0.1
  • Cliente IP: 192.168.0.23
    • Configuração Servidor
 sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.backup
 gksudo gedit /etc/cups/cupsd.conf
find the block
<Location />
  ...
  Allow localhost
  ...
</Location>
E acrescente a seguinte linha.
 Allow 192.168.0.23
Reinicie o cups.
 sudo /etc/init.d/cupsys restart
    • Configuração Cliente
 sudo cp /etc/cups/client.conf /etc/cups/client.conf.backup
 gksudo gedit /etc/cups/client.conf
E acrescente a seguinte linha.
 ServidorName 192.168.0.1
Reinicie o cups.
 sudo /etc/init.d/cupsys restart
Agora digite "lpq" e deverá surgir algo como
 vitek@lightfox:~$ lpq
 HPLJ6P is ready
 no entries

Como imprimir numa máquina Ubuntu remota a partir de uma máquina Windows


1.19.4.5

How to set up 4 port printer server

Setting up COMPUSA print server on Ubuntu

(1) Ir a System, Administration, Printing.

(2) Agora Add a printer

(3) Network Printer e escolher HP JetDirect

(4) Onde diz Host escreva o IP Address da Impressora servidor. Pode encontra-la com Smb4k

(5) Onde diz Port escreva 9100 para USB port 1. 9101 para USB port 2. 9102 para USB port 3. e 9103 para USB port 4.

(6) De seguida clique forward e instale a sua impressora

NFS Servidor

Instalar Servidor NFS

sudo apt-get install nfs-kernel-server nfs-common portmap

Configurar Portmap to not bind to loopback interface:

sudo dpkg-reconfigure portmap 
sudo /etc/init.d/portmap restart

Definir quais pastas a partilhar (export):

sudo vi /etc/exports

Adicionar definições de partilha (export):

This will export path to all IP addresses between 192.168.1.1 and 192.168.1.255 with Read/Write access:

/path/to/shared/files 192.168.1.1/24(rw,no_root_squash,async)

This will export path to all IP addresses between 192.168.1.1 and 192.168.1.255 with Read Only access:

/path/to/shared/files 192.168.1.1/24(ro,async)

When finished, save changes and restart the NFS Servidor:

sudo /etc/init.d/nfs-kernel-server restart

Export your new configuration:

sudo exportfs -a

Installing NFS Client

sudo apt-get install portmap nfs-common
Mounting Manually
cd ~
mkdir temp
sudo mount 192.168.1.1:/path/to/shared/files temp

You may need to restart NFS services:

sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-common restart
Mounting Automatically

Create mountpoint:

sudo mkdir /mnt/files

Edit configuration:

sudo vi /etc/fstab

Add something similar to below:

192.168.1.1:/path/to/shared/files /mnt/files nfs rsize=8192,wsize=8192,timeo=14,intr

Test new configuration:

sudo mount /mnt/files

Reboot to test automatic mounting.

Servidor Samba

Como instalar o servidor Samba para o serviço de partilha de ficheiros/pastas

sudo apt-get install samba smbfs

Como adicionar/editar/apagar utilizadores na rede

sudo smbpasswd -a system_username
gksudo gedit /etc/samba/smbusers
    • Insira a seguinte linha no novo ficheiro
system_username = "network username"
    • Grave o ficheiro editado
  • para editar um utilizador da rede
sudo smbpasswd -a system_username
  • Para apagar um utilizador da rede
sudo smbpasswd -x system_username

Como partilhar pastas em /home com permissão read only (apenas leitura)(Autenticação=Sim)

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Procure a seguinte linha
...
;  security = user
...
  • Substitua pela linha seguintes
  security = user
  username map = /etc/samba/smbusers
  • Descomente as seguintes linhas:
;[homes]
;comment = Home Directories
;browseable = no
;valid users = %S
;writable = yes
sudo testparm
sudo /etc/init.d/samba restart

Como partilhar pasta em /home com permissão de read/write (ler e escrever)(Autenticação=Sim)

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Procure a seguinte linha
...
;  security = user
...
  • Substitua pela linha seguintes
  security = user
  username map = /etc/samba/smbusers
  • Procure esta secção
...
# By default, the home directories are exported read-only. Change next
# parameter to 'yes' if you want to be able to write to them.
  writable = no
...
  • Substitua pela linha seguintes
# By default, the home directories are exported read-only. Change next
# parameter to 'yes' if you want to be able to write to them.
  writable = yes
sudo testparm
sudo /etc/init.d/samba restart

How to share group folders with read only permission (Authentication=Yes)

sudo mkdir /home/group
sudo chmod 777 /home/group/
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Procure a seguinte linha
...
;  security = user
...
  • Substitua pela linha seguintes
 security = user
 username map = /etc/samba/smbusers
  • Adicione as linhas seguintes ao final do ficheiro
[Group]
  comment = Group Folder
  path = /home/group
  public = yes
  writable = no
  valid users = system_username1 system_username2
  create mask = 0700
  directory mask = 0700
  force user = nobody
  force group = nogroup
sudo testparm
sudo /etc/init.d/samba restart

How to share group folders with read/write permissions (Authentication=Yes)


sudo mkdir /home/group
sudo chmod 777 /home/group/
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Procure a seguinte linha
...
;  security = user
...
  • Substitua pela linha seguintes
  security = user
  username map = /etc/samba/smbusers
  • Adicione as linhas seguintes ao final do ficheiro
[Group]
  comment = Group Folder
  path = /home/group
  public = yes
  writable = yes
  valid users = system_username1 system_username2
  create mask = 0700
  directory mask = 0700
  force user = nobody
  force group = nogroup
sudo testparm
sudo /etc/init.d/samba restart

How to share public folders with read only permission (Authentication=Yes)


sudo mkdir /home/public
sudo chmod 777 /home/public/
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Procure a seguinte linha
...
;  security = user
...
  • Substitua pela linha seguintes
  security = user 
  username map = /etc/samba/smbusers
  • Adicione as linhas seguintes ao final do ficheiro
[public]
  comment = Public Folder
  path = /home/public
  public = yes
  writable = no
  create mask = 0777
  directory mask = 0777
  force user = nobody
  force group = nogroup
sudo testparm
sudo /etc/init.d/samba restart

How to share public folders with read/write permissions (Authentication=Yes)

sudo mkdir /home/public
sudo chmod 777 /home/public/
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Procure a seguinte linha
...
;  security = user
...
  • Substitua pela linha seguintes
  security = user
  username map = /etc/samba/smbusers
  • Adicione as linhas seguintes ao final do ficheiro
[public]
  comment = Public Folder
  path = /home/public
  public = yes
  writable = yes
  create mask = 0777
  directory mask = 0777
  force user = nobody 
  force group = nogroup
sudo testparm
sudo /etc/init.d/samba restart

How to share public folders with read only permission (Authentication=No)

sudo mkdir /home/public
sudo chmod 777 /home/public/
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Procure a seguinte linha
...
;  security = user
...
  • Substitua pela linha seguinte
  security = share
  • Adicione as linhas seguintes ao final do ficheiro
[public]
  comment = Public Folder
  path = /home/public
  public = yes
  writable = no
  create mask = 0777
  directory mask = 0777
  force user = nobody
  force group = nogroup
  • Grave o ficheiro editado
sudo testparm
sudo /etc/init.d/samba restart

How to share public folders with read/write permissions (Authentication=No)

sudo mkdir /home/public
sudo chmod 777 /home/public/
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Procure a seguinte linha
...
;  security = user
...
  • Substitua pela linha seguinte
  security = share
  • Adicione as linhas seguintes ao final do ficheiro
[public]
  comment = Public Folder
  path = /home/public
  public = yes
  writable = yes
  create mask = 0777
  directory mask = 0777
  force user = nobody
  force group = nogroup
  • Grave o ficheiro editado
sudo testparm
sudo /etc/init.d/samba restart

Como imprimir numa máquina remota Ubuntu via samba

 sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup
 gedit /etc/samba/smb.conf
Procure as seguintes linhas
 ...
 # printing = cups
 # printcap name = cups
 ...
e descomente-as.
 printing = cups
 printcap name = cups
Reinicie o Servidor Cups
 sudo /etc/init.d/cupsys restart
Agora impressoras configuradas na máquina Ubuntu deveram estar acessíveis via samba..

Samba Web Administration Tool (SWAT)

Como instalar INETD Superserver

 sudo apt-get install netkit-inetd

Como instalar SWAT for Samba daemon

 sudo apt-get install swat
  • Open inetd daemon configuration
 sudo gksu gedit /etc/inetd.conf
  • If string is:
 <#off#> swat            stream  tcp     nowait.400      root    /usr/sbin/tcpd  /usr/sbin/swat
  • Change to (due to know BUG which resets peer connection):
 swat            stream  tcp     nowait.400      root    /usr/sbin/swat  swat
  • Restart daemon
 sudo /etc/init.d/inetd restart


  • http://localhost:901/

Servidor SSH

Como instalar o servidor SSH para serviço de administração remoto

sudo apt-get install ssh

Como ligar via SSH para uma máquina remota Ubuntu

e.g. Exemplo: Assumindo que a máquina Ubuntu remota tem o serviço servidor SSH instalado
Ler #Como instalar o servidor SSH para serviço de administração remoto
Máquina Ubuntu Remota: 192.168.0.1
ssh username@192.168.0.1

Como copiar ficheiros/pastas de uma máquina remota Ubuntu para a máquina local (scp)

Exemplo: Assumindo que a máquina Ubuntu remota tem o serviço Servidor SSH instalado
Ler #Como instalar o servidor SSH para serviço de administração remoto
Máquina Ubuntu Remota: 192.168.0.1
Localização remota de ficheiros/pastas: /home/username/remotefile.txt
Localização para guardar local: . (directório actual)
scp -r username@192.168.0.1:/home/username/remotefile.txt .

How to copy files/folders from local machine into remote Ubuntu machine (scp)

Exemplo: Assumindo que a máquina Ubuntu remota tem o serviço Servidor SSH instalado
Ler #Como instalar o servidor SSH para serviço de administração remoto
Localização remota de ficheiros/pastas: localfile.txt
Máquina Ubuntu Remota: 192.168.0.1
Destino na máquina Ubuntu Remota: /home/username/
scp -r localfile.txt username@192.168.0.1:/home/username/

Como copiar ficheiros/pastas de uma máquina remota Ubuntu para a máquina local (rsync)

Exemplo: Assumindo que a máquina Ubuntu remota tem o serviço Servidor SSH instalado
Ler #Como instalar o servidor SSH para serviço de administração remoto
Máquina Ubuntu Remota: 192.168.0.1
Localização remota de ficheiros/pastas: /home/username/remotefile.txt
Localização para guardar local: . (directório actual)
rsync -v -u -a --delete --rsh=ssh --stats username@192.168.0.1:/home/username/remotefile.txt .

Como copiar ficheiros/pastas da máquina local para uma máquina remota Ubuntu (rsync)

Exemplo: Assumindo que a máquina Ubuntu remota tem o serviço Servidor SSH instalado
Ler #Como instalar o servidor SSH para serviço de administração remoto
Localização dos ficheiros/pastas locais: localfile.txt
Máquina Ubuntu Remota: 192.168.0.1
Destino na máquina Ubuntu Remota: /home/username/
rsync -v -u -a --delete --rsh=ssh --stats localfile.txt username@192.168.0.1:/home/username/

How to mount remote folders into local Ubuntu machine (sshfs)

Ex: Assumindo que a máquina remota tem instalado o serviço Servidor SSH instalado
Read #Como instalar o servidor SSH para serviço de administração remoto
Remote machine: 192.168.0.1
Remote machine folder location: /media/music
  • Instalar o sshfs
sudo apt-get install sshfs
  • Carregar o driver do kernel para sshfs
sudo modprobe fuse
  • Adicionar o seu utilizador ao Grupo 'fuse'
sudo adduser your_user_name fuse
  • Logout e login para fazer efeito.
  • fix group on /dev/fuse
 sudo chgrp fuse /dev/fuse
  • Criar ponto de montagem local na directoria home
mkdir ~/remote_music
  • Mounta a pasta remota em ~/musica_remota
sshfs 192.168.0.1:/media/musica ~/musica_remota

Como ligar-se por SSH à uma máquina remota Ubuntu via uma máquina Windows

Ex: Assumindo que a máquina remota tem instalado o serviço Servidor SSH instalado
Read #Como instalar o servidor SSH para serviço de administração remoto
  • Faça Download do PuTTY: AQUI


How to copy files/folders from/into remote Ubuntu machine via Windows machine

e.g. Assumed that remote Ubuntu machine have installed SSH Servidor service
Read #Como instalar SSH Servidor for remote administration service
  • Download FileZilla: Here

How to limit the user accounts that can connect through ssh remotely

e.g. If you enable the SSH server, then any user with a valid account can connect remotely
This can lead to security risks, as there exist remote password cracking tools that
try common username/password pairs.
  • Keep a backup of the ssh server configuration file with

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIGINAL

  • Edit the configuration file

gksudo gedit /etc/ssh/sshd_config

  • Change the parameter PermitRootLogin from yes to no. The superuser must not be able to connect directly from remote.
  • Add the parameter AllowUsers and specify the usernames (space separated) that can connect remotely.

NOTE: This will allow ONLY the users specified to connect. You may use wildcards here (example: j* will allow jsmith to connect but not fsmith)

  • You can also use DenyUsers for fine-grained selection of users.
  • If you enable the openssh server and you have no intention for now to enable remote connections, you may add AllowUsers nosuchuserhere to disable anyone connecting.

Using SSH to Port Forward

e.g. Assumed that remote machine has installed SSH Servidor service
Read #Como instalar SSH Servidor for remote administration service

If is possible to create secure SSH tunnels between multiple sites. Imagine two sites (home and office). If you have an SSH server available in the office available via the Internet, you can tunnel across to this server and communicate with any local PC in the office from home.

  • Example: Make Port 80 (Web Servidor) on 10.0.2.10 in the office available locally on Port 81

From home:

ssh -L 81:10.0.2.10:80 user@office.net

Once logged in, you can now browse to http://localhost:81 which is really a secure tunnel to the web server in your office. You can setup multiple port forwardings.

ssh -L 81:10.0.2.10:80 -L 82:10.0.2.20:80 -L 83:10.0.2.30:80 user@office.net

Now, port 81 locally forwards to port 80 on 10.0.2.10, port 82 forwards to port 80 on 10.0.2.20 and port 83 forwards to port 80 on 10.0.2.30

For example, http://localhost:81 connects you to port 80 on 10.0.2.10 (computer at remote location)

Specify port with -p?? if SSH Servidor on office.net does not run on default port 22.

Explanation:

ssh -L <local port>:<remote computer>:<remote port> <user>@<remote ip>

Protecting SSH from brute force atack

It is possible to easily protect SSH from a password brute force attack with a pam_abl module. You can install it by the two ways:

  • Manually according to pam_abl documentation and manually apply patch for a bug №405041 onto openssh-server
  • Automatically by the repository from tolero.org

To install from a repository:

  • Add a repository for your distribution listed on the ssh brute force protection page

And execute the following commands:

sudo aptitude update
sudo aptitude upgrade
sudo aptitude install libpam-abl
sudo /etc/init.d/ssh restart

First command is to fetch the repository listing. Second is to upgrade the openssh-server package to patched version (openssh-client will be also updated). Third is to set up a protection plugin. And the fourth is to restart a server with a new security plugin.

Servidor DHCP

Como instalar um Servidor DHCP para atribuição automática de endereços IP

e.g. Assumed that "eth0" is the interface for network card
IP Address Range: 192.168.0.100 to 192.168.0.200
Subnet Mask: 255.255.255.0
DNS Servidors: 202.188.0.133, 202.188.1.5
Domains: tm.net.my
Gateway Address: 192.168.0.1
sudo apt-get install dhcp3-server
sudo cp /etc/default/dhcp3-server /etc/default/dhcp3-server_backup
gksudo gedit /etc/default/dhcp3-server
  • Procure a seguinte linha
...
INTERFACES=""
  • Substitua pela linha seguinte
INTERFACES="eth0"
  • Grave o ficheiro editado
sudo cp /etc/dhcp3/dhcpd.conf /etc/dhcp3/dhcpd.conf_backup
gksudo gedit /etc/dhcp3/dhcpd.conf
  • Procure esta secção
...
# option definitions common to all supported networks...
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 600;
max-lease-time 7200;
...
  • Substitua pela seguintes linhas
# option definitions common to all supported networks...
#option domain-name "example.org";
#option domain-name-servers ns1.example.org, ns2.example.org;
#default-lease-time 600;
#max-lease-time 7200;
  • Procure esta secção
...
# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}
...
  • Substitua pelas seguintes linhas
# A slightly different configuration for an internal subnet.
subnet 192.168.0.0 netmask 255.255.255.0 {
 range 192.168.0.100 192.168.0.200;
 option domain-name-servers 202.188.0.133, 202.188.1.5;
 option domain-name "tm.net.my";
 option routers 192.168.0.1;
 option broadcast-address 192.168.0.255;
 default-lease-time 600;
 max-lease-time 7200;
}
  • Grave o ficheiro editado
sudo /etc/init.d/dhcp3-server restart

Backup Ubuntu System

If you want to backup your ubuntu system try one of the following backup tools

Sbackup

  • Backup Using Sbackup - Backup and Restore Ubuntu System Using Sbackup

Dar and Kdar

  • Backup Using Dar and Kdar - Backup and Restore Ubuntu System Using Dar and Kdar

Servidor de Base de Dados

Como instalar o Servidor de Base de Dados MYSQL

sudo apt-get install mysql-server
  • MySQL initially only allows connections from the localhost (127.0.0.1). We'll need to remove that restriction if you wish to make it accessible to everyone on the internet. Open the file /etc/mysql/my.cnf
gksudo gedit /etc/mysql/my.cnf
  • Find the line bind-address = 127.0.0.1 and comment it out
...
#bind-address           = 127.0.0.1
...
  • MySQL comes with no root password as default. This is a huge security risk. You'll need to set one. So that the local computer gets root access as well, you'll need to set a password for that too. The local-machine-name is the name of the computer you're working on. For more information see here
mysqladmin -u root password your-new-password
mysqladmin -h root@local-machine-name -u root -p password your-new-password
sudo /etc/init.d/mysql restart

MySQL Database backup using AutoMySQLBackup

  • AutoMySQLBackup is a script to take daily, weekly and monthly backups of your MySQL databases using mysqldump.
  • AutoMySQLBackup Script Features
    • Backup mutiple MySQL databases with one script. (Now able to backup ALL databases on a server easily. no longer need to specify each database seperately)
    • Backup all databases to a single backup file or to a seperate directory and file for each database.
    • Automatically compress the backup files to save disk space using either gzip or bzip2 compression.
    • Can backup remote MySQL servers to a central server.
    • Runs automatically using cron or can be run manually.
    • Can e-mail the backup log to any specified e-mail address instead of “root”. (Great for hosted websites and databases).
    • Can email the compressed database backup files to the specified email address.
    • Can specify maximun size backup to email.
    • Can be set to run PRE and POST backup commands.
    • Choose which day of the week to run weekly backups.
  • Download from here
  • AutoMySQLBackup Requirements

The AutoMySQLBackup script only requires mysqldump (A standard utility provided with the mysql client) and gzip or bzip2 for compression of the backup files. If you would like to have the log emailed to you then you will need to have permission to execute the “mail” program. If you want the compressed backup files mailed to you then Mutt must be available on the server. Finally you will need a bash shell and the standard system tools and utilities (all these requirements should be the default on most linux system.)

  • What AutoMySQLBackup does

Every day AutoMySQLBackup will run (if setup in /etc/cron.daily) and using mysqldump and gzip will dump your specified databases to the /backups/daily directory, it will rotate daily backups weekly so you should never have more than 7 backups in there..

Every Saturday AutoMySQLBackup will again backup the databases you have chosen but they will be placed into /backups/weekly, these will be rotated every 5 weeks so there should never be more than 5 backups in there..

Every 1st of the month AutoMySQLBackup will create a backup of all databases and place them into /backups/monthly. These will never be rotated so it will be up to you to do your own house keeping. I would suggest taking a copy of this offline every month or two so that if you have a hard drive failure you will be able to restore your database

  • AutoMySQLBackup Installation

The install is as simple as editing a few variables in the AutoMySQLBackup file. The full setup is documented in the AutoMySQLBackup script file below the variables section.

  • Download automysqlbackup.sh and place it into your /etc/cron.daily directory or your home directory.
  • Edit (at least) the following lines :
...
USERNAME=dbuser 
PASSWORD=password DBNAMES=”DB1 DB2 DB3″
...
  • Note:The user must have at least select privileges to the databases and make sure to keep the quotes ” ” otherwise it won’t work
  • Make the file executable :
sudo chmod u+rwx
  • Create the following directory
./backups
  • That’s it...Now you can run it using the command line “./automysqlbackup.sh” or if it is in /etc/cron.daily it will run each day when cron

Como instalar MYSQL Administrator

sudo apt-get install mysql-admin

Como instalar MySQL Query Browser (SQL Client)

sudo apt-get install mysql-query-browser

Como instalar Oracle Database XE

  • Add the following repository to your /etc/apt/sources.list:
deb http://oss.oracle.com/debian unstable main non-free
  • Install the software using apt-get
sudo apt-get update
sudo apt-get install oracle-xe
  • Add your login to the 'dba' group (where your login name is username)
sudo usermod -G dba -a username
  • Run the initial configuration
sudo /etc/init.d/oracle-xe configure

You can configure any ports you want as long as they don't interfere with any other services listening on ports. You can choose the defaults by pressing enter instead of entering something in.

Servidor Apache HTTP

Como instalar o Servidor HTTP Apache para Servidor HTTP (Web)

sudo apt-get install apache2
  • http://localhost

Como instalar PHP para o Servidor Apache HTTP

Como instalar PHP4
sudo apt-get install php4
sudo apt-get install libapache2-mod-php4
sudo /etc/init.d/apache2 restart
  • Para testar se o PHP4 esta instalado correctamente:
sudo gedit /var/www/testphp.php
  • Insira a linha seguinte no novo ficheiro
<?php phpinfo(); ?>
  • Grave o ficheiro editado
  • http://localhost/testphp.php
  • Atenção para remover o ficheiro depois, pois pode ser um risco de segurança.
Como instalar PHP5
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart
  • Para testar se o PHP5 esta instalado correctamente:
sudo gedit /var/www/testphp.php
  • Insira a linha seguinte no novo ficheiro
<?php phpinfo(); ?>
  • Grave o ficheiro editado
  • http://localhost/testphp.php
  • Atenção para remover o ficheiro depois, pois pode ser um risco de segurança.

If that didn't work (for example, if your browser prompted you to save the testphp.php page), try these commands:

sudo a2enmod php5
sudo /etc/init.d/apache2 force-reload

Then try opening http://localhost/testphp.php again

  • (Optional) Install recommended PHP5 modules
sudo apt-get install php5-xsl php5-gd php-pear
  • Restart Apache
sudo /etc/init.d/apache2 restart

Many PHP applications use XSLT technology as well as server-side graphic manipulation (via GD). Also, PEAR provides access to PHP's module repository.

pear help

Como instalar o MYSQL para o servidor HTTP Apache

sudo apt-get install libapache2-mod-auth-mysql
  • Escolhe o php4-mysql ou php5-mysql conforme a versão do PHP que tens instalado
sudo apt-get install php<version-number>-mysql
sudo apt-get install phpmyadmin
  • Para o PHP funcionar com o MYSQL abra o ficheiro ( onde tiver <versão> é 4 ou 5 conforme a versão que tiver instalada do PHP)
gksudo gedit /etc/php<version>/apache2/php.ini
  • É preciso descomentar a linha ";extension=mysql.so" para ficar a parecer assim:
...
extension=mysql.so
...
  • Grava o ficheiro editado e saia
sudo /etc/init.d/apache2 restart
  • http://localhost/phpmyadmin

Alternative if the above doesn't work (which it probably won't and this probably will):

 sudo apt-get install mysql-server

Como instalar Python para Apache 2

sudo aptitude install python
sudo aptitude install libapache2-mod-python
sudo gedit /etc/apache2/mods-available/mod_python.conf

Adicione as linhas seguintes

AddType application/x-httpd-python .py
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On

Grave o ficheiro editado

cd /etc/apache2/mods-enabled
sudo ln -s ../mods-available/mod_python.conf mod_python.conf
sudo /etc/init.d/apache2 restart

Como adicionar endereços para pastas fora de /var/www/

gksudo gedit /etc/apache2/conf.d/alias
  • Insira as linhas seguintes no ficheiro novo
Alias /Caminho-URL /localizacao_da_pasta/
<Directory /localizacao_da_pasta/>
  Options Indexes FollowSymLinks
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>
  • Grave o ficheiro editado
sudo /etc/init.d/apache2 restart
  • http://localhost/Caminho-URL
  • Se der um erro "403 - Permission denied", tente o seguinte:
chmod o+x /localizacao_da_pasta/
  • If that doens't work, the following might help:
chmod o+r,o+x /localizacao_da_pasta/

Como mudar o número de porta por defeito no servidor HTTP Apache

e.g. Assumed that new port number is 78
sudo cp /etc/apache2/ports.conf /etc/apache2/ports.conf_backup
gksudo gedit /etc/apache2/ports.conf
  • Procure a seguinte linha
Listen 80
  • Substitua pela linha seguinte
Listen 78
  • Grave o ficheiro editado
sudo /etc/init.d/apache2 restart
  • http://localhost:78

How to parse RSS into PHP for Apache HTTP Servidor

e.g. Assumed that RSS is DistroWatch.com - News
wget -c http://easylinux.info/uploads/magpierss-0.71.1.tar.gz
sudo mkdir /var/www/feeds
sudo tar zxvf magpierss-0.71.1.tar.gz -C /var/www/feeds/
sudo mv /var/www/feeds/magpierss-0.71.1/* /var/www/feeds/
sudo rm -fr /var/www/feeds/magpierss-0.71.1/
sudo chown -R www-data:root /var/www/feeds/
gksudo gedit /var/www/feeds/index.php
  • Insert the following lines into the new file
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 <head>
 <title>DistroWatch.com - News</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
 <style type="text/css">
 /*<![CDATA[*/
 /* 
 DEFAULT TAG STYLES
 */
 body {
  background: #ffffff;
  margin-left: 20px;
  font-family: bitstream vera sans,sans-serif;
  font-size: 9pt;
 }
 h1 {
  font-family: luxi sans,sans-serif;
  font-size: 15pt;
 }
 /*]]>*/
 </style>
 </head>
 <body>
 <?php
 require_once 'rss_fetch.inc';
 error_reporting(E_ERROR);
 $url = 'http://distrowatch.com/news/dw.xml';
 $rss = fetch_rss($url);
 if ($rss) {
  echo "<h1>";
  echo "<a href=$url>", $rss->channel[title], "</a><br/>";
  echo "</h1>";
  foreach ($rss->items as $item ) {
   $url = $item[link];
   $title = $item[title];
   $description = $item[description];
   echo "<li>";
   echo "<b>Topic:</b> <a href=$url><b><u>$title</u></b></a><br/><br/>";
   echo "$description<br/><br/>";
   echo "</li>";
  }
 }
 else {
  echo "<a href=$url>", $url, "</a> - Servidor Down!<br/>";
 }
 ?>
 </body>
 </html>
  • Grave o ficheiro editado
  • http://localhost/feeds/index.php

Solução de problemas no Feisy Fawn

  • Corrigir um Feisty Fawn corrompido É um processo simples de como corrigir um Feisy Fawn corrompido

Servidor FTP

Como instalar um servidor FTP para o serviço de transferências

sudo apt-get install proftpd

Como configurar o utilizador de FTP para estar "preso" (chrooted) ao seu directório "home"

sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup
gksudo gedit /etc/proftpd/proftpd.conf
  • Procure esta secção
...
DenyFilter           \*.*/
...
  • Adicione a seguinte linha por baixo
DefaultRoot           ~
  • Grave o ficheiro editado
sudo /etc/init.d/proftpd restart

Como configurar o servidor FTP para permitir aos utlizadores anónimos apenas acesso de leitura

sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup
gksudo gedit /etc/proftpd/proftpd.conf
  • Adicione as linhas seguintes ao final do ficheiro
<Anonymous ~ftp>
 User            ftp
 Group            nogroup
 UserAlias          anonymous ftp
 DirFakeUser on ftp
 DirFakeGroup on ftp
 RequireValidShell      off
 MaxClients         10
 DisplayLogin        welcome.msg
 DisplayFirstChdir      .message
 <Directory *>
  <Limit WRITE>
   DenyAll
  </Limit>
 </Directory>
</Anonymous>
  • Grave o ficheiro editado
sudo /etc/init.d/proftpd restart

Como configurar o servidor FTP para permitir aos utlizadores anónimos apenas acesso de leitura e escrita

sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup
gksudo gedit /etc/proftpd/proftpd.conf
  • Adicione as linhas seguintes ao final do ficheiro
<Anonymous ~ftp>
 User            ftp
 Group            nogroup
 UserAlias          anonymous ftp
 DirFakeUser on ftp
 DirFakeGroup on ftp
 RequireValidShell      off
 MaxClients         10
 DisplayLogin        welcome.msg
 DisplayFirstChdir      .message
</Anonymous>
  • Grave o ficheiro editado
sudo /etc/init.d/proftpd restart

Como mapear utilizadores anónimos para directórios fora de /home/ftp/

sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup
gksudo gedit /etc/proftpd/proftpd.conf
  • Adicione as linhas seguintes ao final do ficheiro
<Anonymous /location_of_folder/>
 User            ftp
 Group            nogroup
 UserAlias          anonymous ftp
 DirFakeUser on ftp
 DirFakeGroup on ftp
 RequireValidShell      off
 MaxClients         10
 DisplayLogin        welcome.msg
 DisplayFirstChdir      .message
 <Directory *>
  <Limit WRITE>
   DenyAll
  </Limit>
 </Directory>
</Anonymous>
  • Grave o ficheiro editado
sudo /etc/init.d/proftpd restart

Como alterar o numero da porta padrão para o servidor FTP

e.g. Assumed that new port number is 77
sudo cp /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup
gksudo gedit /etc/proftpd/proftpd.conf
  • Procure a seguinte linha
Port              21
  • Substitua pela linha seguinte
Port              77
  • Grave o ficheiro editado
sudo /etc/init.d/proftpd restart

Como aceder um servidor ftp numa máquina Ubuntu remota a partir de uma máquina Windows

e.g. Assumindo que a máquina Ubuntu remota tem instalado o servidor FTP servie
Read #Como instalar o servidor FTP para File Transfer service
  • Download FileZilla: Aqui

Repositório APT Pessoal

Configurar o Repositório

Nota: This type of repository is known as a Trivial Repository. Nota: Este tipo de repositório é conhecido como Trivial Repository.

Este tipo de repositório não obedece completamente aos padrãos Debian, por isso não deve ser usado comercialmente, mas é ideal para uso pessoal.

  • Instale Package Tools
sudo apt-get install dpkg-dev
  • Crie o repositório no sistema de ficheiros
mkdir /somewhere/apt
mkdir /somewhere/apt/archives
mkdir /somewhere/apt/archives/binary
  • (Opcional) Copie cache local de APT existente para o teu repositório
cp -v /var/cache/apt/archives/*.deb /somewhere/apt/archives/binary/
  • Crie a Lista de Pacotes para o teu repositório
cd /somewhere/apt/archives
dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
  • Publique o repositório com o Apache
cd /var/www
sudo ln -s /somewhere/apt/archives apt
  • Adicione o repositório (em todos os PCs) a /etc/apt/sources.list

Abra /etc/apt/sources.list

sudo gedit /etc/apt/sources.list

Adicione o seguinte no final do ficheiro:

# O meu repositório
deb http://localhost/apt binary/
  • Actualizar a base de dados do APT
sudo apt-get update

Actualizar o Repositório

Simplesmente copie ou faça download os ficheiros ".deb" para /somewhere/apt/archives/binary/ e depois actualize a lista de pacotes:

cd /somewhere/apt/archives
dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz

Streaming Media Servidor

Como instalar GNUMP3d for Streaming Media Servidor service

e.g. /var/music/ is the directory containing multimedia files
sudo apt-get install gnump3d
  • http://localhost:8888
  • Streaming Media Servidor Guide

Como mudar a localização por defeito de ficheiros multimedia do GNUM3d

e.g. Assumed that new directory containing multimedia files is /home/music/
sudo cp /etc/gnump3d/gnump3d.conf /etc/gnump3d/gnump3d.conf_backup
gksudo gedit /etc/gnump3d/gnump3d.conf
  • Procure a seguinte linha
root = /var/music
  • Substitua pela linha seguinte
root = /home/music
  • Procure a seguinte linha
user = gnump3d
  • Substitua pela linha seguinte
user = root
  • Grave o ficheiro editado
sudo /etc/init.d/gnump3d restart
  • http://localhost:8888

How to change the default port number for GNUMP3d

e.g. Assumed that new port number is 7878
sudo cp /etc/gnump3d/gnump3d.conf /etc/gnump3d/gnump3d.conf_backup
gksudo gedit /etc/gnump3d/gnump3d.conf
  • Procure a seguinte linha
port = 8888
  • Substitua pela linha seguinte
port = 7878
  • Grave o ficheiro editado
sudo /etc/init.d/gnump3d restart
  • http://localhost:7878


Groupware (Email/Calendaring)

Como instalar Meldware Communication Suite

  • Ler #Notas Gerais
  • Ler #How_to_install_Java_Development_Kit_.28JDK.29_v5.0
  • Meldware Communication Suite provides a multi-platform alternative to popular groupware like Exchange or Lotus Notes including Email(SMTP/POP/IMAP) and Calendaring(iCAL,WCAP). It depends on Java and, optionally, for the webmail/webcal client, Flash.
sudo aptitude install sun-java5-jdk
sudo update-java-alternatives -s java-1.5.0-sun
  • Download the jar file for a recent milestone or build here
  • Open a new terminal (capture java path updates)
  • change directory to your download directory
  • replace below filename with correct version based on your download
sudo java -jar buni-meldware-20070225.jar
  • A series of configuration questions are asked, for destination directory specify /opt/mcs
sudo cp /etc/init.d/skeleton /etc/init.d/meldware-cs
sudo vi /etc/init.d/meldware-cs
  • Replace the value in the line beginning with PATH with "/usr/sbin:/usr/bin:/sbin:/bin:/opt/mcs/bin" excluding quotes (assuming you specified /opt/mcs as the destination directory to the installer)
  • Replace the value in the line beginning with DESC with "Meldware Communication Suite" including quotes
  • Replace the value in the line beginning with NAME with "run.sh" excluding quotes
  • Replace the value in the line beginning with DAEMON with "/opt/mcs/bin/$NAME" excluding quotes
  • Replace the value in the line beginning with DAEMON_ARGS with "-c meldware" excluding quotes
  • Replace the value in the line beginning with SCRIPTNAME with "/etc/init.d/meldware-cs" excluding quotes
  • save (ESC):wq
sudo chmod 755 /etc/init.d/meldware-cs
sudo ln -s /etc/init.d/meldware-cs /etc/rc3.d/S21meldware-cs
sudo ln -s /etc/init.d/meldware-cs /etc/rc6.d/K21meldware-cs
sudo ln -s /etc/init.d/meldware-cs /etc/rc4.d/S21meldware-cs 
  • start MCS
sudo /etc/init.d/meldware-cs restart
  • Additional documentation is available here

Servidor de Galerias de Imagem

  • Para uma comparação entre Gallery1 e Gallery2 veja aqui

Gallery1

Como instalar Gallery1 para serviço de Servidor de Galerias de Imagem
sudo apt-get install gallery (when prompted to restart Apache, choose No or Cancel)
sudo apt-get install imagemagick
sudo apt-get install jhead
sudo apt-get install libjpeg-progs
sudo /etc/init.d/apache2 restart
sudo sh /usr/share/gallery/configure.sh
  • http://localhost/gallery/setup/index.php
  • Configuração Gallery
Gallery Configuration Wizard: Step 1
Next Step ->
Gallery Configuration Wizard: Step 2
General settings Tab ->
Admin password: Specify the password
Locations and URLs Tab ->
Album directory: /var/www/albums/
Temporary directory: /tmp/
Gallery URL: http://localhost/gallery
Albums URL: http://localhost/albums
Next Step -->
Gallery Configuration Wizard: Step 3
Next Step -->
Gallery Configuration Wizard: Step 4
Save Config ->
  • http://localhost/gallery/albums.php
Como configurar o Gallery1 para estar acessível via Internet (Hostname ou IP fixo) ou LAN (IP fixo)
e.x. Supondo que as conecções de rede e internet foram correctamente configuradas
Internet (Hostname ou IP fixo) ou LAN (IP fixo): http://www.url.com
sudo cp /etc/gallery/config.php /etc/gallery/config.php_backup
gksudo gedit /etc/gallery/config.php
  • Procure esta secção
...
$gallery->app->photoAlbumURL = "http://localhost/gallery";
$gallery->app->albumDirURL = "http://localhost/albums";
...
  • Substitua pela linha seguintes
$gallery->app->photoAlbumURL = "http://www.url.com/gallery";
$gallery->app->albumDirURL = "http://www.url.com/albums";
  • Grave o ficheiro editado
  • http://www.url.com/gallery/albums.php
Como configurar Gallery1 para estar acessível via LAN (IP dinâmico)
e.x. Supondo que as conecções de rede foram configuradas correctamente
LAN (IP dinâmico): 192.168.0.1
sudo cp /etc/gallery/config.php /etc/gallery/config.php_backup
gksudo gedit /etc/gallery/config.php
  • Procure esta secção
...
$gallery->app->photoAlbumURL = "http://localhost/gallery";
$gallery->app->albumDirURL = "http://localhost/albums";
...
  • Substitua pela linha seguintes
$gallery->app->photoAlbumURL = "/gallery";
$gallery->app->albumDirURL = "/albums";
  • Grave o ficheiro editado
  • http://192.168.0.1/gallery/albums.php
Como salvaguardar/restituir os dados Gallery1
sudo tar zcvf gallery.tgz /var/www/albums/ /etc/gallery/
  • Para restituir os dados Gallery
sudo tar zxvf gallery.tgz -C /

Gallery2

Como instalar Gallery2
Como configurar Gallery2

Como instalar Subversion version control server (with Apache support)

  • Install Subversion and Apache 2 Module
sudo aptitude install subversion libapache2-svn
  • Enable Subversion/DAV Apache 2 Module
sudo a2enmod dav_svn
  • Configure Apache 2
sudo nano /etc/apache2/mods-enabled/dav_svn.conf

Edit the file to look something like this:

<Location /svn>
  DAV svn
  SVNPath /home/svn
  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /etc/apache2/dav_svn.passwd
  Require valid-user
</Location>
  • Create Subversion Repository
sudo mkdir /home/svn
sudo svnadmin create /home/svn
  • Give Apache 2 Permissions to Repository
sudo chown -R www-data /home/svn
  • Create Repository User

Replace 'username' with your username

sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd username

Enter password when prompted.

  • Restart Apache 2
sudo /etc/init.d/apache2 restart

Como instalar Subversion version control server (svnserve)

  • Install Subversion and Internet services daemon
sudo apt-get install subversion xinetd
  • Create user that will own the repositories
sudo adduser --system --no-create-home --home /var/svn --group --disabled-login svn
  • Create directory that will hold the repositories
sudo mkdir /var/svn
sudo chown svn:svn /var/svn
  • Create file /etc/xinetd.d/svnserve with the following content
service svn
{
       port = 3690
       socket_type = stream
       protocol = tcp
       wait = no
       user = svn
       server = /usr/bin/svnserve
       server_args = -i -r /var/svn
}
  • Restart xinetd
sudo /etc/init.d/xinetd restart
  • Create the first repository
sudo -u svn svnadmin create /var/svn/testrepo
  • It should be possible to check out the repository and work on it
svn co svn://localhost/testrepo

Troubleshooting

Como desactivar o sistema hora/data de ser restaurado para UTC (GMT)

sudo cp /etc/default/rcS /etc/default/rcS_backup
gksudo gedit /etc/default/rcS
  • Encontre esta linha
...
UTC=yes
...
  • Substituir pela seguinte linha
UTC=no
  • Guardar o ficheiro editado
  • Sistema -> Administração -> Hora e Data

Ajustar hora/data correcta

sudo /etc/init.d/hwclock.sh restart

Como configurar o som para trabalhar correctamente em GNOME

sudo killall esd
sudo cp /etc/esound/esd.conf /etc/esound/esd.conf_backup
gksudo gedit /etc/esound/esd.conf
  • Procure esta secção
...
auto_spawn=0
spawn_options=-terminate -nobeeps -as 5
...
  • Substituir com as seguintes linhas
auto_spawn=1
spawn_options=-terminate -nobeeps -as 2 -d default
  • Guardar o ficheiro editado
sudo apt-get install libesd-alsa0
gksudo gedit /etc/asound.conf
  • Inserir as seguintes linhas num novo ficheiro
pcm.card0 {
type hw
card 0
}
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1025
slave {
pcm "hw:0,0"
period_time 0
period_size 2048
buffer_size 32768
rate 48000
}
bindings {
0 0
1 1
}
}
  • Guardar o ficheiro editado
sudo ln -fs /usr/lib/libesd.so.0 /usr/lib/libesd.so.1
Sistema -> Preferências -> Som
Sound preferences
General Tab -> Sounds for events (Un-Checked)
  • Guardar e fechar todas as aplicações abertas, Reiniciar computador

Como forçar Lixo vazio no GNOME

sudo rm -fr $HOME/.Trash/

Como remover menus duplicados/itens menu no GNOME

Como actualizar o menu Locais no GNOME (se estiver montado no /media/ em /etc/fstab e não for mostrado)

sudo /etc/init.d/dbus restart

How to consume static (not dhcp) wireless LAN (WLAN) connection (KDE)

  • I assume you have successfully consumed WLAN connection in Windows
  • To enable the network device please follow the following steps
  • Go to K-menu -> System Settings -> Network Settings
  • Enable Administrator mode
  • Select Network Interfaces tab and the wireless interface (usually ath0) to configure
  • Click Configure Interface...
  • Choose Manual or Automatic. Choose Manual
  • Fill the preferred IP address to identify your computer and the netmask. Choose to activate when computer starts
  • Click Advanced Settings to for more properties
  • Select Routes tab and fill the gateway IP address
  • Make sure you choose the correct device in the right dropdown (e.g. ath0)
  • Click apply to commit all changes
  • To choose wireless connection please follow the following steps
  • Go to K-menu -> Internet -> Wireless Assistant
  • Right click on preferred connection ssid
  • Choose and complete fields for Manual connection
  • Click Ok
  • Create connection configuration
gksudo gedit /etc/wpa_supplicant.conf
  • Insert the following lines into the new file
network={
ssid="YOUR_PREFERRED_CONNECTION_SSID"
scan_ssid=1
proto=WPA
key_mgmt=WPA-PSK
psk="STRING_TO_GENERATE_PASSWORD"
#psk=123456789 #you have option to use connection key instead of connection password
}
  • Save the edited file
  • Create script to easily activate connection
gksudo gedit /etc/init.d/wifi_wpa.sh
  • Insert the following lines into the new file
#! /bin/sh
# wifi: wpa_supplicant init
echo " * [Wifi]: Enabling WPA supplicant..."
if [ -x /sbin/wpa_supplicant ]; then
/sbin/wpa_supplicant -B -i ath0 -c /etc/wpa_supplicant.conf -D madwifi -w
fi
exit 0
  • Save the edited file
  • Make sure both file readable and executable
sudo chmod +r /etc/wpa_supplicant.conf
sudo chmod +x /etc/init.d/wifi_wpa.sh
  • make wireless connection automaticaly starts when computer starts
sudo ln -s /etc/init.d/wifi_wpa.sh /etc/rcS.d/S40netwifiwpa
  • Close all opened applications, Reboot computer

Como conseguir a resolução 1400x1050

  • Ver http://ubuntu.vdb-studios.be/installationDapper.php

Upgrading Ubuntu

Como fazer o upgrade Feisty Fawn -> Gutsy Gibbons

  • Ubuntu Feisty 7.04 foi lançado recentemente e ainda não há repositórios Gutsy Gibbons. Divirtam-se com o Feisty!

RESTO SERÁ ADICIONADO MAIS TARDE.