Fedora EC2 HVM AMI

In this blog post, I am going to tell you how to setup a Fedora HVM Image from the official Fedora PV Image on Amazon EC2. In general, this basically covers how to convert a PV image into a HVM image for AWS EC2. This works for fedora, but might not work for other OSes.

I assume you know about AWS, EC2, AMI, HVM and PV. Amazon has been steadily pushing towards using HVM. With the latest round of launches on July 1, 2014, Amazon now shows only HVM Images by default when you go to launch an instance. You now have to search for PV images. One benefit of using HVM images is better access to underlying hardware resources which gives benefits such as enhanced networking.

Fedora has official Amazon AWS EC2 AMIs available at http://cloud.fedoraproject.org/. However presently it only has para-virtualized (PV) Images.

I have been working extensively on AWS EC2 for the last few weeks and have realized that for best performance, we should be using HVM images.

For this particular project, I was interested in the multiqueue block layer, which was introduced in kernel 3.13.

The first step is to spin up an instance from the existing PV AMI. Its not completely necessary, since you just need the snapshot of the AMI. However I created an instance as I needed to make some changes to the image. The existing AMI available from Fedora has Kernel 3.10. So, I had to do a yum upgrade to get the latest available kernel 3.15.

After launching the instance from PV and making changes as per your needs (in my case, sudo yum upgrade -y), create a new AMI using AWS tools or web console, whatever way you are comfortable with.

For the rest of the steps, you need to setup EC2 API tools or the EC2 Command line Tools. I use EC2 CLI Tools.

After the AMI is ready, find the snapshot id used by the above AMI under EC2 > Elastic Block Store > Snapshot in EC2 Console.

or if you have the ec2 api tools setup:

ec2-describe-images ami-id_of_above_created_ami

and find the snapshot id for the ami. It would be something like snap-a12b34cd .

Once you have the snapshot id, you can register a new AMI using the above snapshot.

To register a new HVM AMI using the above snapshot, you need to use the cli/api tools since AWS still doesn’t have this in the webconsole (it might come soon).

ec2-register -a x86_64 -d '3.15.7-200.fc20.x86_64' -n 'Fedora_20_HVM_AMI' --sriov simple --virtualization-type hvm -s snap-b44feb18 --root-device-name /dev/sda1

where

-d is AMI description
-n is AMI name
-s is snapshot id from step 3.
-a is architecture
–virtualization-type is required for making it hvm
–sriov is for enabling enhanced networking , though it might be redundant, not sure.

This would register/create a new HVM AMI based on the snapshot created by the PV Image.

So, in this blog, we discussed how you can convert an existing PV AMI into an HVM AMI, specifically, how to create a fedora HVM AMI from the official PV AMI.

PS: I have made my Fedora HVM AMI public in the east region. So just search for Fedora and you will find it. Feel free to create AMIs of your own and/or copy it over to other regions.

PPS: Wanna know which cool place do I work where we end up playing with the state of the art latest technologies, be it kernels or the latest SSDs? Hit over to http://aerospike.com/careers to join the team!

How to earn Fedora Badges?

Fedora recently launched https://badges.fedoraproject.org, a recognition system that awards badges based upon certain activities that you do within the Fedora Infrastructure Environment.

I have recently been working with the Fedora Infrastructure and came to know about the badges. Needless to say I was excited and wanted some of my own.

First step to be a part of the Fedora infrastructure is to have a Fedora Account System account. You can signup for it at http://admin.fedoraproject.org/accounts/.

Once you have created your account, you should add a secret question to your account. This will earn you https://badges.fedoraproject.org/badge/riddle-me-this.

https://badges.fedoraproject.org/pngs/fas-riddle-me-this.png

Adding your timezone to your account profile earns you the

https://badges.fedoraproject.org/badge/white-rabbit

https://badges.fedoraproject.org/pngs/fas-white-rabbit.png

By adding your ssh or GPG key to your account, you can earn the https://badges.fedoraproject.org/badge/crypto-panda

