Archive

Archive for the ‘python’ Category

MEDIAFIRE DIRECT LINK GENERATOR

December 8, 2009 3 comments

THIS SCRIPT DOESN’T WORK ANYMORE!

IF ANY FUTURE SCRIPTS WILL BE MADE THEY WILL BE POSTED  AT MY NEW BLOG

http://djsh.net/

UPDATE2: Mediafire updated their page leaving this script non functional.

UPDATE: Added Proxy Support

This is a python based Mediafire link resolution script . It resolves the input link to give the direct link to the file.

By using this script you are automatically agreeing to MediaFire ‘s Terms and Conditions.

If you wish to have the source code , contact me.

DOWNLOAD

For help use “mediafire.pyc –help”

Categories: Bash, Linux, python, Windows Tags: ,

Install XBMC

January 10, 2009 2 comments

XBMC (a.k.a. XBOX Media Center) is a great media center available on all platforms

If you have Ubuntu then see this
http://xbmc.org/forum/showthread.php?p=185738

For Fedora an unofficial rpm is available at http://www.fedorajunkies.com/index.php/XBMC

Installing From source:

0) Get Latest SVN Snapshot

svn co http://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/linuxport/XBMC/

Fedora:
1)Get RPMFusion Repo:

rpm -Uvh  http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

2)Install Dependencies :

yum install SDL* glew glew-devel libmad-devel tre tre-devel libogg libogg-devel libvorbis libvorbis-devel boost \
boost-devel bzip2-devel bzip2-libs fribidi* lzo lzo-devel mysql-libs mysql-devel jasper jasper-devel faac faac-devel \
enca enca-devel hal hal-devel hal-libs cmake gperf nasm libXmu-devel fontconfig-devel freetype-devel libXinerama-devel \
pcre-devel gcc-c++ sqlite-devel curl-devel pulseaudio-libs-devel libsmbclient-devel

3)Make sql symbolic link
– For i386

ln -s /usr/lib/mysql/libmysqlclient.so.15.0.0 /usr/lib/libmysqlclient.so

For 64 bit

ln -s /usr/lib64/mysql/libmysqlclient.so.15.0.0 /usr/lib64/libmysqlclient.so

4)Configure

cd linuxport/XBMC
./configure

5)Make

make

During this some errors may occur:
A)

../xbmc/utils/CharsetConverter.h:31:39: error: fribidi/fribidi_char_sets.h: No such file or directory

Sol:

cd xbmc
ln -s lib/libfribidi/ fribidi
cd ..
make

B)

/usr/include/jpeglib.h:1096:55: error: jpegint.h: No such file or directory

Sol:

cp xbmc/lib/cximage-6.0/jpeg/jpegint.h /usr/include/
make

C) For any other errors refer to fedorajunkies.com or fedoraforums.org

6) Install

make install

7) Configuring

Open xbmc by typing   xbmc in terminal or ALT+F2

-Settings > System >Audio Hardware
-Change Audio Output to Digital
-Change Audio Output Device and Passthrough Output Device to same device settings

(pulse -for fedora , hdmi/spdif- for ubuntu/debian systems)

You can also find out your device by using

aplay -L

8) To learn More about plugins and scripts Visit

http://www.xbmc.org/wiki

Python 3.0 Basics

December 9, 2008 Leave a comment

print(“Hello”) prints Hello , to know more about any command use help(<name>) so help(print) brings the command info.

-Unlike older versions python now classifies strings into data and text. All Text is Unicode  represented by type str and all data is encoded Unicode represented as binary data by byte. Both are immutable cannot be inter-converted as in older versions.

-A python script can be written by writing the code in a text file with extension .py Also in Linux / Unix based systems the first line can give the interpreter version
#!/usr/bin/env python        or #!/usr/bin/env python3.0
(If you have multiple versions of python its HIGHLY recommended to stick to 3.x versions)
-Python is strictly indentation based, so give same indentation at each level.

Eg.
i=0                     1
while i<5:              2
print (i)               3
i+=1                    4

So inside the file line 1 & 2 have same indentation while those inside while loop (line 3 &4) have
same indentation but different from outside level.
(To Be Continued ..)
For FAQS and More Info Visit http://docs.python.org/dev/3.0/ or http://docs.python.org/

Categories: python

Installing Python 3.0

December 9, 2008 Leave a comment

1)For Windows
Go to http://python.org/download/    and download software depending on your OS’s architecture
2)Linux
a) First Search in your Package Manager for python 3.0 (it probably is installed) if not try to install from the repos else:
Go to http://python.org/download/ and download the bz package and extract it.
b) Open a terminal in root / superuser mode
cd <dir>
where <dir> is the path .
c) ./configure
d) make
e) make altinstall (this preserves current python version , else do make install)
If you get any dependency errors ,don’t be scared just try to find them using your package   manager or use google to find them.
For Old Python Users:
– Basic syntax had changed but you would get used to it.
– There’s a tool to convert old syntax scripts to new 2to3 .(unstable)

Windows users can add python to their environment variables
My Computer>Properties>(Advanced System Settings in vista)>Advanced
Go to Environment Variables >Scroll bottom scroll bar, select PATH and click edit
Add to the end ;<path where its installed>;
Now a script can be written anywhere and executed by

python <file-name> in dos
-Open DOS or terminal and enter python or python3.0 .Upon pressing enter an interactive shell
shall open with current python version and install date and time and OS type you are using.

Categories: python

Python 3.0 Introduction

December 9, 2008 Leave a comment


Python is a freeware open-source cross-platform interpreted scripting language used by NASA ,
Google , Honeywell and many other companies and now days its also being distributed along
with all the major GNU/Linux distros.


Its been one the most favoured scripting languages due to its short and easy syntax which can
perform complex tasks and is easily extended with new functions and data types implemented in C
or C++ (or other languages callable from C). Python is also suitable as an extension language for
customizable applications.


Many people might have tried using python before but on 03 Dec 2008 Python 3.0 was released
which is a major update to python syntax making its interpreter faster and more efficient.


Categories: python