Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

Sep 4, 2009

How to build Clutter for Beagleboard

The Clutter need to be configured with =flavour=eglnative= so that it can work with SGX driver
The following is the configure command
./configure --with-flavour=eglnative --host=arm-angstrom-linux-gnueabi PKG_CONFIG=/data/workspace/OE/tmp/staging/i686-linux/usr/bin/pkg-config PKG_CONFIG_PATH=/data/workspace/OE/tmp/staging/armv7a-angstrom-linux-gnueabi/usr/lib/pkgconfig CFLAGS="--sysroot=/data/workspace/OE/tmp/staging/armv7a-angstrom-linux-gnueabi/ -I/data/workspace/OE/tmp/staging/armv7a-angstrom-linux-gnueabi/usr/include" --with-x=no --with-gles=1.1 --with-imagebackend=internal

with
  • --host: set the target for the build, need to be arm-angstrom-linux-gnueabi
  • PKG_CONFIG: use the pgk-config command from OE distribution
  • PKG_CONFIG_PATH: the path to search for *.pc file, need to be pointed to OE distribution
  • --with-x: not using X
  • --with-imagebackend: specific the image backend to use
  • --with-gles: specific the GLES version to use (1.1 or 2.0)
  • CFLAGS: override some C compiler flags
  • --sysroot: the root directory to search for library and header files
  • -I[include_dir]: some optional include directories to search for

Fix undefined rpl_malloc on autoconf tool in cross compile mode

When using autoconf tool in cross compile environment, sometime there is error like this `undefined reference to `rpl_malloc'`

It is the bug of autoconf tool in the test function AC_FUNC_MALLOC. To fix it we need define an environment variable that forces the test to pass. Define it in the environment prior to calling ./configure and the script will act as if the AC_FUNC_MALLOC check has passed.

export ac_cv_func_malloc_0_nonnull=yes

Jul 15, 2009

cygwin undefined reference to `_glEnd' and related OpenGL function

Sometime, when building OpenGL application under cygwin, we fail to compile with following message or relating OpenGL function message "undefined reference to `_glEnd' and related OpenGL function"

The simple test is such as following
#include <GL/gl.h>
int main() { glEnd(); return 0; }