https://badges.fedoraproject.org/panda/fas-crypto-panda.png

Accepting the FPCA (Fedora Project Contributor Agreement) earns you the https://badges.fedoraproject.org/badge/involvement

https://badges.fedoraproject.org/pngs/involvement.png

To earn the https://badges.fedoraproject.org/badge/let-me-introduce-myself , you need to create your User twiki page on the Fedora twiki. Mine is at https://fedoraproject.org/wiki/User:Anshprat

https://badges.fedoraproject.org/pngs/wiki-let-me-introduce-myself.png

Editing 10 times on the Fedora twiki earns you the https://badges.fedoraproject.org/badge/junior-editor

https://badges.fedoraproject.org/pngs/junior-editor.png

Participating in one of the Fedora meetings in #fedora-meeting in irc.freenode.net earns you a
https://badges.fedoraproject.org/badge/speak-up!

https://badges.fedoraproject.org/pngs/irc-speak-up.png

This is a brief overview of how to earn some of the badges. I will be updating soon with more badges and more details on the the steps mentioned above.

You can see all the badges at https://badges.fedoraproject.org/explore/badges

And the badges I have earned so far at :

https://badges.fedoraproject.org/user/anshprat

Moving from rackspace to digital ocean

I finally moved my hosting from rackspace to digital ocean (hereafter mostly referred to as DO). The reasons were simple – better config for half the price (especially in terms of memory). In rackspace, I was paying $10 a month for about 245 MB of RAM. In DO, I am getting 491 MB of RAM for $5. I had to resort to 5 minutes cron to keep restart httpd and cleaning up the cache to keep it sane on rackspace. Hopefully, things will be better at DO.

I first came across DO through facebook ads. The thing that caught my eyes was the SSD hosting. In my present job with Aeropsike, Inc, I deal with SSD on a daily basis and surely hosting my own blog on SSD was lucrative. Needless to say getting it at half the existing hosting charges was also enticing. I sat on it for a few weeks, finally got around to clear a DO account and left it short of adding my payment details (to search for a discount code). Few weeks later, I went back, added my payment details (sans any discount coupons) and went ahead to create my first droplet. The UI asked the hostname first thing at the top, and then some clicks to chose your OS version. I missed the hostname part first and selected fedora. On submit, the UI gave an error that hostname is missing. A quick scroll up and then the form was all green. DO boasts of 55 seconds to get your droplet up. While I did not actually time it, the experience was definitely faster than creating EC2 in Amazon WS and rackspace as well.

Screenshot from 2013-08-31 23:05:00

Screenshot from 2013-08-31 23:05:20

Its easy to miss the hostname if you scroll right down to the lower part of page where you do the size and OS selection

DO mails over your root password and then you are pretty much on your own. Here also considering am more comfortable with setting up my own environment using terminal, it was faster for me to create users and add my ssh keys than pre generated users etc.

I then quickly did yum install of wordpress to pull in the required dependencies, export and import from my older blog installation and a quick redo post changing the domain (only dropping the database and then import), my new install of blog was up and running. The reason I chose to reinstall the db for wp was that the first time I did install using stg.hackalyst.info/blog/wp and then changing the css and js links later would have been a pain. (Though now looks like wp has a way of specifying alternate install location in the configuration. Will check it out later).

After installing wp, I tried to activate my jetpack and I kept getting the error:

Your Jetpack has a glitch. Something went wrong that’s never supposed to happen. Guess you’re just lucky: xml_rpc-32601
Try connecting again.

Error Details: The Jetpack server could not communicate with your site’s XML-RPC URL. If you have the W3 Total Cache plugin installed, deactivate W3 Total Cache, try to Connect to WordPress.com again, reactivate W3 Total Cache, then clear W3 Total Cache’s cache.

A few quick web searches later I realised its because the DNS name has not yet propagated for the server. I waited for few hours and later it just worked fine.

