STARTUP LIFE

#entrepreneur #techie #analytics

Hey there, I'm Shanif! I'm working in the tech field and have a background in technology, analytics, startups, and even options trading. I've been developing software since 1997, working in startups since '08, and started trading options in '09.

I have a BS in Computer Science and Information Systems Engineering, and an MBA (specializing in Quantitative Finance and Entrepreneurship & Innovation). These days, I'm working on product analytics at Twitter after they acquired a mobile ad company I helped build after b-school. Come say hello!

Though I love connecting with people in real life, I have a strong web presence. Feel free to get in touch.

Subscribe (enter your email):

photos
People, Places, Things - My Best Shots
my pov
New Solution For WordPress “White Screen of Death”
January 13, 2011 Shanif Tech

I’m in the process of rebuilding Intigril’s website, and as I do so, I have to tightly integrate the Rails and WordPress pieces of it. One of the issues I was recently having was the WordPress “White Screen of Death.” This is a problem that most WordPress managers have probably seen at one point or another.

You try to go to your WordPress homepage and the only thing you see is a blank white screen. There’s nothing in the logs. There’s nothing in the source of the page. Just blank, white, death (thus the name). Doing a quick Google search shows that thousands of others have experienced this problem. Like any other technical issue, there are a variety of causes and solutions (bad plugins, extra spaces at the end of files, messed up wp-config.php files) – all of which I tried to solve my current issue, and all of which subsequently failed.

After going through a whole day’s worth of efforts, I read through a couple of forum posts on my web hosts’s support site and realized that they may have to make some entries into my Apache vhost file (since I am running WordPress as a subdirectory of a Rails app that is running on Passenger).

When I contacted them, they gave me a one line, extremely simple answer. As far as IT things go, these are generally the best solutions, and in my case, it fixed my issue. All I had to do was put PassengerEnabled off in the .htaccess file of my WordPress root directory.

As soon as I did that, both the homepage of my WordPress installation as well as my admin login page came up without a hitch. Hopefully this will help those of you out there that are experiencing the WSOD and are seeing no success with the other, more common solutions out there.

View comments →
7 Comments
Patrickmoda on April 25, 2016

flights bdl to fll change flight date finnair cheap tickets dollywood american airlines multiple flights airport idioms airline agnostic american airlines multiple flights fm flights airports association council international southwest airlines in flight wifi airports oxford cheap flights hyderabad to bangalore airports glasgow map flights cuba to mexico cheap international air tickets yatra .com airports near agadir cheap tickets to pakistan delta airlines flights cheap air tickets domestic india qwg airport code esta return date discount tickets tn aquarium book cheap flights ibiza pwc airports zambezi airline return sas date wkl airport airlines uvf qantas flights leaving sydney today united airlines flight schedules download airfares venice to budapest united airlines - airline tickets vacations packages travel deals cheap airline tickets to guadalajara mx flights dsm airlines watertown ny airline trenton nj search for airline codes rn airline code american airlines flight change charge airlines hk1 united airlines gbp cheap tickets outback bowl flight status rj 193 airfare sydney to brisbane qantas flight overbooked airport kva airline zb flight code cheap flights lcy flight status ewr to sfo flights aguadilla puerto rico

Patrickmoda on April 27, 2016

flight information exeter flights to hre from london airlines iloilo to manila airports gainesville fl airport over beach flights kelowna to vancouver fy airlines airline uld dimensions rdu airlines arrivals discount fly fishing equipment mp online hotel booking airport aeroplane live flight information sri lanka budget airline search asia change flight date frontier airlines airport zlin flight information cairns airport cheap air tickets in india airline cell phone qantas missed flights rmv airline flights to fpo airport flight search different airports cheap flights agadir manchester cheap flights yvr to bkk cheapest air ticket dhaka to kolkata airfare dfw to cancun airlines bkk flights djibouti airline pnr spicejet cheap bhuj tickets cheap tickets nyc to las vegas airport list in usa cheap tickets knotts berry farm coupons qantas airfares brisbane to sydney cheap lfc tickets flights thailand airport mggt airlines flying to gnd airports bureau systems ltd airline fcom xkh airport code cheap airfares bne to lax airport bzn flight status ool airfare okinawa to manila southwest airlines in flight entertainment airport phoenix airline fz nl airline code

Patrickmoda on May 4, 2016