$ gcc -lGL test.c -o test
/.../.../ccO7Cfcr.o:test.c:(.text+0x2b): undefined reference to `_glEnd'
collect2: ld returned 1 exit status

That is because the OpenGL library on cygwin is depended on GLU library also. We need to link with GLU when linking with GL
Change the link command to $ gcc -lGL -lGLU test.c -o test and everything is OK.

I met this issue while compiling ShivaVG package on cygwin

Apr 19, 2009

How to install Broadcom BCM43xx driver on Fedora Core 10

It has been tested on the bcm4318 card.

1. Configure NetworkManager to automatically start and start the service.
Code:
chkconfig NetworkManager on
service NetworkManager start
2. Download and extract the firmware
Code:
wget http://downloads.openwrt.org/sources/broadcom-wl-4.80.53.0.tar.bz2
tar -jxvf broadcom-wl-4.80.53.0.tar.bz2
3. Cut the firmware
Code:
cd broadcom-wl-4.80.53.0/kmod
/usr/bin/b43-fwcutter -w /lib/firmware wl_apsta.o
4. Restart NetworkManager
Code:
service NetworkManager restart
If you want to use the fedora system-config-network tool (System -> Administration -> Network) to configure the connection, run the following command as well.
Code:
echo "alias wlan0 b43" >> /etc/modprobe.conf
After that I was able to use the NetworkManager applet to enter my encryption key to finish connecting to my network.

If it does not work, check the /etc/sysconfig/network-scripts directory and remove the possible file ifcfg-wlan0

Then restart the network service;

service network restart

Jan 26, 2009

How to download Windows 7 beta

Windows 7 has been in beta release for months and here is how to download and test the BETA version.
  1. Register yourself a Live account http://www.live.com
  2. Go to Microsoft Connect Website https://connect.microsoft.com
  3. Search for Windows Ecosystem Readiness Program - https://connect.microsoft.com/site/sitehome.aspx?SiteID=704
  4. Download and enjoy yourself :-)
Have fun,
-Hieu

Dec 30, 2008

How to fix DNSChanger Malware

DNSChanger is a trojan designed to change DNS server address on computers that they are run on. This is done to redirect victims to fake websites that steal credit card information, logins and passwords for on-line banks and payment systems like PayPal.

The trojan modify some registry at TcpIp service and maybe it also adds some Windows service for monitoring...

To fix it
Option 1. Disable the DNS Client service (the service has no effect on client machine, it normally cache the DNS request to optimize)

Option 2. Download the CombFix http://download.bleepingcomputer.com/sUBs/ComboFix.exe and run, it'll automatically fix the issue for you.

Dec 23, 2008

Holiday Calendar in Outlook for Vietnam company

The following is how to create holiday list and add it into Outlook calendar for the year 2009

1. Create a file with extension .HOL (i.e. outlook.hol) with following contents
[GCS] 10
New Year's Day,2009/1/1
Independence Day,2009/4/30
Christmas Day,2009/12/25
International Labor Day,2009/5/1
National Day,2009/9/2
Lunar New Year Eve,2009/1/25
Lunar New Year Day 1,2009/1/26
Lunar New Year Day 2,2009/1/27
Lunar New Year Day 3,2009/1/28
Hung Kings Commemorative Holiday,2009/4/4
2. Double click on the file to import the holiday list into Outlook, just do it one time.

Have fun.

Nov 16, 2008

Turn off display non-secure item popup dialog in Internet Explorer

Step 1: Go to Tool >> Internet Options

Step 2: Select the "Security" Tab and then click on the "Custom Level" button

Step 3: Scroll down until you see the option: "Display mixed content". Sect the option "Enable" (in the Miscellaneous section)

Step 4: Click Ok

Enable exFAT in Windows XP/2003

To enable exFAT (which is a new file system type introduced by Microsoft in Windows Vista), you need to copy the two files uexfat.dll and exfat.sys located under System32 folder and System32/Drivers folder into correspond folder of Windows XP/2003

Create the following registry file "enable-exfat.reg"

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\exfat]
"Description"="exFAT File System Driver"
"DisplayName"="exFAT File System Driver"
"ErrorControl"=dword:00000001
"Group"="Boot File System"
"Start"=dword:00000002
"Type"=dword:00000002

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\System\exfat]
"EventMessageFile"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,\
00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,\
5c,00,49,00,6f,00,4c,00,6f,00,67,00,4d,00,73,00,67,00,2e,00,64,00,6c,00,6c,\
00,00,00
"TypesSupported"=dword:00000007

Run the file to import it into registry.
Restart your PC and the exFAT will be enabled

Cheers,
-Hieu

Nov 11, 2008

Remove xxx activation in yyy 2008

Stops the SL UI Notification Service and removes 3 system32 files : SLLUA.exe, SLUI.exe and SLUINotify.dll (located at C:\Windows\system32 folder)

Nov 1, 2008

How to unlock attachment restriction in Microsoft Outlook

To unlock the attachment restriction in Microsoft Outlook, just follow the steps below:

- Start => Run => Enter regedit
- Look for HKEY_CURRENT_USER\ Software\ Microsoft\ Office\ 10.0\ Outlook\ Security
- Create a new String value Level1Remove (modify if exists) and add the extension that you would like to allow for download (seperated by comma) ex: exe;jpg;gif;png

Note: These are the list of files that is normally being lock by Ms Outlook when received as e-mail attachments: “ade, adp, asx, bas, bat, chm, cmd, com, cpl, crt, exe, hlp, hta, inf, ins, isp, js, jse, lnk, mda, mdb, mde, mdz, msc, msi, msp, mst, pcd, pif, prf, reg, scf, scr, sct, shb, shs, url, vb, vbe, vbs, wsc, wsf, wsh”

Oct 23, 2008

How to Disable Steal Lock in Subversion

In Subversion, you can easily steal the lock that other user lock it. By using hook script, you can disallow user to do so. Just edit the pre-lock script as following

pre-lock.bat
The following is the content of pre-lock.bat which will work on Windows environment. Just copy the content and put it under the hook folder of your Subversion repository

@ECHO OFF
:: Set all parameters. Even though most are not used, in case you want to add
:: changes that allow, for example, editing of the author or addition of log messages.
set repository=%1
set rev_path=%2
set userName=%3

:: If a lock exists and is owned by a different person, don't allow it
:: to be stolen (e.g., with 'svn lock --force ...').

FOR /F "delims=: tokens=1*" %%a IN ('svnlook lock "%repository%" "%rev_path%"') DO if %%a==Owner (set LOCK_OWNER=%%b)

:: If we get no result from svnlook, there's no lock, allow the lock to
:: happen:
if "%LOCK_OWNER%"=="" (
exit /b 0
)

:: If the person locking matches the lock's owner, allow the lock to
:: happen:
if "%LOCK_OWNER%" = " %username%" (
exit /b 0
)

:: Otherwise, we've got an owner mismatch, so return failure:
echo "Error: %rev_path% already locked by %LOCK_OWNER%." >&2
exit /b 1

Enable Edit Log Message in Subversion

In Subversion, when you commit the changeset, you're not allow to edit the log message but the SVN admin with svn-admin command.
To enable it to user, you (the SVN admin) must enable the pre-prop-change hook

pre-prop-change.bat (Windows)
Here is the content of pre-prop-change hook, just save it to pre-prop-change.bat and copy it into SVN hook folder. The content is Windows batch file and just for Windows environment

The script will enable the owner of the revision and the owner of SVN to change the log message.

The owner of SVN is get from SVN auth file (authz-svn.conf) and should be configure in the form @svn_owner = userA, userB...

You need to edit the PATH to authz-svn.conf file

@ECHO OFF
:: Set all parameters. Even though most are not used, in case you want to add
:: changes that allow, for example, editing of the author or addition of log messages.
set repository=%1
set revision=%2
set userName=%3
set propertyName=%4
set action=%5

:: Only allow the log message to be changed, but not author, etc.
if /I not "%propertyName%" == "svn:log" goto ERROR_PROPNAME

:: Only allow modification of a log message, not addition or deletion.
if /I not "%action%" == "M" goto ERROR_ACTION

:: Make sure that the new svn:log message is not empty.
set bIsEmpty=true
for /f "tokens=*" %%g in ('find /V ""') do (
set bIsEmpty=false
)
if "%bIsEmpty%" == "true" goto ERROR_EMPTY

FOR /F "tokens=*" %%a IN ('svnlook author "%repository%" -r %revision%') DO set REV_USER=%%a

FOR /F "delims== tokens=1*" %%a IN (%repository%\..\Permission\authz-svn.conf) DO if "%%a"=="svn_owner " ( set SVN_OWNER=%%b )

set bIsOK=false
FOR %%a IN (%SVN_OWNER%) DO if "%%a"=="%userName%" ( set bIsOK=true )
if "%bIsOK%"=="false" (
goto ERROR_AUTHOR
)

goto :eof

:ERROR_AUTHOR
echo You must be the author of the log message or owner of the repository %SVN_OWNER% %userName%. >&2
goto ERROR_EXIT

:ERROR_EMPTY
echo Empty svn:log messages are not allowed. >&2
goto ERROR_EXIT

:ERROR_PROPNAME
echo Only changes to svn:log messages are allowed. >&2
goto ERROR_EXIT

:ERROR_ACTION
echo Only modifications to svn:log revision properties are allowed. >&2
goto ERROR_EXIT

:ERROR_EXIT
exit /b 1

pre-prop-change (Linux)
The following is the script in Linux, it just allow the owner of the revision to change the log.

#!/bin/sh

REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"

if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ];
then
REV_USER=`svnlook author "$REPOS" -r $REV`
if [ "$REV_USER" = "$USER" ];
then
exit 0;
else
echo "You must be the owner of the revision to be able to change the svn:log property" >&2
exit 1
fi
fi

echo "Changing revision properties other than svn:log is prohibited" >&2
exit 1

Oct 16, 2008

StyleCop command line

StyleCop command line

Here is a version of StyleCop in command line mode - http://www.nichesoftware.co.nz/content/stylecop-cmd. You need to have VS 2008 in order to compile, or you can install .NET 3.5 and compile using MSbuild command

set PATH=%PATH%;C:\WINDOWS\Microsoft.NET\Framework\v3.5
cd C:\StyleCopCmd-1.1.27.5997\src\StyleCop
msbuild StyleCop.csproj

Oct 15, 2008

How to copy music from PC to iPhone without using iTunes

How to copy music from PC to iPhone without using iTunes

Hehe, you will need to use the SharePod at http://www.getsharepod.com/ and everything will be solved ;-)

Sep 20, 2008

Disable Certificate Error Report in IE7

Internet Explorer 7 is saying "Certificate error: navigation blocked". This means that, although the secure server certificate is encrypting data correctly, IE7 cannot verify the domain name. That is because there is not a SSL certificate for your particular domain name.

This does not indicate a problem with the website or control panel. This could be more acurately described as a fault with Internet Explorer being a little overly paranoid on your behalf.

Your choice is to either click that you want to navigate the site anyhow, or permanently disable the warning.

If you would like to permanently disable the warning error, go to the Internet Explorer Tools menu and select Internet Options, Advanced tab. Scroll down to the bottom (under Security) and disable/uncheck "Warn about certificate address mismatch".

Sep 8, 2008

Knowledge Sharing in Software Development

Have you ever tried the Wiki for knowledge sharing in project? Have you recognized the value of knowledge sharing?

I know some of you tend to resist sharing your knowledge with the rest of the organization, some of you don’t know what to write, it’s because of the system and blah blah blah. Just stop blaming on the system, we should change our mindset and our behavior in using the tools.

Here is some practices for sharing
  • Knowledge is from project.
  • Each project must have trouble, issue, development tips & tricks, environment setup, this is the knowledge – (as I have seen in some projects, the development environment is kept inside developer’s mind, when newcomer come to the project, at least 1 dev will sit with him for setting up the environment)
  • We’re not master, but when facing the problem we should be, this is where knowledge come from.
  • You’re in the project so it definitely that you’ll have some knowledge to share otherwise you look like a “chess man” in project.

Will you try out the Wiki? Some wiki you might be interested in

Aug 1, 2008

How To Compile C Code Analysis (CCA)

CCA is an analysis toolkit for analyzing C source code. The following show you how to compile CCA on Windows.
Prerequisite
  • Cygwin: gcc, ocaml, make
To Compile open Cygwin bash shell and run following command
cd cil
./configure
make
make quicktest
You might need to edit the Makefile.cil to remove the following lines (at line 259)

$(ECHO)#if test $(OBJDIR) != $(<D) -a -f $(OBJDIR)/$(basename $(<F)).cmi ;then \

$(COMMAND) mv -f $(OBJDIR)/$(basename $(<F)).cmi $(<D); \

mv -f $(OBJDIR)/$(basename $(<F)).cmi $(<D); \

fi

Jul 27, 2008

How To Create DirectX (.X) file

Using Tools
  • Get yourself a program named TrueSpace or Milkshape, which can export Models into this format (and create them)
  • Get a Plug in for any other 3D modeler (Maya Plugin and others are included with the DirectX9 SDK)
  • Create 3DS Files using almost Any Modeler (3DS is more or less a standard format) and use the Program supplied with the SDK to convert it into .X format
  • Open the File in WordPad and u can create/modify them, since they are not stored in any compressed/unreadable format (although for this u need to know how the file is build)
Programmatically
  1. Create the mesh
    D3DXCreateMeshFVF(...)
  2. Lock the vertex buffer and copy your vertices into it
    outMesh->LockVertexBuffer(...)
  3. Lock the index bufer and copy indices into it
    outMesh->LockIndexBuffer(...)
  4. Save it to a file
    D3DXSaveMeshToX(...)

Jun 21, 2008

How to setup GCS Global Mail with iPhone

Incoming Mail Server
Host Name: mail.globalcybersoft.com
User Name: xxx@globalcybersoft.com
Password: xxx

Outgoing Mail Server
Host Name: mail.globalcybersoft.com
Port: 25
User Name: xxx@globalcybersoft.com
Password: xxx

Use SSL: OFF