Another problem I had with the new wp install was setting up the permalinks. On setting up the permalinks in configuration, I kept getting 404. I searched the docs a bit but found the solution in my own older post when I searched for permalink.

http://hackalyst.info/2010/02/17/setting-up-your-websiteblog-using-wordpress-on-a-slicehost-slice/

In short, I had to change
AllowOverride FileInfo

in directory directive in httpd.conf found in /etc/httpd/conf folder.

Rather this time, I decided to add the blog directory itself to the virtual host config and voila, it all worked fine.

Another warning I got while doing the wordpress install and configuration with apache httpd was

AH00548: NameVirtualHost has no effect and will be removed in the next releas

I wanted to know what the change actually meant and found this link in a comment here
httpd.apache.org/docs/current/vhosts/name-based.html which lead me to

http://httpd.apache.org/docs/2.4/upgrading.html#misc

The NameVirtualHost directive no longer has any effect, other than to emit a warning. Any address/port combination appearing in multiple virtual hosts is implicitly treated as a name-based virtual host.

Though I still haven’t found what the number AH0048 mean. Maybe I will have to dig into the source code or mailing lists archive to find the meaning of that number.

Coming back to DO, though they advertise SSD setups, the vm I am on says its rotational.

[root@hackalyst conf]# cat /sys/block/vda/queue/rotational
1

Will see if I can figure out the actual disk.

So far my DO experience has been good. Fingers crossed. Lets see how it goes. I will be disabling my rackspace server soon.

IPv6 is still missing in DO though. So I might get back to tunnel like how I was doing on slicehost before moving to rackspace.

Here is how to get ipv6 using tunnels. Though the blog post says in India, its geographic independent.

google.ps hacked

Looks like google.ps got its dns hacked.

Update below
Update 2- Looks like its a .ps registry hack rather!(based on HN)
Update 3 – Alls well again

[anshup@aero ~]$ host google.ps
google.ps has address 41.77.118.2
google.ps mail is handled by 0 google.ps.

[anshup@aero ~]$ host 41.77.118.2
2.118.77.41.in-addr.arpa domain name pointer abubakr.genious.net.

[anshup@aero ~]$ sudo nmap 41.77.118.2

