Bryan Seeds

30Jun/120

AWS ec2 Fedora 8 x86 Nginx Upgrade to nginx-1.2.1

Recently had to perform this. Here are some resources and my ./configure arguments.

Download

  • http://nginx.org/download/nginx-1.2.1.tar.gz

References

  • https://wincent.com/wiki/Updating_to_nginx_0.8.54_and_nginx_upload_module_2.2.0_on_Fedora_8
  • http://nginx.org/en/docs/install.html

My Config

./configure --user=nginx --group=nginx --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-cc-opt=-O2

Filed under: Uncategorized No Comments
21Apr/110

PHP : csv string to associative array

Here is a handy function :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function CsvStr2Array($str = ''){
		$data = array();
		$a = str_getcsv($str, "\n");
	    foreach($a as $k => $v){
	    	if($k == 0){
	    		$columns = str_getcsv($v);
	    	} else {
	    		if($k > 0){
	    			$v = preg_replace("/[^[:print:]]+/", "", $v);
	    			$row = str_getcsv($v);
	    			foreach($columns as $i => $col){
	    				if(is_null($row[$i])){
	    					continue;
	    				}
	    				$data[$k-1][$col] = $row[$i];
	    			}
	    		}
	    	}
	    }
	    return $data;
	}

might be the most efficient regarding big O notation.. but.. it works =)

6Apr/110

HOWTO : Select Your eCommerce Shopping Cart

Overview

So you want to sell something online, and you are sick of using eBay and Amazon, or you want to mix it up and scale out by opening your very own online store on top of using those services.  Well, that is fantastic! Now comes the big question, which shopping cart and approach is the best for me?  Do I need to hire a web designer, a marketing company, a programmer?  How are the customers going to be secured?  How are people going to find my site?  How much does something like this usually cost?

Well, no doubt there are a lot of questions for a newcomer or even a junior, when it comes to ecommerce.  After having over 14 years experience with ecommerce programming and electronic data interchange, I wanted to share some insights.

