Get A Sys Admin

sysadmin linux open source centos redhat rhel ubuntu apache mysql amazon ec2 s3 tutorial

Jan 30, 2010

PLEXes for Haiti

Don't shoot me!!! Yes I do play EVE Online! Not as much as I would want but still an active player I would say. If you are too lazy to read the whole quoted text here is the short version: CCP, the company behind EVE, will accept PLEX donations from players and will convert them into real cash that will be donated to the Red Cross effort in Haiti.

Dear EVE Players,

Along with the rest of the world, we at CCP have been following the devastating impact of the earthquake of January 12 on the people of Haiti. The situation is as dire as ever for Haiti's brave population, even with the rush of goodwill and aid from many countries, international organizations and countless individuals-including many of you. In 2004 we assisted a collection amongst EVE players to help with the Southeast Asia Tsunami relief efforts and we have figured out a way to use our PLEX system to facilitate such a collection again.

Beginning January 29th, 2010 and ending February 15th, 2010, CCP will accept PLEX donations from players and convert them to a cash donation for the Red Cross efforts in Haiti. 100% of the proceeds will be given to this important charity as a representative gift from EVE's player community.

· To participate, contract your PLEX to the "CCP PLEX for Haiti" character, and please make sure the character is in the "C C P" corporation and that the name is spelled correctly to avoid scams.

· Contracts will be accepted within 24 hours of submission, though usually sooner than that.

CCP regards any scamming attempts surrounding this effort to be morally reprehensible and they will be met with swiftest action.

This is about one community of people helping another in need.

I urge you to use your hard earned ISK (or any of the other various ways which you can acquire a PLEX) to do something greater than it could ever do in New Eden.

Back in the day all that was required to reach the whole community was a dev blog. Now more is needed to reach the ears of the 330,000 players. Please help pass the word to your fellow EVE Players.



Sincerely,

Hilmar Veigar Pétursson

Labels:

mEgo is sky high

Yes ladies and gents, it is true! mEgo Inc, my former company where I have worked for the last 2 years as sysadmin, made the move to Amazon Elastic Compute Cloud (aka EC2) today!!!11oneone It's a moment of great joy to see this thing happening now at the beginning of 2010.

Best wishes to the mEgo team!

LE: Proof
PING mego.com (67.202.39.53) 56(84) bytes of data.
64 bytes from ec2-67-202-39-53.compute-1.amazonaws.com (67.202.39.53): icmp_seq=1 ttl=48 time=10.6 ms

Labels: , , , , , , ,

Jan 23, 2010

WordPress and dubious themes

