segunda-feira, 4 de agosto de 2014

[Debian] Desbloqueio do Ambiente de Trabalho

Para poder ter icons/atalhos no ambiente de trabalho.

1. Carregar simultaneamente nas teclas Alt + F2.
2. Na pequena janela que é aberta, escrever "dconf-editor" (sem as aspas).
dconf-editor
3. Abrir a árvore da seguinte forma:
org » gnome » desktop » background
4. Por fim seleccionar a opção "show-descktop-icons".

segunda-feira, 28 de julho de 2014

Instalação de arquivos .deb no Linux

1. Iniciar a consola do Linux.
2. Aceder à directoria onde se encontra o pacote com a extensão .deb, por exemplo na directoria "Downloads".
cd /Downloads
3. Executar o ficheiro para instalar.
sudo dpkg -i nome_do_pacote.deb

* no comando anterior é solicitada a password do utilizador. Se aparecer uma mensagem a informar que não tem permissões para executra ou algo parecido, entre primeiro como SuperUtilizador e depois executem o comando de instalação, ou seja:
su
irá ser solicitada a password de su
dpkg -i nome_do_pacote.deb

sexta-feira, 23 de maio de 2014

Formatar Pen USB em EXT4

Verificar qual a identificação do dispositivo usb na directoria /dev.
sudo fdisk -l
O resultado deverá ser algo similar a este:
Disk /dev/sda: 80.0 GB, 80026361856 bytes
240 heads, 63 sectors/track, 10337 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xbd3cc0bb
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       10338    78149633    5  Extended
/dev/sda5               1          46      340992   83  Linux
/dev/sda6              46          52       48128   83  Linux
/dev/sda7              52         698     4881408   83  Linux
/dev/sda8             698        1086     2928640   83  Linux
/dev/sda9            1086        1861     5858304   83  Linux
/dev/sda10           1861        2830     7323648   83  Linux
/dev/sda11           9305       10338     7812096   82  Linux swap / Solaris
/dev/sda12           2830        9304    48949248   83  Linux
Partition table entries are not in disk order
Disk /dev/sdb: 2000.4 GB, 2000365289472 bytes
255 heads, 63 sectors/track, 243197 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005f107
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      243198  1953480704    7  HPFS/NTFS

Neste caso o "device boot" da minha pen usb é '/dev/sdb1'
Comando para formatar a pen usb (que no meu caso é /dev/sdb1) no formato de ficheiros linux ext4. 
sudo mkfs.ext4 /dev/sdb1

Caso a vossa pen esteja montada no Linux, têm que a desmontar para poderem realizar o comando anterior.
sudo umount /dev/sdb1

segunda-feira, 13 de janeiro de 2014

[Raspberry Pi] Gestão da Memoria Ram

RAM is very crucial for Linux performance for couple of reasons:
  • Caches. Linux runs without free memory for most of the time. If some memory is not used by applications, it is used for caches which speeds things up. So no memory is ever wasted. If applications needs more memory, caches are freed so caches won't ever prevent applications needing more RAM from running. But of course the more your can cache, the better.
  • Many applications (especially desktop ones) needs a lot of memory to run nowadays. This is no surprise - most desktop systems (or even smartphones) this days have a lot more memory than Rapsberry Pi. For example web browsers even lightweight) will use tens of MB of memory as soon as you open some bigger web site.
  • Each and every application needs some amount of memory. So the more applications you run, the more memory they use.
So you always want to have as much ARM memory as possible. But GPU has its own needs depending on what features you want from it.

256MB version

For older RaspberryPi, with 256 MB of RAM, 4 splits are available:
  • 240/16 - The most RAM size ARM can get (240MB) with mimial GPU memory. It's the best for general computing when you don't need 3D graphics or hardware video acceleration. It has enough memory to handle 1920x1200x16bpp framebuffer resolution. While 32bpp is also working, it's not recommended since it leaves very small amount of free memory for GPU.
  • 224/32 - This one is deprecated in favor of 240/16 split. It has 3D and hardware video decoding build in but since there is not enough memory to actually use it, there's little point in using it. Unless you have some problems with 240/16 split or want to use 32bpp framebuffer at highest resolution. It is possible it will be deleted in the future.
  • 192/64 - You need at least 64MB of GPU split to use hardware video acceleration or 3D graphics. It may not be enough GPU memory for hardware accelerated video playback at highest resolution or if you need a lot of GPU memory for things like textures.
  • 128/128 - The most RAM GPU can get. Use it when you need a lot of memory for 3D graphic card and hardware accelerated video playback in high resolution. This split is needed for RaspBMC to work properly or to play fullHD video content with omxplayer without problems.

512MB version

New versions of RaspberryPi has 512 MB of RAM. You have 4 additional splits designed for this version:
  • 496/16 and 448/64 - like 240/16 and 192/64 split for 256MB respectively but with 256MB more RAM available for ARM. Since GPU has only 16 MB/64MB or RAM, all the limitations from 240/16/192/64 still apply.
  • 384/128 - Similar to 128/128 split for 256MB - you should get all the graphic chip features but with reasonable amount of ARM memory. This will probably be the most universal split right now.
  • 256/256 - Some bonus graphic card memory if you really need it, like for big textures and similar things. While 256MB of ARM memory is bigger than you could possibly have in older RaspberryPis, I don't think this one will be used on many occasions.

Dynamic splits

New versions of firmware package removes most of start_*.elf files, leaving only start.elf and start_cd.elf (also fixup*.elf files where added). From now on, you don't have to manually choose proper start_*.file. Instead, you should use gpu_mem* options in config.txt file to choose how much memory goes to GPU. The remaining memory will be allocated to ARM. It should be possible to use arbitrary number in the following range for this options:
**512MB of RAM**: 16M-448M
**256MB of RAM**: 16M-192M
While there is no hardcoded split values right now, most of the informations for the rest of this answer should still be valid when you're trying to determine how much memory should be allocated to GPU.
start_cd.elf and fixup_cd.elf files are cutdown versions of the respective files, only used when gpu_mem=16.

Using one SD card on both 256 and 512 MB version

If you are using one SD card image for different RaspberryPi versions, you can use gpu_mem_256 and gpu_mem_512 options. First one will only be used on 256MB version while second one only on 512MB version of the board.