First I will address the question, "How much does something like this usually cost".  Well, as always, "it depends".   Some key reasons behind that statement are pointed out below :

  • number of customers
  • number of products in your catalog (how many individual unique sku's?)
  • number of catalogs (need distributor pricing, etc..)
  • number of product variations (colors, sizes, etc..)
  • are your products built to order (e.g. custom built)
  • computer hardware infrastructure requirements (servers, database, etc..)
  • internet and offsite marketing strategies (phone book, search engine, etc..)
  • personal experience with web design, graphic design, and computer troubleshooting

Above, you see a bulleted list of factors that can determine not only cost, but also can guide you to your perfect solution.  All ecommerce systems are designed, sold, and marketed around the above factors.  So, taking these into account let us describe a scenario, and see how it can resolve.

Common Scenario

Rosie is a knitter who wants to sell hand made curtains online, using her own store (so common I know).  She determines her budget is only $500 USD, and she wants to sell about 30 different curtains, with each a different price, image, and description.  Some of the curtains come in different colors, and all with different sizes.  She has some experience with computers including basic office, email, internet, social networks, limited graphic design, and photography.  She has a vision of what the store must look like, and she also has a marketing strategy to promote on search engines.  Finally, she does not currently have or operate a website, domain name, and knows nothing of them.

Requirements

Well, that is pretty basic, huh.  Sounds like a pretty common scenario and budget.  Ok well from the above paragraph, we can deduce her requirements :

  • cannot spend more than $500 USD
  • product catalog has 30 individual products
  • she needs product variations (e.g. colors and sizes)
  • she can do her own product adding, editing, and picture taking
  • she can figure out with guidance, how to do her own internet marketing
  • she can manage a web designer to meet her vision
  • she has no web host or domain name

Options

Now that we know what is needed, let's list her best options :

Solution 1

She can research on Google how to get her own domain name, web host, freelance designer, and have the web host install a generic shopping cart system.

  • go to GoDaddy and buy a domain name for $7.95 USD.
  • sign up for web hosting with HostGator for $6.95 USD per month
  • use the hosting cPanel to install a generic osCommerce installation, a free open source shopping cart system **
  • buy a SSL security certificate from GoDaddy for $29.95 USD
  • pay HostGator $10 USD to install the certificate onto your store
  • pay a oDesk freelance web designer $200 USD to design her site logo and osCommerce theme
  • put $50 USD towards Google AdWords campaign
  • creates PayPal acount to accept payments, sets up her own osCommerce configuration
  • creates UPS shipping account, sets up her own osCommerce configuration
  • adds her own products to the osCommerce product database

** osCommerce is only mentioned because it is included in cPanel with HostGator.  It is not recommended.  If you want open source shopping carts, look into Magento, osQuantum, and OpenCart.

Total Cost = $304.84 USD

Budget Balance = $195.16 USD

Not to shabby.. this solution works, meets her requirements, and budget.  However, everything went without a hitch, and she did spend countless days researching, managing web designer, and setting up her shopping cart payment/shipping modules.  Had anything not worked, she would have had to consult a more experienced person, possibly inquiring fees.  So, this is a solution that is not 100% simple, and leaves room for big errors.

Solution 2

She finds out there are "hosted shopping carts", available online for a subscription. She finds Shopify for $29 USD a month and BigCommerce for $24.95 USD a month.  Both carts offer similar features, she chooses BigCommerce because she doesn't want the 2% transaction fee** that Shopify adds on :

  • she signs up for BigCommerce $24.95 a mo
  • she elects to get a new domain name during sign up for $12.27 USD
  • security certificate is included in the BigCommerce package
  • chooses a free store template that makes her pretty happy
  • all payment and shipping modules are set up with guidance and video tutorials
  • she add her products with all variants and is pleased at how easy it was
  • cart includes free $50 value coupon for Google AdWords

** Shopify actually has a lot to offer, do not be discouraged easily by the transaction fee.  They more than make up for that.

Total Cost = $37.22

Budget Balance = $462.78

This solution fits her requirements perfectly, and is a breeze to setup.  She is up and running in less than two hours (domain propagation).  So safe to say, if you do not have existing infrastructure, large scale requirements, or a certain reason to obtain a custom shopping cart, one of these providers (Shopify or BigCommerce) can be largely beneficial.  Also, if you need to customized themes, modules, apps, extensions, add-ons, what have you.. they both offer and sell them for fair pricing.

Solution 3

You email me (generated110 {a-t} hotmail {d-o-t} com ), I create and manage your custom online presence starting at $500, includes internet marketing campaigns and I take a 3% transaction fee for one year.

This solution fits perfect for those who do not have the experience in the field, do not want to manage the process of customizing their store presence, and do not want to spend countless days marketing their new found brand online.

Conclusion

Well, I hope this article was helpful and can get your brain thinking the right way as to what approach would best fit your needs.  If you have any questions and would like to discuss with me about your needs, I would be more than happy to do so.  You can email me (generated110 {a-t} hotmail {d-o-t} com ), and I will reply.  Thanks for reading this and bookmark this page for future postings!

 

21Oct/100

Redmine 0.9.3.stable + SQLite 3.6.22 + Ubuntu 10.04 + Lighttpd 1.4.26

Well as the title states, this is just going over how I ended up configuring everything to get Redmine functioning in an Ubuntu 10.04 Lucid Lynx environment.

1. "sudo apt-get install lighttpd"
2. "sudo apt-get install redmine-sqlite"
3. "sudo ln -s /usr/share/redmine/public /var/www/redmine"
4. "sudo lighty-enable-mod fastcgi simple-vhost"
5. "sudo vi(m) /etc/lighttpd/lighttpd.conf"
6. Uncomment "mod_rewrite" from server.modules = ()
7. Check doc root is where you want it
8. Check that binded port number is correct
9. Check server.username and server.groupname for how you want this process to run
10. Create a virtual host in the lighttpd.conf for redmine similar to below :

$HTTP["host"] == "redmine.example.com" {
        server.document-root = "/var/www/redmine"
        server.follow-symlink = "enable"
        alias.url = ()
        server.indexfiles = ( "dispatch.fcgi" )
        server.error-handler-404 = "/dispatch.fcgi"
        url.rewrite-once = (
                "^/(.*\..+(?!html))$" => "$0",
                "^/(.*)\.(.*)"        => "$0",
        )
 
        fastcgi.server = (
                ".fcgi" => (
                        "redmine" => (
                                "bin-path" => "/usr/bin/ruby /var/www/redmine/dispatch.fcgi",
                                "socket" => "/tmp/redmine.socket",
                                "min-procs" => 1,
                                "max-procs" => 4,
                                "idle-timeout" => 120,
                                "check-local" => "disable",
                                "bind-environment" => (
                                        "RAILS_ENV" => "production"
                                )
                        )
                )
        )
}

11. invoke command ":wq" in vi(m) to write the altered lighttpd.conf changes to disk and quit back to shell.
12. "sudo vi(m) /etc/lighttpd/conf-enabled/10-simple-vhost.conf"
13. check simple-vhost.server-root setting to your web server root and other defaults
14. invoke command ":wq" in vi(m) to write the altered 10-simple-vhost.conf changes to disk and quit back to shell.
15. "sudo vi(m) /usr/share/redmine/config/environment.rb"
16. search for "config.action_mailer.perform_deliveries"
17. add this config if you want SMTP email notifications to work :

config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
      :address => "smtp.example.com",
      :port => 25,
      :domain => 'mail.example.com',
      :authentication => 'none' }
