Monday, January 25, 2010

How to Regenerate Reports in Untangle

For Untangle 7.X.X
You can regenerate a report from the terminal.
"/usr/lib/python2.5/reports/process.py"

For Untangle 6.X.X
You can regenerate a report from the terminal.
"/usr/share/untangle/reports/update-reports"


Sunday, January 10, 2010

Install MediaWiki on Ubuntu


Install the package:
 sudo apt-get install mediawiki


Optionally install add-ons:
 sudo apt-get install imagemagick mediawiki-math php5-gd


Enable MediaWiki by editing the following file and remove the '#' from the third line so that it reads 'Alias /mediawiki /var/lib/mediawiki':

sudo nano /etc/mediawiki/apache.conf


Then restart apache:
 sudo /etc/init.d/apache2 restart


How to install the packages from the EPEL software repository

What is EPEL

EPEL (Extra Packages for Enterprise Linux) is open source and free community based repository project from Fedora team which provides 100% high quality add-on software packages for Linux distribution including RHEL (Red Hat Enterprise Linux), CentOS, and Scientific Linux. Epel project is not a part of RHEL/Cent OS but it is designed for major Linux distributions by providing lots of open source packages like networking, sys admin, programming, monitoring and so on. Most of the epel packages are maintained by Fedora repo.

Why we use EPEL repository?

  1. Provides lots of open source packages to install via Yum.
  2. Epel repo is 100% open source and free to use.
  3. It does not provide any core duplicate packages and no compatibility issues.
  4. All epel packages are maintained by Fedora repo.

How To Enable EPEL Repository in RHEL/CentOS 7/6/5?

First, you need to download the file using Wget and then install it using RPM on your system to enable the EPEL repository. Use below links based on your Linux OS versions. (Make sure you must be root user).

RHEL/CentOS 7 64 Bit

## RHEL/CentOS 7 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
# rpm -ivh epel-release-7-2.noarch.rpm

RHEL/CentOS 6 32-64 Bit

## RHEL/CentOS 6 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

RHEL/CentOS 5 32-64 Bit

## RHEL/CentOS 5 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -ivh epel-release-5-4.noarch.rpm

## RHEL/CentOS 5 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -ivh epel-release-5-4.noarch.rpm

RHEL/CentOS 4 32-64 Bit

## RHEL/CentOS 4 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/4/i386/epel-release-4-10.noarch.rpm
# rpm -ivh epel-release-4-10.noarch.rpm

## RHEL/CentOS 4 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/4/x86_64/epel-release-4-10.noarch.rpm
# rpm -ivh epel-release-4-10.noarch.rpm

How Do I Verify EPEL Repo?

You need to run the following command to verify that the EPEL repository is enabled. Once you ran the command you will see epel repository.
# yum repolist

Sample Output

Loaded plugins: downloadonly, fastestmirror, priorities
Loading mirror speeds from cached hostfile
 * base: centos.aol.in
 * epel: ftp.cuhk.edu.hk
 * extras: centos.aol.in
 * rpmforge: be.mirror.eurid.eu
 * updates: centos.aol.in
Reducing CentOS-5 Testing to included packages only
Finished
1469 packages excluded due to repository priority protections
repo id                           repo name                                                         status
base                              CentOS-5 - Base                                               2,718+7
epel Extra Packages for Enterprise Linux 5 - i386 4,320+1,408
extras                            CentOS-5 - Extras                                              229+53
rpmforge                          Red Hat Enterprise 5 - RPMforge.net - dag                      11,251
repolist: 19,075

How Do I Use EPEL Repo?

You need to use YUM command for searching and installing packages. For example we search forZabbix package using epel repo, lets see it is available or not under epel.
# yum --enablerepo=epel info zabbix

Sample Output

Available Packages
Name       : zabbix
Arch       : i386
Version    : 1.4.7
Release    : 1.el5
Size       : 1.7 M
Repo : epel
Summary    : Open-source monitoring solution for your IT infrastructure
URL        : http://www.zabbix.com/
License    : GPL
Description: ZABBIX is software that monitors numerous parameters of a network.

Let’s install Zabbix package using epel repo option –enablerepo=epel switch.
# yum --enablerepo=epel install zabbix

Note: The epel configuration file is located under /etc/yum.repos.d/epel.repo.
This way you can install as many as high standard open source packages using EPEL repo.


Thursday, January 7, 2010

Block Yahoo Mail Chat Feature in Untangle

I have found a link in the yahoo website related to this, I just blocked the websites in the webfilter and the chat was not able to be loaded under the yahoo mail.

