Browsed by
Category: Tutorials

How to search for specific text within your website’s PHP files using SSH

How to search for specific text within your website’s PHP files using SSH

Here’s a quick little tip for anyone that needs to plow through a zillion PHP files to find a specific line of code or a specific keyword.   I recently needed to scan the entire P2L folder for a specific word within any PHP files in the main public_html and subfolders.  The alternative would be to download everything to your local PC and then run a search locally on your PC.  That’s fine and dandy if you have a small site that would only take seconds to transfer, but it’s a different story when you have dozens of folders and subfolders and hundreds of pages.

So, let’s put the magic of Linux to work shall we?  Open up Putty or whatever SSH program you use and log in and make your way to the public_html folder of the account you want to search.

Here’s the command you want to run:

grep -r -i -l "keyword" *

Hit enter and the quary will run… be patient as it will take some time to complete.  It will list any files found that contain your keyword as the query runs.  Here’s a breakdown of the command flags used:

-r recursive (will search folder and subfolders)

-i case insensitive (ignores UPPERCASE or lowercase)

-l list only (displays names of files found only)

Hope that helps!
Dan

The SEO Marketing Traps – There is no secret SEO recipe you don’t know about!

The SEO Marketing Traps – There is no secret SEO recipe you don’t know about!

After a recent experience of mine with some SEO related service questions, I wanted to put together a few thoughts on SEO services, tactics and maybe put some of your minds at ease… both for people who provide SEO, people who do SEO package reviews like me, and users of SEO.  If you’re trying to find the secret ingredient to SEO success, you might like to read this.  Please note this is an updated posting, the tutorial has been moved from the old host.

You’ve probably seen the emails…  a company in India is a leading SEO specialist, and for a monthly fee ranging from $100 a month to over $1000 will perform some SEO magic on your website, making you more visible, higher ranked on keywords, increased PR and even possibly a better lover!  You’ve been busting your head trying to figure out what these guys are doing that you’re not…?  your site has been stagnant and after a couple of months of work, you’re not really getting anywhere.  So what the HECK are these guys doing that’s you’re not?  What secret recipe are they using that will yield the amazing results you’ve been after but have failed to produce?  What do they know that I don’t?!

The answer is likely… nothing.  And here lies the trap, and likely leads to the most common SEO mistakes most of us have fallen prey to at some point.

SEO is real, powerful and necessary for the success of your website even at a basic level.  Internet marketers and specialists focus (or least should focus) very strongly on SEO practises, and SEO companies like YEAH! Local are trying very hard to let all webmasters know that SEO is important and that you need to use them and their elite SEO knowledge to get results and be the top of the world quickly and effectively.  The truth of the matter is many of us think that SEO is a bag of tricks that changes month to month and that only a few folks that have dedicated hundreds of hours to the study of SEO truly know what they’re doing.

Good news…  that’s completely untrue, and most SEO tactics that result in overnight increases in traffic often do more harm than good as they are probably against search engine guidelines and their TOS.  You have to change your mindset completely… there is no secret recipe or overnight tricks.  You need patience and time, plain and simple.

 01. There is no SEO smoking gun!

The first mistake to avoid is looking for the secret that you believe SEO experts know and you don’t.  Every single SEO concept and tactic you need has been repeated over and over in thousands of free tutorials and articles all over the web.  Deep down you probably even know that, but you’re on a mission for more organic search engine traffic so you throw caution to the wind and decide to pay an expensive SEO service that will employ exactly the same tactics you already know about, they will simply dedicate more time to it than you probably realized was required, and even the best of SEO companies can’t deliver overnight results unless they are performing shady blackhat tactics.  SEO is a lot like investing money… you need to think long-term, as in 6 months down the road, not 6 days or 6 weeks.  Forget about spam campaigns or link directories with a million other SEO “gurus” have posted links.  You need to focus on quality backlinks and real keyword research, and of course the king of web marketing: CONTENT!

02. Search Engine Guidelines

