Friday, April 17, 2015

32-bit exeutables on 64-bit ubuntu OS


32-bit compilers or executable do not run as is on 64-bit OS. You need to install additional packages to run 32-bit executable on 64-bit OS.

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
Reference: 
http://askubuntu.com/questions/454253/how-to-run-32-bit-app-in-ubuntu-64-bit

Monday, May 2, 2011

Bluez : Cross compilation of Libs

bluez - bluetooth stack for Linux - users

1. compile bluez-libs
2. compile bluez-utils
3. clean up
4. final steps, tests

Wednesday, December 8, 2010

C#: Elevating UAC privileges from within application

 
WindowsPrincipal pricipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
bool hasAdministrativeRight = pricipal.IsInRole(WindowsBuiltInRole.Administrator);

if (!hasAdministrativeRight)
{
RunElevated(Application.ExecutablePath);
this.Close();
Application.Exit();
}

private static void RunElevated(string fileName)
{
//MessageBox.Show("Run: " + fileName);
ProcessStartInfo processInfo = new ProcessStartInfo();
processInfo.Verb = "runas";
processInfo.FileName = fileName;
try
{
Process.Start(processInfo);
}
catch (Win32Exception)
{
//Do nothing. Probably the user canceled the UAC window
}
}

Thursday, November 11, 2010

Turn off Android power management from console

It is very annoying during development on Android system if it enters sleep mode and there is no keyboard connected to Android target machine. So use the following commands to turn off power management from console.

# echo my_lock > /sys/power/wake_lock
and 
# echo my_lock > /sys/power/wake_unlock
to enable power management back.

Monday, October 4, 2010

Network and DNS settings for Android

Use following command to set DNS server:

setprop net.dns1 xxx.xxx.xxx.xxx

Use following command to set gateway:

route add default gw 192.168.1.1 dev eth0