Estrutura de Diretórios Linux

Uma pequena referência:

/bin Arquivos binários (“executáveis”) de comandos essenciais do sistema.
/boot Arquivos de boot (inicialização; boot-loader; grub, lilo); kernel.
/dev Dispositivos (devices) de entrada/saída: floppy, hardisk, cdrom, usbs
/etc Arquivos de configuração e scripts de inicialização.
/home Diretório local (home) de usuários.
/lib Bibliotecas e módulos compartilhados com freqüencia
/mnt Diretório de montagem de dispositivos, sistemas de aquivos e partições
/opt Para instalação de programas não oficiais da distribuição
/proc Diretório virtual (RAM) onde rodam os processos ativos
/root Diretório local do superusuário (root)
/sbin Arquivos de sistema essenciais (binários do superusuário).
/tmp Arquivos temporários gerados por alguns utilitários
/usr Arquivos de usuários nativos da distribuição.
/usr/local Para instalação de programas não oficiais da distribuição
/usr/src Arquivos fontes do sistema necessarios para compilar o Kernel
/var Arquivos de log e outros arquivos variáveis

Tricking higher resolutions on CRT monitors

product-5393439

If you happen to own a display monitor such as the Samsung SyncMaster 550v CRT (a very old model btw) let me inform you that your device may be capable of displaying resolutions higher than the limited on its manual. However, forcing those out-of-spec resolutions possibly can  result in problems, but this is more device dependent than anything else. I’ve tricked this display model for almost 5 years, and it continues to work flawlessly to this date.

The SyncMaster 550v (and probably other models from this line of CRT monitors) is said to have a maximum resolution of 1024×768, but can run just as well with 1152×864 pixels. However prepare your eyes to fight against a refreshing rate of 60Hz. I’ve heard somewhere you can even trick higher refresh rates on this monitor, but I can’t confirm it. Maybe this is pushing too much out-of-spec.

IMPORTANT NOTICE: Using unsupported or unspecified display modes can damage your hardware (your monitor) permanently. Just because it worked for some, you shouldn’t assume it will work for you. I assume no liability or responsability over any damages, errors or failures that could be result of the following instructions. If something brokens, it will always be your own fault! 

How to do this on Windows 9x/Me

    Download PowerStrip. PowerStrip is a shareware program that provides programmable hardware support to a wide range of graphics cards. It is possible to change hardware monitor settings and write a modified driver version for your display enabling the use of higher resolutions. This was the software I used by the time I discovered this was possible, but unfortunately I don’t have any machines with 98 anymore, and I can’t remember the steps exactly involved.

How to do this on Windows XP

    Piece of cake. Just hit the right button on your desktop then select “Properties“. Go to the “Settings” tab then click “Advanced“. Go to the “Monitor” tab then uncheck “Hide unsupported modes for this monitor“. Now you can select all sort of resolution modes for your monitor. But PLEASE don’t go selecting something crazy like the highest resolution available. Try one step above the previous maximum at time. At the very least, it just won’t work, going black or displaying garbage. Wait 15 seconds to return back to previous mode. At the other hand, I can’t garantee it just wouldn’t blow up. USE WITH CARE!

How to do this on Linux

    Well, lets edit our xorg config file as usual. Just grab your favourite text editor, assegure you have the proper privileges and open /etc/X11/xorg.conf. In my case, I’ll use nano.

    nano /etc/X11/xorg.conf

    Now find the Device section, as indicated by the line

    Section “Device”

    Now add the following option line:

    Option “IgnoreEDID” “1”

    In summary, if you had a section looking like this:

    Section “Device”
       Identifier      “NVIDIA TNT2”
       Driver          “nvidia”

    Now it should be looking like this:

    Section “Device”
       Identifier      “NVIDIA TNT2”
       Driver          “nvidia”
       Option         “IgnoreEDID”  “1”

    Now specify the resolutions you want on xorg.conf as normal. I’ll update this post with the proper config lines as soon as I have enough spare time again. Now, just be sure to never make something stupid such as selecting the highest resulution available or guessing something crazy. Make only small, incremental steps. More information about EDID and why we are ignoring it can be found on Wikipedia, here.

Software Licenses’ Legal Notices

800px-Gpl_auto
When releasing software it is always good to release under a suitable license. Licensing policies were created to protect you and your code, restricting what others can do using your code, and not what you can do with your own code. The copyright holder (the author, e.g. you) is able to change licensing policies anytime, but, depending on the license you choose, only as long as every author and every person who has ever contributed to your project also agree.

Wikipedia offers a list of popular licenses and a comparison of free software licenses you can use in your projects. But no matter which one you choose, a common practice is to include a license notice header in all your source files to enforce the restrictions you have chosen. Here is a list of common headers for the most common available software licenses. Comparison between its different implications is beyond the scope of this post, but more information is available on the Additional Information section below.


