Unfortunately, there’s no guide available for installing mediawiki on dotcloud and googling for it doesn’t turn up anything much useful. But, I had to move out LUG wiki to dotcloud. I proceeded with it while refering to drupal documentation. At the moment, I don’t have a guide on installing mediawiki but I can highlight the problem I faced.
The big problem lies in the fact that the setup of MediaWiki was done on Apache and dotcloud runs nginx. So, the problem occured mainly with getting the path right.
The savior comes in form of the MediaWiki documentation for nginx.

Some of the changes I had to make were

LocalSettings.php

$wgUsePathInfo = true;

nginx.conf

try_files $uri $uri/ /index.php?title=$1&$args;

fastcgi.conf

fastcgi_param  PATH_INFO          $fastcgi_path_info;

 

This isn’t a full fledged guide or a how-to but hopefully a pointer for people who are stuck while getting started with MediaWiki on dotcloud or nginx.

 

Do you find performance of your WordPress blog to be lousy? And have no clue on where to start with it?

There are lots of articles on the Internet which will tell you what to do. So, instead of repeating the same, I’ll cover each aspect and links to articles which provide useful how-to’s on the same which I have come across while working on OnlyGizmos and iPhoneHelp

I’ll divide it into sections on basis of the type of hosting as it is usually the limiting factor on how much tuning you can do.

Shared Hosting

Having your blog on shared hosting means there’s not much you can change but this is what will suffice for huge number of bloggers out there.

  • Caching Plugin: W3 total cache is the best and highly recommended plugin. With tons of features besides caching like Minification, CDN support, mobile support, Cloudflare integration it is by far the best cache plugin I have come across. For installation and configuration see this wonderful how-to from wpbeginner
  • Theme: Use themes which have been designed with SEO in mind. These themes follow the best practices to speed up your page loading time e.g. putting stylesheets at the top and minify them. The theme framework I would recommend is Thesis. It is a paid theme but having worked with it, I can say that it’s worth the price if you are serious about your website.
  • Scripts: Put javascript files at bottom as recommended in YSlow. This can be handled by W3 Total Cache.

Single Server

In addition to the above, if you have control over your server e.g. VPS or Dedicated server you can take following extra steps -

  • HTTP Server: Move over from Apache to Nginx. Here’s a good guide on moving over your wordpress blog to nginx.
  • MySQL Tuning: Run the mysqltuner script and follow the recommendations given by it to improve MySQL performance.
  • PHP Accelerators: Install PHP Accelerator like APC or XCache. List of accelerators is available on wikipedia. I recommend APC since it’s stable and is likely to be merged into PHP 6.
  • CDN: If you serve lot of static content and media do consider going with a CDN. And if you think you cannot afford CDN’s as they are too costly, think it over. MaxCDN offers excellent CDN at an affordable price of $39.95 for the 1st TB. Do check them out.

Multiple Servers

  • Memcached: One of the components I am yet to personally handle but have heard a lot of good stuff about it. It can provide superior object caching. It has a good support in W3 Total Cache thus making your work of integrating with wordpress easier.
  • Varnish: Place varnish in front of your HTTP server and see your websites fly. Here’s a good article on setting up varnish with nginx, w3tc and APC. And if it isn’t enough official website provides excellent documentation.

These are the things that I have learnt in the past one year. If you have something which I have not covered please share it with us in the comments.

 

Sunday February 1 2009 was the day when BarCampMumbai 5 was held with the same old enthusiasm but at a whole new venue – VJTI College, Matunga. The camp was host to many firsts for the BCM as well as for me.

  1. First time BCM was held outside IIT-B.
  2. First BCM without any sponsorship. It was jokingly called as recession camp by a few of us.
  3. First time I had the responsibility of handling something on my own
  4. I took a first session at BarCamp
  5. First opportunity for me to live tweet from an event

Taking up a session was an awesome experience for me. I haven't spoken in front of a crowd since college days, when we used to have presentations in front of the class. And I am glad that I was able to speak better than I did at college. Also, the amount of response I received from the crowd was unexpected. I expected to have 3-4 people attending the session, so I decided to go for a BoF. But in the end had to adjust it to accommodate an audience of 15+.
There was a downside though, I almost attended no session at all throughout the whole BarCamp. The opportunity to meet up people and do something more than made up for it.
Icing on top of the cake was when some of us went to see the play -The Park, at Horniman Circle. It was a perfect way to end the nice day. Thank you Thakkar for informing about the play. My next blog post would be on the play. It was too awesome to not have it's own separate post.

 

I have been looking for a way to enabling network inside virtualbox so that I can access it from anywhere thus being able to run various services inside virtual environment, trying out anything without any worries.

Here’s a simple how-to borrowed from archlinux wiki

Install bridge utils for creating bridge and uml_utilities for creating a tun device

pacman -S bridge-utils uml_utilities

Open the file /etc/udev/rules.d/60-vboxdrv.rules and add the following line to it

KERNEL==”tun”, OWNER=”root”, GROUP=”vboxusers”, MODE=”0660″