Another mistake most webmasters make is to completely disregard user guidelines of the major search engines.  I think it’s safe to say that most of us know that Google has a TOS with very specific guidelines of what you can and can’t do to optimize your site for it’s index, but how many of us have actually read it?  Oh, you have?  Good stuff, now how many of you check it for changes on a regular basis?  That’s what I thought…  and yes it changes quite often.  Following these terms is critical if you care about search engine traffic because you can score some very effective tips on optimizing your site, plus find out what could end up getting your site penalized.

03. Internal Linking Strategy

The final mistake I see quite a bit, that even I am working on correcting, is internal linking.  You can bust your butt on backlinks, but if you ignore the topology of your internal link, you are missing a VERY important ingredient to your SEO success and your ability to earn what is called “link juice”.  First time you hear this term?  Link juice is the currency used by Google to determine why your site should outrank others.  For a great explanation on link juice and how it works, check out this article.

The fact is, it’s extremely difficult, if not damn near impossible to control how other sites link to you, but you can do whatever the heck you want with your own site.  Internal linking is an art-form on it’s own and can yield significant long-term gains when properly applied.  By creating effective internal linking, you’re more or less promoting other areas of your site that are less popular, but still possibly relevant to your visitors.  This increased visibility on an internal level can introduce your users to features, areas and content they may have never realized you had, and these users are all potential backlinks, social media buffs or word-of-mouth links to untapped traffic.  Just check out large sites like Microsoft, Amazon, eBay, Digg and many more… you’re presented with the content you are looking for, as well as internal links to other relevant areas in an effort to engage you and explore further.  This is effective internal linking.

Again, you’ve read SEO articles before and most say the same thing… you need to focus on the following:

Onsite SEO

  1. Establish and optimize your website pages for specific keywords.  This includes metatags, URLs and content.
  2. Investigate and research your competitors… see where they rank for keywords and how they are optimizing their pages.  Are they ranked higher than you?  You can find out why by checking meta tags, backlinks and their content pages.
  3. Optimize your title, meta and header tags.
  4. Optimize your anchor text, your robots.txt and your image Alt tags.
  5. Write relevant content as often as possible!
  6. Fix broken links on your site.
  7. Create an XML sitemap and submit it.
  8. Ensure your site is included in major search engines and see how you rank for your top 10 – 20 keywords.  Keep track on a monthly basis to check your progress.
  9. Install and use Google Analytics.
  10. Validate your code for easy crawler inclusion.

Offsite SEO

  1. Verify search engine guidelines and make sure you are compliant
  2. Research and build up backlinks to your site… there are dozens of strategies.
  3. Create a separate blog and keep it updated with content regarding your site, updates, research and other projects.  Use it to generate interest!
  4. Create articles for open distribution
  5. Take advantage of social media and social bookmarking sites
  6. RSS Feed submission
  7. Forum posting
    Search for link directories and link exchanges relevant to your site’s content and join them!  Don’t just submit to everything under the sun, most link directories are completely useless.

I’m sure I’m missing a couple of items on here, but this is everything you need to know, and this is everything an SEO company will do for you no matter how much you spend per month.  There are no magic bullets, smoking gun or any other catch-phrase worthy techniques you don’t know about, it’s all out in the open.  The key is to dedicate time to your SEO strategies and set long goals for results, but short-term goals to get there.  For example, rather than say “OK this month I want to increase my traffic an extra 5000 visitors a day” look for a more tangible short term goal such as “This month I will create 50 new one way links to my site”.  With small monthly goals, the long-term traffic goals will follow and will likely exceed your initial estimates.

Of course, if you have absolutely no time to optimize your site for search engine traffic, that’s an whole different issue and at that point you may wish to employ the services of a reputable SEO consultant, but don’t spend a cent if you’re thinking they know something you don’t.  Patience and hard work always trumps looking for a quick fix and instant results.

Now for some handy links you should know about…

Google Webmaster Guidelines
Yahoo Terms Center
Bing’s Webmaster Center
W3C Standards
SEO Centro Keyword Rank Checker