GPL – GNU Public License (details)

LGPL – Lesser GNU Public License (details)

MPL – Mozilla Public License (details)

BSD License (details)

MIT License (details)

Apache License (details)

CC – Creative Commons (details)

Creative Commons licenses are not intended to apply to, and should not be used for software. I’ve included it here just to remember you.

Public Domain (details)

This is only a suggestion as there is no common sense on how to dedicate your work for the public domain. This excerpt was borrowed from the SQLite site, a popular software that is itself dedicated to the public domain.

WARNING: Please pay attention that the Public Domain Dedication is not a license. By using it, you do not simply carve out exceptions to your copyright; you grant your entire copyright to the public without condition. This grant is permanent and irreversible. You’ve been warned.


Additional Information


For a nice comparison of different licenses, implications and more useful information, please check:

Comparison of Source Code Licenses

Also, before blindly adopting the GPLv3, please be sure you have completely and correctly understood everything it says. For more info about the GPL and the GPLv2 vs GPLv3 debate, see:

The GPL for Dummies
The GPLv2 vs. GPLv3 Debate
What the kernel guys are and aren’t (and really should be) saying about GPLv3
The Dangers and Problems with GPLv3
The GPLv2 vs. GPLv3 Chart

Personally, I would rather go with the GPL v2 instead.

Enabling bash autocompletion on Debian

terminal


Open up a terminal, then type:

nano /etc/bash.bashrc

