Dicas para o Ubuntu

Olá!

O objetivo dessa página é orientar usuários iniciantes do Ubuntu que desejam instalar e configurar o Ubuntu utilizando ao máximo o modo gráfico. Caso o uso do ambiente gráfico não for possível, as orientações buscam ser o mais simples possível, sempre voltadas aos iniciantes do Ubuntu. A versão utilizada do Ubuntu é sempre mais atual e estável de 64 bits.

domingo, 20 de julho de 2014

Transformando seu laptop velhinho num roteador com o Ubuntu

 Bem galera, tenho uma internet 1 Mb via rádio no notebook (através de cabo - não há roteador) e estava procurando uma maneira de compartilhar essa internet com os meus aparelhos móveis - um galaxy Y e um Positivo Ypy, ambos Android. Vi que o Ubuntu tem uma maneira de criar rede sem fio nativa, mas me parece que é ad hoc (não sei bem o que significa), mas sei que os Androids não reconhecem. Tava quase comprando um roteador quando achei hoje um tutorial que resolveu meu problema: ele transformou o meu notebook em roteador.

   Transcreverei o tutorial, traduzindo (ele está em inglês) a meu modo, como eu fiz e deu certo.

   Já adianto que não tenho conhecimentos avançados, apenas segui os passos do tuto e deu tudo certo. Tente por sua conta e risco (como eu fiz).
   O endereço para quem quiser ver o original é:

 http://forum.xda-developers.com/showthread.php?p=38228707#post38228707
 
   Parece-me que funciona em qualquer máquina, desde que tenha a placa wireless (acho que não existe notebook que não tenha).

Passo 1: Verifique se seu adaptador wireless suporta infraestrutura hotspots.
  Abra o terminal e digite sudo lshw | less
  Encontre a seção -network do wireless (no meu note era a segunda, havia duas: a primeira era a rede cabeada). Confirme que o driver é ou ath5k ou ath9k (o meu é ath9k), se não for, não vai funcionar.

Passo 2: Instale 2 ferramentas adicionais para criar o hotspot: 1ª é o hostapd (servidor hotspot) e a 2ª é o dnsmasq (servidor dns dhcp).
  No terminal digite sudo apt-get install hostapd dnsmasq

Passo 3: Pare estes serviços se eles já iniciaram e impeça-os de iniciar junto com o sistema:
  No terminal digite:
sudo service hostapd stop
sudo service dnsmasq stop
sudo update-rc.d hostapd disable
sudo update-rc.d dnsmasq disable

Passo 4: Configure os arquivos:
  No terminal digite sudo gedit /etc/dnsmasq.conf
  Adicione as seguintes linhas no arquivo (pule uma linha após a última e cole o scipt)

# Bind to only one interface
bind-interfaces
# Choose interface for binding
interface=wlan0
# Specify range of IP addresses for DHCP leasses
dhcp-range=192.168.150.2,192.168.150.10

Passo 5: Configure o hostapd
   No terminal digite  sudo gedit /etc/hostapd.conf
   Adicione as seguintes linhas no arquivo

# Define interface
interface=wlan0
# Select driver
driver=nl80211
# Set access point name
ssid=myhotspot
# Set access point harware mode to 802.11g
hw_mode=g
# Set WIFI channel (can be easily changed)
channel=6
# Enable WPA2 only (1 for WPA, 2 for WPA2, 3 for WPA + WPA2)
wpa=2
wpa_passphrase=mypassword

Você pode alterar o nome que a rede wifi terá e senha nas linhas ssid e wpa_passphrase, respectivamente (no caso o nome da rede ficaria myhotspot e a senha mypassword).

Passo 6: Crie um arquivo de texto.
   No terminal digite gedit

   No arquivo cole o seguinte script

#!/bin/bash
# Start
# Configure IP address for WLAN
sudo ifconfig wlan0 192.168.150.1
# Start DHCP/DNS server
sudo service dnsmasq restart
# Enable routing
sudo sysctl net.ipv4.ip_forward=1
# Enable NAT
sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Run access point daemon
sudo hostapd /etc/hostapd.conf
# Stop
# Disable NAT
sudo iptables -D POSTROUTING -t nat -o ppp0 -j MASQUERADE
# Disable routing
sudo sysctl net.ipv4.ip_forward=0
# Disable DHCP/DNS server
sudo service dnsmasq stop
sudo service hostapd stop

  Troque o ppp0 por eth0 (ou o número que se referir a sua conexão - confirme no 1º passo nas informações -network).
  Salve o arquivo (em qualquer lugar) com o nome start.sh

