Mostrando postagens com marcador Linux. Mostrar todas as postagens
Mostrando postagens com marcador Linux. Mostrar todas as postagens

quarta-feira, fevereiro 06, 2013

How to disable Overlay Scrollbars in Ubuntu 12.04

There is a simple way to disable the annoying overlay scrollbars in Ubuntu 12.04. Just run the command bellow in the Linux console:


gsettings set org.gnome.desktop.interface ubuntu-overlay-scrollbars false


You don't need to reboot. Just close the applications and open them again, so the old style bars (which are much better) will become visible!

domingo, dezembro 09, 2012

How to install Xfce in Ubuntu 12.04

If you want to use less machine resources on Ubuntu 12.04, or if you simply didn't like Gnome 3 layout and usability, here goes a nice tip to you: use the Xfce desktop enviroment. It's lightweight and makes me remember the good old times from Gnome 2 also (this is just a personal opinion).

To install it on Ubuntu 12.04, use the  following command:

sudo apt-get install xfce4

After installation, you are going to be able to choose your desktop enviroment the next time you try to log in.


Another option is to download and install Xubuntu, a Linux operating system based on Ubuntu that comes with Xfce by default.

Xubuntu 12.04 with Xfce 4.10

terça-feira, maio 08, 2012

Linux "nice" command: running a program with modified scheduling priority

There is a very useful program for Linux for setting different priorities to a program: the nice command.
Priority ranges in Linux varies from -20 (greater priority) to 19 (lesser priority). So, the lesser the value, the greater is the scheduling priority.
Use nice is simple. In the example shown bellow, we want to run the program "your_program_name" using priority value 10:

nice -n 10 your_program_name

The default priority value is 0. If you want to set a priority less than 0 (greater priority than the default), you should run it as system root.

quinta-feira, dezembro 29, 2011

Raspberry Pi, the tiny and powerful US$25 computer

Here I'll be posting some videos about the Raspberry Pi, when they become avaliable.


Presentation of one of the first final boards:




First video of the Gertboard connected to the Raspberry Pi's GPIO:

quarta-feira, dezembro 28, 2011

The abusive price of electronics in Brazil

Last month, I've heard about the Raspberry Pi project. It's about a US$25~35 board, with an 700 MHz ARM processor (the Broadcom BCM 2835), 128/256 MB of RAM, USB, HDMI and Ethernet (depending of the model) connectors. Those boards are suposed to run some Linux distributions (initially Fedora and Debian) and programming languages such as Python, Java, C (and others), and it's aimed to educational proposes (but can you imagine the things that could be possible to do with such hardware?)





I've been very excited with the news that the Raspberry Pi final boards would be finished in December/2011 or January/2012, and they would be sold first in United Kingdom and maybe in the United States. Although, at the same time, I got worried about the possibility of that board never come to Brazil (the country I live) or to become a very expensive product that only few people could get access to. Since it's not being sold yet (until the publication of this post), I had a hope that all my worries could not become true.

Today, I knew that there is another similar project, but with a board (the BeagleBoard) that is more sophisticated than the Raspberry Pi, and is being sold for the recommended price of US$149 in the rest of the world, but in Brazil, due to a restriction of Texas Instruments that prohibits brazilians to buy that board directly from the United States through the Internet, it costs about R$850~975 !!!












Just for comparison, today US$1,00 is about R$1,90. So, we can conclude is that the BeagleBoard is being sold for, at least, 3 times it's recommended price.







I really hope that the Raspberry Pi can become a reality in brazilian education (from schools to universities), and I can't wait to get my own board. But if it costs much more than US$25~35, I'm sure that the dream is really, really over!

segunda-feira, novembro 21, 2011

Using a SSH connection as a proxy (SSH Tunneling)



For many people it is necessary to go the University to access many websites to download papers or journals. What many of those people don't know, is that is possible to create a socket (Windows/Linux) with a SSH (Secure Shell) server and then connect to the University server direct from your computer, using that SSH connection as a proxy server to your web browser (IE, Firefox, Chrome, Opera, etc). For that, you need:
*One client ssh (you can use Putty on Windows, for instance)
*Have a valid username and password to access the University server.

Bellow, there's one example about how it could be done using Windows (XP) platform.

In Putty's main screen we need to create a new "Saved Session". In this example, we called it "Tunneling". Create then save it. After that, in the same screen, set the host name and port.




Then in Category "Connection" click in SSH->Tunnels. Choose one random port (in this example we chose 8084) from your computer and type it in the "Source port" field. Before add, you need to set it as "Dynamic" (the default is "Local" as in the picture bellow, so change it).




After doing that, you can connect to the SSH server. Once connected is time to configure your browser. We are going to use Firefox web browser in this example, but it can be done in any other, like IE, Chrome, Opera, Safari, etc.

Open Firefox. At the upper menu click on Tools->Option, then choose "Advanced" and finally the "Network" tab. Click the "Settings..." button.

Select the "Manual Proxy Configuration", and set the IP "127.0.0.1" to SOCKS. The source port should be the same as you chose for your Tunneling configuration for Putty (in this example: 8084).