That’s for me on this one guys, thanks for reading and see you on the next tutorial!

Take care,
Dan

How to use the other black ink cartridge when one is empty on your Canon Pixma MX850 Printer!

How to use the other black ink cartridge when one is empty on your Canon Pixma MX850 Printer!

My Canon Pixma MX850 printer is one of the Canon series that uses the 4 small CLI-8 color cartridges (black, yellow, blue and magenta) and then has the large PGI-5 black cartridge, which is what the printer uses when printing regular black and white text. The smaller CLI-8 black cartridge is only used for printing photos and colored documents that require black coloration… now, in the world that us simple folk live in, you would think that if one black runs out, it would use the other black as a backup, right? Not so my friends, the Canon doesn’t use that kind of logic and there’s no way to bypass it within the printer’s menu. BUT FEAR NOT! With a couple of clicks, you can trick the printer in to using the other cartridge.

First off, this applies to when your large black cartridge is empty… the one used for printing standard black and white documents. So if you’re printing out your thesis at 4AM when everything is closed and run out of ink mid-way through, this will save your ink-starved derriere! Here’s how to force the printer to use the smaller ink cartridge:

  1. Click on print to get the print options window in whatever program you’re using… This is the window where you normally select the printer you want to use, how many copies etc.
  2. Within that window, you should see a link, button or icon that allows you to adjust the printer settings, such as paper, paper source, ink use etc.
  3. Switch the paper type from regular paper to “high resolution paper”.
  4. Click OK and close the settings window.
  5. Print your document.
  6. Post a comment on this post telling me if it worked.
  7. Mail me your underwear a check.

 

Hope that helps someone out there!  It saved my ass last weekend when I had to print tickets with barcodes 20 minutes before leaving for the St. Sauveur Aquapark!

Dan

Unable to pair your Motorola S9 or S9HD Headset with your iPhone? Separate them!

Unable to pair your Motorola S9 or S9HD Headset with your iPhone? Separate them!

Hey guys… just a quick little tip for anything who is having a bitch of a time pairing their Motorola S9 bluetooth headset to their iPhone. I recently dove in to the world of Mac with an iPhone 4G and was having a horrible time at getting my headset to pair, yet pairs with my Android phone in 2 seconds with zero issues. I dug all over the web for solutions and didn’t really get anywhere until I tried something so stupid that I couldn’t believe it worked. I powered on the headset and placed in across the room and it paired within seconds! *shakes head* So apparently the unit won’t pair with the iPhone if both are sitting on your dining room table, but works fine when they’re in separate rooms, go figure.

Oh and this was only necessary for the initial pairing. Once paired for the first time, the S9 connects right away when I power it on and they’re next to each other.

By the way, I can’t believe how you Mac fans are so rabid about the iPhone, it’s quite honestly the most horribly conceived smartphone I have ever used in terms of usability. Even after unlocking it, jailbreaking it and loading all kinds of apps to regain some basic usefulness, my Nexus One was still more functional straight out of the retail box. I still can’t believe you guys are forced to use that ridiculous iTunes for music management, what a HUGE piece of crap that application is.

Anyhow, I’m sure I’ll get used to the iPhone once I’ve hacked it to normalcy, but good lord do I feel bad for someone who’s not very tech savvy and gets saddled with this phone. Nick is promising good things with iOS 5, but until they allow me to connect the phone via USB and it opens with explorer like a normal external drive to move around photos and music (even a FREE basic noname brand phone does this) this will never be as good as an Android or Windows based phone.

I will say the iPhone is fast… the buttons respond very quickly and the screen is gorgeous with smooth transitions on the menus and apps. But the lack of support for so many common features that every other smart phone has is infuriating. No widgets, no writable drive via USB, too many paid apps vs Android marketplace, no free google maps GPS, can’t place icons where you want on the springboard… when you drag them to move them around, they always sort to the top left. You need a third party app for free placement and can only get that app after jailbreaking the phone.

The list goes on and on, but that’s for another post I think… for now, I hope this helps S9 users get paired up with their iPhones!

Dan