Categories
TechBiz WebApps

Amazon’s EC2 and S3 — Computing on the Cheap

I was really inspired by the story of Pownce., and how they used S3 for storing media assets.

I really liked how easy it was to share media with Pownce. Alas, it’s no more and shut down on December 15th of last year.

What’s a guy to do? Well, using a combination of Transmit, a file upload and synchronization client, and S3 I can hack my own file sharing. I just upload the files I want to share and send the links to friends.

Here’s a link to an S3 media asset.

Once I felt comfortable about S3, I took the dive into EC2.

Pros: You can have a server of your choice, in my case LAMP, running in less than 5 minutes.

Cons: If the server crashes, all your data is gone.

Solution: Use ESB for database storage and S3 to back up files and custom executables.

How much does it cost?

For 1 LAMP server with 1.7GiB RAM running with a virtual 1.7Ghz CPU, and about 160GiB of storage will run you about 10 cents an hour, which is not bad considering that a colo will charge you around $100 per 1U or 12.5 cents per hour, and you’re stuck with the hardware you have.

The savings are even greater if you’re just setting up servers for prototyping and tearing them down. My last EC2 bills averaged at about $35 per month.

The next few blog posts will go into more detail about how to set up your own EC2 virtual server, and the pitfalls I’ve run into.

Categories
Social Media TechBiz WebApps

Site Diversity FTW

If it’s the thought that counts, think about how site diversification has helped out the Gawker Media and Nick Denton these past 6 months.

This set of graphs says it all:

Site Diversity FTW in the Gawker Network

Happy Holidays!

Categories
Announcements php WebApps

Another Hackday Update: PHP unserialize doesn’t quite do it

Wow, I had to use someone’s custom unserialize code because PHP’s unserialize doesn’t quite work multi-byte strings. 🙁 Time wasted: 3 hours.

Here’s the function:

function mb_unserialize($serial_str) {
$out = preg_replace(‘!s:(\d+):”(.*?)”;!se’, ‘”s:”.strlen(“$2″).”:\”$2\”;”‘, $serial_str);
return unserialize($out);
}
Categories
Announcements php WebApps

Update on the WordPress Dev2Live Hackday

I know the bare minimum of what has to change in a WordPress install. Code that gets me the tables, and shows me the serializeable data in WordPress’ option settings is done.

Categories
Announcements php WebApps

A WordPress Hackday

Today, I’m going to explore looking for a solution for staging WordPress from a development environment to a production one. I’ll be posting throughout the day as “hacks” become available.

The main issue is changing serialized dev data into production data.

I’ll be in irc.freenode.net #wpdev2live .

Categories
TechBiz WebApps

What I Whitelist in my Spam Filter

This is a list of domains that I have to whitelist because my spam filter either at the ISP end or on my laptop thinks you are a spammer.

My Whitelist

Notable on this list are:

  • facebookmail.com
  • Mavericks — the surfer email list. wtf?
  • match.com — no, it’s not okay to look. 😉

I really think pbwiki.com doesn’t belong on this list. I also don’t think levi.com belongs on this list, so it’s really interesting what gets filtered as spam and what doesn’t.

What strategies do you use so that your emails don’t end up in the spam box?

What do you whitelist but think you shouldn’t have to?

Categories
WebApps

The Funny Video of You Malware linked on Facebook

If you don’t already know, there’s malware going around through Facebook.

It starts off with the subject of:

i found a video with you in my camera.

You click on the link and you are led to a bunch of domains. One controlled by some ISP in Colorado, and then very-funny-webs.com . Do an nslookup on that one. Then you’re led to a server in Beijing and then finally to some poor computer that’s been hacked on port 7777.

Whatever you do, do not click that link!

Where was I? That computer automatically downloads a payload called: flash_update.exe

This is where things get interesting.

0000040: 0e1f ba0e 00b4 09cd 21b8 014c cd21 5468 ……..!..L.!Th
0000050: 6973 2070 726f 6772 616d 2063 616e 6e6f is program canno
0000060: 7420 6265 2072 756e 2069 6e20 444f 5320 t be run in DOS
0000070: 6d6f 6465 2e0d 0d0a 2400 0000 0000 0000 mode….$…….

Also, the dirty work of ruining your day is done here:

0003470: 0000 0000 08f1 0000 0000 0000 4b45 524e …………KERN
0003480: 454c 3332 2e44 4c4c 0041 4456 4150 4933 EL32.DLL.ADVAPI3
0003490: 322e 646c 6c00 5553 4552 3332 2e64 6c6c 2.dll.USER32.dll
00034a0: 0000 4c6f 6164 4c69 6272 6172 7941 0000 ..LoadLibraryA..
00034b0: 4765 7450 726f 6341 6464 7265 7373 0000 GetProcAddress..
00034c0: 5669 7274 7561 6c50 726f 7465 6374 0000 VirtualProtect..
00034d0: 5669 7274 7561 6c41 6c6c 6f63 0000 5669 VirtualAlloc..Vi
00034e0: 7274 7561 6c46 7265 6500 0000 4578 6974 rtualFree…Exit
00034f0: 5072 6f63 6573 7300 0000 5265 674f 7065 Process…RegOpe
0003500: 6e4b 6579 4578 4100 0000 4973 5769 6e64 nKeyExA…IsWind
0003510: 6f77 0000 0000 0000 0000 0000 0000 0000 ow…………..

The code seems to be messing around with your DLL’s in Windows which is bad. I’m on OS X, so I lucked out.

Anyway, I hope this piece of Malware didn’t get you and I hope those assholes burn in hell.

If anybody can add more details about how this malware works, please let me know.

Categories
WebApps

A Comparison of Ajax Libraries


go to the table!

Categories
command-line How-To ruby WebApps

A Quick Guide to Noobwatcher

curl -O http://svn.collab.net/repos/svn/trunk/tools/client-side/showchange.pl
mv showchange.pl $HOME/bin
svn co http://codebelay.com/noobwatcher
mkdir watched_repositories
cd watches_repositories
cp $HOME/noobwatcher/trunk/noobwatcher.rb .
svn co

Create and edit a settings.yml file. Mine looksl like this:

path: /Users/barce/nooblive/trunk
repo: http://www.example.com/the_repo_I_am_watching
diffs: /Users/barce/nooblive/diffs
twitter_email: the_twitter_email_that_notifies_you@example.com
twitter_password: the_password_to_the_twitter_email_that_notifies_you
twitter_recipient: your_twitter_account
sleepseconds: 60

Start noobwatcher:

./noobwatcher.rb
Categories
git How-To WebApps

Getting Around the Politics of Subversion with git

This is the nightmare scenario. You are working with a coder who overwrites your changes in subversion. You’ve told this coder once, twice, three times, “Hey, please don’t do that. Hey, let’s talk about your changes before you commit them.”

But this coder for some reason thinks that he or she is the gift of the gods when it comes to coding, and continues to overwrite your changes.

This is where git comes in. If I had learned about this feature of git and the idea of accepting or rejecting changes in git sooner, I would have avoided the whole nightmare of re-comitting code and lengthy merge debates.

Most projects you work won’t involve the worst case above. Most of the time, there will be a great developing rule that says never commit bugs into subversion. But whenever you have to re-factor code and commit each line, branching and then later merging can be an issue in subversion, and it’s slow too.

On a project that I’m working on now the client wants only good code in svn which is great, and so I’m using git with svn. I got this idea thanks to Jakob Heuser. Thanks, Jakob!!!!

This is where git comes in. Here’s a quick cheat sheet and it assumes you are using GitHub:

mkdir newlispoauth
cd newlispoauth/
git init
touch README
git add README
git commit -m ‘first commit’
git remote add origin git@github.com:barce/newlispoauth.git
git push origin master

Now we have to pull in changes from subversion:

mate .git/config

In the config file add something that looks like this:

[svn-remote “newlispoauth/trunk”]
  url = http://codebelay.com/newlispoauth/trunk
  fetch = :refs/remotes/newlispoauth/trunk

Now we’re gonna fetch the subversion repo:

git-svn fetch newlispoauth/trunk
git checkout -b local-svn/trunk newlispoauth/trunk
git svn rebase
git checkout master
git merge local-svn/trunk
git mergetool # if there are conflicts with the README file above
git add README # if you had to make changes with the mergetool
git commit
git push origin master

Now you are working with “master” and “local-svn/trunk”.

“master” is for your changes to share with your team on git-hub
“local-svn/trunk” is for you and where you push changes to subversion.

You basically pull in changes from newlispoauth/trunk and do your work in local-svn/trunk.

Let’s put the changes in master into “newlispoauth/trunk” and commit those changes to subversion:

git checkout local-svn/trunk # you did commit your changes in origin right?
git merge master
git-svn dcommit