Starting Nmap 6.40 ( http://nmap.org ) at 2013-08-26 23:33 IST
Nmap scan report for abubakr.genious.net (41.77.118.2)
Host is up (0.21s latency).
Not shown: 981 filtered ports
PORT STATE SERVICE
20/tcp closed ftp-data
21/tcp open ftp
22/tcp closed ssh
25/tcp open smtp
26/tcp open rsftp
53/tcp open domain
80/tcp open http
110/tcp open pop3
143/tcp open imap
389/tcp closed ldap
443/tcp open https
465/tcp open smtps
554/tcp open rtsp
587/tcp open submission
993/tcp open imaps
995/tcp open pop3s
2000/tcp closed cisco-sccp
3306/tcp open mysql
7070/tcp open realserver

[anshup@aero ~]$ dig NS google.ps

; <<>> DiG 9.9.3-rl.13207.22-P2-RedHat-9.9.3-5.P2.fc19 <<>> NS google.ps
;; global options: +cmd
;; Got answer:
;; ->>HEADER< ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.ps. IN NS

;; ANSWER SECTION:
google.ps. 21590 IN NS omar.genious.net.
google.ps. 21590 IN NS hamza.genious.net.

;; Query time: 2 msec
;; SERVER: 10.0.1.1#53(10.0.1.1)
;; WHEN: Mon Aug 26 23:48:13 IST 2013
;; MSG SIZE rcvd: 77

[anshup@aero ~]$ dig @8.8.8.8 google.ps

; <<>> DiG 9.9.3-rl.13207.22-P2-RedHat-9.9.3-5.P2.fc19 <<>> @8.8.8.8 google.ps
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER< ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.ps. IN A

;; ANSWER SECTION:
google.ps. 7367 IN A 41.77.118.2

;; Query time: 14 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Mon Aug 26 23:50:56 IST 2013
;; MSG SIZE rcvd: 54

UPDATE:

Looks like www.google.ps is fine whereas google.ps is hacked.

[anshup@aero ~]$ host www.google.ps
www.google.ps has address 74.125.236.55
www.google.ps has address 74.125.236.63
www.google.ps has address 74.125.236.56
www.google.ps has IPv6 address 2404:6800:4007:800::1018

[anshup@aero ~]$ host google.ps
google.ps has address 41.77.118.2
google.ps mail is handled by 0 google.ps.

Also, the site hosting the hacked google site seems to belong to this guy:

https://twitter.com/ElZakaria

https://www.facebook.com/preemptif

Update 2
Based on Hacker News, looks like its a .ps registry hack rather.
https://news.ycombinator.com/item?id=6278976
Looks like similar to the .ro (romanian) registry hack late last year.

Update 3

At around 0530 Hrs IST (0000 UTC), aug 27th, the DNS at genious.net seems to have been re-populated with proper gooogle ips.

;; ANSWER SECTION:
google.ps. 7349 IN NS omar.genious.net.
google.ps. 7349 IN NS hamza.genious.net.

;; Query time: 8 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Aug 27 05:20:01 BDT 2013
;; MSG SIZE rcvd: 88

;; ANSWER SECTION:
google.ps. 299 IN A 74.125.236.50
google.ps. 299 IN A 74.125.236.49
google.ps. 299 IN A 74.125.236.52
google.ps. 299 IN A 74.125.236.48
google.ps. 299 IN A 74.125.236.51

;; Query time: 86 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Aug 27 05:20:01 BDT 2013
;; MSG SIZE rcvd: 118

This because the TTL for the genious.net DNS was quite high preventing the google SOA from propagating.

At around 0722 IST, the SOA TTL expired from google’s own 8.8.8.8 DNS.

;; ANSWER SECTION:
google.ps. 149 IN NS omar.genious.net.
google.ps. 149 IN NS hamza.genious.net.

;; Query time: 8 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Aug 27 07:20:01 BDT 2013
;; MSG SIZE rcvd: 88

;; ANSWER SECTION:
google.ps. 299 IN A 74.125.236.52
google.ps. 299 IN A 74.125.236.49
google.ps. 299 IN A 74.125.236.51
google.ps. 299 IN A 74.125.236.48
google.ps. 299 IN A 74.125.236.50

;; Query time: 93 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Aug 27 07:20:01 BDT 2013
;; MSG SIZE rcvd: 118
;; ANSWER SECTION:
google.ps. 21599 IN NS ns2.google.com.
google.ps. 21599 IN NS ns3.google.com.
google.ps. 21599 IN NS ns1.google.com.
google.ps. 21599 IN NS ns4.google.com.

;; Query time: 114 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Aug 27 07:30:01 BDT 2013
;; MSG SIZE rcvd: 120

Screenshot from 2013-08-26 23:49:27

screen vertical split rpm

I ve been using screen with vertical split for sometime now. And whenever I move my workspace to a new environment, its a fight to get either a build or a rpm with vertical split.

Recently I moved to centos 6.3 for my workspace usage and used the following rpm for install with glibc < 2.12

ftp://fr2.rpmfind.net/linux/fedora/linux/releases/15/Everything/x86_64/os/Packages/screen-4.1.0-0.3.20101110git066b098.fc15.x86_64.rpm

http://www.rpmfind.net//linux/RPM/fedora/devel/rawhide/x86_64/s/screen-4.1.0-0.15.20120314git3c2946.fc20.x86_64.html

dsc_0526-large

Drinks, Food, Music @ Plus91, Bangalore!

Last sunday, on April 7th, 2013, I had the opportunity to attend a bloggers-cum-food review meet at the newly opened Plus91 Cafe Bar, a food and drinks place that call themselves a Fast Food Restaurant, Snack Place and a Café , rightly so. This is another venture from the JSM Corporation Pvt Ltd, the same group that brings HRC, Shiro and CPK amongst others to you.

Considering the heat that Bangalore is facing this year, we started off with a very nice range of mocktails and cocktails including Virgin Mojitos, Virgin Mary, Pina Coladas and Long Island Iced teas. There are few places in bangalore which do a decent LIT and I guess the one at Plus91 is decent enough. We then started with a wide variety of starters ranging from a choice of street foods like pani puri, some chaats and miniature masala papads to veg and non-veg dishes including nachos, baby-corn and chicken preparations. All of them were mouth watering delicious. A special mention to the presentation where they were served in plates which looked like leaf mouldings. For the non-vegetarians, the Buffalo Chicken Wing at this place should be a must try! These were definitely one of the best ones I had in a long time in Bangalore, juicy, rich, succulent ones! Once we were done with the starters and the drinks, it was time for the real deal, the main course. We went in for the various sizzlers including a veg sizzler (a first for me), beef sizzler, chicken sizzler. The sizzlers were pretty good and are definitely worth a visit (and re-visits!)

By now, we were all pretty full, but there is always some place for desserts. We had Gulab Jamuns for desserts and it was one of the pleasant surprises I had. Usually its difficult to find a good “Gulab Jamun” when you go to any “big” place or chain. Not that they are bad, but they are not the desi, Indian feeling Gulab Jamuns. Some are either too big, or too small, or too soft or too sweet. But for once, the one at Plus91 were just perfect! I might already ve been intoxicated by all the fabulous food maybe, but it was the perfect end to a wonderful afternoon! To end it all, nothing else could surmise it up better than this tweet of mine…

Am definitely looking forward to visit this place soon with friends, family and loved ones!

Wired Up!

Long Island Iced Tea

Baby Corn! And the leaf shaped moulded plate.

Ye Nachos mujhe de de Thakur!

Me enjoying the sizzling sizzlers (L) with Santosh(R)

the delicious gulab jamun!

And finally the bloggers/tweeple !


PS: All photos thanks to @uniqgeek‘s post.

More pics at this facebook page.

Fedora laptop setup – Dell Inspiron 1420

I ve been using fedora since FC3. I bought my laptop in 2008 and since then I ve been using fedora on my laptop. I was on Fedora 7 when I first bought my laptop and today am on Fedora 18. After every install of Fedora, I end up looking up for some of the regular problems.. sound, disable hibernate/sleep on lid close, etc etc.

This blogpost is a placeholder for all such efforts going forward:

No Sound problem:

cat /etc/modprobe.d/snd-hda-intel.conf
options snd-hda-intel model=dell-3stack

Stop sleep/hibernate on lid close

$ gsettings list-recursively org.gnome.settings-daemon.plugins.power|grep lid
org.gnome.settings-daemon.plugins.power lid-close-ac-action 'blank'
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'blank'
org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor false

$gsettings set org.gnome.settings-daemon.plugins.power lid-close-ac-action 'blank'

I also found this..
http://nottooamused.wordpress.com/2012/12/29/fedora-17-and-18-how-to-disable-auto-suspend-when-laptop-lid-is-closed/


I tried Fedora 20 on a Dell Vostro 1450 Laptop, and got problems with the wifi card.

[root@aero anshup]# lspci |grep -i network
07:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n (rev 01)

The way to fix this in Fedora 20 is:

Install rpm fusion free and non free repo:

su -c ‘yum localinstall –nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm’

Now install akmod-wl
su -c ‘yum install akmod-wl “kernel-devel-$(uname -r)”

Error establishing a database connection – WordPress Error

Well, for the last few weeks I ve been seeing this error quite often on my blog. I didn’t think of it much initially as it used to go away on a mysql restart. However, today I ran into it and was persistent after mysql restarts. So I started digging a bit more and enabled debugging in wp-config


in wp-config.php

define(‘WP_DEBUG’, true);
define(‘WP_DEBUG_DISPLAY’, true);

This didn’t show any error that could help me. I could ve tried enabling further logging in apache to see if that helps

http://codex.wordpress.org/Editing_wp-config.php#Configure_Error_Log

I had tried logging into mysql with the username and password configured in the wordpress config and it worked fine. So I knew those were fine and mysql was running fine. I even restarted httpd a few times to confirm, but it didnt help either.

Then I checked up the mysqld log and voila!

 

101:130113 10:15:33 InnoDB: Database was not shut down normally!
116:130113 16:37:34 InnoDB: Database was not shut down normally!
131:130113 16:39:16 InnoDB: Database was not shut down normally!
146:130113 16:42:20 InnoDB: Database was not shut down normally!
158:130113 16:45:05 InnoDB: Database was not shut down normally!

130113 10:15:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130113 10:15:33 InnoDB: Initializing buffer pool, size = 8.0M
130113 10:15:33 InnoDB: Completed initialization of buffer pool
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130113 10:15:33 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files…
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer…
130113 10:15:33 InnoDB: Started; log sequence number 0 1049991
130113 10:15:33 [Note] Event Scheduler: Loaded 0 events
130113 10:15:33 [Note] /usr/libexec/mysqld: ready for connections.
Version: ’5.1.56′ socket: ‘/var/lib/mysql/mysql.sock’ port: 3306 Source distribution
130113 16:37:04 mysqld_safe Number of processes running now: 0
130113 16:37:04 mysqld_safe mysqld restarted
130113 16:37:29 InnoDB: Initializing buffer pool, size = 8.0M
130113 16:37:30 InnoDB: Completed initialization of buffer pool
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130113 16:37:34 InnoDB: Database was not shut down normally!

Version: ’5.1.56′ socket: ‘/var/lib/mysql/mysql.sock’ port: 3306 Source distribution
130124 20:22:26 [ERROR] /usr/libexec/mysqld: Incorrect key file for table ‘./wp_options.MYI’; try to repair it
130124 20:22:26 [ERROR] /usr/libexec/mysqld: Incorrect key file for table ‘./wp_options.MYI’; try to repair it
130124 20:25:00 [ERROR] /usr/libexec/mysqld: Incorrect key file for table ‘./wp_options.MYI’; try to repair it
130124 20:25:00 [ERROR] /usr/libexec/mysqld: Incorrect key file for table ‘./wp_options.MYI’; try to repair it
130124 20:33:04 [ERROR] /usr/libexec/mysqld: Incorrect key file for table ‘./wp_options.MYI’; try to repair it
130124 20:33:05 [ERROR] /usr/libexec/mysqld: Incorrect key file for table ‘./wp_options.MYI’; try to repair it
130124 20:33:05 [ERROR] /usr/libexec/mysqld: Incorrect key file for table ‘./wp_options.MYI’; try to repair it
130124 20:34:44 mysqld_safe Number of processes running now: 0
130124 20:34:44 mysqld_safe mysqld restarted
130124 20:34:47 InnoDB: Initializing buffer pool, size = 8.0M
130124 20:34:47 InnoDB: Completed initialization of buffer pool
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130124 20:34:48 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files…
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer…
130124 20:34:48 InnoDB: Started; log sequence number 0 1049991
130124 20:34:48 [Note] Event Scheduler: Loaded 0 events
130124 20:34:48 [Note] /usr/libexec/mysqld: ready for connections.
Version: ’5.1.56′ socket: ‘/var/lib/mysql/mysql.sock’ port: 3306 Source distribution
130124 20:34:59 [ERROR] /usr/libexec/mysqld: Table ‘./wp_options’ is marked as crashed and should be repaired
130124 20:34:59 [ERROR] /usr/libexec/mysqld: Table ‘./wp_options’ is marked as crashed and should be repaired
130124 20:34:59 [ERROR] /usr/libexec/mysqld: Table ‘./wp_options’ is marked as crashed and should be repaired
130124 20:34:59 [ERROR] /usr/libexec/mysqld: Table ‘./wp_options’ is marked as crashed and should be repaired
130124 20:34:59 [ERROR] /usr/libexec/mysqld: Table ‘./wp_options’ is marked as crashed and should be repaired
130124 20:34:59 [ERROR] /usr/libexec/mysqld: Table ‘./wp_options’ is marked as crashed and should be repaired
130124 20:35:06 [ERROR] /usr/libexec/mysqld: Table ‘./wp_options’ is marked as crashed and should be repaired
130124 20:35:06 [ERROR] /usr/libexec/mysqld: Table ‘./wp_options’ is marked as crashed and should be repaired

So looks like this is what was causing my recent problems.

Once I saw this in the mysql logs, it was a simple fix:


mysql> repair table wp_options;

Found 231 of 230 rows when repairing wp_options

 

And so far its all been good after that :)

