Winner of the 2013/2014 Teach something, Win something is Zander who is active on the Lowendspirit forums and did a writeup on his skype bot setup on one of the Lowendspirit boxes.
Happy reading!
OS: Ubuntu 12.04 64Bit
First of all start by installing Ubuntu 12.04 64bits version on your vps. I assume you know how SolusVM works, if not take a look at the forum.
Give it a few minutes to finish the installation, and change your SSH port. Again, I assume you know how to do this. If not look at the forum.
First we start to install all the needed packages. Start with a update.
1 |
apt-get update |
Then lets install a few python packages, xvbfc, fluxbox, tightvncserver.
1 |
apt-get install -y xvfb fluxbox tightvncserver dbus libasound2 libqt4-dbus libqt4-network libqtcore4 libqtgui4 libxss1 libpython2.7 libqt4-xml libaudio2 libmng1 fontconfig liblcms1 lib32stdc++6 lib32asound2 ia32-libs libc6-i386 lib32gcc1 nano python-gobject-2 curl git |
Also install skype, just download the .deb file and install it:
1 |
wget http://www.skype.com/go/getskype-linux-beta-ubuntu-64 -O skype-linux-beta.deb && dpkg -i skype-linux-beta.deb |
It is recommended to create a new user (for example: skype) and install the service on there. In this guide I will install it on root just to make it shorter.
If you want, create a new user:
1 |
adduser skype |
and change user:
1 |
su skype |
If you want to run as root skip that part and continue. If you changed your user don’t forget to go to your home directory and get out of /root.
First of all, lets clone sevabot into your home directory.
1 |
cd ~/ && git clone git://github.com/opensourcehacker/sevabot.git |
There are a few scripts available, too bad we can’t use these anymore. The default bot uses x11vnc and it is too heavy. (I wasn’t able to run the bot stable on a 512mb box with x11vnc)
To good thing about the scripts is that we can specify which servers we want to start/stop. Lets start xvfb and vnc:
1 |
SERVICES="xvfb" ~/sevabot/scripts/start-server.sh start |
Start tightvncserver, this is as simple as running:
1 |
tightvncserver |
However we need to specify a different port. You can do this by using the -rfbport flag. Example: (My port range is 14801 ~ 14820)
1 |
tightvncserver -rfbport 14802 |
Enter a password twice, and optionally pres y or n to enter a view only password. (Not recommended)
Download a vnc viewer. I use this one:
http://www.tightvnc.com/download.php I recommend the java viewer, just because it is only 1 jar.
Connect to your vps, don’t forget the port you set previously!
Go back to your terminal and start skype:
1 |
SERVICES="skype" ~/sevabot/scripts/start-server.sh start |
Back to your vnc viewer you should see a skype window. Recommended is to create a new account. Login and go to your skype settings. And copy your settings:
Now comes the hardest part. Installing python and sevabot. If you followed the guide correctly you end up with a directory name sevabot. Go in that directroy.
1 |
cd sevabot |
A few days ago virtualenv decided to update their file. DO NOT USE THE LATEST VERSION! I couldn’t get it to work and went back to 1.9. You can find it here:
1 |
wget https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.tar.gz |
Extract it, go into the new directory and move virtualenv.py and virtualenv_support 1 directory up:
1 |
tar zxfh virtualenv-1.9.tar.gz && cd virtualenv-1.9 && cp virtualenv.py .. && cp -r virtualenv_support .. && cd .. |
Now deploy your environment:
1 2 3 |
python virtualenv.py venv . venv/bin/activate python setup.py develop |
Last thing we need to do is create a settings.py and change the password for the web interface, change the http host and your skype name.
1 2 |
cp settings.py.example settings.py nano settings.py |
Lets start sevabot:
1 |
SERVICES=sevabot ~/sevabot/scripts/start-server.sh start |
If you go to VNC you will find a a little pop up from skype saying “Skype4Py” is trying to connect to Skype. Tick the box to remember the selection and answer Yes.
Now you can add your bot on skype, and test it with !ping. It should return “Pong”
1 comment for “Skype Bot”