Category: dev enviornment


In ffmpeg, you can determine video or image file info:


ffmpeg -i my_video_filename

Another option is exiftool tool.

1. Install on RHEL
yum install perl-Image-ExifTool.noarch
**you need to have rpmforge repository installed.

2. Use it
exiftool my_video_file

廣告

XShell from NetSarang is a great SSH client that we use. Even one awhile, you might wanna back up all the saved profiles.

The profiles are actually located at: %user_profile%\%username%\AppData\Roaming\NetSarang\Xshell. For example, C:\Users\johnny\AppData\Roaming\NetSarang\Xshell.

You can just copy the directory to where you want to back it up. You can also create sub-directories if you want to manage them a bit.

If you get this error, it’s because your windows user home directory is changed. Fix the error by adding a environment variable named ANDROID_SDK_HOME, and set the value to, for example, d:\users\MY_USERNAME.

Click to view

Reference: http://www.mail-archive.com/android-beginners@googlegroups.com/msg13718.html

MonoDevelop 1.91 on Cent OS

Last post we installed Mono 2.x run time. Here we will get MonoDevelop install on GNOME, for development environment.

First, here are the related software. You should have most of them when installing the run-time:

yum install glib2-devel pango-devel gtk2-devel glade2-devel libgnome-devel \
gnome-desktop-devel gnome-panel-devel libgnomeprintui22-devel \
gtksourceview-devel ruby ruby-rdoc gtkhtml38-devel wget

Now, we need make the required environment variables while we’re building the IDE, as well in its run-time. So let’s make it into shellscript called env.sh (or whatever you like it).

echo 'PATH="/opt/mono/bin:$PATH"' /opt/mono/env.sh
echo 'export PKG_CONFIG_PATH=/opt/mono/lib/pkgconfig' >> /opt/mono/env.sh
echo 'export LD_LIBRARY_PATH=/opt/mono/lib' >> /opt/mono/env.sh
echo 'source /opt/mono/env.sh' >> /opt/mono/env.sh

chmod +x /opt/mono/env.sh

Now we are ready to build MonoDevelop from tarball source. The following packages are the minimum software needed – we will build them one-by-one:

gtk-sharp

cd ~/
wget http://ftp.novell.com/pub/mono/sources/gtk-sharp212/gtk-sharp-2.12.5.tar.bz2
tar xjf gtk-sharp-2.12.5.tar.bz2
cd ./gtk-sharp-2.12.5
./configure --prefix=/opt/mono
make;make install

Mono.Addins

wget http://ftp.novell.com/pub/mono/sources/mono-addins/mono-addins-0.3.1.tar.bz2
cd ./mono-addins-0.3.1
./configure --prefix=/opt/mono
make;make install

Monodoc

wget http://ftp.novell.com/pub/mono/sources/monodoc/monodoc-2.0.zip
unzip monodoc-2.0.zip
cd ./monodoc-2.0
./configure --prefix=/opt/mono
make;make install

Mono Tools

wget http://ftp.novell.com/pub/mono/sources/mono-tools/mono-tools-2.0.tar.bz2
tar jfxv mono-tools-2.0.tar.bz2
cd ./mono-tools-2.0
./configure --prefix=/opt/mono
make;make install

MonoDevelop

wget http://ftp.novell.com/pub/mono/sources/monodevelop/monodevelop-1.9.1.tar.bz2
tar jfxv monodevelop-1.9.1.tar.bz2
cd ./monodevelop-1.9.1
./configure --prefix=/opt/mono
make;make install

You should now able to start up MonoDevelop in GNOME, enjoy.

Mono 2.x on CentOS 5

Mono no longer packages for Red Hat distribution but still provide sources. Here we will grab the source code, and install manually on a Cent OS 5.2 box.

First off, make sure you have all the development tools installed:

Pre-Software requirement

yum groupinstall "Development Tools"
yum install httpd build-essential gcc bzip bison pkgconfig glib-devel \
glib2-devel httpd-devel libpng-devel libX11-devel freetype fontconfig \
pango-devel ruby ruby-rdoc gtkhtml38-devel wget

At this time, Mono 2.0.1 is the latest. You can always check for new build at http://ftp.novell.com/pub/mono/sources-stable/

Getting all the needed Mono software

cd /root
wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.0.1.tar.bz2
wget http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.0.tar.bz2
wget http://ftp.novell.com/pub/mono/sources/mod_mono/mod_mono-2.0.tar.bz2
wget http://ftp.novell.com/pub/mono/sources/libgdiplus/libgdiplus-2.0.tar.bz2

