Uncategorized

How often do my Rackspace Cloud servers have issues?

by on Apr.20, 2012, under Uncategorized

I have about 6 cloud server instances running and they seem to have problems too often. But I never actually listed them out, so going back through my cloudkick and rackspace emails here’s what I have for the past 6 months or so.

I have emails going back through Fall of 2009. There is rarely a month without an outage. While most are short, this level of uptime is probably unacceptable to many businesses.

Oddly enough, my server with the highest level of traffic has not died yet. I’m not sure if that is because it is on newer hardware or if something in the OpenStack system doesn’t like my mostly idle boxes.

One of the failures earlier this year left me with a corrupted filesystem. While restoring from a backup is simple enough it took a little while to get my Master/Slave replication on Mysql working again. (Slave was ahead of the master). The rest of these issues took no work on my part other than pinging the RS team if they weren’t already working on the issue.

2 Comments more...

Simple logic problems from interviews

by on Jun.30, 2011, under Uncategorized

I love logic/algorithm problems but during an interview I can sometime just blank out on these questions.   I don’t feel like taking a lot of time but at the same time some of the problems are quite complex if not approached in the right way.

Problem 1:

You have an array that contains 0s and 1s.   Order the array.

Now if memory and performance weren’t a factor this is as simple as doing a ones_and_zeros.sort in ruby (where ones_and_zeros is the array).

You could also build an array of 0s and 1s and then merge them but if the array huge and taking up too much memory this is less than ideal.   You could also add up all the 1s and build a new array but then you are also building a second array and iterating twice.

So the correct answer is to do this inline.

My solution is to loop through the array, replacing any 0 with a 1 and putting 0s on the front of the array.  There is the main loop index and then the zero index that points to the location of the last 0.

 

def sort_it!(ones_and_zeros)
 zero_index = -1
 for i in 0 .. ones_and_zeros.size
   if ones_and_zeros[i] == 0
     zero_index +=1
     unless zero_index == i
       ones_and_zeros[zero_index]=0
       ones_and_zeros[i] = 1
     end
   end
 end
 return ones_and_zeros
end

This works fine but I got stuck and came back to this problem later.  :-\   I should probably google this and see if there is a better way.

Problem 2:

Next problem was..  you have 5 bottles of pills,  1 has bad pills.  The bad bills weigh 9oz and good pills are 10oz.  You can use the scale once.  You can weigh pills, bottles or any combination but you can only use the scale once.

Now you could weigh pills 3 pills from different bottles and determine narrow down to 2 or 3 which bottle has the bad pills but we need to know which one has the bad pills.

After what seemed like an eternity I figured it out.   put 1 pill from bottle #1, 2 from #2, 3 from #3, etc on the scale.   if all the batches are were good these 15 pills would weigh 150oz.  but there are bad pills.  If they were in bottle #1 it would weigh 149oz, in #2 148oz. etc.   Isn’t this fun!    It is fun unless you are under a the pressure of a interview…  that said I guess this tests how people react under pressure as well as their logic skills.

Final problem

you need to determine what the highest floor on a 100 story building that you can drop a marble from before it will shatter on the ground.   You have 2 marbles to work with and you need to minimize the number of tries.   You could go floor 1, 2,3,4, etc but then worse case you have made 100 tries.

I immediately started thinking about dividing the problem like a binary tree.  Try floor 50, then 75 if no breakage, then 62 if it broke but you only have 2 marbles so the worse case is 50 tries.  start at 50.  breaks,  go back to 1 and progress to 49.

Now what if I moved up 5 floors at a time.  Worse case is 99 with 24 tries.   5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,96,97,98,99

Ok, how about 10s?  10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 91, 92, 93,94,95,96,97,98,99

19 tries.  better

There must be a formula here..  assuming a fixed increment we have ceiling(floors/increment) + increment -1

This seems to work ceiling(100/10) + 9 = 19 and ceiling(100/5) + 4 = 24 check out.

Ok,  graph this thing and find the lowest point..  turns out with this technique 19 tries is the best by using 10 as the fixed increment.

But the real answer is 14 using an increment that changes.   I’m out of time for today but I’ll probably dig into that one while i sleep.  :-)

 

 

 

2 Comments more...

Getting Rails/Nginx installed on Ubuntu 10.10

by on Apr.10, 2011, under Uncategorized

I did a fresh install of Ubuntu today and figured I would share the steps and packages necessary to get Ruby on Rails running.    I always miss a package or 2 and need to go back.   Here is what worked for me today.

Rails3 / Ubuntu 10.10 / MySql / Nginx / Ruby 1.9.2