Click the "OK" button, then your IP address within the Internet is going to be the same as the server you are connected. To the Internet, it is as if you were accessing from your University (for example).

In fact, you are using the SSH server as a proxy server, and the data transmitted between you and that server are encrypted.

domingo, setembro 18, 2011

The Unix Time

Don't you know what is Unix Time?
According to Wikipedia: "Unix time, or POSIX time, is a system for describing points in time, defined as the number of seconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970, not counting leap seconds."

It's a linear representation of time, because we're just working with the amount of seconds that have passed from an event in the past (January, 1, 1970 00:00 - UTC time). Hence, it is widely used in computer systems because it's easy to store (only one "integer" variable is needed), and it makes some time calculations easier. Basically, you will work with dates the same way you work with integer numbers.


Bellow, we list some examples about how to get the Unix Time in different programming languages:

C#:

(DateTime.UtcNow - new DateTime(1970,1,1,0,0,0)).TotalSeconds;



Java:

System.currentTimeMillis()/1000;



JavaScript:

Math.round(new Date().getTime()/1000.0);



MySQL:

SELECT unix_timestamp(now())



Oracle PL/SQL:

SELECT (SYSDATE - TO_DATE('01/01/1970 00:00:00', 'MM-DD-YYYY HH24:MI:SS')) * 24 * 60 * 60 FROM DUAL



Perl:

time



PHP:

time()



PostgreSQL:

SELECT extract(epoch FROM now())



Python:

time.time()



R:

as.numeric(Sys.time())



Ruby:

Time.now



SQL Server:

SELECT DATEDIFF(s, '1970-01-01 00:00:00', GETUTCDATE())



Unix or Linux shell:

date +%s

domingo, julho 03, 2011

How to send an E-mail using the Linux command line (The Mutt Mail User Agent)

Yesterday I needed to send an e-mail with a file attached using the Linux command line. The solution was quite simple but I spent some very important minutes to find it. So there is it:


$ mutt -s "Mail's subject" -a file_to_attach.rar user@provider.com


I hope it could be useful to you one day.

sexta-feira, abril 22, 2011

DD-WRT - A Linux-based firmware for wireless routers

Are you satisfied with configuration options of your wireless router?



If the answer is "No", you should know that there are many third-party firmwares that you can install on your device, and give it options that you would find only in high-end routers.
In this post, I'm going to introduce DD-WRT. It's a free third-party linux-based firmware, under the terms of GPL license. It include features like daemon-based services, IPv6 support, Wireless Distribution System (WDS), RADIUS, Quality of Service (QoS), radio output power control, and many others.

I tried DD-WRT in my D-Link DIR-300 wireless router and I got many new functionalities, such as iptables, traffic graphs, better QoS support, blocking websites by URL or keyword, and others. One interesting thing is that now I can use my Wi-Fi router as a Client or as a Repeater (even the other wireless routers of the network doesn't support WDS). I present you some printscreens from its configuration pages:


Wireless Modes



Used CPU and Memory



Traffic Chart of this Month


DD-WRT can be downloaded at: http://www.dd-wrt.com. Note that firmware upgrades have a risk of damaging your device. Please read carefully all about it on the website. There you will find if your wireless router is compatible with DD-WRT or not.

quinta-feira, abril 08, 2010

How to configure Grub 2 in Ubuntu 9.10 (Karmic Koala)

I've installed Ubuntu version 9.10 (Karmic Koala) recently, and previously I had another operating system installed in my computer. I tried configure Grub (GRand Unified Bootloader) to execute the dual boot screen, so I noticed that this version of Grub was not the same as the previous versions of Ubuntu.


Ubuntu 9.10 uses Grub 2, and there are some new features to make it easy to configure.
First: You should NOT edit the /boot/grub/grub.cfg file. This file replaces the old /boot/grub/menu.lst Grub legacy file. By the way, it no longer exists.

Actually, there is another configuration file /etc/default/grub that can be edited by a root user (like the old menu.lst). Some of the parameters of this file are:

GRUB_DEFAULT: Sets the default and pre-selected menu entry. Entries may be numeric or saved.

GRUB_DEFAULT: Sets the default menu entry by menu position. As with Grub Legacy, the first "menuentry" in grub.cfg is 0, the second is 1, etc.

GRUB_DEFAULT: Sets the default menu entry by name. Example: "Windows XP Professional (on /dev/sda1)".

GRUB_DEFAULT: Sets the default menu entry with whatever was selected on the last boot. If the menu is displayed during boot, the previously selected option will be highlighted. If no action is taken, this is selection which will be booted at the end of the timeout, or if the menu is hidden.

GRUB_TIMEOUT: No change from Grub Legacy. This is the number of seconds before the default entry is automatically booted.
Setting a value of -1 will display the menu until the user makes a selection (no timeout).

There are another parameters that were ommited in this post.

After you edit /etc/default/grub, run the command update-grub at console as root user, so /boot/grub/grub.cfg will be updated automatically by system.

For further information about Grub 2, read: https://wiki.ubuntu.com/Grub2.