Unlike many other tutorials, we will install using “Java" style – the version # is included:

mkdir /opt/mono-2.0.1

Let’s make a desult symlink:,

ln -s /opt/mono-2.0.1 /opt/mono

This is needed when building xsp:

export PKG_CONFIG_PATH=/usr/lib/pkgconfig/:/opt/mono/lib/pkgconfig/:/usr/lib/
Set path (even we don’t actually have it yet)

export PATH=/opt/mono/bin:$PATH

Now we are ready to compile:

tar jvfx mono-2.0.1.tar.bz2

cd mono-2.0.1
./configure --prefix=/opt/mono-2.0.1
make; make install

tar jvfx xsp-2.0.tar.bz2
cd ~/xsp-2.0
./configure --prefix=/opt/mono
make; make install

tar jvfx mod_mono-2.0.tar.bz2
cd ~/mod_mono-2.0
./configure --prefix=/opt/mono --with-mono-prefix=/opt/mono --with-apr-config=/usr/lib/httpd/modules
make; make install

tar jvfx libgdiplus-2.0.tar.bz2
cd ~/libgdiplus-2.0
./configure
make; make install

You should now have mod_mono.so in /usr/lib/httpd/modules. Also you should have mod_server in /opt/mono/bin.
You directories should look like those:

Directory contents are as follows:

ls /opt/mono/bin/

al                    mono-api-info
al2 mono-api-info2
asp-state monodis
asp-state2 mono-find-provides
caspol mono-find-requires
cert2spc monograph
certmgr monolinker
chktrust monop
cilc monop2
dbsessmgr mono-service
dbsessmgr2 mono-service2
disco mono-shlib-cop
dtd2rng mono-test-install
dtd2xsd mono-xmltool
fastcgi-mono-server mozroots
fastcgi-mono-server2 nunit-console
gacutil nunit-console2
genxs pedump
gmcs permview
httpcfg prj2make
ilasm resgen
ilasm2 resgen2
installvst secutil
jay setreg
macpack sgen
makecert signcode
mbas smcs
mconfig sn
mcs soapsuds
mjs sqlsharp
mkbundle wsdl
mkbundle2 wsdl2
mod-mono-server xbuild
mod-mono-server2 xsd
mono xsp
mono-api-diff xsp2

ls /opt/mono/lib/

libgdiplus.a             libmono-profiler-aot.so.0
libgdiplus.la libmono-profiler-aot.so.0.0.0
libgdiplus.so libmono-profiler-cov.a
libgdiplus.so.0 libmono-profiler-cov.la
libgdiplus.so.0.0.0 libmono-profiler-cov.so
libikvm-native.a libmono-profiler-cov.so.0
libikvm-native.la libmono-profiler-cov.so.0.0.0
libikvm-native.so libmono.so
libmono.a libmono.so.0
libmono.la libmono.so.0.0.0
libMonoPosixHelper.a libMonoSupportW.a
libMonoPosixHelper.la libMonoSupportW.la
libMonoPosixHelper.so libMonoSupportW.so
libmono-profiler-aot.a mono
libmono-profiler-aot.la pkgconfig
libmono-profiler-aot.so xsp

ls /usr/lib/httpd/modules/

libphp5.so              mod_file_cache.so
mod_actions.so mod_filter.so
mod_alias.so mod_headers.so
mod_asis.so mod_ident.so
mod_auth_basic.so mod_imagemap.so
mod_auth_digest.so mod_include.so
mod_authn_alias.so mod_info.so
mod_authn_anon.so mod_ldap.so
mod_authn_dbd.so mod_log_config.so
mod_authn_dbm.so mod_log_forensic.so
mod_authn_default.so mod_logio.so
mod_authn_file.so mod_mem_cache.so
mod_authnz_ldap.so mod_mime_magic.so
mod_authz_dbm.so mod_mime.so
mod_authz_default.so mod_mono.so
mod_authz_groupfile.so mod_mono.so.0.0.0
mod_authz_host.so mod_negotiation.so
mod_authz_owner.so mod_proxy_ajp.so
mod_authz_user.so mod_proxy_balancer.so
mod_autoindex.so mod_proxy_connect.so
mod_cache.so mod_proxy_ftp.so
mod_cern_meta.so mod_proxy_http.so
mod_cgid.so mod_proxy.so
mod_cgi.so mod_rewrite.so
mod_dav_fs.so mod_setenvif.so
mod_dav.so mod_speling.so
mod_dbd.so mod_status.so
mod_deflate.so mod_suexec.so
mod_dir.so mod_unique_id.so
mod_disk_cache.so mod_userdir.so
mod_dumpio.so mod_usertrack.so
mod_env.so mod_version.so
mod_expires.so mod_vhost_alias.so
mod_ext_filter.so