The Mayans were right!

The Mayans were right! It is the end of the world. The end of the world as we knew it. With the deads of maestros like Yash Chopra, Pandit Ravi Shankar; others like Neil Armstrong, Michael Clarke Duncan, Whitney Houston, Jaspa Bhatti, Verghese Kurien, Dara Singh, A.K Hangal to name a few; it indeed seemed as if they were all being ported away to “2012″ themed escape pods/ships. Closer home, where everything seemed “theek hai“, the famed IAC broke up to just become yet another political party, even if it be for the common man, while India rallied for her Damini, the Nirbhaya Amanat symbolised the end of an era; and beginning of another one where the boy child needs to be taken care of. And what else to say when The God himself says its time to hang up the boots.

Yes, the world has ended. Everything that begins has an end; and after every end there is a new beginning. The Mayans never said the circle is broken. Their calendar is a circle. Its just the beginning of a new one. Here is to the brand new year, with all its copy lefts and common creatives; see you tomorrow!

PS: Wishing you all a very happy new year!

how to create ipv6 reverse DNS entry

Lets begin with what all we will be covering in this blog post.
We will be covering a lil bit of what is a reverse DNS entry and why do we need it.
We will then cover how to create a reverse DNS entry for two types of ipv6 entries:

    1. A 6to4 ipv6 ip using our own dns server and a 6to4 nro delegation
    2. A tunnel broker ipv6 entry using dns provided by he.net

