Don't bother like my brother

Just another WordPress weblog

 

Windows Vista, DNS settings and IPv6 April 28, 2009

Filed under: IT — Artem @ 12:23 am

Just a quick tip for those, who has the same problem in Vista with DNS settings not updated. Recently my ISP had some problems with DNS server, so the “Internet” was not working, however there was a physical connection and I could ping all the IPs. I defined the DNS addresses manually by putting OpenDNS ip addresses, however after applying settings Vista refused to use these settings. After some experiments it turned out that the problem was IPv6. Everything started to work after disabling the IPv6.

 
 

Skype API on Python = Skype4Py April 10, 2009

Filed under: code — Artem @ 1:30 pm

Recently I needed to write a small utility for Skype. Python seemed as a good start for this purpose as the language is easy and flexible and it has a Skype4Py module with all the necessary APIs. The installation is straightforward. First off, go to the download page and get the latest version. Then go to the folder you downloaded it into and unpack the archive:

tar xzvf Skype4Py-1.0.31.0.tar.gz

Go to the folder with the source and install the module:

cd Skype4Py-1.0.31.0
sudo python setup.py install

Now when everything is installed, you can proceed to the code. There are not much examples of the code in the Internet, but if you know python, then the process is very simple. The project page has extensive documentation on all the classes and methods, and is very helpful in using this module. To demonstrate how it all works, I wrote a small and not very useful program, which however serves its purpose:

import sys
import Skype4Py

# attach our program to the Skype
def OnAttach(status):
    print 'API attachment status: ' + skype.Convert.AttachmentStatusToText(status)
    if status == Skype4Py.apiAttachAvailable:
        skype.Attach()

# create Skype object
skype = Skype4Py.Skype()
skype.OnAttachmentStatus = OnAttach

if not skype.Client.IsRunning:
    print 'Starting Skype..'
    skype.Client.Start()

# get the name of Skype contact from the command line and create an object uprofile
uname = sys.argv[1]
uprofile = skype.User(Username=uname)

# now we can use all the methods from this object (see the documentations for "IUser" class for all available methods)
# print the full name of a person
print 'profile: ' + uprofile.FullName

# open chat with uname
message = 'From cmd: ' + sys.argv[2]
uchat = skype.CreateChatWith(uname)
uchat.SendMessage(message)
print 'message sent: ' + message

sys.exit

The main Skype interface is Skype4Py.Skype, from there you start the chat, get the user profiles, place calls and do all other things.

To run this program, use this command, where skypedummy.py is the name of your program, “i.am” is the skype name of the contact, and in the quotation marks is the message you are sending to him:

python skypedummy.py i.am "Greetings from my first skype app"
 
 

Ubuntu start-up programs

Filed under: IT, software — Artem @ 1:03 pm

Have you ever wondered what services are starting during the booting process of your Ubuntu? Got confused with all these rc levels and other things? There is a very easy to use program called BUM, or boot-up manager which is aimed to help find out and configure all the start-up programs.

To install bum, simply run the following command:

sudo apt-get install bum

And then run it:

sudo bum &

Or just go to the System -> Administration -> Boot-up Manager

bum