Passo 7 e último: Ligue seu hotspot iniciando o script criado.
  No terminal digite sudo sh "local do arquivo salvo"
  No meu caso ficou: sudo sh /home/julian/Área\ de\ Trabalho/start.sh (o arquivo eu salvei na Área de Trabalho mesmo).

Pronto! Liguei o wifi no smartphone e no tablet e funcionou. Fiquei muito alegre (não precisarei mais comprar o roteador, não para isso).


sexta-feira, 20 de junho de 2014

Decoding a dvd - libdvdread and libdvdcss2


Are you trying to rip a dvd but you're don't open a dvd? Probably you need a lib that decrypt the dvd. See this instructions:

Installing libdvdread on Ubuntu

Install the libdvdread4 package (no need to add third party repositories) via Synaptic or command line: (note: if you have installed *ubuntu-restricted-extras this has already been installed automatically for you)

open a terminal (alt+ctrl+t)

so, in the terminal, type:

sudo apt-get install libdvdread4
 
after installing,type: 
sudo /usr/share/doc/libdvdread4/install-css.sh
 
 

Installing libdvdcss on Ubuntu

With the demise of the Medibuntu repository and libdvdcss not being hosted in the main Ubuntu repos due to licensing issues a new repository is needed from 13.10 upwards. Thanks to the good folks at VideoLAN (makers of the awsome VLC Video Player) there is a ready and updated source available.

open a terminal (alt+ctrl+t)
then, type:

wget ftp://ftp.videolan.org/pub/debian/videolan-apt.asc | sudo apt-key add -
echo "deb ftp://ftp.videolan.org/pub/debian/stable ./" | sudo tee /etc/apt/sources.list.d/libdvdcss.list


sudo apt-get update


sudo apt-get install libdvdcss2

quinta-feira, 29 de maio de 2014

Fresh Player Plugin: Pepper Flash Wrapper For Firefox - Beta version

Install Fresh Player Plugin In Ubuntu Via PPA (Pepper Flash Wrapper For Firefox)

Not so long ago I was telling you about Fresh Player Plugin, a new wrapper that's currently in alpha, which allows Linux users to use Pepper Flash (which is bundled with Google Chrome) in Firefox and other NPAPI-compatible web browsers.

Firefox Fresh Player Plugin



Firefox Fresh Player Plugin

Well, in just over a week, Fresh Player Plugin evolved a lot and in my test, I actually didn't encounter any major issues: the sound works, video playback works with YouTube and other websites, full-screen videos work with multi-monitor setups, etc. (hardware acceleration doesn't work properly yet though!). So I've decided to upload Fresh Player Plugin to the main WebUpd8 PPA so you can test it easily and stay up to date with the latest code from GIT.

As a reminder, the latest Adobe Flash Player versions are available on Linux only through Google Chrome, while other browsers are stuck with version 11.2.

The Adobe Flash Player plugin that's bundled with Google Chrome is in the form of a PPAPI (or Pepper Plugin API) plugin and Mozilla isn't interested in adding support for it.

That's why Rinat Ibragimov decided to create this wrapper so Firefox users can use the latest Pepper Flash from Google Chrome.


Install Fresh Player Plugin in Ubuntu via PPA

Important notes:

    Fresh Player Plugin is installed under /usr/lib/mozilla/plugins/ and so it works with Firefox but it may not work with other NPAPI-compatible browsers. If you want to use it with some other web browser, you're on your own;
    the plugin is still in early alpha stages and even though in my test it seems that most stuff works, it may not work for you. Also, it probably only works with a limited number of websites right now. You should only install it for testing purposes for now!


1. Install Fresh Player Plugin in Ubuntu (via PPA), by using the following commands:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install freshplayerplugin

You can also download the deb from HERE but installing it without adding the PPA means you won't get updates!

2. Fresh Player Plugin is just a wrapper for libpepflashplayer.so so it needs this file which is bundled with Google Chrome. The easiest way to get this file is to simply install Google Chrome Stable - download it from here, then install it. That's it!