The reverse DNS look up helps to resolve an ip into the respective host name. It is, like the name says, “reverse” of what the DNS normally do.

DNS is used to convert a human readable name like “hackalyst.info” into its corresponding ip.


host hackalyst.info
hackalyst.info has address 50.57.67.195

reverse DNS entry helps to resolve the ip into a hostname.

$ host 50.57.67.195
195.67.57.50.in-addr.arpa domain name pointer hackalyst.info.

Now, why is reverse DNS required?

One of the reasons nicely explained at godaddy is to fight spam.

Other than that, its always cool to have your ip map to your domain name ;)

There are two ways of creating a reverse DNS entry for ipv6.
1) You can create your own DNS server, point your domain name provider to point to your additional DNS.
2) You can use a free dns service provided by dns.he.net

Lets first go through the first option which is slightly lengthier and more DYI and CLI friendly :P

The wikipedia entry on 6to4 pointed my towards 6to4.nro.net that can be used to create a revese DNS PTR for a 6to4 ip, i.e, an ipv6 starting with 2002:.

The 6to4.nro.net needs dns servers with zone for this reverse delegation. None of the dns servers I host with (domaincontrol.com through godaddy, stabletransit.com via rackspace and he.net) were accepted in 6to4 form. So I decided to setup my own DNS server.

