WordPress with MariaDB instead of MySQL

So I heard good things about MariaDB and decided to switch from MySQL to MariaDB. MariaDB is a fork of MySQL developed by the original developers of MySQL and it is intended to be a drop in replacement – meaning all your commands and databases from MySQL should continue to work seamlessly after the switch.

Tall claim, but with years of relationships with webservers, it isn’t too tough to know that even an upgrade can break things. Here, however seamlessly, the DATABASE management software was being replaced. Only a complete novice would believe “as advertized” to the point of not being worried.

My biggest fear was breaking my blogs. Backups are there, but…. it is unpleasant to see your precious sites not working, and I was apprehensive.

So anyway, I did it.

Added the repository (these are my instructions, but they helpfully provide a configurator for customized MariaDB repositories for your Operating System – version – MariaDB version, which you should totally use).

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb http://mirrors.hustunique.com/mariadb/repo/5.5/ubuntu saucy main'

I’d done paranoid backups to the nth degree before, as you should too, but I won’t bore you with the details. Suffice it to say that I had 3 of each database AND a snapshot of my VPS to restore with “one click” if I got itchy AND I copied the mysql directory anyway (I really love my blogs. Really). I think this was mostly of therapeutic value after the first backup, but hey, it was good for my blood pressure.

Updated and installed MariaDB.

sudo apt-get update
sudo apt-get install mariadb-server

The only pain here was that the repository I used was agonizingly slow to download from, which really did not help my anxiety levels, since I’m used to the more blazing fast ubuntu repositories. Or perhaps it was a temporary patch of bad network I hit.

Regardless, if you are superstitious, you may want to avoid this one.

After a wait that almost had me too old to care, the installation was done.

That is it. There was no noticeable difference to my site except seeming slightly faster. I noticed the configuration file got replaced, but the defaults are good enough that the blogs are completely normal. I expect once I get around to tweaking it, the performance may get even better, but this is good already.

The backups did not get used. A textbook “drop in”. Zero hassle.

Do it already. The only cure for your wondering is finding out.

Meteor::Socket bind: Address already in use at Meteor/Socket.pm line 115.

If, after installing meteor server, you get an error like

Meteor::Socket bind: Address already in use at Meteor/Socket.pm line 115.

when trying to start it up with ./meteord -d or /etc/init.d/meteord start, it means that you likely have another instance of meteor running.

Unless you have changed ports around, you can kill the exising instance of meteor with pkill meteor or simply use it without starting a new one 😉

Installing Meteor Server on Ubuntu

Meteor is a javascript server that does interesting things like live updating your live blog with far less load on your server than without it. However, setting it up is iffy, and the instructions are not idiot proof. So here are the steps distilled from my hits and misses, so that you may not have to go through that yourself.

Meteor Server Installation instructions

These instructions are as per instructions provided on the Meteor Server website along with my comments.

Make a directory for the Meteor Server and cd into it.
mkdir usr/local/meteor
cd usr/local/meteor

We begin with getting and unpacking Meteor Server:
wget http://meteorserver.org/download/latest.tgz
tar zxvf latest.tgz
rm latest.tgz

Alas, this doesn’t work. There is no file at the provided url, and I had to use the url provided for download. So this should work.

wget https://github.com/visitsb/meteorserver/blob/master/build/meteor-latest.tgz?raw=true
At this point, check the name of the file you got.
ls
if it is “meteor-latest.tgz?raw=true”, then
mv meteor-latest.tgz?raw=true meteor-latest.tgz
before proceeding, or the next step won’t work. Now
ls
should give you “meteor-latest.tgz”. Ready to move on.
tar zxvf meteor-latest.tgz
rm meteor-latest.tgz

Now to set it up.

Copy the init script to /etc/init.d/meteord:

cp daemoncontroller.dist /etc/init.d/meteord

You will need to edit the file to change the path if you did not install meteor in /usr/local/meteor. If you wish to use this to start/stop Meteor, you will need to edit line 14 to specify which user account will be used to run it. The default is meteor, so if you want to create that user account now, type:

useradd meteor

Now copy the configuration file to /etc/meteord.conf:

cp meteord.conf.dist /etc/meteord.conf

To start meteor at boot, they recommend

chkconfig meteord on

This part didn't work for me, as I don't have chkconfig installed - the instructions seem "Fedora-ish" - I have no idea how Fedora works. Never used it. Instead, I did

update-rc.d meteord defaults
update-rc.d meteord enable