Then type the following command to load the tun module

modprobe tun

Now, let’s setup a bridge device to bridge network from your physical network interface to the virtual one

  • Create a bridge interface

brctl addbr br0

  • Set your interface in promiscous mode so it can accept packets from any interface

ifconfig <interface name> 0.0.0.0 promisc

  • Now, bridge the bridge interface with the real network interface

brctl addif br0 <interface name>

  • Now set the bridge interface to acquire IP address as your physical network interface would. eg if eth0 is your network interface and it acquires IP via DHCP then

dhclient br0

  • And finally add virtualbox host interface

VBoxAddIF vbox0 <VirtualBox user> br0

Now start VirtualBox and go to network settings. Select network interface as ‘host networking’ and interface device as ‘vbox0′.

Now you need to give an unused IP address in your IP range of the internet gateway. If you cannot provide that due to some reason then what you can do is create a virtual interface say eth0:0 then bind bridge network to that interface and setup NATing to pass packets between virtualbox and external network.

 

Let me narrate 3 nice experiences with pdf on Linux while at work

1) Merging multiple PDF files

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOUTPUTFILE=filename.pdf file1.pdf file2.pdf……..fileN.pdf

2) Convert ps to pdf

ps2pdf file.ps file.pdf

3) Compressing PDF files.

4) Convert images to PDF

convert image1.jpg image2.gif image3.tiff…….imageN.xyz filename.pdf

 

I had to urgently view a MS Word file but I didn’t have a word processor on my system to view it in, KWord2 beta wasn’t able to support MS Word files. And I couldn’t find any small word processor or the one that wouldn’t being a gnome and a half in with itself. So, I decided to explore the CLI way.

I came across this nice article on how to view MS Word files on CLI. One of those softwares which I tried out is antiword, as it seemed most suitable to my purpose. A nifty utility to download and use while Oo.org takes it’s sweet couple of hours.

Another nice thing is that it can be used when you don’t have X running or if you’re connecting via SSH.

Viewing the file in antiword is as simple as typing

antiword filename.doc

Though it has a few options to format stuff via parameters, I don’t need them. But, they can be quite useful for some purposes.

Pipe the document through a pager and nicely sit and enjoy reading your MS Word document over Command Line Interface.

