How do I cut and paste from Windows into PuTTy / Linux Shell?
LAMP, Linux December 30th, 2008
From shell to Windows
You can select and take some content from the terminal window to the clipboard by holding down the left SHIFT key and the left mouse button
From Windows to shell
You can paste some content into the terminal window: by holding down the right SHIFT and click with the right mouse button to the actual position of the cursor.
UPDATE: see comment below
Breaking down SEO nice urls
Apache, Google, SEO, optimization, Linux April 24th, 2008
Every developer knows that Apache rewrites rules to break down urls with lot’s of query strings are one of the most efficient ways to optimize your site for search engines.
Recently I have to create a series or rules to work with a extensive directory list in one site and here are some of the things that you can use when creating your rules.
1. If you are working with a directory listing or if you will use an address as part of the search on the query string, then, when creating the url create in a ordered manner way, but at the title, write it in back order way.
Think like this: When you search for a product or service on a search engine you will probably do service + city + state, right!? Then writing the title with service, city and state will increase the chances that you have to appear on the first pages on the search engine results.
2. When creating the rules be sure to put them in a logic order way. Apache will not understand too similar rules pointing to different pages if one contains less requirements than the second.
Consider this:
1st. RewriteRule ^directory/([A-Za-z+]+)/([A-Za-z]+)/([A-Za-z+].+)/?$ /list.php?&c=$1&s=$2&v=$3 [NC]
2nd. RewriteRule ^directory/([A-Za-z+]+)/c/([A-Za-z+].+)/user/([A-Za-z+,.]+)/([0-9]+)/?$ /detail.php?&c=$1&v=$2&name=$3&id=$4 [NC]
With this disposition, apache will not understand the second rule, even knowing that the rule is there, because the first rule requirements will became true before the second, but if you invert the rules, apache will understand both, since the second rule has more requirements than the first and not all the requirements where matched.
3. Try to create a rule that is a catch all for something that you are not expecting. This will avoid the user and search engine view something that is not supposed to be there.
Linux Command Line Power: find
Linux November 19th, 2007
Working with Linux, I spend a lot of time searching for files. Sometimes I don’t know the name of the file I’m looking for, I just know that it’s big. Or maybe I’m looking for any file with 777 permissions. That’s where find comes in.
find can virtually find anything on your computer and comes with a lot of options. This tutorial will introduce a basic use of it and show how you can search your filesystem for file names matching a name pattern.
Full HOWTO: http://www.debuntu.org/how-to-find-files-on-your-computer-with-find
PEAR, MDB2, MIME/Type on Verio Server
PEAR, Linux, Web Development, PHP November 16th, 2007
I have just expend a whole morning trying to figure out why the MDB2 and the MIME/Type libraries wasn’t working on the domain under Verio server even knowing that all of them were installed.
Every single time I was getting a different path error in one of the libraries and forcing the path on the files wasn’t working either.
After some research I have found out that the PEAR installation did not carries every library that you need to work with MIME and MDB2, and the php.ini does not have the include_path set.
Making the story short.
Change php.ini to set the include path. This should be, for the Linux server, something close to this:
include_path = ‘/usr/local/php5/lib/php/’;
Save the file and verify the configuration for PEAR. It should be the same as the include_path.
For that type pear config-show and it will bring a list for the pear configuration.
Verify the list of installed libraries for pear. For that type pear list.
Check if all your libraries are there including the System_Command necessary for the MIME/Type.
Install all necessary libraries.
Restart apache and you are good to go.
su -c & Linux Certification
Certification, Linux November 5th, 2007
The purpose of the -c option with the su command allows you to execute only one line of commands as superuser before returning to the account of the former user.
The commands that follow must be enclosed in quotation marks if there are any spaces in the commands.
su -c "ls /root"
I’ve noticed that the -c option is often present in the correct answer on Linux Certification practice questions because it is a good security practice to use the lowest level of priviledge needed to complete a task.
Practice Exams for Linux Certification
Certification, Linux October 9th, 2007
I’m collecting links to practice exam questions to take Linux+ CompTIA exam XK0-001
http://www.free-tests.com/comptia.cgi
Some additional tests although the tests may be out of date and some of the answers are incorrect:
http://www.passitnow.com/comptia.html
Posts