http://help.yahoo.com/l/us/yahoo/mail/yahoomail/chat/chat-23.html;_ylt=AuRtahSGRrYxeHLwwMzZoztq5yN4

Just create a rule for each of the websites to be blocked under the webfilter:
Webfilter --> Block Lists (Sites) --> Add -->
Site:webcs.msg.yahoo.com
Check Block & Log
Description: "whatever you like"

Second Rule
Site:httpcs.msg.yahoo.com
Check Block & Log
Description: "whatever you like"

I have tried and I keep being offline can not connect at all.

Wednesday, January 6, 2010

Running VMware vSphere Client on Windows 7

Many of you, like myself, have started running Windows 7 as their primary desktop OS and find it to be a massive improvement over Windows Vista on so many levels.
One of the very few inconveniences I have found with it, and this is not an bug or problem with Windows 7 itself, is the inability to run the VMware vSphere Client.
UPDATE: Good News – This issue has now been resolved in VMware ESX/ESXi 4.0 Update 1 (U1).
When attempting to run the client the following errors are received and you are unable to proceed any further:
“Error parsing the server “







“The type initializer for ‘VirtualInfrastructure.Utils.HttpWebRequestProxy’ threw an exception.”







Luckily there have been a few good VMware forum posts such as this one by ftubio which outlines how to successfully run the vSphere Client under Windows 7.

If you are running the x64 version of Windows 7 you will notice that any reference to the ‘Program Files’ will have an ‘(x86)’ at the end of it. If you are running the x86 version of Windows 7 then ignore the ‘(x86)’ portion of the directory path (ie: C:\Program Files (x86) –> C:\Program Files).

Follow these 4 basic steps and you’ll be up and running in no time!

Step 1.


Download this DLL called system.dll

*Note: This DLL is usually found in the %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\ directory of a non Windows 7 PC with .NET v3.5 SP1 installed.



Step 2.


Once downloaded install it in the “C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\Lib” directory. If the ‘lib’ directory doesn’t exist then create it and drop the dll file into it.

Step 3.


Next edit the “VpxClient.exe.config” file which can be found in the “C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Launcher” directory and add the following three lines to it right below . Then save the changes.



Step 4.


From the Windows 7 ‘System Properties’ click the ‘Advanced’ tab and then the ‘Environment Variables’ button as we want to add a new ‘System’ variable.



Create a new ‘System’ variable called ‘DEVPATH’ and assign the following variable value:

C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\Lib






You are now ready to start using the VMware vSphere Client on your Windows 7 machine! Some people have reported having to run the client as an ‘Administrator’ so if you are having difficulties it may pay to try this – I luckily didn’t experience this problem. Also you will likely have to reboot your machine (or restart the explorer.exe process) for your new path information to come into effect.




Tuesday, December 29, 2009

Install Subversion with Web Access on Ubuntu

This article covers installing subversion with the apache module so that it can be easily accessed from other systems on a public network. If you want a more secure svn server, you could use svnserve+ssh, which isn’t covered in this article.

To install subversion, open a terminal and run the following command:

sudo apt-get install subversion libapache2-svn

We’re going to create the subversion repository in /svn, although you should choose a location that has a good amount of space.

sudo svnadmin create /svn

Next we’ll need to edit the configuration file for the subversion webdav module. You can use a different editor if you’d like.

sudo gedit /etc/apache2/mods-enabled/dav_svn.conf

The Location element in the configuration file dictates the root directory where subversion will be acessible from, for instance: http://www.server.com/svn

The DAV line needs to be uncommented to enable the dav module

# Uncomment this to enable the repository,
DAV svn

The SVNPath line should be set to the same place your created the repository with the svnadmin command.

# Set this to the path to your repository
SVNPath /svn

The next section will let you turn on authentication. This is just basic authentication, so don’t consider it extremely secure. The password file will be located where the AuthUserFile setting sets it to… probably best to leave it at the default.

# Uncomment the following 3 lines to enable Basic Authentication
AuthType Basic
AuthName “Subversion Repository”
AuthUserFile /etc/apache2/dav_svn.passwd

To create a user on the repository use, the following command:

sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd

Note that you should only use the -c option the FIRST time that you create a user. After that you will only want to use the -m option, which specifies MD5 encryption of the password, but doesn’t recreate the file.

Example:

sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd geek
New password:
Re-type new password:
Adding password for user geek

Restart apache by running the following command:

sudo /etc/init.d/apache2 restart

Now if you go in your browser to http://www.server.com/svn, you should see that the repository is enabled for anonymous read access, but commit access will require a username.

If you want to force all users to authenticate even for read access, add the following line right below the AuthUserFile line from above. Restart apache after changing this line.