First I setup the DNS name for my DNS (yeah, thats required!) at my existing dns provider.
I am setting up my dns on my own server, hence can simply create sub domains (I used dns1 and dns2 instead of traditional ns1 and ns2) pointing to my own domain. You can create such subdomains pointed to the actual hosts where you will be setting up your DNS. You can set it up on one host or on multiple hosts.

I setup my own DNS server using instructions from devshed forums. Its pretty old but still works.

At the end of configurating the dns server, I initially got an error saying:

_default/67.57.50.in-addr.arpa/IN: file not found

That was because the file name in the config and my actual file name were not the same. After I fixed this issue, still named would refuse to start without throwing any erorrs.

An inspection of /var/log/messages said something about unable to write to the log file.

Jun 24 11:58:22 deltacore named[31254]: the working directory is not writable
Jun 24 11:58:22 deltacore named[31254]: isc_stdio_open 'query.log' failed: permission denied
Jun 24 11:58:22 deltacore named[31254]: configuring logging: permission denied
Jun 24 11:58:22 deltacore named[31254]: loading configuration: permission denied

The way to fix was to change the ownership of the /var/named folder and /etc/named to named :)


#chown -R named:named /var/named /etc/named.conf

And then all was fine :)

After setting the above DNS server, I needed to add the PTR info for my ipv6.
I found http://www.fpsn.net/index.cgi?pg=tools&tool=ipv6-inaddr via searching and headed over to create my reverse PTR configuration for my own DNS.

