Saturday, April 15, 2017

Setting Up nginx and php on Windows 10

Got a new laptop recently and hadn't set up php and nginx in a long time went looking for a simple setup and thanks to TechTuts they had just what the doctor ordered.

Friday, April 7, 2017

Find All Files Modified In Last Day Excluding Path

Recently had a situation where we were trying to track down which files had been modified in the last 24 hours but needed to exclude the cache directory since it builds files often and for a large site sifting through this is time consuming.

The following command will show all files, recursively, that have been modified in the last 24 hours and exclude the cache directory.

user@machine> find . -not \( -path ./wp-content/cache -prune \) -mtime -1 -ls

Sunday, May 1, 2016

Add YouTube Channel to Your Podcast Software

Go to http://podsync.net/ and past the channel URL.

If you're not sure of the channel URL perform the following:

1) Subscribe to the channel
2) Go to your channel listing in youtube.
3) Right click and select Copy link address
4) Paste into box on podsync.net and copy the link they provider to your podcast software, I use pocketcasts.com.

Thursday, February 11, 2016

Recursive Replace Text in Files

If you ever have a need to replace text in files (including subfolders) execute the following linux command.

In the below example we wanted to replace a copyright on a group of html and php pages.
2010 - 2015 became 2010 - 2016


user@machine> find . -type f -name "*" -exec sed -i'' -e 's/2010 - 2015/2010 - 2016/g' {} +

Sunday, May 17, 2015

Nokia 635 - Consumer Cellular MMS and Internet

Moved to Consumer Cellular a year or so ago using Apple and Android phones. A family member has a Lumia 635 running Microsoft Phone 8.1 and was unable to send/receive group SMS messages and picture text messages.

The below settings resolved the issue on the 635, see this point for the fix for a Lumia 520.

To edit/add the settings perform the following:

1) Go to System Settings > cellular+SIM > SIM settings
2) Click [Add/Edit] internet APN

APN: att.mvno
User name: [leave blank]
Password: [leave blank]
Proxy server (URL): 66.209.11.32
Proxy port: 80
 ...and click Disk icon to save

3) Click [Add/Edit] MMS APN
APN: att.mvno
User name: [leave blank]
Password: [leave blank]
WAP gateway (URL): proxy.mvno.ccmobileweb.com
WAP gateway port: 80
MMSC (URL): http://mmsc.cingular.com/
MMSC port: 80
Maximus MMS size: [leave blank] 
 ...and click Disk icon to save

Although it should work with other Windows Phone 8+ models it would be appreciated if you could post your model below and a go/no-go if it worked for you to benefit others on the web.

All the best!

Monday, April 27, 2015

Nokia 520 - Consumer Cellular MMS and Internet

Moved to Consumer Cellular a year or so ago using Apple and Android phones. Recently switched to a Lumia 520 running Microsoft Phone 8.1 and was unable to send/receive group SMS messages and picture text messages.

The below settings resolved the issue on my 520, see this point for the solution for a Lumia 635.

To edit/add the settings perform the following:

1) Go to System Settings > cellular+SIM > SIM settings
2) Click [Add/Edit] internet APN

APN: ccdata
User name: [leave blank]
Password: [leave blank]
Proxy server (URL): [leave blank]
Proxy port: [leave blank]
 ...and click Disk icon to save

3) Click [Add/Edit] MMS APN
APN: att.mvno
User name: [leave blank]
Password: [leave blank]
WAP gateway (URL): proxy.mvno.ccmobileweb.com
WAP gateway port: 80
MMSC (URL): http://mmsc.cingular.com/
MMSC port: 80
Maximus MMS size: [leave blank] 
 ...and click Disk icon to save

Although it should work with other Windows Phone 8+ models it would be appreciated if you could post your model below and a go/no-go if it worked for you to benefit others on the web.

All the best!

Tuesday, September 24, 2013

Create Archive of Website

If you have a website that you're retiring but would like to copy it from your current registrar without having to sFTP/FTP the following command will copy it in Linux.

wget --recursive --domain [domain] --no-parent --page-requisites [location]

Wednesday, September 18, 2013

Force Verizon Galaxy S3 to CDMA Only

There are quite a few people searching for an old app that would force the S3 to CDMA only or maybe they are wanting a way to turn off 4g on an Android phone. In my case it was necessary because I had invested big $$ in a signal booster however it only handles the 800 MHz and 1900 MHz frequencies. Well guess what 4G uses, if you're with Verizon not those two frequencies.

The old app was named Phone Info and was in the Google Play store but has been removed/retired. After some search stumbling across a comment for this post which indicated there is a post here that explains the issue but it requires registration. However after registering it turns out it just refers to a Google Play store app.

Short answer, install the Battery Monitor Widget. Once installed click the Tests button on the bottom right, click the Device Info menu and VoilĂ  scroll down and select under the 'Set preferred network type:' menu.

Tuesday, September 10, 2013

Nginx - Count of IP addresses in /var/log/nginx/access.log

Inspired by this post which supposedly works for Apache and also works for my Nginx installation. It seems however, some of the comments didn't work quite right on our Debian Lenny equipment.