Require valid-user

Now if you refresh your browser, you’ll be prompted for your credentials:

You now have a working subversion server!

Git

Git is an open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.

Installation

Following these instructions we assume you already have a Ubuntu Hardy or later version installed on you computer/server and that you already have a public ssh key on your machine you can use that to initalize the repository (Don't have one, look here). The following instructions will guide you on how to set up and run a fully managed hosting for projects using git on your server.

Used software

This tutorial was done using a Ubuntu Hardy server edition setup.

We'll be using the latest git package available in the launchpad at: https://launchpad.net/ubuntu/+source/git-core

For a more up to date version of git, packages for both Karmic and Jaunty are available in an unofficial repository. More information about using the repository at: http://blog.avirtualhome.com/git-packages-for-ubuntu/

For git project management will be using Gitosis. The latest builds for Ubuntu can be found at https://launchpad.net/ubuntu/+source/gitosis

For repository web browsing we will be using ViewGit. The latest version we will clone directly from a git repository: git clone git://repo.or.cz/viewgit.git

Setting up Git and Project Management

Use your favorite package installer to install git-core package:

apt-get install git-core

In Hardy the package gitosis is not available yet, so we will use this package from a later version of Ubuntu. In this case I will use version 0.2+20080826-2 downloading it directly from launchpad.Net and installing it:

cd /tmp
wget http://launchpadlibrarian.net/16540443/gitosis_0.2%2B20080626-2_all.deb
sudo dpkg -i gitosis_0.2%2B20080626-2_all.deb
sudo apt-get install -fy

{i} The last line is needed to fulfill the gitosis dependencies. It is written in Python, so it may require additional packages than those you probably installed already.

We have to add a system user in order to run gitosis:

sudo adduser \
--system \
--shell /bin/sh \
--gecos 'git version control' \
--group \
--disabled-password \
--home /srv/gitosis/ \
git

Now that you should have both packages installed, we can set up gitosis. First copy your public key to the server:

scp .ssh/id_dsa.pub username@serveraddress.tld:/tmp

Initialize gitosis using your copied key:

sudo -H -u git gitosis-init < /tmp/id_dsa.pub

Once you saw some output like this: Initialized empty Git repository in ./ Your gitosis is installed. You can now remove the copied key.

rm /tmp/id_dsa.pub

Once done, you can now checkout the gitosis-admin branch on your local machine:

git clone git@yourserver.com:gitosis-admin.git

Use your favorite editor to modify the contents of the gitosis configuration file:

cd gitosis-admin
vim gitosis.conf

Adding a new project to the repository

Here is an example of the gitosis configuration file you clone before. Here it contains the default gitosis entry, and a new project entry:

[gitosis]

[group team]
writable = testproject
members = hostname.serveraddress.tld

[group gitosis-admin]
writable = gitosis-admin
members = keyfilename

hostname.serveraddress.tld or keyfilename is the name of the public key without .pub extension you copied into gitosis-admin/keydir/ directory.

After you've done editing, save the file, and commit it back to the server.

git commit -a -m "Added a new project"
git push

Any future projects will be added the same way.

Committing to the first project

To commit the project you just created, initiate a new git project, add files to it, commit it, then push it to your repository with the name you set up in gitosis config file.

git init
touch a_text_file.txt
git add .
git commit -m "initial import"
git remote add origin gitosis@serveraddress.tld:testproject.git
git push --all

The project should be committed!

{i} If not, please check your /srv/gitosis/.ssh/authorized_keys file, if that one contains your correct public key!

The web browsing interface

Server will need a web server so I recommend you to install Apache with support for php. Once ViewGit can be linked to GeSHI, I also recommend you installing the php-geshi package:

sudo apt-get install apache2 libapache2-mod-php5 php-geshi

{i} For more extended Apache installation we recommend you reading a dedicated page like this ApacheMySQLPHP.

Once done, /var/www/ directory will be created. Go there and clone the latest git version of ViewGIT:

cd /var/www
sudo git clone git://repo.or.cz/viewgit.git
sudo chown -vR www-data:www-data viewgit

After finishing this operation, use your favorite editor to edit the config file for ViewGit:

cd /var/www/viewgit/inc
sudo cp config.php localconfig.php
sudo chown www-data:www-data localconfig.php
sudo vim localconfig.php

Here is an example of the ViewGit localconfig.php with GeSHI and the testproject.git we created:

 array('repo' => '/srv/gitosis/repositories/testproject.git/'),
);

// Where git is. Default is to search from PATH, but you can use an absolute
// path as well.
$conf['git'] = 'git';