If you are like me and deal with a lot of WordPress themes chances are that you have encountered several themes that contain something like:
eval(base64_decode('ZnVuY3Rpb24gY2hlY2tfdGhlbWVfaGVhZGV
yKCkgeyBpZiAoIShmdW5jdGlvbl9leGlzdHMoImZ1bmN0aW9uc19maWxlX2V4
aXN0cyIpICYmIGZ1bmN0aW9uX2V4aXN0cygidGhlbWVfZm9vdGVyX3QiKSkpI
HsgdGhlbWVfdXNhZ2VfbWVzc2FnZSgpOyBkaWU7IH0gfQ=='))

Now, all the people, or at least most of them would advice not to use such things on your WordPress and probably they are right. But if you are a curios person like me you have to know what that long string means.
function check_theme_header() { if (!(function_exists("functions_file_exists") && function_exists("theme_footer_t"))) { theme_usage_message(); die; } }
Meh, not a big deal. Someone is very obsessed about his links in the footer of your WordPress theme. He want's to make sure you keep his precious links in place. Whatever!
I find this very rude however and a headache for anyone that installs wordpress themes, especially free ones. A simple "Please keep the footer intact" would do better. People are going to replace the footer anyway if that's what they desire. No one wants some strange text that he doesn't know what's doing on his server.

And because I like to have at least one useful thing in my posts here is a link to an online decoder, the same I have used to decode the example: http://www.motobit.com/util/base64-decoder-encoder.asp

To quickly find such precious bits of information you can run something like:
grep "eval(base64_decode" -r /path/to/some/dir 2>/dev/null

LE: An so I discover another bug in my blogger theme ...

Labels: , , , ,

Jan 21, 2010

ISPConfig3 running on Ubuntu 9.10 on AWS

This is an idea on how to set ISPConfig 3 on Amazon EC2 for web hosting. It's still work in progress and I await for any constructive feedback. Since English is not my first language there might be some grammatical errors.

Prerequisites:
  • AWS Account
  • Some Linux experience

Part I - Setting up AWS

I have done all the setup of instance and ebs from the Amazon Management Console. It has a very intuitive interface and it's so easy to work with.

Optional: You can purchase reservation for an instance if you are planing to run it 24/7. To do so go to Instances -> Reserved Instances and click on Purchase Reserved Instance. For example a c1.medium instance reservation for 1 year costs 455$ one time fee and the hourly cost of the instance goes to 0.06$/hour. It's your decision, do the math if it's worth it or not to go with reserved instances.
  1. From the Management Console go to Volumes and Create Volume. I created a 40 GB volume in us-east-1a zone, choose an appropriate value for your needs.
  2. Next step which is also optional is to get an Elastic IP for your instance. Go to Elastic IPs and click Allocate New Address.
  3. You will need a keypair to access your instance. You can create one before launching the instance or create one when you also setup the new instance. Your choice. I created one before by going to Key Pairs -> Create Key Pair.

Part II - Launching the instance

Instance type used was c1.medium, the AMI for it was Ubuntu 9.10 Karmic 32bit ami-1515f67c from Canonical Images for Amazon EC2.
Go to Instances and press Launch Instance and make sure you set it to use ami-1515f67c. If you need to use a different zone or a 64 bit instance you can check the alestic page which is a wonderful resource for Ubuntu images for EC2. I would also suggest to join their EC2 Ubuntu Google Grup if you are serious about AWS + Ubuntu.
After the instance is up and running attach the Elastic IP and the Volume you have created to it. To attach the IP go to Elastic IPs and select Associate, for the EBS go to Volumes. I attached the EBS as /dev/sdb to the instance.

Later Edit: You will need to also modify the Security Groups and permit access on ports 22(SSH), 80(HTTP), 8080(ISPConfig 3), 20-21(FTP) -> still need more work to support PASV.

Part III - Install ISPConfig 3

Before proceeding with ISPConfig 3 setup connect to your instance and update the packages.

sudo su
apt-get update
apt-get upgrade

Note: You will have to connect to your instance using the ubuntu username and the key pair you generated for that instance. It won't allow you to connect directly as root.

To install the ISPConfig 3 I followed the HowtoForge excellent tutorial with a small exception: I skipped the part of setting up the quota since I was planning to use the EBS as storage for sites and MySQL databases. The rest of the tutorial was just perfect.

Part IV - Setting up the EBS and ISPConfig to work with it

Most of the stuff and talk about EBS and MySQL snapshots is discussed on Amazon developer forums in the thread called Tutorial: Running MySQL on Amazon EC2 with EBS (Elastic Block Store). Make sure you read the discussion before or after you are done with this post.

apt-get install dmsetup
modprobe dm_mod
modprobe dm_mirror
modprobe dm_snapshot
mkdir /dev/.static/dev/mapper -pv

Create ext3 filesystem:
mkfs.ext3 /dev/sdb

Setup it with dmsetup
echo 0 `blockdev --getsize /dev/sdb` linear /dev/sdb 0 | dmsetup create ebs

Add the records to fstab
echo "/dev/mapper/ebs /ebs ext3 noatime,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 0 0" >> /etc/fstab

Setup quota
touch /ebs/aquota.user /ebs/aquota.group
chmod 600 /ebs/aquota.*
mount -o remount /ebs


Enable quota on ebs
quotacheck -avugm -F vfsv0 /ebs
quotaon -avug /ebs


For websites:
mkdir /ebs/sites
ln -s /ebs/sites /var/www/clients


Jailkit:
Set Jailkit chroot home: /ebs/home/[username]
mkdir /ebs/home

MySQL:
/etc/init.d/mysql stop
mkdir /ebs/mysql/data /ebs/mysql/log -pv
mv /var/lib/mysql /ebs/mysql/data
ln -s /ebs/mysql/data/mysql /var/lib/mysql
mv /var/log/mysql /ebs/mysql/log
ln -s /ebs/mysql/log/mysql /var/log/mysql



To make a snapshot of the database, go to the mysql console (msqyl -p)
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
SYSTEM dmsetup suspend /dev/mapper/ebs


Take your snapshot of the EBS

SYSTEM dmsetup resume /dev/mapper/ebs
UNLOCK TABLES;


Note:This is still work in progress, any advices on how to improve it are greatly appreciated and any constructive criticism also.

Labels: , , , , , , , ,