There are other ways of getting libpepflashplayer.so but I won't post installation instructions for all of them here. Instead, I'll just list them below:

    if you're using Google Chrome Unstable, create a symbolic link from /opt/google/chrome-unstable/PepperFlash to /opt/google/chrome/ or change add a freshwrapper.conf file and add the /opt/google/chrome-unstable/PepperFlash/libpepflashplayer.so path there - see step 3;
    you can install Pepper Flash using 2 other ways: via the installer available in the official Ubuntu 14.04 repositories and via the Pepper Flash PPA which is also available for older Ubuntu versions - once installed, then you'll need to create a symbolic link for Pepper Flash to /opt/google/chrome/PepperFlash/libpepflashplayer.so or see step 3 for how to change the path to it.


3. Optional (only use it if you want to tweak various settings): configure Fresh Player Plugin

Here you'll find an example Fresh Player Plugin configuration - to use it, save this file, rename it to "freshwrapper.conf" and copy it under ~/.config/

Use this configuration file to change the path to libpepflashplayer.so or to tweak the sound buffer if you have shuttering sound. Don't use it to enable hardware acceleration yet as it doesn't work properly for now!

The configuration options available in this file are pretty self-explanatory - you can configure the lower and higher bound for the audio buffer size, change the Xinerama screen used to acquire fullscreen window geometry (default: 0), change the path to libpepflashplayer.so along with command line arguments (like enabling hardware video decoding).

To report bugs or help with its development, see the Fresh Player Plugin GitHub page ->
https://github.com/i-rinat/freshplayerplugin

This article is from: http://www.webupd8.org/2014/05/install-fresh-player-plugin-in-ubuntu.html

The target of this post is just educational for poor communities surrounded São Paulo city, Brazil. There is no financial interests. If you get access to the original  article, please go there!

terça-feira, 20 de maio de 2014

A shockwave plugin for Firefox and others browsers - alpha version

Fresh Player Plugin: Pepper Flash Wrapper For Firefox And Other NPAPI-Compatible Browsers

 

 

As you probably know, the latest Adobe Flash Player versions are available on Linux only through Google Chrome, while other browsers are stuck with version 11.2.

The Adobe Flash Player plugin that's bundled with Google Chrome is in the form of a PPAPI (or Pepper Plugin API) plugin and Mozilla isn't interested in adding support for it.