And the mod_mono config file should be like this:

ls /etc/httpd/conf/mod_mono.conf
vi
/etc/httpd/conf/mod_mono.conf

<ifmodule>
LoadModule mono_module /usr/lib/httpd/modules/mod_mono.so
AddType application/x-asp-net .aspx
AddType application/x-asp-net .asmx
AddType application/x-asp-net .ashx
AddType application/x-asp-net .asax
AddType application/x-asp-net .ascx
AddType application/x-asp-net .soap
AddType application/x-asp-net .rem
AddType application/x-asp-net .axd
AddType application/x-asp-net .cs
AddType application/x-asp-net .config
AddType application/x-asp-net .Config
AddType application/x-asp-net .dll
DirectoryIndex index.aspx
DirectoryIndex Default.aspx
DirectoryIndex default.aspx
</ifmodule>

Let’s move it to CentOS style:

mv /etc/httpd/conf/mod_mono.conf /etc/httpd/conf.d/mod_mono.conf

Restart web server

service httpd restart

Make a simple test file named default.aspx:
<%Response.Write("mono on centos - it works");%>

If you see that message at http://localhost/default.aspx, congrad, there you have it!

trac-10.4 繁體中文版

trac-10.4-zh_TW Traditional Chinese translation
trac-10.4 繁體中文版

Modified from ZoomQuiet version, this version provides translation for Traditional Chinese.

To download: http://trac-hacks.org/wiki/TraditionalChineseTranslation

Recently I set up a virtual server to use as a development machine. It runs on CentOS 5 and hosts several Subversion repositories with associated Trac projects.

There are many guides and plenty of help on the net to help you setup such a system. However, when I tried to do it I came across a few problems and I hope this post may help at least a few people trying to do the same as me. I am not going to rewrite the great tutorials out there, I will just point you to them and note what things I did differently.

This ‘guide’ should get you from a fresh install of CentOS 5 linux to one or more working Subversion (SVN) repositories and associated Trac wiki’s. Apache/WebDAV is used as the network layer. I have only tested this on a fresh install of CentOS 5.

The Environment

I am aiming for the following:

  • CentOS 5, SVN installed. Apache2 as the network layer using mod_dav_svn.
  • Trac running on Apache with mod_python
  • SVN repositories located at: /srv/svn (e.g. /srv/svn/my-project), accessible via http://server/svn/my-project
  • Trac projects located at: /srv/trac (e.g /srv/trac/my-project) accessible via http://server/trac/my-project

How I did it

Not all the steps are vital (probably) but this is how I got it working. Feel free to skip any non-relevant steps (i.e. there is probably no need for a fresh install). Replace any occurence of with the name of your first project.

1. Fresh install of CentOS. I followed most of the Perfect Setup Guide, except the mail and ISPConfig stuff. The important part is setting up the Apache2 web server.

2. Make sure SVN and mod_dav_svn are installed. As root:

yum install subversion mod_dav_svn
vim /etc/httpd/conf/httpd.conf

If the following two lines are not present, add them:

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

3. Install Trac: Follow Nick’s guide with the alternative Clearsilver installation below. Skip the Apache Configuration part.

Follow all of parts 1 and 2. Instead of part 3 do:

wget http://dag.wieers.com/rpm/packages/clearsilver/clearsilver-0.10.4-1.el5.rf.i386.rpm
rpm -i clearsilver-0.10.4-1.el5.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/clearsilver/python-clearsilver-0.10.4-1.el5.rf.i386.rpm
rpm -i python-clearsilver-0.10.4-1.el5.rf.i386.rpm

Continue with parts 4.1 and 4.2 of Nick’s guide. Remember, leave out Apache configuration section.

4. Create your first SVN Repository:

svnadmin create --fs-type fsfs /srv/svn/project_name

5. Initialise a Trac project for your new repository:

trac-admin /srv/trac/project_name initenv