// If set, contains an array of globs/wildcards where to include projects.
// Use this if you have a lot of projects under a directory.
//$conf['projects_glob'] = array('/path/to/*/.git', '/var/git/*.git');

$conf['datetime'] = '%Y-%m-%d %H:%M';

// More complete format for commit page
$conf['datetime_full'] = '%Y-%m-%d %H:%M:%S';

// Maximum length of commit message's first line to show
$conf['commit_message_maxlen'] = 50;

// Maximum number of shortlog entries to show on the summary page
$conf['summary_shortlog'] = 30;

// Maximum number of tags to show on the summary page
$conf['summary_tags'] = 10;

// Whether to show remote labels on shortlog
$conf['shortlog_remote_labels'] = false;

// Allow checking out projects via "git clone"
$conf['allow_checkout'] = true;

// If set, this function is used to obfuscate e-mail addresses of authors/committers
// The 'obfuscate_mail' function simply replaces @ with ' at ' and . with ' dot '
//$conf['mail_filter'] = 'obfuscate_mail';
//$conf['mail_filter'] = create_function('$mail', 'return str_rot13(strtoupper($mail));');

// Whether to use GeSHi for source highlighting
$conf['geshi'] = true;

// Path to geshi.php
$conf['geshi_path'] = 'inc/geshi/geshi.php';
$conf['geshi_path'] = '/usr/share/php-geshi/geshi.php'; // Path on Debian

// Use line numbers in geshi?
// Setting this to "false" disables line numbers
// Using a value of 0 will enable "NORMAL" geshi line numbers
// Using values of 1 or more will enable "FANCY" geshi line numbers
$conf['geshi_line_numbers'] = 5;

// RSS time to live (how often clients should update the feed), in minutes.
$conf['rss_ttl'] = 10;

// RSS: Maximum number of items in feed
$conf['rss_max_items'] = 30;

// RSS item format. Allowed formatting:
// {AUTHOR}, {AUTHOR_MAIL}, {SHORTLOG}, {LOG}, {COMMITTER}, {COMMITTER_MAIL}, {DIFFSTAT}
$conf['rss_item_title'] = '{SHORTLOG} ({AUTHOR})';
$conf['rss_item_description'] = '
{LOG}
{AUTHOR} <{AUTHOR_MAIL}>
{DIFFSTAT}
';

$conf['debug'] = false;

// Includes a small link to the ViewGit homepage on each page
$conf['ad'] = false;

Now you should be able to browse your Git repository by going to http://localhost/viewgit/ if you got problems on accessing repositories, add your web server user to the same group gitosis user is:

adduser www-data git

Making available public cloning of the projects

To make available public access for cloning of the projects, you have to set up git-daemon. git-daemon is a service which runs on port 9418 and handles public requests for project cloning. git-daemon comes together with git-core so no additional installation is required.

To make this service easier to administrate, here is an init script to start and stop the daemon:

# Taken from here: http://pastie.org/227647

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=git-daemon
PIDFILE=/var/run/$NAME.pid
DESC="the git daemon"
DAEMON=/usr/lib/git-core/git-daemon
DAEMON_OPTS="--base-path=/srv/gitosis/repositories --export-all --verbose --syslog --detach --pid-file=$PIDFILE --user=git --group=nogroup"

test -x $DAEMON || exit 0

[ -r /etc/default/git-daemon ] && . /etc/default/git-daemon

. /lib/lsb/init-functions

start_git() {
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--startas $DAEMON -- $DAEMON_OPTS
}

stop_git() {
start-stop-daemon --stop --quiet --pidfile $PIDFILE
rm -f $PIDFILE
}

status_git() {
start-stop-daemon --stop --test --quiet --pidfile $PIDFILE >/dev/null 2>&1
}

case "$1" in
start)
log_begin_msg "Starting $DESC"
start_git
log_end_msg 0
;;
stop)
log_begin_msg "Stopping $DESC"
stop_git
log_end_msg 0
;;
status)
log_begin_msg "Testing $DESC: "
if status_git
then
log_success_msg "Running"
exit 0
else
log_failure_msg "Not running"
exit 1
fi
;;
restart|force-reload)
log_begin_msg "Restarting $DESC"
stop_git
sleep 1
start_git
log_end_msg 0
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac

exit 0

To make it usable, and make possible it's automatic startup on server boot change its permissions and update-rc.d

sudo chmod +x /etc/init.d/git-daemon
sudo update-rc.d git-daemon defaults

The daemon can be started or stoped by accesing:

sudo /etc/init.d/git-daemon start
sudo /etc/init.d/git-daemon stop