config.action_mailer.raise_delivery_errors = true

18. create a symlink to the sqlite3 database location somewhere for easier access
19. "sudo ln -s /var/lib/dbconfig-common/sqlite3/redmine/instances/default /home/user/_data/redmine-db"

Will update as I remember more =)

19Jun/100

SEEDS Technologies : New World Wide Web Order – jQuery

Just wanted to first let everyone know that SEEDS Technologies website has been redesigned a bit and includes the jQuery Content Slider to keep things fresh on the homepage. It is still in development progress, and me being so busy on other projects at the moment it gets updated piece by piece, day by day.

So, what I wanted to discuss is jQuery. jQuery has really revolutionized the web world and brought order to a stateless protocol. I love it! It has been many many times that I say to myself, this new age web world rocks! Back in the day I could only dream of this era, and here it is. I am curious to here from everyone some of the sexy and hip things they are doing with jQuery for their applications. After stumbling onto some javascript engineer job posting, it is no doubt that the trend and growth of this library is straight up.

Recently, with some spare time I have been developing jQuery plugins and trying out new code. Aside from hearing what people are doing, I was wondering if anyone has a good idea they would like to share for a jQuery plugin that they need written.

Anyhow, kudos to the library and I enjoy it everyday! Web development is sooo much better with it!

23Mar/100

Custom Magento Module for CMS Page

Today just wanted to discuss how to make a custom Magento module that will allow you to make your own blocks to load into a CMS page using the layout updates.  Really not going to get in depth in the the Models and controllers part of the module creation, going to save that for another time..  anyhow here it is.

First let's create the file to enable the module in magento :

app/etc/modules/{Namespace}_{ModuleName}.xml

<?xml version="1.0"?>
<config>
    <modules>
       <[Namespace_ModuleName]>
           <active>true</active>
           <codePool>local</codePool>
       </[Namespace_ModuleName]>
     </modules>
</config>

Next, we are just going to create a configuration file to define the Block configuration only at this point, for our module :

app/code/local/{Namespace}/{ModuleName}/etc/config.xml

<?xml version="1.0"?>
<config>
<global>
<blocks>
<[namespace]_[modulename]>
<class>[Namespace]_[ModuleName]_Block</class>
</[namespace]_[modulename]>
</blocks>
</global>
</config>

Now, let's go ahead and create our own Block class code to define the object used for our CMS/template page.

app/code/local/{Namespace}/{ModuleName}/Block/MyBlock.php

<?php
 
class <Namespace>_<ModuleName>_Block_MyBlock extends Mage_Core_Block_Abstract
{
 
public function __construct()
{
parent::__construct();
// any instantiation code here
}
 
protected function _toHtml()
{
 
// by overriding this method, you can define here everything you will render to browser, and use the inherited methods and accessors i.e. - $this->get[ParamName]()
 
return $html;
}
 
}

Last thing is to just throw this line into the CMS page content text area to load this custom Magento Block module.

 
{{block type="[namespace]_[modulename]/myblock" param1="value" param2="value"}}

So, that's it in a nutshell.. I will expand on this later for those who need more =)

9Mar/100