fdp airline departure date putlocker yda airport airports herefordshire discount airfare nicaragua flights glasgow to london xsh airport departure date deutsch emirates flight offers jc flights airports mn flights zurich to amsterdam cheap flights ryanair to malaga flights jordans fpr flights edmonton airports authority airline cvg delta airlines flight dl 200 airport rmf online hotel booking raipur flight iwd airport oxford ms cheap airline tickets from okc airfare international surcharge airports ct usa gbas airports airports equipment cheap airline tickets cambodia wpb airlines srilankan airlines information airfares to myrtle beach from new york singapore airlines qff sleeping in airports hkg lufthansa flights with flynet vtf airline code cheap tickets shanghai flight information volaris airlines domain knowledge flight information ac794 gb airline tax code qantas flights enquiries airport byelaws airline ftl airline mnl-wnp airport hnl hotel airline dcf valuation search rail ticket availability flight information victoria bc southwest airlines flights on time x burlesque cheap tickets

RonaldTauM on July 25, 2016

порядочный веб сайт bosch - caterpillar, cat.

Sprut77t on August 13, 2016

Если вам желательна программа которая надежно выполнит уничтожение информации обязательно загляните к нам. Наша программа Terminator, выполняет уничтожение информации на отлично! Вы можете быть спокойны за свой бизнес, если удаление данных на вашем компьютере выполнил Terminator! зайдите на наш сайт: http://www.gkclab.com/russ/terminator/terminator.html

MaggiLow on August 29, 2016

Если вам желательна программа чье назначение удаление данных с диска обязательно зайдите в наш магазин. У нас есть и система умный дом и система умный дом просто загляните на наш сайт: http://www.gkclab.com/

VampAdd on September 15, 2016

Ужасные призраки Франции ждут вас! Обязательно приходите к нам и призраки Франции расскажут вам свои тайны. Только на нашем сайте вас ждут реальные истории в которых привидения в России играют свою зловещую роль. И так - приходи на http://www.mystictourism.com

Leave a Comment
Getting Tidy To Work On 64-Bit Linux Systems
June 18, 2010 Shanif Tech
Image from Riebart (Flickr)

Image from Riebart (Flickr)

For one of the tools I’m making for Intigril’s new site, I need to do some scraping and parsing.  There’s a great Rails plug-in for this called scrAPI.  This plug-in uses a separate plug-in called Tidy.  Tidy is used to clean-up bad HTML so that it’s easier to parse.  A while ago, I wrote an application that utilized both of these plug-ins to do some extensive scraping and parsing.  Everything was working fine until my shared host decided to upgrade their system (isn’t it funny how upgrades usually tend to break everything).

Well, they ended up going to a 64-bit server, which caused a whole lot of issues for me.  It turns out that in order to use Tidy, you have to have the compiled binary for it loaded onto your system.  scrAPI comes with that binary when you install it, but that binary is compiled for 32-bit systems.  When you try to use it on 64-bit systems, you’ll get an error that says the file can’t be loaded.  It’ll read something like this:

Scraper::Reader::HTMLParseError: Scraper::Reader::HTMLParseError: Unable to load /var/lib/gems/1.8/gems/scrapi-1.2.0/lib/scraper/../tidy/libtidy.dylib

It took me a while to figure out what this really meant, but ultimately, it means you’ll need to get a different version of the file “libtidy.so” – one that’s compiled for 64-bit architectures.  This seemed easy enough – after all, all I had to do was find a file and toss it onto the server.

It’s never really that simple, though, is it?

