ViniciusMuniz.com - Programação, linux e afins.
ViniciusMuniz.com - Programação, linux e afins.
  • Linux
  • PHP
  • Contact
CentOS, Debian, Linux, MySQL, Programming, Ubuntu, Uncategorized

What is Iptables, what it’s for, and how to use?

November 1, 2014by viniciusNo Comments

Iptables

After a long time, I finally had some time to write again, and this time I intend to keep a periodicity. The reason for my absence? Well now I have Dom

Without further ADO, let’s get to the point, what is Iptables, to that server, and where do I use it?

Continue reading
CentOS, Debian, Linux, Ubuntu, Uncategorized

TTY: How to reduce the number of terminals and increase performance

February 7, 2014by viniciusNo Comments

As we saw in the last article TTY: What is? What’s the use? . If you think you do not need as many TTY as those available by default in your environment. I agree, and it affects a little performance of your linux .. but rather it. Certainly for those who need the full potential of a machine that will make a difference.

There are ways you can decrease the amount of TTY of their distribution here will decline to 3 the device files , if you want to you can change as you wish, just following the logic, and steps.

Continue reading
Linux, Ubuntu, Uncategorized

Installing lighttpd on linux easily

January 28, 2014by viniciusNo Comments
Instalando lighttpd

Instalando lighttpd

There is always a doubt, and a great discussion about the best web server . I think it’s complete nonsense .. all (those who pay) always have an application which does well.

Continue reading
Linux, PHP, Programming, Ubuntu, Uncategorized

Enabling PHP on lighttpd without difficulties

January 28, 2014by viniciusNo Comments
lighttpd pagina padrao

lighttpd pagina padrao

To enable php on lighttpd, is very simple.

The facility is geared to ubuntu -. http://ubuntu.com , but in other distributions, is basically the same thing

We use the fastcgi- http://www.fastcgi.com/ for this connection between the two. Remembering that php has to be CGI.

Continue reading
CentOS, Debian, Linux, Ubuntu, Uncategorized

Update date and time in linux

January 28, 2014by viniciusNo Comments

There are several ways of update date and time in linux , among which the simplest are:

For server

Easier however, there is the need to have internet connection, and ntpdate installed.

If you do not have ntpdate installed you can install from source: http://www.ntp.org/downloads.html , or whether you have the aptitude:

 aptitude install ntpdate 
Continue reading
Linux, Ubuntu, Uncategorized

How to solve problem with languages of ubuntu

January 28, 2014by viniciusNo Comments

A little over two weeks, I was having a problem with a server, it always showed me the error:

 perl: warning: Setting locale failed.
perl: warning: Please check your que locale settings:
LANGUAGE = "en_US",
LC_ALL = (unset),
LC_MESSAGES = "en_US.UTF-8"
LC_COLLATE = "en_US.UTF-8"
LC_CTYPE = "en_US.UTF-8"
LANG = "en_US.UTF-8"
are supported and installed on your system. 
Continue reading
Debian, Linux, Subversion, Ubuntu, Uncategorized

Installing Subversion on ubuntu

January 28, 2014by viniciusNo Comments

What is Subversion?

Subversion is a control system version free / open-source. That is, Subversion manages files and directories, and the changes made to them over time. This allows you to recover older versions of your data, or examine the history of their changes. Because of this, many people think of a version control system as a sort of “time machine”.

Subversion can operate across networks, which allows it to be used by people on different computers. On one level, the ability for various people to modify and manage the same set of data from their respective locations fosters collaboration. Progress can occur more quickly without a single conduit through which all modifications must occur. And because the work is versioned, you need not fear that their work quality for not miss this one for changes via the data suffers an improper modification, just undo that change.

Continue reading
Debian, Linux, Ubuntu

Creating a DEB package

January 28, 2014by viniciusNo Comments

Deb is the Debian package or as an ‘installer’ for Debian-based distributions. There are two types of Debian packages, both with the same functionality to implement certain command, resource or resources.

Continue reading
CentOS, Debian, Linux, Ubuntu, Uncategorized

Understanding permissions on linux easy way

November 26, 2013by viniciusNo Comments

permissao-linux

Permissions on Linux, is the main "feature" of Unix-based systems. They are used in different ways and for different purposes. But mostly for safety and organization of a system.

Through the permissions, you can define who can access, write and execute a file. Any per group, or per-user. With permissions, Linux prevents a malicious program, for example, delete a file that should not send special files to someone else or provide network access for other users to invade the system.

Let us understand better, and learn how to change and check the permissions of certain directory or file.

Checking permission

To check the permissions of a file or directory, it is common to use the command ls with parameter -l , it’s will discover with the permissions and owners of files and directories .

ls -l /home/vinicius/tmp/

Returns me the result:

