Servidores

How to easily create Debian packages for PHP extensions

Written on March 20th, 2011
.

debian php packe How to easily create Debian packages for PHP extensions

Let me explain to all of you how to create a Debian package from a PECL tarball. Currently is very simple to package a PECL extension without having any previous experience in Debian packaging and thus this system administration by installing deb packages could be more easy too.

So let’s start the packaging.

Read the rest of this entry »

Setup a remote git repository using http with push support and digest auth

Written on February 9th, 2011
.

git over http Setup a remote git repository using http with push support and digest auth

And here is another post about our daily job with git, this time talking about how to setting up a remote git repository with digest authentication and support for pushing changes using http protocol.

There is a lot of options to setup a git repository: git-daemon, gitosis, ssh, and more.

  • The more secure way is to use ssh protocol but it needs to create user accounts for each user you want to allow to pull and push changes from the remote repository.
  • For the other hand git-daemon is the faster way that allows to publish a public repository but if you needs to restrict access for some users (allow/disallow push/pull or view one entire repository) this won’t be your best choice.

Now I will write all the steps to setup a remote git repository that uses http protocol.

Read the rest of this entry »

Get back your disk space in a Debian-based Linux

Written on November 21st, 2010
.

4242576451 39b4be5d76 b 300x214 Get back your disk space in a Debian based LinuxThere are some actions you can perform to achieve if you can get back disk space in your Debian/Ubuntu based box. Most packages contain files that aren’t necessary. For example, UI and documentation translations in languages you don’t use. Wouldn’t it be nice if you could get rid of them and get back a few megabytes? Well, since dpkg 1.15.8 you can.

dpkg has two options --path-include=glob-pattern and --path-exclude=glob-pattern that filter what files are installed or not. You can get the format of the pattern from the glob man page: glob(7).

But this just works if you issue dpkg command from the shell but not if you are using apt or aptitude. So the best way to use them is to write them down in a file in /etc/dpkg/dpkg.cfg.d/.

A comon usage is: first exclude a directory and then re-include parts of that directory that you want to keep. For example if you want to delete gettext translations and translated manual pages except Galician, you could write down this in /etc/dpkg/dpkg.cfg.d/excludes:

# Delete locales except Galician
path-exclude=/usr/share/locale/*
path-include=/usr/share/locale/gl/*
path-include=/usr/share/locale/locale.alias

# Delete translated man pages except Galician
path-exclude=/usr/share/man/*
path-include=/usr/share/man/man[1-9]/*
path-include=/usr/share/man/gl*/*

This rules will apply to packages you will install/upgrade from now, but if you want to save space immediately, you have to reinstall all the packages in your system.

aptitude reinstall

or

apt-get --reinstall install

NOTE:
Concerning locale deleting you can get the same results by using localepurge. But this tool is strongly discouraged because this tool is a hack which is *not* integrated with Debian’s package management system and therefore is not for the faint of heart (other examples of tools that is strongly disacouraged are: dpkg-repack, reportbug, etc). Responsibility for its usage and possible breakage of your system therefore lies in the sysadmin’s hands.

NOTE 2:
The package management system on Linux makes installing and upgrading software a snap, but it also caches every package in a local folder in case it’s needed again. Here’s how to clear that cache and save loads of drive space.

sudo apt-get clean

Joining Ubuntu Lucid Lynx to Active Directory

Written on July 27th, 2010
.

linux xp Joining Ubuntu Lucid Lynx to Active DirectoryFrom Jaunty Jackalope version of Ubuntu and now in the lastest release (Ludid, 10.4) it’s very easy to join your Ubuntu to an Active Directory. Where I work we have a huge Active Directory to centralize users, groups, computers and resources (far more than 3000 users).

Here I go to explain how to join an Ubuntu Lucid Lynx (10.04) box to an Active Directory server:

Before all take notice that your DNS are pointing to your corporative DNS and the client system-time is synchronized with the server time. To do this just issue the next command:

sudo ntpdate domain.of.your.ad.server.com
  1. Install the likewise open AD authentication application with the next command: sudo apt-get install likewise-open
  2. Register your Ubuntu system:
    sudo domainjoin-cli join name.of.jour.domain.com admin-user 

    (where name.of.your.domain.com is your domain name, and admin-user is a user account on the domain with permissions to add computers to it).

  3. When prompted, enter the password of your adminstrator account. A dialogue box will appear asking for your domain name, enter your AD fully qualified domain name in upper case letters, i.e YOUR.DOMAIN.COM
  4. Finally reboot.

Read the rest of this entry »