Core packages

  
sudo apt-get install curl # RVM needs it and it is good to have
sudo apt-get install libcurl3-dev  # needed by several gems and nginx i think
sudo apt-get install git # RVM needs it and it is good to have
# Packages needed by rails and some popular Gems (also ssl for nginx)
sudo  apt-get install build-essential bison openssl libreadline6  libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev  libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf  libc6-dev ncurses-dev
# MySql
sudo apt-get install libmysqlclient-dev  sudo apt-get install mysql-server
# needed by nginx
sudo apt-get install libpcre3-dev  #nginx

Install RVM

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
#fix .bashrc then
rvm install 1.9.2  # or whatever ruby version you like
rvm –default use 1.9.2
gem install rails

Install Passenger/Nginx with SSL

Grab Nginx tarball

cd /tmp
wget http://sysoev.ru/nginx/nginx-0.8.54.tar.gz
tar -zxvf nginx-0.8.54.tar.gz

# install the gem
gem install passenger

# build Nginx
rvmsudo passenger-install-nginx-module
  • Watch Phusion Passenger do its thing and when it asks you “Automatically download and install Nginx?”, answer 2
  • Specify the directory where you unzipped the nginx source code (Please specify the directory: /tmp/nginx-0.8.54))
  • Specify the directory where you want to install nginx to (/usr/local/nginx in my case)

You’ll need a init script for nginx.  Get it here and follow directions

http://wiki.nginx.org/Nginx-init-ubuntu

To start Nginx use

sudo /etc/init.d/nginx start

Now at this point your nginx.conf needs some changes.  You need to point to your Rails apps and setup passenger.

Here is my http section for /usr/local/nginx/conf/nginx.conf .. this is a dev setup.  don’t read too much into it.

 

http {
 passenger_root /home/tony/.rvm/gems/ruby-1.9.2-p180/gems/passenger-3.0.6;
 passenger_ruby /home/tony/.rvm/wrappers/ruby-1.9.2-p180/ruby;
 passenger_user_switching on;
include       mime.types;
 default_type  application/octet-stream;

 log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
 '$status $body_bytes_sent "$http_referer" '
 '"$http_user_agent" "$http_x_forwarded_for" "$http_host"';

 access_log  /tmp/nginx.access.log  main;
 sendfile        on;
 keepalive_timeout  65;

 server {
 listen       *:80;
 server_name  localhost;
 rails_env development;
 root   /<path to my rails app>/public;
  if ($request_method !~ ^(GET|HEAD|POST|PUT|DELETE)$ ) {
   return 444;  # block requests that Rails doesn't handle
  }
passenger_enabled on;
}
# HTTPS server
server {
  listen       443;
  server_name  localhost;
  rails_env development;
  root   /<path to my rails app>/public;
  if ($request_method !~ ^(GET|HEAD|POST|PUT|DELETE)$ ) {
    return 444;  # block requests that Rails doesn't handle
  }
  ssl                  on;
  ssl_certificate      local.crt;
  ssl_certificate_key  local.key;
  ssl_session_timeout  5m;
  ssl_protocols  SSLv2 SSLv3 TLSv1;
  ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
  ssl_prefer_server_ciphers   on;
  passenger_enabled on;
  }
}

restart your Nginx if it is already running

sudo /etc/init.d/nginx restart

That’s all..  hopefully this helps someone.  :-)    My nginx.conf is much longer so hopefully I didn’t cut out anything too important.

1 Comment more...

SunRocket Survey

by on Aug.04, 2007, under Uncategorized

It looks like SunRocket member services communications are running on auto-pilot.  I just got the following email today.

Dear Antonio, Thank you for being a loyal SunRocket member. From time to time we like to check in to hear how you are doing with the service and to learn where we can improve. We sincerely value your business and strive to ensure that your experience is a great one. Please click below to take a short survey and provide your valuable input.

Click here to take the survey. 

Thank your for being a valued SunRocket member.

Sincerely,

SunRocket Member Service

SunRocket, Inc.
8045 Leesburg Pike
Suite 300
Vienna, VA 22182

 

This email address is not accepting replies.

This email was sent to .
To ensure that you continue receiving our emails, please add us to your address book or safe list.
To unsubscribe, please reply to this message with “unsubscribe” as the subject line.


Too bad the survey link didn’t work.  I have some feedback for them.

Leave a Comment more...

Heads up for ViaTalk BYOD customers who are porting their numbers

by on Aug.01, 2007, under Uncategorized

Just FYI.  I never received an email when my number port was completed.   My only indication was that my phone stopped working.   As mentioned in my previous post, when this happens do the following

  1. Log into viatalk using your  ported number and existing password.
  2. Goto softfone config and get your new password
  3. Update your device with new number and password.

Also..  for some reason Brendan (ViaTalk) CEO started answering questions on the DSL Reports forums.  I would have expected him on the ViaTalk forums.  :-\  His thread is here

Leave a Comment more...

Sunrocket number ported to ViaTalk today

by on Jul.31, 2007, under Uncategorized

The ViaTalk people told me that my number would port on 7/31 (14 days after my order) but I was skeptical.   I checked my email throughout the day for confirmation and password.