Did away with grep (instead using cat) and tweaked to fix sorting not working correctly.

cat access.log | cut -d' ' -f1 | sort | uniq -c | sort -rg

If your log is big enough to scroll multiple pages when logged in remotely.

cat access.log | cut -d' ' -f1 | sort | uniq -c | sort -rg | less

Tuesday, October 16, 2012

Wordpress on Steriods

We have corporately started moving all of our clients which use a CMS from Drupal to Wordpress. There are a few reasons but we have been pleased with the functionality and performance of Wordpress on our hosted infrastructure. One of the primrary things we've done in our migration to Wordpress in buying some products which expedite our ability to take clients from concept to live site. We've done that using some of the below products. We will provide more in-depth reviews of the products as we have time.

All the best.

Catalyst Website Builder
Catalyst Dynamik Themes and Skins

We will also use this post as a place to keep some other helpful Wordpress links that we have referred back to during the migration process.
Changing Wordpress Site URL

Tuesday, March 6, 2012

Bulk File Rename

As usual there are command I use just often enough to forget them when the time cose. In our case we had a group of files that has the file extension in caps which was causing a problem with some 3rd party javascript so instead of modifying the .js files we change the extension to lower case (.JPG to .jpg).

for file in *.JPG ; do mv $file `echo $file | sed 's/\(.*\.\)JPG/\1jpg/'` ; done

Friday, September 16, 2011

Drupal 7 Painfully Slow Performance

We recently (yes, finally) started testing Drupal 7 and there is only one word for its performance....SLOW! It seemed to load quickly on the home page after the installation but once we logged back in it was as if we were attempting to run the site on a x86 with 512MB of RAM from a USB RAID array.

This server has a dev version of Drupal 6 that screams along without any issues but the defaul Drupal 7 installation was not performing well. After some research on the web it appears the performance issues are caused by modules that provide functionality to the server and client (a.k.a. browser).