Distributed Company From Concept to Reality

This is a great idea, something that has been in my brain for some time now.  It is nice to see it is working the way it should.  Not only can software be developed with scalability, now even a company structure can be articulated to allow for scalability as well.  Check the article and see what I'm talking about : 5 reasons why your company should be distributed.

9Mar/100

Intel Calls 2012 The Year Of Mobile WiMax Iteration 2

Why WiMax?

WiMax is Worldwide Interoperability for Microwave Access, for those who have not heard.  This technology will allow for the masses to experience high bandwidth data interchange.  Below is an article I had come across on PCWorld.

" Chip giant Intel, a major backer of the movement to provide mobile WiMax wireless broadband to Internet users around the world, expects the next major release of the technology to be deployed starting in 2012, an executive said Tuesday.

"Standards work will be completed by the end of this year," said Rama Shukla, a vice president and director of the WiMax program office at Intel, during a news conference in Taipei.

The new Mobile WiMax standard, 802.16m, will replace 802.16e and offer far faster download and upload speeds. The new technology will provide users 170M bps (bits per second) download speed and 90M bps upload speeds, according to Intel data, and will be fully backward compatible with 802.16e. Users will be able to use the service even while traveling at speeds up to 350 kilometers per hour, he said.

Current WiMax network operators are offering service packages for 16Mbps download and 4Mbps upload on networks using 802.16e technology.

Shukla said that this year, estimates for the number of global WiMax subscribers range from around 6 million to 10 million, led by users in the U.S., Russia and Japan. Most of those users are turning to mobile WiMax for laptop computer use. "We see very strong momentum [for WiMax] in notebook PCs today," he said.

The earlier 802.16d version of WiMax is not called mobile WiMax because it was made for devices in fixed locations, not devices on the move such as smartphones in hand or laptops inside a moving train.

WiMax is competing with mobile phone-based wireless standards such as HSPA (High Speed Packet Access) and LTE (long term evolution) for wireless data services. WiMax is currently at a disadvantage because networks are just now being rolled out in many places and do not yet cover a significant part of the globe, unlike mobile phone networks, which cover much of the world's population.

In Taiwan, for example, WiMax wireless service provider Vmax Telecom covers Taipei, but its network does not extend outside the capital city. Meantime, Chunghwa Telecom, the island's largest mobile phone service provider, offers HSPA throughout Taiwan. WiMax promises download and upload speeds significantly faster than those on a mobile phone network in the future, but the mobile phone industry is also hard at work boosting performance to maintain its edge. "

-- this references verbatim the PCWorld Article

Also, another helpful resource is of course the WiMax Wiki.

8Mar/100

Windows NT 4 PDC Server + VMWare Server Migration (p2v)

Project Background

Had a customer come to me, needing to upgrade his old server to new hardware since he was having hardware issues on the old machine, and couldn't part with his software, data, and applications on his old server.  This server was an NT 4 Service Pack 6 primary domain controller, file server, application server, and print server.  Needless to say it was his entire company's backbone, and it was critical that this operation succeeded and without problems.  Below is how I managed to pull this one off.

Now the great opportunity of migrating over an old Dell Poweredge 2300 server fitted with a single SCSI hard drive, tape drive, and Windows Small Business Server 4.5 (Windows NT 4 Server Service Pack 6).  Below is an outline of how I performed this just in case anyone needs to reference this, or I do later, heh :

Project Tools

Tools I used for the Job:

And away we go...

First I powered down the physical server. Some would normally go in and disable network adapters, add Microsoft loop back adapter, and the like to conform with VMWare Converter Best Practices, but I was in a hurry =)..

26Oct/090

Apache Redirect HTTP to HTTPS

This article explains how to redirect a HTTP request to HTTPS so you ensure your visitors are always using an SSL enabled connection with the Apache web server.  This requires first that you have in your httpd.conf configuration file the SAPI module "mod_rewrite" un-commented and working, and of course that you have mod_ssl working also.  Then all there is to it is create an ".htaccess" file in your servers document root.  The file should contain the below :

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]

Also, there is another method.  Simply append to your httpd.conf file these lines :

SSLRequireSSL
Redirect permanent / https://www.domainname.com/

Hope that is of some help to some of you.

Tagged as: , , No Comments