In the form:
Record type : select ip6.arpa (new standard)
Assigned IPv6 Block: (your ipv6 block)
Admin email:
DNS Server: (DNS Created above)
Secondary server (DNS Created above)

Then it gives the configuration file which you can add to your named.conf and create the reverse zone file.
Like it says at the end of generated reverse zone file, you need to add the AAAA entry in your respective zone file.

After this, it was just playing around to add “my” DNS servers to my “Domain” NS entries with my service provider.
My primary DNS provider is godaddy. I just added my own DNS entries into the NS entry of my domain.

If you do not want to create your own DNS server (or cannot due to resource crunch), you can use freely available DNS servers from he.net.

For this second purpose, I am going to use both the 6to4 ip above tied with your domain and another ipv6 obtained through tunnelbroker.

DNS provided by he.net can be used for managing your domains and these are pretty good in terms of usability.
Add your domain to your dns.he.net account, create your A,AAAA and other entries.

For creating your reverse DNS entry, you need to create the PTR record. Its available under “Additional” menu in dns.he.net.
For finding out the value of your ipv6 PTR, head over to http://rdns6.com/ and enter your v6 ip. The nibble value is what basically goes into your PTR record. In dns.he.net, the above nibble would be added as Name in PTR entry and your domain name in the Hostname.

If you are using a tunnel broker ipv6, you can login to the dns.he.net using same credentials as your tunnelbroker and it would import and delegate the ipv6 provided to you to the he.net nameservers. (I might be wrong here as I ve been using dns.he.net for quite some time and do not remember the initial steps I took).

Once you ve assigned dns names to your ipv6 ips, you can go and assign those ips and respective domain in the dns.he.net. This creates the PTR record for those ipv6 pointing to your domain.

at the end of the day, this is what should be the result of a perfectly working PTR record.

$ host hackalyst.info
hackalyst.info has address 50.57.67.195
hackalyst.info has IPv6 address 2002:3239:43c3::1

$ host 2002:3239:43c3::1
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.3.c.3.4.9.3.2.3.2.0.0.2.ip6.arpa domain name pointer hackalyst.info.

$ host hackalyst.homeunix.org
hackalyst.homeunix.org has address 106.51.119.133
hackalyst.homeunix.org has IPv6 address 2001:470:5:869:21e:c9ff:fe03:803b

$ host 2001:470:5:869:21e:c9ff:fe03:803b
b.3.0.8.3.0.e.f.f.f.9.c.e.1.2.0.9.6.8.0.5.0.0.0.0.7.4.0.1.0.0.2.ip6.arpa domain name pointer hackalyst.homeunix.org.

So now you know how to create reverse DNS entry aka PTR for your ipv6 :)

cheers!