To help with client speed disable the following modules (http://yoursite.com/admin/modules/list).
- Overlay module
- Toolbar module (Disclaimer: Make sure you have installed a module which replaces the admin functionality such as the Administration menu module before disabling this module.)

Server side:
- Update Manager Module

Disabling those three modules caused a significant increase in the response time and performance of our Drupal 7 sites.

All the best.

Tuesday, April 19, 2011

Compound Interest Calculator

Have you ever wanted to do a compound interest calculation but don't have a calculator in front of you? Here is a nifty way of doing it with Google.

A more detailed description of the below formula is provided in the Wikipedia link above however here is simple example which takes US$10,000 which is compounded at 5% annual interest 2 times per year for 20 years.

10000(1+(.05/2))^(2*20)=

Each number is as follows, the bolded number represented the item being described:
10000(1+(.05/2))^(2*20) = US$10,000.00
10000(1+(.05/2))^(2*20) = Fixed value (do not change)
10000(1+(.05/2))^(2*20) = 5% interest rate converted to decimal
10000(1+(.05/2))^(2*20) = Numbers of times the interest is compounded per year
10000(1+(.05/2))^(2*20) = Number of years the money will have to grow

Tuesday, March 29, 2011

Find Text Within Files

If you're a Linux Geek who likes to spend time figuring out a problem and writing grep commands this post is not for you. If you're using Linux, specifically a Debian distro such as Ubuntu, and need a quick solution and do not have a mastery of the command line nor time to write scripts for Gnome Nautilus this is your post!

Background:
Started using Ubuntu again due to finally having decent support in Google Talk for Drag/Drop file transfer and Google Voice Chat in Empathy. Since I use this quite a bit in my business it was imperative this work correctly.

Problem:
The ability to search inside of a variety of files (such as: pdfs, office 2K3 and 2K7 files, text files, etc.) for specific text. Tried apps such as sagasu, regexxer and even tried a few Nautilus scripts but they didn't perform what I needed.

Solution:
Google Desktop
If you've used it before you know how it works, if you haven't download it and give it a try. Here is a short post about how to install, setup and use Google Desktop on Ubuntu.

Monday, March 21, 2011

Help - SearchFilterHost.exe is hogging CPU!


Are you having the problem of SearchFilterHost.exe, SearchProtocolHost.exe and/or SearchIndexer.exe performing a HIIT workout on your CPU? We had the same problem with our Vista machines having an usually high CPU utilization and found that the following minor change helped fixed the problem.

Try and disabling the .XML file extension from being indexed in the Indexing Options control panel.
Answer by Eric Wolz - MSFT
via this thread


How do I change Windows indexing options?

Thank you Eric!

Friday, October 22, 2010

Show all NVRAM Settings in Tomato

1. Log onto the router
2. Go to Tools > System
3. In the textbox type nvram show
4. Click Execute button
5. Should see results similar to below:


DD_BOARD=Asus WL-520GU/GC
Fix_WL520GUGC_clock=1
NC_DocumentRoot=/www
NC_ExcludePorts=25
NC_GatewayMode=Open
[snip]

For NTP Update on Tomato

1. Log onto the router
2. Go to Tools > System
3. Type ntpc in the text box. If U.S. based you can use ntpc 0.us.pool.ntp.org
4. Click Execute button
5. Should see results similar to below:

Trying 0.us.pool.ntp.org [72.14.177.132]:

Time: Sat, 23 Oct 2010 00:53:23 +0000, no change was needed.

Tuesday, July 6, 2010

Send MySQL Backup thru Google Apps Email using PHP

This post combines items that were gathered from a few sites. The problem we were trying to solve is emailing a MySQL database backup using PHP PEAR through Google Apps. This script could also be easily modified to send through gmail. The file includes some hints and links to assist you whenever/wherever possible. Thank you Peter for providing the starting point for this script.



// enhanced from original provided @ http://www.theblog.ca/mysql-email-backup

// install the following pear modules
// pear install mail_mime
// pear install mail
// pear install net_smtp

// see this entry for more information about pear mail
// http://www.phpmaniac.net/wiki/index.php/Pear_Mail

// mysql database connection information
$dbhost = "localhost"; // usually localhost
$dbuser = "mydbuser";
$dbpass = "mydbpass";
$dbname = "mydbname";

// create the mysql backup file
$backupfile = $dbname . "_" . date("Y_m_d") . '.sql';
system("mysqldump -h $dbhost -u $dbuser -p$dbpass $dbname > $backupfile");

// includes
include('Mail.php');
include('Mail/mime.php');

// smtp settings
$params["host"] = "smtp.gmail.com";
$params["port"] = "587";
$params["auth"] = true;
$params["username"] = "myusername@mydomain.com";
$params["password"] = "mypassword";

// email settings
$cr = "\n";
$recipients[] = "Recipient 1 ";
$recipients[] = "Recipient 2 ";
$sendfrom = "sender ";
$sendsubject = "Backup - MySQL - mydomain.com";
$text = "Database backup performed on " . date("m/d/Y @ H:i:s", time()) . $cr;
$text .= "File name: " . $backupfile;

// *************************************
// do not edit below this line
// *************************************

$message = new Mail_mime();
$message->setTXTBody($text);
$message->AddAttachment($backupfile);
$body = $message->get();
$extraheaders = array("From"=>$sendfrom, "Subject"=>$sendsubject);
$headers = $message->headers($extraheaders);
$mail = Mail::factory("smtp", $params);
$mail->send($recipients, $headers, $body);

// Delete the file from your server
unlink($backupfile);

?>

Friday, May 7, 2010

Installing Tomato Firmware on Asus WL520GU


If you're like me having an integrated router and NAS is a big plus. Our needs at my house are somewhat tame, we don't need the fastest NAS nor do we need a full-on Cisco Firewall/Router setup. Also being constrained by US$ (aren't we all) a low cost solution that would allow us to run custom firmware such as dd-wrt and USB storage was what I was looking for.

The WL-520GU was right up our alley and the price was right at less than $40 from Newegg. After getting the unit and trying the stock firmware for less than an hour it was obvious the custom firmware was going to be installed soon. The unit kept locking up on Skype calls and it has issues with the USB drive when rebooted. It could well be user error however we had not noticed that those same behaviors with our Linksys WRT54Gs.

After reading conflicting information on the web and anecodotal testing at the house we were not able to get the USB working for the 520gu using dd-wrt. We did have dd-wrt installed however the USB was not going to work with us, much like a goat not wanting to be milked. Then we stumbled on this article, An Easy Guide to Installing Tomato on the Asus 520gu, and soon the birds were chirping and our USB drive was sharing files like it was born to. We seemed to get the same performance on the storage as indicated in this article, So How Fast Is NAS Under Tomato? You May Be Surprised!. The only changes from the installation article were the following:

1) We used a newer version of the USB hacked Tomato ND firmware which we retrieved from here. Most of the sites seem to link to this post at LinksysInfo.org which has been down for an upgrade for the last two days.

2) We did not reset the router to the default settings when upgrading to the Tomato firmware. This presented the biggest problem of not being able to log into the router with the existing username & password, the default tomato username and password or any of the other 20 or so gyrations that were tried. Eventually doing multiple reset and power cycles allowed us to log in.

The tomato firmware has some nice graphs and other settings that I like more than the dd-wrt firmware and once I get familiar with everything I'm sure there will be some things I miss as well.

Good day and best wishes.

Monday, April 19, 2010

Drupal 6 Shortened URL to Files Directory

We recently had a situation where a client wanted shorter URLs since they were sending out emails and e-newsletters to clients and wanted things shortened up. Since Drupal 6 requires that uploaded files have the entire path it is obvious how that can be an eyesore for some people.

Current URL:
http://{domain}/sites/{domain or alias}/files/{file}.{extension}

A workaround is to go to the file system on the Drupal directory (/usr/share/drupal6) and create a symbolic link to the directory.

user@machine /usr/share/drupal6> ln -s /sites/{domain or alias}/files/{file}.{extension} {short-alias}

Example:
user@machine /usr/share/drupal6> ln -s /sites/blogger.com/files/ mbf

So the new URL becomes:
http://{domain}/mbf/{file}.{extension}