At this stage, you should be able to start meteor in debug mode (according to them).

./meteor -d

For me, it didn't. I needed to

chmod +x meteord

as they have suggested. I also did

chmod /etc/init.d/meteord

I could start meteor in debug mode successfully, but

/etc/init.d/meteord start

wouldn't work.

I was getting "/bin/sh^M: bad interpreter: No such file or directory"

Found two problems. The first was that /etc/init.d/meteord script refers to /etc/init.d/functions which didn't exist. I edited the file to change the line

. /etc/init.d/functions

to

. /lib/lsb/init-functions

By checking what file was being referred by scripts that were working.

About the "^M" in the error, I discovered that it was caused by the file having dos line endings. It should have been unix line endings.

I opened it in vi

vi /etc/init.d/meteord

and in the command mode itself (hit ESC if you've switched to INSERT) entered:

:set fileformat=unix

Then saved and exited

:wq

Now

/etc/init.d/meteord

starts Meteor.

🙂

I will do a separate post on using Meteor to power Live Blogging Plus (when I finish doing it).

Setting up live blogging that works with the latest version of Wordpress 1

Setting up live blogging that works with the latest version of WordPress

True to form, I want big things for my blog, but they aren’t easy. This time the idea came from a reader who wanted my commentary tweet series on current events to be done instead as a live blog, so that they could read all the ideas at once in one place and they would also remain easily accessible.

Great idea, except all the plugins I came across for live blogging were outdated and not working correctly with the latest WordPress, with the exception of 24liveblog, which I was not so keen on, as the content does not reside on my server, but theirs (though it is free and they promise never to take it down).

If you are fine with the content being hosted on another service, look no further, 24liveblog is good, and free and the resulting liveblog can be embedded on your site with a code provided.

I wanted to make the plugins work as I wanted the content to reside on my server AND I wanted it to make tweets linking to the post with each update.

So I have updated the live blogging plugin to fix several issues with tweets not getting posted to Twitter. You can download Live Blogging Plus it here.

The plugin is capable of delivering the live blog more efficiently using meteor, so I am planning to set up a meteor server for it to use. Stay tuned.

Enhanced by Zemanta

Upload Error: client intended to send too large body

If you are using Nginx and are unable to upload files exceeding 1MB or so (most common) and get your error log shows “client intended to send too large body”, then here is the fix.

Edit your Nginx configuration file (which on Debian/Ubuntu will be found at /etc/nginx/nginx.conf) and edit the setting for client_max_body_size to something you can live with. If there is no line for it, add this line:

client_max_body_size 5M;

Obviously, replace 5M (for MB) with a number that makes you happy if your upload is larger.

Enhanced by Zemanta
Nginx-1.5.6 with ngx_pagespeed (Google Pagespeed module) and ngx_cache_purge 2

Nginx-1.5.6 with ngx_pagespeed (Google Pagespeed module) and ngx_cache_purge

So I got tired of fiddling around with repositories offering builds that compiled ngx_pagespeed with Nginx. I was getting a lot of errors, was using older versions of Nginx and was not able to make the dotdeb repository work.

I was wary of compiling, because I’m a creature of habit, and I like my Nginx installed as a service and other minor pleasures of life (I still haven’t learned to make init scripts :p)

What I have basically done is compiled the latest Nginx (1.5.6 – as of writing this post) along with these two modules I wanted in the place of the Nginx package.

So far, all seems to be working well, and I’m hitting pagespeed scores of 98+ without any noticeable strain on the server. So, for what it is worth, here is what I did.

Step 0: Install dependencies for compiling

Time to become root (better than typing “sudo” for each line.

sudo bash

Enter your password to become root@whatever:~#

Install dependencies for compiling.

apt-get install build-essential zlib1g-dev libpcre3 libpcre3-dev

Step 1: Get the latest ngx_pagespeed

The ngx_pagespeed page gives you the code to install the beta package. I just grabbed the current master download from the button on the right (right-click and copy link 😉 )

You could choose either. I’m not certain the server won’t explode because of whatever I’m doing. So play safe if you want. I just wanted all the fixes already.

This is if you use the recommended beta:

$ cd ~
$ wget https://github.com/pagespeed/ngx_pagespeed/archive/release-1.6.29.7-beta.zip
$ unzip release-1.6.29.7-beta.zip # or unzip release-1.6.29.7-beta
$ cd ngx_pagespeed-release-1.6.29.7-beta/
$ wget https://dl.google.com/dl/page-speed/psol/1.6.29.7.tar.gz
$ tar -xzvf 1.6.29.7.tar.gz # expands to psol/

What I did was:

$ cd ~
$ wget https://github.com/pagespeed/ngx_pagespeed/archive/master.zip
$ unzip master.zip
$ cd ngx_pagespeed-master/
$ wget https://dl.google.com/dl/page-speed/psol/1.6.29.7.tar.gz
$ tar -xzvf 1.6.29.7.tar.gz # expands to psol/

Step 2: Get the latest ngx_cache_purge

You know the drill by now. Just giving the steps I did:

$ cd ~
$ wget http://labs.frickle.com/files/ngx_cache_purge-2.1.tar.gz
$ tar -xvf ngx_cache_purge-2.1.tar.gz

I could have used the master here as well, but I wasn’t having too many errors with it, so it seemed an unnecessary risk (yeah, I know kinda late in the day to be cautious).

Now for the tricky part.

Step 3: Configuring Nginx for compiling

What we are going to do in this step is configure the source to build right on top of the existing Nginx package.

$ # check http://nginx.org/en/download.html for the latest version
$ wget http://nginx.org/download/nginx-1.5.6.tar.gz
$ tar -xvzf nginx-1.5.6.tar.gz
$ cd nginx-1.5.6/

This assumes you have a Nginx server running (you don’t need to stop it yet. I’ll tell you when) that you want to replace and a preference for organizing the files “as usual” in the Ubuntu/Debian way. I had the added greed of not wanting to invent anything I could recycle – like the lazy habit of “service nginx restart” for example. If not, you could probably install it anywhere. There may be easier ways of doing this.

Remember I am NOT an expert, I am simply a determined person trying to get what I want and making do with my limited knowledge.

Ok. Let’s proceed. Get the configuration of your existing nginx package (for the paths). You could also skip to next step without going through this reasoning and method and only return here if there is a problem.

nginx -V

You want to copy this to a text file somewhere for easy reference.

Now, you have to create the command for configuring using the paths here.

./configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log

If you run this command, you will find some alerts going “Not found” in the checking. This is normal, since you don’t need all the things it checks for (indeed some are found on other Operating Systems altogether), but it is a good idea to keep an eye on what’s missing, in case there is a problem…. and there is.

This command will give you all the “Not founds” from that lengthy output. It is the same command, using grep to catch the lines:

./configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log | grep 'not found'

The rest seems ok to my inexperienced eye, but “checking for nobody group … not found” is a problem. So we set the user and group to www-data by adding this to our configure line.

--user=www-data --group=www-data

Then we add our modules from steps 1 and 2.

 --add-module=$HOME/ngx_pagespeed-master  --add-module=$HOME/ngx_cache_purge-2.1

And we have our complete line.

Step 4: Configure the build

$ ./configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --user=www-data --group=www-data --with-http_ssl_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_spdy_module --add-module=$HOME/ngx_pagespeed-master  --add-module=$HOME/ngx_cache_purge-2.1

I have no idea what you will do if you get errors. Comment here, and I’ll see if I have ideas. This should build smoothly on a standard Ubuntu server (I tried on three, all three worked).

Hopefully all went well, and we make the build.

$ make

Now for the other tricky part.

Step 5: Stop your existing Nginx server

Find out where the Nginx files and folders are

$ whereis nginx
nginx: /usr/sbin/nginx /etc/nginx /usr/share/nginx

Check and doublecheck that these are the same folders we are configuring. Not the end of the world if you get it wrong, but you’ll probably get errors with the init script and will have to either make a new one or hack it. Sure they are the right folders?

Now stop the server.

$ service nginx stop

Move your configuration folder somewhere safe.

$ mv /etc/nginx ~

Delete the existing install (we have simply stopped the server, not removed the package). Remember the locations we got in the whereis? add them all to a delete command. (yes, I know we moved the configuration folder somewhere safe, just doing a lazy copy-paste)

$ rm -rf /usr/sbin/nginx /etc/nginx /usr/share/nginx

Step 6: Install the compiled Nginx in the place of the files we removed

Time to install the make we did earlier.

$ make install

Step 7: Add a line to fastcgi_params

Edit the new fastcgi_params file /etc/nginx/fastcgi_params and add

fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;

This line gets added when you install from a package. The source doesn’t have it. No idea why.

If you don’t do this, you’ll get blank pages and a lot of frustration trying to figure out why your server isn’t working. Then you’ll get superstitious over masquerading builds as packages and so on. (Don’t ask how I know) So don’t forget.

Step 8: Return the configuration files to their respective places in /etc/nginx

Move or copy or create the files in sites-available, symlink them to sites-enabled, and so on. The usual stuff.

If you don’t return your original nginx.conf here and choose to use the new one, please remember to add in the http block:

        ##
        # Virtual Host Configs
        ##
        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;

Your earlier package installed by Ubuntu/Debian would have configured the folders automatically, but the source does not have this structure, so you will have to include the files (or paste their contents here – messy) or returning the server blocks into position will *still* not load them and leave you puzzled.

Tweak to taste. The old files worked as they were, for me. I was able to start my new server with a downtime of less than 2 minutes after I had these steps lined up and ready to copy-paste.

Start/restart server.

If there are problems with emerg not being able to bind to port, just do

pkill nginx

and start it

service nginx start

Result?

My pageload time went from 20+seconds for first page load (I wish I had a screenshot) to under 1s for first pageload right off the bat – this is before configuring pagespeed, and frankly, with this performance, I’ll leave pagespeed unconfigured if it so much as whimpers.

So maybe it was all for nothing, unless you count installing Nginx-1.5.6 with the conveniences of a package before it hit the repositories 😉

Note: When it is time for an update, there may be issues. I have no idea what will happen, but worst comes worst, I can

apt-get remove nginx

and

apt-get install nginx

and

lather-rinse-repeat

unless a better option has hit the repositories by then.

I will also post urgent updates here if anything goes wrong. So far as I can see, this is working as a dream.

Also note: There may be changes in performance over the next couple of days as I fiddle around trying to configure stuff. Not a reflection of end result if you suddenly find the blog slow. Work in progress.

Enhanced by Zemanta

PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

If you are trying to upgrade, and suddenly start getting errors like:

Incompatible Archive. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

Here are some things to check.

  • This basically means that WordPress is not able to unzip the downloaded packages to install the upgrades.
  • Check to see available space on your disk. If your disk is full you should try upgrading your hosting package or freeing up some space on the disk. One easy way might be to delete old image thumbnails in sizes you no longer use.
  • If you have enough space on your disk, it may be that specific downloaded packages may be problematic. Try to install a plugin you don’t have, and if that works, you should check to see if there is a mysterious folder called “Upgrades” [DO NOT CONFUSE WITH UPLOADS]. If this folder exists, it is worth deleting it to see ii that lets  you do the upgrade.
Enhanced by Zemanta

Free space in your WordPress install by deleting old image sizes

If you change your theme often, your uploads folder will accumulate thumbnails of images in many sizes that you no longer use. This consumes disk space unnecessarily. I wish someone coded a plugin for this, but failing that, a handy way to do this via SSH is:

find . -name *-250x250.* | xargs rm -f

Where 250×250 is the image size you want to delete. You could also try something like:

find . -name *-250x*.* | xargs rm -f

if you have multiple thumbnail sizes like 250×250 250×300 etc.

What I do is list images in the folders to see the unwanted sizes there, and run this delete a few times with various sizes. A more ruthless person could try something like:

find . -name *-*x*.* | xargs rm -f

I do not recommend this, as it can match several files that you may not want to delete, for example a file with a hyphenated name and the letter x in the last hyphenated word, like “wish-merry-xmas.jpg” for example, which wouldn’t be a resized image, but an original or worse, it could be another file and not an image at all, like “here-are-exact-directions-to-our-property.html”.

But if you have a lot of thumbnail sizes, you may feel tempted anyway. Two suggested precautions. Change directory to your uploads folder (you should do this in any case)
cd /path/to/wprdpress/wp-content/uploads
find . -name *-*x*.* | xargs rm -f

The other precaution to take is to specify extension.
find . -name *-*x*.jpg | xargs rm -f
find . -name *-*x*.png | xargs rm -f

This will give you some protection from inadvertently deleting non-resize uploads like “entertaining-extras.pdf”

of course, if you are a patient soul (or don’t have too many files uploaded), you could find the files before deleting to see if any other files are getting selected along with resizes.

find . -name *-*x*.*
and if all is well
find . -name *-*x*.* | xargs rm -f

Do you have a better method?

Enhanced by Zemanta

How to autopost your blogs and Twitter feed to Google Plus pages

HEADS UP!!! Hootsuite is offering a very cool 50% off on a pro membership (which allows you unlimited autoposts). Use Coupon Code: HOOTXA90

Please note that this does not work with Google Plus profiles, only pages – like this Vidyut page. Google has recently released an API to select partners, which allows posting to google plus pages. Of these, hootsuite is the only one that appears to be free. You can also use it as your social media manager, as it supports scheduling posts and viewing and posting to several streams simultaneously.

Many of us are not yet active on Google Plus, but would like to distribute our content there. Currently, the free account in Hootsuite allows you to have 5 social media profiles and 2 RSS streams, which can post to one social media profile in an automated manner. It is a simple matter to add your google plus page and plug in your blog feed to it. However, plugging in your twitter updates is not so simple.

You will need a server where you can serve php files. I have no idea how secure (or not) the script is, so it is best if it is isolated from any production site you have. As a subdomain or something. If you don’t have your own website, you could easily sign up for some free webhosting, which is a limited account usually, but should be adequate for this purpose as long as it supports curl. Additionally, security will not be such a big risk, considering that there will be nothing beyond the script to get at. The specifications will mention if curl is available, or you can simply upload the script and see if it works. It will work if its needs are met. If not, it is a free account anyway. Try another place. You could also buy hosting, if you like spending money.

I am using Tweetledee, a fairly primitive application for grabbing feeds off Twitter. You can download it here. The website has Tweetledee Usage Examples for setting it up, but if you are somewhat skilled, here is what you have to do.

Create a Twitter application from your Twitter developer site (you will have to login with your Twitter account). You only need read access, so default settings should be fine. For the application url, plug in the url to wherever you are planning to host your application.

Download the Tweetledee application and unpack it onto your computer. You will only be uploading the tweetledee folder inside, but first, add your application details from Twitter into the file tweetledee_keys.php, which can be found in tweetledee/tldlib/keys/.

Surf to http://your.script.host/tweetledee-folder-if-not-root/userrss.php If everything is working, you will see an RSS feed of your Twitter posts here that you can plug into your hootsuite for automated posting. By default, you get 25 posts, but you can increase up to 200 by adding a parameter “c” like:
You can get another user’s timeline by adding their handle as a parameter (mine, in the example):
http://your.script.host/tweetledee-folder-if-not-root/userrss.php?c=200&user=vidyut
You can exclude the replies:
http://your.script.host/tweetledee-folder-if-not-root/userrss.php?xrp=1

However…. several things and their fixes.

The Tweetledee script is fairly primitive in the sense that it simply gives you your timeline as RSS. It does not cache the results currently, so simply refreshing the page a few times may put you out of your API limit. It should not be such a problem if the script is called only when needed, but if the page is available on the internet, there will be spiders and bots and possibly other traffic that may max you out and make your feed unavailable for Hootsuite. A simple fix for this is to check your logs after the script is accessed by Hootsuite for the first time and configure your server to only serve to their user-agent and return a 403 for all other attempts to access it. This works brilliantly. Not to mention it prevents others from misusing your tweetledee tools for their purposes (The scripts do several things, like pull search results or timelines of other users – read documentation).

The Tweetledee application gives you your timeline as seen on your profile page and directly plugging it into hootsuite will post a lot of unnecessary updates (which is not desirable, since you can only make 5 updates an hour with a free account). Besides, if you are a social media addict to the point of seeking a fix like this, you probably make way more than five tweets an hour. So we hack this further.

Now the method bifurcates a bit. If you are paying for a hootsuite account (HootSuite Pro Free Trial) then you will likely not have to worry about the five tweets an hour limit. (Please note that you should limit the access to the application by user-agent or you will likely keep running out of api calls)

We can refine our tweet stream with Yahoo pipes

However, if you are only using a free account, all is not lost. You can still get your best tweets on your Google Plus page, even if not all. To do this, instead of using your profile feed, you use the search feed by “popular” for your handle, which will have tweets you make as well as replies and mentions.

http://your.script.host/tweetledee-folder-if-not-root/searchrss.php?q=vidyut&rt=popular

The best part is that they will be organized so that the “top” tweets – which are your best viewed tweets – show first. You will be doing a considerable amount of weeding of this RSS, so be sure to grab the maximum number of tweets the api allows, which is 200.

Plug this RSS into your Yahoo Pipes, and filter out tweets not made by you as well as any tweets made by you that begin with “@” (which means they are replies to someone). You are left with pure gold. You can additionally sort these tweets by time of publishing to get something that resembles a timeline of your best tweets, or you can use it as it is, so that your best tweets are posted on priority regardless of when you tweeted them. This will largely depend on your tweeting habits. If you tweet like conversation, you may want them in sequence. If you tweet individual tweets, you may want the best leading.

You can also experiment with other ideas like marking tweets you want to share on your Google Plus page as favorites, and using the favorites feed:
http://your.script.host/tweetledee-folder-if-not-root/favoriterss.php?c=200&user=vidyut

Now, when you output this pipe as RSS and plug it into hootsuite, your Google plus page will keep updating with your best tweets (or all, if you are paying to remove limits and not selecting only best tweets). While it will only update five tweets an hour, it will not repeat items it has already tweeted, so if you have made less than 5 good tweets in that hour, your backlog will slowly get cleared, as it also will, every hour when you are offline.

Hope this helps.

If you got a better idea, tell me. Also let me know if anything does not work.

Fix: Realtek SD card reader not working with Ubuntu

I have a RTS5209 Realtek SD card reader on my laptop, which was not reading any card inserted. The following instructions are likely to work for other versions like RTS5229 or RTS5289 as well.

Turns out I needed to install the driver.

Realtek offers drivers on its website for Ubuntu/Linux. Download the driver and unpack into a temporary directory.

Open a terminal and cd into the directory you unpacked the file.

Then enter one after the other:

make

sudo make install

sudo depmod

You will have to reboot your computer for the driver to load, or you can enter this command:
sudo modprobe rts_pstor

This is for RTS5209. I believe for RTS5229 it is (hint:read folder name):
sudo modprobe rts5229

However, this only works on older kernels and on 3.9+ you get errors like:

vidyut@vidyut-Compaq-435-Notebook-PC:~/tmp/rts_pstor$ make
sed "s/RTSX_MK_TIME/`date +%y.%m.%d.%H.%M`/" timestamp.in > timestamp.h
cp -f ./define.release ./define.h
make -C /lib/modules/3.8.0-26-generic/build/ SUBDIRS=/home/vidyut/tmp/rts_pstor modules
make[1]: Entering directory `/usr/src/linux-headers-3.8.0-26-generic'
CC [M] /home/vidyut/tmp/rts_pstor/rtsx.o
/home/vidyut/tmp/rts_pstor/rtsx.c:916:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_probe’
/home/vidyut/tmp/rts_pstor/rtsx.c:1080:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_remove’
/home/vidyut/tmp/rts_pstor/rtsx.c:1106:11: error: ‘rtsx_probe’ undeclared here (not in a function)
/home/vidyut/tmp/rts_pstor/rtsx.c:1107:2: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/home/vidyut/tmp/rts_pstor/rtsx.c:1107:24: error: ‘rtsx_remove’ undeclared here (not in a function)
/home/vidyut/tmp/rts_pstor/rtsx.c:485:12: warning: ‘rtsx_control_thread’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:596:12: warning: ‘rtsx_polling_thread’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:745:13: warning: ‘quiesce_and_remove_host’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:780:13: warning: ‘release_everything’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:790:12: warning: ‘rtsx_scan_thread’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:816:13: warning: ‘rtsx_init_options’ defined but not used [-Wunused-function]
cc1: some warnings being treated as errors
make[2]: *** [/home/vidyut/tmp/rts_pstor/rtsx.o] Error 1
make[1]: *** [_module_/home/vidyut/tmp/rts_pstor] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-26-generic'
make: *** [default] Error 2
vidyut@vidyut-Compaq-435-Notebook-PC:~/tmp/rts_pstor$

The fix for this is to edit the file rtsx.c (that is throwing the errors) and remove “__devinit” “__devexit” and “__devexit_p” from it, leaving the rest of the code (and the rest of the line they occur in) in tact.

Like so:

static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)

Becomes:

static int rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)

static void __devexit rtsx_remove(struct pci_dev *pci)

Becomes:
static void rtsx_remove(struct pci_dev *pci)

.remove = __devexit_p(rtsx_remove),

Becomes:
.remove = rtsx_remove,

Now, when you run make, the process should complete without errors.

If your SD card *still* doesn’t mount, check your dmesg like so:

sudo dmesg

If it shows something like:
[ 694.058432] systemd-hostnamed[2516]: Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!

Try installing the library.
apt-get install libnss-myhostname

If it still doesn’t work, I don’t know what to do. This SHOULD work.