The mail never came but when I got home my phone was dead.  I quickly went to the ViaTalk site to see if my new password was available.   I needed to log in with my ported number (and the password I used with the temporary number).

I jumped into the softphone config screen and was happy to see my SunRocket  number and a new password.    I logged into my AC-211-SR, updated the information, rebooted and was making calls with my old number in no time.

Finally something has gone right.    Now I can activate that credit card I got in the mail the day Sunrocket died.

2 Comments more...

Time to buy a GM car?

by on Jul.26, 2007, under Uncategorized

People who know me know I can’t stand general motors cars. In college I got a GM Card and I ended putting my mom on the account so she could use my points towards a GM car.

I don’t claim to know anything about design but I find cars like the Aztec hideous. Also quality of GM cars has been historically low. But as my 1996 VW GTI ages I’ve decided I really need to start looking for a new car.

What do I want? A light all-electric car. Sorry, I don’t want to spend $100,000 on a telsa. I don’t think an affordable all-electric will be available before I need to stop putting money into the GTI.
Compromise? A small and sporty clean diesel. (torque is more important in urban areas than horsepower). Oh wait. Car companies think Americans don’t want diesels.

So that leaves me with a small sporty car that runs on gas. I don’t want a hybrid. Maintaining and carrying 2 drive systems seems wasteful to me.

How about another GTI? No way. I love the car but after 11+ years I need something different. Cooper? Tempting but its soooo small. I really like hatchbacks.

I noticed that GM is bringing the Opel Astra to the States this year under the Saturn nameplate. They are throwing out the diesel option but it still looks nice. It looks a lot like the Dodge Caliber but a little better. Chrysler has great designers but I think the blew it with the Caliber. I think the issue is that they try to use designs that work well on big cars on the compacts and it just doesn’t translate.

Maybe I’ll just have someone bring me an Opel Astra Diesel from Europe. ;-) I think this rant is done.

2 Comments : more...

ViaTalk setup notes

by on Jul.18, 2007, under Uncategorized

I like supporting the little guys so I signed up for ViaTalk after SunRocket dumped me. Before VOIP I was using Cavalier instead of Verizon.

I can’t comment too much on the ViaTalk quality since I just got it working last night but if you sign up use my referral code. 51164 :-) Sorry. I figured it was worth a try and my Gizmo reconfiguration notes may save you time.

I’ll post more details on trying to get 27 months of ViaTalk for $200 and my number porting progress soon.

ViaTalk was giving 2 years of service for $200 but they switched it to 15 months and up to 12 additional months for people coming from SunRocket. One operator said I would get 27 months but another made it sound like they would buy out the time I have left with SunRocket.

Either way this is the best deal out there. I hope they stay in business.

Leave a Comment more...

Addicted to makeup?

by on Aug.20, 2006, under Uncategorized

I can’t stand makeup.   It’s fine for covering up a small blemish but when caked on you end up creating an un-human appearance.   The issue is that people have been looking a people with makeup on for so long that they start to think that is what beauty is.

Beauty is in the blemishes and minor imperfections!

People instantly think of Tammy Faye but even people like Pamela Anderson look like aliens to me.   It’s just not natural.

Of course for people who cake it on its hard to go back, because their poor pores are so clogged from the makeup, that their skin is just one big blemish.   Its like a drug, get them started and its impossible to quit.   Maybe we should be pursuing the makeup companies instead of tobacco companies.  ;-)

Yeah.  I know,  I’m a guy and I have no idea what I am talking about but I can say that I prefer it when my wife wears no makeup.  :-)

2 Comments more...

Head Trauma

by on Jul.09, 2006, under Uncategorized

More than swimming I love to make big splashes from diving boards.  My favorite dive is the “watermelon”, it’s a face 1st cannonball and with just the right amount of spin it results in a nice splash.

The problem with this dive as I just recently discovered is that it is pretty dangerous in small pools.    I know because I have a handful of stitches in my head now after hitting bottom in a relative’s pool.   I’ve been spoiled by my large neighborhood pool and I launch way off the board for dramatic effect.   In a small poll this sealed my doom; I slammed into the part of the pool where the deep end slopes up to the shallow end.

As my head hit bottom and I thought “oh god, that was stupid and now I’m going to be paralyzed for life”.   Fortunately I was not knocked out so I swam out of the pool and looked for help.    This was pretty upsetting for my 4 year old daughter, whom I was trying to splash, as I came up pretty bloody.  But at least I didn’t float to the top unconscious and I’m glad that I’m still walking.

Of course now I remember being told several times as a child to always dive straight down in a pool but the huge diving well in the neighborhood pool washed that lesson our of my head.    Unfortunately that lesson is now literally stitched into my head.   :-(

I’m looking foward to getting the stiches out of my head this week as I am not allowed to get my head wet and a week without washing my hair has been gross to say the least.

Leave a Comment more...