Now, search for the following commented lines (lines with a starting #)

# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ]; then
#. /etc/bash_completion
#fi

And uncomment them like this:

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi

Now whenever you want to install a package, for example, you need only type the first letters of the package in the apt-get install command line and then hit tab twice to list available packages starting with those letters.

e.g. Typing

apt-get ins<TAB>

will autocomplete to apt-get install. Now continue and type

apt-get install amar<TAB>

and a list with every package with “amar” in their name will be shown. In this example, it will probably list packages such as amaroK and amarok-engines.

I know this feature works with far more commands, however I can’t enumerate all of them because I just don’t know they all. If you think it may work in the context you are in, then it costs nothing to try and check it yourself. Sometimes you’ll be surprised!

Essential Software for Linux

Here is a list a few packages I install every time I setup a new Linux box. As this isn’t something I do often (probably only when I’m buying a new computer), I really have to write them down so I don’t forget about them next time. Here is a complete list with the package name and their description. The last update made for this post was made in July 24, 2008.

  • System
    synaptic – graphical user interface to apt-get.
    prelink – improves system performance prelinking libraries and executables. Commonly I use prelink -avmR for optimizing my systems. Please see manpage for more details.
    apt-build – builds your packages from source with any desired optimization level.
    unrar – the proprietary WinRAR command line equivalent for linux, from rarlabs. If you want a pure GPL system, stick to unrar-free. [considering ditching in favor of p7zip]
    p7zip – the free command line archiver tool for 7z packages. Compression ratios are usually considered to be better (source?) than those of .rar packages. Plus, it’s LGPL.
    less – improved more. Perhaps one of the first essential things you should apt-get if you didn’t have it already.
    module-assistant – essential tool for building kernel modules The Debian Way(tm).
    deborphan – Lists unused and orphaned packages that generally can be removed from your system.

  • Desktop Tools
    katapult – the most useful application launcher I’ve ever seen. Press Alt + Space and a nice, elegant-looking window will pop in the center of your screen. Type anything – a program name, a song name, a google query or even a mathematic formula – it will autocomplete your command and run, play, search or compute for you.
    yakuake – want a terminal? Just hit a keyboard shortcut (I have set mine to alt + ~) and a terminal you scroll down your screen just like the Quake console would. Impressive and useful.
    ark – graphical user interface for various command line compressing and archiving tools.

  • Internet Tools
    emesene – finally a MSN Messenger client worth looking. For years Linux lacked a decent Messenger clone with a consistent interface that didn’t want to implement every protocol under the sun.

  • Browsers
    opera – The Fastest Browser on Earth! Albeit Opera has been known to be one of the lightest internet browsers available, which in the past could fit inside a single floppy disk, it has built in support for chat, email, torrents, bookmark synchronizing, mouse gestures, voice recognition, thousand of skins and is known to be one of the most secure and standard compliant browsers. Runs everywhere, on computers, cellphones, fridges, televisions and Wiis. For me, it its my browser of choice. Isn’t open source, though.
    w3m – So you decided to upgrade X or your nvidia drivers and something went wrong. Now X fails to start and instead you are locked in the dark, text-only world of the linux terminal. Not a problem if you have w3m, a browser for text mode which you can use to call for help searching google. It even supports mouse clicking and the display of pictures through the framebuffer!

  • Development
    build-essential – essential build tools, such as gcc and libc development libraries. A must have if you plan to build Debian packages, including compiling and installing your kernel The Debian Way™.
    eagle – the proprietary circuit design tool from CADSoft. Although a powerful software for Windows, its linux counterpart has some issues, mainly with desktop integration. It looks really like a Windows app in your Linux box, not matching any your GTK or KDE themes. Sometimes it want to be run as root (!) to gain some additional privileges. Also it had some problems with X, but I think they were due to compiz.

  • Games
    mupen64plus – The best N64 emulator for GNU/Linux, fork of the original Mupen64, which hasn’t been updated for years. Anyone willing to pack it up for Debian?

  • Multimedia
    amaroK – THE best audio player ever coded. Well, at least until last time I’ve upgraded it. One of the biggest reasons for flipping the linux switch.
    kmplayer – video player fronted for various multimedia engines.
    xine libraries – acts as an engine for amarok and kmplayer, also providing mp3 support through plugin package. To replaced by xine 2 libs
    Packages: libxine1 libxine1-plugin

  • Office

  • Google Tools
    picasa – picture management tool by Google.
    google-desktop-linux – Google desktop for linux. It doesn’t have that fancy sidebar of the windows version, so it isn’t of much use for me.
    googleearth-package – tool for downloading Google Earth and creating a nice .deb package. If it only told you how to do so. After installing, type make-googleearth-package on a console to create the package. Ensure you have proper privileges and install using dpkg -i package_name.deb.
    ps: I really feel they should standardize package names for google things. To apt-get picasa and google desktop, you may have to add the Google Linux Software Repository to your apt sources.

  • Themes & Styles (KDE)
    gtk-qt-engine – enables both KDE and GTK based apps to share the same QT theme. A must have for KDE users if your choosen theme isn’t available to GTK. Well, a must have anyways.
    Some interesting additional styles for KDE 3.5
    Packages: kde-style-serenity kde-style-qtcurve kwin-style-knifty kwin-baghira

  • Themes & Styles (other)
    lxappearance – a tool for changing GTK styles. Useful for changing the style of applications that have to run with higher privileges, like the Synaptic Package Manager, if you use it together with sudo. i.e: sudo lxappearance 
    splashy – adds a nice bootsplash to your system without touching your kernel.
    Interesting themes for GTK
    Packages: gtk2-engines-qtcurve

  • Interoperabilty
    wine – The ubiquitous tool for porting emulating running your windows apps on linux. Has reached 1.0 state some months ago, has support for Windows XP themes and works really, really well. Under constant development, though.
    winetricks – A script with tricks and hacks to run applications which just wouldn’t work with a vanilla wine installation.
    mono – The .Net Framework for Linux. I still don’t know if there is a metapackage for downloading the entire library for a complete replacement of the .Net Framework. I usually install the following packages, as dependencies gets automatically resolved.
    Packages: mono-gmcs libmono2.0-cil libmono-winforms2.0-cil

Escrevendo ç no us-int

Caso ‘ + c não adiante, para fazer o ç (c-cedilha) no padrão internacional (us-int), basta pressionar

 Alt Gr + ,

e depois

 C

Este tipo de problema ocorre no linux quando temos um teclado abnt2 e propositalmente tentamos forçar um padrão diferente, como o us-int. Sinceramente, acho mais fácil comprar um teclado novo.

Configurando teclado abnt2 multimídia no linux

Para quem tem um teclado multimídia que simplesmente se nega a funcionar corretamente no linux, independente da configuração que você seleciona no KDE (meu caso), ou ainda se seu teclado parou de funcionar de repente após um upgrade, e não há nada que o faça funcionar de volta, aqui vai a dica…

Abra um terminal, e digite o seguinte comando:

setxkbmap -keycodes “xfree86(abnt2)+aliases(qwerty)” -model microsoftpro -layout br -variant abnt2

Pronto. Verifique agora se as teclas voltaram a funcionar!

Caso positivo, certifique-se de que as novas configurações sobrevivem a um reinício do X. Se tudo voltou a dar errado, inclua este comando na inicialização automática do seu ambiente. No caso do KDE, experimente criar um novo arquivo texto dentro do diretorio ~/.kde/Autostart/ com o nome que desejar, digitando, por exemplo:

nano ~/.kde/Autostart/startup.sh

A seguir, copie e cole o seguinte texto para dentro do arquivo:

#!/bin/bash
###########
setxkbmap -keycodes “xfree86(abnt2)+aliases(qwerty)” -model microsoftpro -layout br -variant abnt2

Agora feche o arquivo com Ctrl+X e selecione S para salvar as modificações no arquivo. Em seguida, marque o arquivo recém-criado como executável, através do comando:

chmod +x ~/.kde/Autostart/startup.sh

Pronto! Agora reinicie o KDE para ver se as configurações surtiram efeito.
PS: Talvez você precise estar logado como root para executar alguns desses comandos.