My thoughts on the software – simple, easy to use and makes life easy when all you want is to view simple text from a MS Word document. What I miss the most in the software is the ability to open odt files :(

 

BarCampMumbai is back again. The same venue, different format.
BCM4 is happening on 4th-5th October 2008 at IIT Powai. Yeah, you read it right it's a 2 day event this time around. There are some other changes too, for better and for worse – as you see it. This time around only way to get to the barcamp is to get involved. You can either volunteer for helping manage the event or you can register as a speaker. A good thing for me as I already wanted to give a shot to volunteering but was a bit late last time around.
You can register for volunteer at Volunteer's Page or register your session in Registration Document.
There's also a logo competition running at BCM this time around for all you creative people.

"BCM
Venue:- SJMSOM, IIT, Powai, Mumbai
Date:- 4th to 5th October 2008

To get news and updates about all the happenings till the countdown clock ticks you can

  1. Join mailing lists and get in touch with the enthusiasts and discuss at http://groups.google.com/group/barcampmumbai2
  2. Follow the blog at http://blog.barcampmumbai.org/
  3. Follow on twitter at http://twitter.com/bcm4
 

I had faced this instance where there ocurred problem with mysql configuration in debian. Something went wrong with the configuration and could not be traced out. We needed to fix it soon and reinstall was the easy option as there was no useful data.
But, the package couldn’t be removed because mysql is stopped before removing, Here, what was happening was that the init script would neither start or stop mysqld due to configuration error. Thus, the package couldn’t be removed as it failed to stop mysql.
So, thus I followed a hack’ish kind of a method to remove mysql.
First I killed mysqld by using top. Then I edited the file /var/lib/dpkg/mysql-server.prerm to remove the relevant section. So, now when I remove the package, the script won’t try to stop mysql-server.
Thus, I was cleanly able to remove the package without any problems.
Also, you get choice whether you want to keep your databases or remove them. Thus, is safe if you have important database.
Though, this method doesn’t have any bad side effects as far as I know, but still it would be better to sort out the configuration issues but here I had no other choice as it was important to remove it quickly and also there were no important configuration saved.

 

Finch is an IM and IRC client for command line. It supports all the protocols supported by pidgin. Like pidgin, it makes use of libpurple. So, all your account configured for pidgin can be used on finch too .
It has nifty shortcuts based on alt keys to navigate around. Making it quite simple to use for those people who are faster with keyboard than with mouse. . Some frequently used shortcuts are :-

  • Alt + q – quit
  • Alt + c – close window
  • Alt + n – next window
  • Alt + p – previous window
  • Alt + a – View available actions
  • Alt + w – list of windows
  • Alt + m – move window
  • Alt + r – resize window
  • F10 – Show menu for current window
  • Alt + tab – next URGENT window
  • Alt + Shift + tab – previous urgent window

Not so difficult to remember the shortcuts. No use of mouse required at all
Alas! Keybindings don’t work under screen so I can’t run it in screen session rest everything is perfect.

 

Searching around the net I came across 2 articles which helped in writing the init script presented below.
There are 3 versions of the script – one for gentoo based distros one for debian based distros and one for Fedora, which is quite similar to debian one.
Requirements for running the scripts

  • rtorrent
  • screen
  • adequate knowledge to operate rtorrent and screen

Steps to get started

  • Copy the contents of the script for your distro to a file
  • Save it with the name indicated in the script
  • Make the file executable with following command

chmod +x /path/to/file

  • Add it to your default boot level as indicated in the comments
  • Change the TUSER value from username to your username
  • Optionally you can change rtorrent to some other bittorrent client depending on your preference. NOTE:- It should be a CLI bittorrent client

The gentoo version of the script

#!/sbin/runscript

# To add the script automatically at the startup execute the following command in the terminal
# eselect rc add rtorrent default

RTUSER=username
TORRENT=/usr/bin/rtorrent

opts=”start stop”

depend() {
#this daemon needs internet to function
need net.eth0
use logger
}

start() {
#display to user that what is being started
ebegin “Starting rtorrent”
#start the process and record record it’s pid
start-stop-daemon –start –background –pidfile /var/run/rtorrent.pid –make-pidfile –exec su -c “/usr/bin/screen -dmUS torrent $TORRENT” $RTUSER
# To interact with rtorrent you will need to reattach the screen
einfo “To use your rtorrent session, reattach screen using following command:”
einfo “screen -r torrent”
#output failure or success
if [[ $? -eq 0 ]]; then
if [[ $? -eq 0 ]]; then
eend “Process started successfully”
else
eend “Process failed to start”
}

stop () {
#display that we are stopping the process
ebegin “Stopping rtorrent”
#stop the process using pid from start()
start-stop-daemon –stop –pidfile /var/run/rtorrent.pid –name rtorrent
#output success or failure
if [[ $? -eq 0 ]]; then
eend “Process stopped successfully”
else
eend “Process failed to stop”
}

Debian version

#!/bin/bash

# To start the script automatically at bootup type the following command
# update-rc.d torrent defaults 99

RTUSER=username
TORRENT=/usr/bin/rtorrent

case $1 in
start)
#display to user that what is being started
echo “Starting rtorrent”
#start the process and record record it’s pid
start-stop-daemon –start –background –pidfile /var/run/rtorrent.pid –make-pidfile –exec su -c “/usr/bin/screen -dmUS torrent $TORRENT” $RTUSER
#output failure or success
#info on how to interact with the torrent
echo “To interact with the torrent client, you will need to reattach the screen session with following command”
echo “screen -r torrent”
if [[ $? -eq 0 ]]; then
echo “The process started successfully”
else
echo “The process failed to start”
;;

stop)
#display that we are stopping the process
echo “Stopping rtorrent”
#stop the process using pid from start()
start-stop-daemon –stop –pidfile /var/run/rtorrent.pid –name rtorrent
#output success or failure
if [[ $? -eq 0 ]]; then
echo “The process stopped successfully”
else
echo “The process failed to stop”
;;

*)
# show the options
echo “Usage: {start|stop}”
;;
esac

Seems that debian version will work for Fedora too. Still, here’s the script

#!/bin/bash

# To start the script automatically at bootup type the following command
# chkconfig add torrent

RTUSER=username
TORRENT=/usr/bin/rtorrent

case $1 in
start)
#display to user that what is being started
echo “Starting rtorrent”
#start the process and record record it’s pid
start-stop-daemon –start –background –pidfile /var/run/rtorrent.pid –make-pidfile –exec su -c “/usr/bin/screen -dmUS torrent $TORRENT” $RTUSER
#output failure or success
#info on how to interact with the torrent
echo “To interact with the torrent client, you will need to reattach the screen session with following command”
echo “screen -r torrent”
if [[ $? -eq 0 ]]; then
echo “The process started successfully”
else
echo “The process failed to start”
;;

stop)
#display that we are stopping the process
echo “Stopping rtorrent”
#stop the process using pid from start()
start-stop-daemon –stop –pidfile /var/run/rtorrent.pid –name rtorrent
#output success or failure
if [[ $? -eq 0 ]]; then
echo “The process stopped successfully”
else
echo “The process failed to stop”
;;

*)
# show the options
echo “Usage: {start|stop}”
;;
esac

One thing I need to implement is to show status. If it is started or stopped. Reload or restart doesn’t seem to make much sense to me thus I haven’t implemented those.
This is only the initial version it may have bugs. Please report them so they can be corrected.
Debian and fedora users please try it and report if it works.
For user of other distros, if interested, please provide some idea of your distro’s init system or attach some init script so that I can work on it.
For people familiar with init system, it would be great to post your modifications/improvements/bug fixes/ideas to this script.

© 2012 Sneek-A-PeekSuffusion theme by Sayontan Sinha

Switch to our mobile site