For the trac-admin command use the defaults if not sure, giving a descriptive name for the project. The `Path to repository` is: /srv/svn/project_name.

6. Set the correct file permissions for apache


chown -R apache.apache /srv/svn/project_name
chown -R apache.apache /srv/trac/project_name

7. Tell apache where to find the new repository. Here we create an additional Apache configuration file specifically for the SVN repositories.

vim /etc/httpd/conf.d/subversion.conf

Add the following directive:


<location>
DAV svn
SVNPath /srv/svn/project_name
AuthType Basic
AuthName "My SVN Repository"
AuthzSVNAccessFile /srv/svn/svn-acl-conf
AuthUserFile /srv/svn/.htpasswd
Require valid-user
</location>

8. Add a repository user:


touch /srv/svn/.htpasswd
htpasswd -m /srv/svn/.htpasswd username

9. Create the Access Control List for the SVN Repository


vim /srv/svn/svn-acl-conf

Add the following directives:


[project_name:/]
username = rw

Where username represents the username of the repository user you created earlier.

10. Tell apache where to find the new Trac project. Here we create an additional Apache configuration file specifically for the Trac projects.

vim /etc/httpd/conf.d/trac.conf

Add the following directives:



<location>
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /srv/trac/project_name
PythonOption TracUriRoot /trac/

<location/login>
AuthType Basic
AuthName "trac"
AuthUserFile /srv/trac/.htpasswd
Require valid-user
</location>
</location>

11. Add a Trac user:

touch /srv/trac/.htpasswd
htpasswd -m /srv/trac/.htpasswd

12. Give admin permissions to the Trac user you just created:

trac-admin /srv/trac/ permission add  TRAC_ADMIN

Where represents the username of the Trac user you just created.

13. Restart Apache:

service httpd restart

You should now have SVN and Trac installed. You will have an SVN repository setup (http://server/svn/) and the Trac wiki (http://server/trac/) associated with the repository.

Please let me know if this helped you. If you come across any problems I will be happy to try and help.

Resources

The last part of CentOS HowTos: Subversion will give you a quick introduction on how to use SVN.

Subversion setup guides: here and here

Trac setup guides: here and here.

ClearSilver template system (used by Trac).

Setting up CentOS 5.0

Samba Setup on CentOS 5

I have an existing user “amy" on my new installation of CentOS v5.1. I want a directory located at “/home/fileServer" to be shared through samba as “fileServer", that can be mounted by amy in Windows XP and Vista.

Here’s the steps:

1. Installed samba server
yum install samba

2. Created directory to be shared
# mkdir /home/fileServer
# chown root:root /home/fileServer
# chmod 770 /home/fileServer

3. Edit samba configuration file
# cd /etc/samba
# mv smb.conf smb.conf.sample
# vi smb.conf
[global]
workgroup = MYWORKGROUP

[fileServer]
comment = file server
path = /home/fileServer
writable = yes
create mask = 0770
directory mask = 0770

4. Edit samba user accounts
# smbpasswd -a root
# smbpasswd -a amy

5. Update smbusers file
# vi smbusers
root = administrator admin
amy = amy

6. Started smb daemon
# service smb restart

7. Test
In Windows XP, typed \\, and entered amy as user with the password. You should see the share defined in smb.conf.


The Visual Studio Team System Project Server 2007 Connector is designed to integrate the project management capabilities of VSTS with Project Server 2007. It’s been developed by the Visual Studio Team System Rangers in response to significant customer demand for a connector solution. Future versions of Team System will have native integration with Project Server, in the meantime this Connector solution is the best way to integrate the two Microsoft products. This solution builds on the previous PS2003 VSTS Connector, published on GotDotNet. This solution is intended to provide guidance, provided as source code that can be used “as is," extended, or modified by developers to use on enterprise development projects.

Read more on the Project Server 2007 VSTS Connector @ codeplex.


The Visual Studio Team System Project Server 2007 Connector is designed to integrate the project management capabilities of VSTS with Project Server 2007. It’s been developed by the Visual Studio Team System Rangers in response to significant customer demand for a connector solution. Future versions of Team System will have native integration with Project Server, in the meantime this Connector solution is the best way to integrate the two Microsoft products. This solution builds on the previous PS2003 VSTS Connector, published on GotDotNet. This solution is intended to provide guidance, provided as source code that can be used “as is," extended, or modified by developers to use on enterprise development projects.

Read more on the Project Server 2007 VSTS Connector @ codeplex.