It turned out that my host already had a copy of this file on their server (in fact, they had several copies of this file, which I found by using the command “find / -name ‘libtidy.so'”.  Once I found the right file, I thought that all I’d have to do next would be to tell Tidy to use that file by setting the path in my production.rb config file, as such:

Tidy.path = "/path/to/libtidy.so"

When I did that, though, I got the following error the next time I tried to run my code:

/path/to/gems/tidy-1.1.2/lib/tidy/tidybuf.rb:40: [BUG] Segmentation fault

Things went from bad to worse.  It turns out that this was a known bug, and there was a patch for it.  You can see the details on this page.  I read all of the posts on that page and made the following changes, as suggested:

  1. Added the line "extern void tidyBufInit(void*)" to the ‘load’ method in the file tidy-1.1.2/lib/tidy/tidylib.rb
  2. Added the following method to the same file (Tidylib):

    #tidyBufInit, using default allocator
    def buf_init(buf)
    tidyBufInit(buf)
    end

  3. Added the following line to the initialize method in the tidybuf.rb file:

    Tidylib.buf_init(@struct)

  4. Added the following field to the TidyBuffer struct:

    "TidyAllocator* allocator"

I saved those changes into the version of Tidy that I had frozen to my Rails app.  Once I made those changes and re-deployed my code, everything was working perfectly.

View comments →
2 Comments
Farooq on May 18, 2011

I trying doing this running on Ubuntu 11 (64 bit), but still getting the same error. I am not sure if I got this line correct - embarrased smile - is this supposed to be in double quotes: "TidyAllocator* allocator" on placed in the struct. I have tried copying the litidy.so etc , that did not work either. Any ideas / suggestions ?

Shanif on May 18, 2011

Oops, sorry, that line should not be in quotes. What it's doing is allocating a pointer to a TidyAllocator object, so it is a line of code. Try that and see if you have any luck.

Leave a Comment
Getting XAMPP, Passenger, And Rails To Play Nicely On A Mac
June 3, 2010 Shanif Tech
Image from Flickr

Image from Flickr

Even though I’ll be switching into the world of sales and trading (and hopefully entrepreneurship) fairly soon, I’m always going to be a techie at heart.  Ultimately, I think that will help my career.  I’ll always be interested in developing applications to solve problems.

Most recently, I needed to install and configure Phusion Passenger and Apache on my Mac so that I could get to work on Intigril’s website.  I wasn’t too worried about this, since everywhere I look, I read articles about how easy it is to install Phusion Passenger.  Oh ye of too much faith.

I just spent the past day struggling with my system.  Fortunately, I’ve been able to get everything up and running, but not without a lot of hassle.

The first thing I tried was installing MAMP on my Mac.  That went off without a hitch.  Then I tried to install Phusion Passenger.  The installation went okay, but when I tried to start the server, it wouldn’t do anything.  It turns out that Macs come pre-installed with Apache, and that when you install Passenger, it will get compiled against that version.

In order to solve this, the Passenger documentation site says that you have to export a certain environment variable.  The website also clearly states that you need to open a “root shell” before running any commands, because using the “sudo” command will eliminate any environment variables you previously set.  I didn’t read that part, so when I tried to install Passenger, it would never get installed to MAMP’s Apache, so when I made the necessary changes to my httpd.conf file, Apache would never start.

So I tried to compile Passenger against my native Apache installation instead.  However, the problem with that was that I would continually get 403 Forbidden errors.  I obviously tried “chmod”ding the heck out of all of my directories and files, but to no avail.

So the next thing I tried was installing XAMPP for the Mac and then compiling Passenger to that installation of Apache.  I made the same mistake as before, so it obviously didn’t work.  That’s when I took a closer look at the documentation and saw that I needed to switch into a root shell by using “sudo -s”.  Once I did this and exported the correct environment variable, I was able to install Passenger into my XAMPP installation.

Following that, I updated my hosts file so that “intigril.local” would point to my local installation, fired up my web browser, and instead of my shiny new site, I got “Passenger Error #2.”  It said something about not being able to “stat” the “config.ru” file in my Rails root directory.

I had no idea what this meant.  I don’t even know what config.ru is used for.  It turns out this was another permissions issue.  The resolution was to update Apache’s configuration file with the following:

  1. Make sure the “User” that Apache runs as is not listed as “nobody.”  I tried changing it to “www” but it still didn’t work, so instead I just used my own user account (hey, it’s just a dev box).
  2. Update the Virtual Host so that Rails runs with the correct username.
  3. Update the Virtual Host so that Rails has the correct DocumentRoot.
  4. Update the httpd.conf file so that it includes the module for virtual hosts.

This post helped a lot in getting through a lot of the configuration issues.

After I did all that, I finally got it working.  The next step will be to get WordPress up and running as a subdirectory of my Rails site.

Wish me luck.

View comments →
2 Comments
Richard on March 2, 2011

Thankyou for posting this! Just saved me a few hours and clumps of hair!

Shanif on March 2, 2011

Glad to help, Richard!

Leave a Comment
contact
Contact info
  • Name: Shanif Dhanani
  • Address: New York, NY, USA
  • E-mail: shanif.dhanani@gmail.com

Name

Email (required)

Subject

Message