For this reason, Rinat Ibragimov (who's also behind libvdpau-va-gl, a VDPAU driver that, among others, brings Adobe Flash Player hardware acceleration on Intel Graphics) has started working on a Pepper Flash NPAPI wrapper which aims to bring Google Chrome's Pepper Flash to Firefox, Opera, etc., called Fresh Player Plugin.

Fresh Player Plugin is in early alpha and still needs work! In my test with the latest Fresh Player Plugin from GIT, YouTube videos didn't play at all while DailyMotion videos worked but the sound was very choppy. So it can't really replace Adobe Flash for Firefox users yet but still, the project is very promising:

Fresh Player Plugin Firefox


Update: WebUpd8 reader hrv posted a comment below saying that both the video and sound worked on YouTube for him. So Fresh Player Plugin might be in a more advanced stage than I initially thought.

If you can help with its development, check out the Fresh Player Plugin GitHub page.

It's also worth mentioning, in case you didn't know, that Mozilla is working on its own Flash replacement: Shumway, which is open source and uses HTML5. But, like the new Fresh Player Plugin, Shumway needs a lot of work until it can fully replace Adobe Flash too.


Test Pepper Flash Plugin


Currently, to test Fresh Player Plugin (remember, it's in early development stages and its functionality is limited; it doesn't work with many websites, including YouTube!) you must build it from source. The instructions below are a rough guide on how to compile it in Ubuntu but it doesn't guarantee it will work so unless you have experience with building packages from source, I suggest you wait until Pepper Flash Plugin becomes more stable, then I'll upload it to a PPA.

1. Install the required dependencies:
sudo apt-get install build-essential git cmake pkg-config libglib2.0-dev libasound2-dev libx11-dev libgl1-mesa-dev liburiparser-dev libcairo2-dev libpango1.0-dev libpangocairo-1.0-0 libpangoft2-1.0-0 libfreetype6-dev libgtk2.0-dev

2. Build Fresh Player Plugin
cd
git clone https://github.com/i-rinat/freshplayerplugin.git
cd freshplayerplugin && mkdir build
cd build
cmake ..
make

3. Once it's built, copy libfreshwrapper.so from the build folder to the browser plugin directory. For Firefox, copy it to /usr/lib/mozilla/plugins/

4. Fresh Player Plugin is just a wrapper for Pepper Flash from Google Chrome so you'll need libpepflashplayer.so. The Pepper Flash path is hardcoded to /opt/google/chrome/PepperFlash/libpepflashplayer.so and to get libpepflashplayer.so under that location you'll have to do one of the following:
  • install Google Chrome stable (that's it!); or
  • if you're using Google Chrome unstable, create a symbolic link from /opt/google/chrome-unstable/PepperFlash to /opt/google/chrome/ ; or
  • on Ubuntu, you can install Pepper Flash using 2 other ways: via the installer available in the official Ubuntu 14.04 repositories and via the Pepper Flash PPA - once installed, then you'll need to create a symbolic link for Pepper Flash to /opt/google/chrome/PepperFlash/libpepflashplayer.so

  from: http://www.webupd8.org/2014/05/fresh-player-plugin-pepper-flash.html

sexta-feira, 31 de janeiro de 2014

Ubunt is not booting - see this

 

  If your Ubuntu system doesn't boot because of some broken updates and the bug was fixed in the repositories, you can use an Ubuntu Live CD and chroot to update the system and fix it.

 

1. Create a bootable Ubuntu CD/DVD or USB stick, boot from it and select "Try Ubuntu without installing". Once you get to the Ubuntu desktop, open a terminal.

2. You need to find out your root partition on your Ubuntu installation. On a standard Ubuntu installation, the root partition is "/dev/sda1", but it may be different for you. To figure out what's the root partition, run the following command:
sudo fdisk -l
This will display a list of hard disks and partitions from which you'll have to figure out which one is the root partition.

To make sure a certain partition is the root partition, you can mount it (first command under step 3), browse it using a file manager and make sure it contains folders that you'd normally find in a root partition, such as "sys", "proc", "run" and "dev".

3. Now let's mount the root partition along with the /sys, /proc, /run and /dev partitions and enter chroot:
sudo mount ROOT-PARTITION /mnt
for i in /sys /proc /run /dev; do sudo mount --bind "$i" "/mnt$i"; done
sudo cp /etc/resolv.conf /mnt/etc/
sudo chroot /mnt

Notes:
  • ROOT-PARTITION is the root partition, for example /dev/sda1 in my case - see step 2;
  • the command that copies resolv.conf gets the network working, at least for me (using DHCP); if you get an error about resolv.conf being identical when copying it, just ignore it.

Now you can update the system - in the same terminal, type:
apt-get update
apt-get upgrade


Since you've chrooted into your Ubuntu installation, the changes you make affect it and not the Live CD, obviously.

If the bug that caused your system not to boot is happening because of some package in the Proposed repositories, the steps above are useful, but you'll also have to know how to downgrade the packages from the proposed repository - for how to do that, see: How To Downgrade Proposed Repository Packages In Ubuntu

 

terça-feira, 27 de agosto de 2013

App Grid: New Lightweight Ubuntu Software Center Alternative

 
App Grid is a new lightweight Ubuntu Software alternative that tries to make application discovery easier by using a grid view which includes app screenshots and ratings.

The application is currently only available for Ubuntu 13.04 and it uses a proprietary license.

Even though this is the first public release, App Grid already comes with most features you'll need, like software search, app review and purchase and more. As for the design, the application reminds me of Muon Discover, a Muon Suit front-end that tries to make it easier to find new software, a goal shared with App Grid.

Below you can see some App Grid screenshots:

AppGrid
App Grid - main view

AppGrid
Games category

You've probably noticed that some applications have a green circle displayed around the application icon - that means they are already installed.

The application page displays an install / launch / remove button, screenshots, a short description along with user comments. Clicking on the comments extends the section and you can filter them by rating, language, Ubuntu version or write a review:

AppGrid

AppGrid


App Grid features:
  • discover new apps every time you open App Grid;
  • search, filter and sort to find exactly what you're looking for;
  • make informed decisions with our extensive detail views;
  • sign in with your Ubuntu One account to review and purchase apps.

Below you'll find a technical comparison between App Grid and Software Center, done by the AppCenter developer (the tests were performed on a Dell Mini 9):
  • python3 vs python2;
  • warm start to home screen is 2.7s vs 20s;
  • warm start to details screen (eg opening an apt: link) is 2.3s vs 30s;
  • full database build is 58s vs 6min24;
  • initial database size is 36.7mb vs 96.5mb;
  • memory usage after startup to home screen is 20mb vs 53.6mb;
  • lines of code is somewhere around 5900 loc vs 56960 loc (incl tests etc).


Install App Grid in Ubuntu


App Grid is available in a PPA for Ubuntu 13.04 only for now. Add the PPA and install App Grid using the following commands:
sudo add-apt-repository ppa:appgrid/stable
sudo apt-get update
sudo apt-get install appgrid

The PPA provides packages for other Ubuntu versions, but they don't work - a message is displayed saying that App Grid is not yet available for that Ubuntu version.

segunda-feira, 19 de agosto de 2013

Ubuntu on a flashdrive

(from: http://www.howtogeek.com/howto/14912/create-a-persistent-bootable-ubuntu-usb-flash-drive/)

 Create a Persistent Bootable Ubuntu USB Flash Drive

Don’t feel like reinstalling an antivirus program every time you boot up your Ubuntu flash drive? We’ll show you how to create a bootable Ubuntu flash drive that will remember your settings, installed programs, and more!
Previously, we showed you how to create a bootable Ubuntu flash drive that would reset to its initial state every time you booted it up. This is great if you’re worried about messing something up, and want to start fresh every time you start tinkering with Ubuntu.
However, if you’re using the Ubuntu flash drive to diagnose and solve problems with your PC, you might find that a lot of problems require guess-and-test cycles. It would be great if the settings you change in Ubuntu and the programs you install stay installed the next time you boot it up.
Fortunately, Universal USB Installer, a great little program from Pen Drive Linux, can do just that!
Note: You will need a USB drive at least 2 GB large. Make sure you back up any files on the flash drive because this process will format the drive, removing any files currently on it. Once Ubuntu has been installed on the flash drive, you can move those files back if there is enough space.
Put Ubuntu on your flash drive
Universal-USB-Installer.exe does not need to be installed, so just double click on it to run it wherever you downloaded it. Click Yes if you get a UAC prompt, and you will be greeted with this window. Click I Agree.
sshot-1
In the drop-down box on the next screen, select Ubuntu 9.10 Desktop i386. Don’t worry if you normally use 64-bit operating systems – the 32-bit version of Ubuntu 9.10 will still work fine. Some useful tools do not have 64-bit versions, so unless you’re planning on switching to Ubuntu permanently, the 32-bit version will work best.

If you don’t have a copy of the Ubuntu 9.10 CD downloaded, then click on the checkbox to Download the ISO. You’ll be prompted to launch a web browser; click Yes.

The download should start immediately. When it’s finished, return the the Universal USB Installer and click on Browse to navigate to the ISO file you just downloaded. Click OK and the text field will be populated with the path to the ISO file.

Select the drive letter that corresponds to the flash drive that you would like to use from the dropdown box. If you’ve backed up the files on this drive, we recommend checking the box to format the drive.

Finally, you have to choose how much space you would like to set aside for the settings and programs that will be stored on the flash drive. Considering that Ubuntu itself only takes up around 700 MB, 1 GB should be plenty, but we’re choosing 2 GB in this example because we have lots of space on this USB drive.

Click on the Create button and then make yourself a sandwich – it will take some time to install no matter how fast your PC is.

Eventually it will finish. Click Close.

Now you have a flash drive that will boot into a fully capable Ubuntu installation, and any changes you make will persist the next time you boot it up!
Boot into Ubuntu
If you’re not sure how to set your computer to boot using the USB drive, then check out the How to Boot Into Ubuntu section of our previous article on creating bootable USB drives, or refer to your motherboard’s manual.
Once your computer is set to boot using the USB drive, you’ll be greeted with splash screen with some options.

Press Enter to boot into Ubuntu. The first time you do this, it may take some time to boot up. Fortunately, we’ve found that the process speeds up on subsequent boots.

You’ll be greeted with the Ubuntu desktop.

Now, if you change settings like the desktop resolution, or install a program, those changes will be permanently stored on the USB drive! We installed avast! Antivirus, and on the next boot, found that it was still in the Accessories menu where we left it.

Conclusion
We think that a bootable Ubuntu USB flash drive is a great tool to have around in case your PC has problems booting otherwise. By having the changes you make persist, you can customize your Ubuntu installation to be the ultimate computer repair toolkit!