total 4
-Rw-r - r - 1 vinicius vinicius 0 Nov 22 12:59 index.html
lrwxrwxrwx 1 vinicius vinicius 15 Nov 22 12:59 link -> / home / vinicius /
drwxr-xr-x 2 vinicius vinicius 4096 Nov 22 24:59 test
-Rwxrwxrwx 1 vinicius vinicius 0 Nov 22 13:00 test_777

Okay? Ta thinking this is a lot of loose letter right? Let us understand what each part of it means.

directory, link, file?

To know what each item is, just look at the first letter.

  • l => means that this item is a link;
  • d => That item is a directory;
  • – => A file;
  • b => block file;
  • c => character special file;
  • p => channel;
  • s => socket;

rwx what’s this?

You noticed that these letters are being repeated throughout the list of ls, each has its meaning:

  • r => read – indicates read permission;
  • w => write – indicates writable;
  • x => Execution – indicates execution permission
  • – => indicates no permission

Ready now know the meaning of each letter, we can now interpret the results of ls command. We can divide the result into 3 parts, let's take the first line as an example:

rw- |  r -  |  r -

Each group of 3 characters means this order, the permission for the owner, permissions for the group that owns the file owner and permissions to other users.

Reading data only allowed -rw-r – r – , we can identify that a file is that the file owner has read and write permission, and that the other ( group and others) allowed only read.

Permission Bits

Each letter has its corresponding bit, which can be identified as follows:

Lyrics Binary Decimal Meaning
— 000 0 No permission
– x 001 1 Execute permission
-w- 010 2 Permission writing
wx 011 3 write and execute permission
r – 100 4 Read Permission
rx 101 5 Readable and execution
rw- 110 6 Permission reading and writing
rwx 111 7 All permissions

Changing permission

Using the above table if we can change the permission of files and directories with the chmod.

The syntax of the command chmod:

 chmod   

Some examples:

Full permission

 chmod 777 test.txt

Permission read-only

 chmod 444 test.txt 

Permission reading and writing to the owner, read for others

 chmod 644 test.txt 

besides using chmod permissions with numbers , there is also possibility to use the most boring form of letters . Where we need to understand that

  • u => user;
  • g => group;
  • O => other;
  • a => all;
  • + => add permission
  • – => remove permission
  • = => set the permission

With this we can use the chmod as follows :

Execute permission for the user

 chmod u + x test.txt 

Read permission for the group

 chmod g+ r test.txt 

The danger of allowing 777

As I said earlier , the permission 777 is the full permission to something , ie everyone can edit, delete , write . Imagine a file with permission 777 where everyone can edit it , someone with malicious intentions can edit your file , and run it , you can steal valuable information , run something on your operating system and erase data . So it is normal if you use permission 755 for directories and 644 for non-executable files such as php files on hosting servers .

Even this is something that some servers block with suPHP , whenever you have getting error 403 , first check the permissions of your files and folders , as in 90% of cases the problem is this .

You can understand more about it at:

http://www.guiafoca.org/cgs/guia/intermediario/ch-perm.html
CHMOD Wikipedia

CentOS, Debian, Linux, Subversion, Ubuntu, Uncategorized

4 tips to improving the performance of linux

November 13, 2013by viniciusNo Comments

We’ll cover some more advanced forms of improve the performance of linux.
Disabling than anything, or fiddling with the interface.

I separated the 3 things that I normally use to improve my servers, and virtual machines.

Performance linux

Ramlog

For those who do not know what is ramlog … can kill yourself now. Just kidding, read the rest. Then mate.

As the name says Rams – log means store the log in the ram, instead of pouring it on disk directly. How common is used by syslog.

Thus is avoided that there is always written to disk, which is a bottleneck of performance on any server. Exist only when the ramlog is restarted or stopped.

The use of ramlog, makes a big difference in performance

Ramlog – http://www.tremende.com/ramlog site you can find the installation tutorial for various distributions.

Continue reading
Page 1 of 212»
  • English

Subscribe!

Thank you!

Recent Posts

  • What is Iptables, what it’s for, and how to use?
  • How to send a POST request without form
  • TTY: How to reduce the number of terminals and increase performance
  • TTY: What is? What’s the use? How to use it?
  • How to iterate through multidimensional array with php

Recent Comments

  • Vinicius Muniz on How to send a POST request without form
  • jeeja.biz (@jeejabiz) on How to send a POST request without form
  • a on How to send a POST request without form
  • Comandos linux que você deveria saber on 18 Linux commands you should know
  • TTY: How to reduce the number of terminals and increase performance on TTY: What is? What’s the use? How to use it?

Tags

array at date date in linux java java in ubuntu Linux Linux linux commands linux permissions mysql mysql.sock nmap ntp performance php php programming programming start php tips php ubuntu ubuntu languages zend zend framework zf zf2

Categories

  • CentOS
  • Debian
  • Linux
  • MySQL
  • PHP
  • Programming
  • Subversion
  • Ubuntu
  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org