Translation


by Transposh

Posts Tagged ‘Linux’

Set Up Your Own Ubuntu Repository using apt-mirror

Sunday, February 6th, 2011

What is Ubuntu Repository?

It is the place where all software’s builds are stored for ubuntu. And when you make any install it downloads the package and install it.


Who should create a Repository?

If  you have a lots of ubuntu machines and you want to update and install a lot of packages in all the machines,else you have a slow internet connections then this is for you.


How can you create a Repository?

There are many ways how you can create a Repository.

  1. apt-proxy
  2. apt-cacher
  3. apt-mirror

Here I am going to show you how to create using apt-mirror. And if the machine is connected to internet,with web configuration it can also be used as a mirror in internet to download from.


Process of Creating The Repository

First of all you need a fast internet connection(this is required only once) with about 80 GB space to get all the downloaded packages.
I am setting up a repository for maverick-meerkat and have also included third party softwares.If you want you can add to the repositories with new source link and also remove some if you don’t want some.It almost is about 63.9 GB but i have added another 20 GB for fail safe options.

So here we go.

Step1: First install apt-mirror

1
sudo apt-get install apt-mirror

now you have the apt-mirror installed,Lets configure it

Step2:

1
 gksudo gedit /etc/apt/mirror.list

Here’s where you can enter the repositories that your local mirror will get all of it’s sources and debs from

Here’s what my mirror.list file looks like. Feel free to modify it to include or exclude what you will. Also, you may be able to find a closer and thus faster repository site i.e. in if you are in india you should look for an indian repository.



1
############# config ##################
#
# set base_path    /var/spool/apt-mirror
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############
deb http://archive.ubuntu.com/ubuntu maverick main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu maverick-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu maverick-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu maverick-proposed main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu maverick-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu maverick main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu maverick-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu maverick-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu maverick-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu maverick-backports main restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu


i have added all the repositories for maverick you can add according to your requirement.


step 3: Now we run it for the first time.Now its going to take a lot of time so you should devote a few hours for it.But in case you want to stop it and restart it from there the is no problem as it continues from there.so you can just run it when no one is using the connection.

1
sudo apt-mirror /etc/apt/mirror.list

step4: Phew once that’s done you’ll get some instructions on how to clean up unwanted files. Follow those.They’ll probably ask you to run below
command,but double check with your output.

1
sudo /var/spool/apt-mirror/var/clean.sh


step 5: Now once done with the download we can add it in the cron file so that it get updated  every day.Run the command to edit the file

1
gksudo gedit /etc/cron.d/apt-mirror

just uncomment the # from the last line and it will be updated every day at 4:00 AM you can edit and also change the timing and interval.


step 6: Now lets see how to use this repository.The easiest way would be using a web server like apache.so install apache

1
sudo apt-get install apache


step 7:point the mirror to apache web directory

1
ln -s /var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu /var/www/ubuntu

step 8: then add this repository in the machines you want to update.
for ex: if the machine can be  accessed by ajatus.in then just add

1
deb http://ajatus.in/ubuntu maverick main restricted universe multiverse.


This is how you can set up your own repository for ubuntu.


How to catch invisible friends on GTalk

Saturday, December 18th, 2010

I always wondered that there must be a way to catch friends off guard when they are invisible. Luckily I came across Python’s XMPP library which helped me. On ubuntu Linux you can install this module using apt.

1
$ sudo aptitude install python-xmpp python-dnspython

The complete script is as below . Open gedit or Vim and copy pate the below code. Save it as “track_invisible_users.py” Don’t forget to replace the username and password fields

?View Code PYTHON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import xmpp
 
#constants
USER_ID = "youruserid@gmail.com"
PASSWORD = "yourpassowrd"
SERVER = "gmail.com"
 
jid=xmpp.protocol.JID(USER_ID)
C=xmpp.Client(jid.getDomain(),debug=[])
 
if not C.connect((SERVER,5222)):
    raise IOError('Can not connect to server.')
if not C.auth(jid.getNode(),PASSWORD):
    raise IOError('Can not auth with server.')
 
C.sendInitPresence(requestRoster=1)
 
def myPresenceHandler(con, event):
   if event.getType() == 'unavailable':
     print event.getFrom().getStripped()
 
C.RegisterHandler('presence', myPresenceHandler)
while C.Process(1):
  pass

After this run

python track_invisible_users.py 

Empathy for Pidgin

Friday, October 9th, 2009
Empathy for pidgin

Empathy for pidgin

The choice is yours.Such is the power of open source.But that doesn’t mean that there are no favourites.Vi editor is the most used text editor while open office remains the most powerful office suite platform.Gimp is a lovely image editor.And if we talk about Instant messaging client Pidgin has been ruling the roost. But things are moving fast, fast enough for Pidgin earlier known as Gaim(GTK AOL Instant messenger).

Empathy Screenshot

Empathy Screenshot

The new kid off the block is known as Empathy which rides on a new framework providing a real-time communication on Linux desktops.Empathy is another instant messaging program which supports numerous networks and has lots of features.The project was introduced into GNOME with release 2.24 as the desktop’s messaging client. Empathy was built to take advantage of the new Telepathy framework which enables system wide communication not previously possible.Empathy also utilizes libpurple (the same library as Pidgin) and as such inherited support for all of its networks from the onset. Although a young project, it has quickly grown an impressive set of features, including the geolocation of contacts and support for video and audio chat over both XMPP (Jabber) and SIP. The XMPP protocol is used by numerous networks, including Google Mail and is considered a very important feature of the application.

Empathy, which literally translates as ‘in feeling’, is the capability to share and understand another’s emotions and feelings. It is often characterized as the ability to “put oneself into another’s shoes”.

Telepathy framework has three main benefits:

Real-time: Telepathy supports instant messaging (both one-to-one and in groups), voice calls and video calls; it’s less suited for store-and-forward applications like email.

Unified: Many different programs can take advantage of these communications; Telepathy lets these programs work together.

Framework: Telepathy allows the different aspects of communication handling to be divided between different parts of the system, meaning each part is simple.

The GNOME project has adopted Telepathy into the environment so that all applications can have system-wide communication. Just where this technology will take the desktop is not yet clear, but the possibilities are endless. This simple game of Sodoku is a good example of what’s possible with the Telepathy framework.Due to its use of the Telepathy framework, Empathy can tie itself into the desktop far more closely than Pidgin ever could.As free software improves over time and applications come and go, it only stands to reason that what is a common tool today might not be tomorrow. The fact that there is lots of choice is naturally a good thing, after all, competition encourages innovation. It is sad to see Pidgin replaced in GNOME because it has been (and continues to be) a great instant messaging client.

Install empathy

s