Me in IT UNIX/Linux Consultancy is based in Breukelen, The Netherlands and specialized in UNIX and Linux consultancy. Experience with Red Hat Enterprise Linux (Red Hat Certified Architect), Fedora Project, CentOS, OpenBSD and related released Open Source products makes Me in IT UNIX/Linux Consultancy a great partner in implementing, maintaining and upgrading your environment.
Open Source software is an important aspect of any Linux distribution. Me in IT UNIX/Linux Consultancy tries to use Open Source software where possible and tries to share experiences actively. In the articles section you will find many UNIX/Linux adventures shared for others to benefit.
I understand from non UNIX-ers that permissions can be challenging to understand. This article should get you going on any UNIX/Linux like operating system.
Each file (or directory) has a permissions based on identity:
And each identity (user, group and other) can have a set of permissions. These can be expressed in more than one way; the whole word, the character representation of it or the numerical representation of it.
Now that you know this, lets take a look at a listing of a few file, using ls(1) command: ls -l.
$ ls -l
drwxr-xr-x 2 robert users 4096 Dec 27 14:51 bin
-rwxr-x--- 1 robert users 31 Feb 14 09:13 script.sh
-rw-r--r-- 1 robert users 13 Feb 14 09:12 textfile
The first column represent these permissions, the third and fourth column refer to user and group. So; the directory "bin" has these permissions: drwxr-xr-x Lets go over the individual characters:
You can repeat the same for those two other files. The difference is that script.sh and textfile are not directories, so:
Write means to have the ability to write in that file, aka modify.
Execute means the file can be executed, if there is code inside that actually does things, you are normally dealing with a program.
If you would express permissions with a number, you first split up the three parts, then count permissions for each part. For example:
Some logical combinations are:
Some strange combinations are 057, 077, 040, 007, etc.
Good, you are almost up to speed. One thing remaining; how to set or modify these permission. There are a few tools to help you:
So, when you create a file, and would like to restrict a file to be only readable by the owner, you would use this command:
$ chmod 400 file
You could also use the more readable syntax of chmod(1):
$ chmod o-rwx,g-rwx,u-xw,u+r file
As using the human readable syntax for chmod requires more typing, it is almost better to use the numerical format. The only exception is when you only want to add on permission (like execute) without interfering with already existing permissions.
chown(1) is used change the owner of a file. It's rather straight forward:
$ chown robert:users
chgrp(1) is even more straight forward, it changes the group of a file or directory:
$ chgrp users file
You have learned a major component of UNIX/Linux/*BSD operating systems. If you need more help, also see the man(1) pages of chmod(1), chown(1) and chgrp(1) by typing man chmod for example.
In my profession (UNIX/Linux and *BSD environments) Open Source is commonly used. My personal vision is that Open Source does not specifically imply free. Let's see what a randomly selected group of people answer to the question:
"Is Open Source software Free software?"
Person 0: No, for example Linux is not free; you are not free to do what you want.
Person 1: Open Source is not Free Software. Open Source is possibly free.
Person 2: Linux is financially free.
Person 3: Yes, Open Source software is free.
Wow, the answers are actually not what I expected. There is a difference in interpretation of Free. Lets take a look:
It seems that I was only thinking about the financial side of free and had forgotten about the functional aspects of free!
If you see all the ugly URL's in your sitemap.xml, like /node/123, but have URL paths specified for those nodes, here is how to fix the problem:
It's that simple, but can make a huge difference, because you need to let search engines know how to access nodes based on your URL paths rather then the node number. Read more about SEO.
Here are a few ways to shorten your Linux/UNIX/*BSD commands. Keep in mind that some short commands are less readable by others.
|Long version||Short version||Characters won||Application|
|cat file | grep -v some | grep -v thing||grep -vE 'some|thing' file||13||Shell|
|sort file | uniq||sort -u file||4||Shell|
|boot bsd||bsd||5||OpenBSD bootloader|
|grep -v '^#' file | grep -v '^$'||grep -vE '^#|^$' file||11||Shell|
This feature can change the mobile market, just as built-in camera's have, possibly more! If you download Google Maps for your mobile phone, you can use My Location. It does not use GPS but uses GSM antenna information to know where you are. This is not as accurate as GPS, and costs data, but if you have no GPS and have a data-plan, this is a cool feature. Take a look at this video:
Now what could be the next steps:
Integrate with friends locations. Know where your friends are! Imagine being at a party, checking your phone to see if any other friends are there!
Wardriving with only your mobile phone. If your phone supports WLAN, use it to scan access-points.
Chatting to strangers nearby. Imagine a chat program that enables you to find people that have "Chat with anybody" set as a preference.
Geocaching. GPS is more accurate, so this would require more descriptive hints, but it's possible!
Here in The Netherlands it tells me it is accurate within 1700 meters/1.1 mile, but the dot is acutally only 400 meters/0.25 miles away. I guess that mobile geographic application will dominate the future.
I was looking how to generate A records with the bind trick $GENERATE. There are lots of small articles available about setting up reversed lookups, but I could not easily find how to use this trick with A records. Therefore, here are my lines:
$GENERATE 32-127 $ A 192.168.1.$
$GENERATE 32-127 $ PTR $.your.domain.name.
After reading many blogs and articles, I have discovered these basic ingredients keep me interested:
5. Short articles don't scare me away
Long articles make me loose interest when I see them. Shorter articles can be much more informative. I only take a minute, maybe 2 to read your article.
4. The essence keeps me interested
Some articles go into (not very interesting) details. This makes me loose interest too.
3. Structured articles help me
I want to be able to see the structure of the article/information within seconds. Using lists (<ol> and <ul>) and headings (<h2> or <h3>) helps.
2. Specialized topics interest me
I don't want to read news-paper style articles, otherwise, I would have bought a news paper. I am on the internet because I can read all these special articles.
1. The title should capture all information
I skim through websites only reading titles. Only if a title interest me, then I will stop scrolling and read that article.
A good example is the titles used at Boing Boing.
I was amused after reading this Network Solutions domain name registration story, I tried it for myself. Check out how easy it is to make Network Solutions pay another few Euros/Dollars:
You can use online services, but whois from the command line like this:
$ whois networks-solutions-suck.com
No match for "NETWORKS-SOLUTIONS-SUCK.COM".
A stupid web-form on Network Solutions will say the domain is available for you to register. Meanwhile, Network Solutions has registered the domain.
As you can now see, Network Solutions has registered the domain. This process takes a few minutes only.
$ whois networks-solutions-suck.com
Domain Name: NETWORKS-SOLUTIONS-SUCK.COM
Registrar: NETWORK SOLUTIONS, LLC.
Whois Server: whois.networksolutions.com
Referral URL: http://www.networksolutions.com
Name Server: NS1.RESERVEDDOMAINNAME.COM
Name Server: NS2.RESERVEDDOMAINNAME.COM
Updated Date: 21-jan-2008
Creation Date: 21-jan-2008
Expiration Date: 21-jan-2009
Registering a domain costs money, so I suggest you type in many idiotic domain names that nobody will ever be interested in. Some suggestions:
Have you ever wondered where you spend most of your online time? With the weekend coming up, here is a list of websites and activities that I do regularly.
Have fun but be sure to switch off the computer after a few hours, go and have a drink in the city, where your RL/physical friends are.
I was on the place, about to fly back from a great holiday in South Africa, when they had a problem with a transmitter on the aircraft. So, they had to "reboot" the whole aircraft. While this was happening I got a chance to see the entertainment system boot up. And, too my delight, I saw that it runs Linux!