If there is any chance that you guys installing windows 7 while in IDE mode for your SATA drives (just like me) and now want to change it to AHCI mode in the bios only to get windows startup crash, here is the step.
in the BIOS, change back the SATA mode to IDE, start windows normally and do below step :
1. start "Regedit"
2. Go to : HKEY_LOCAL_MACHINE / SYSTEM / CurrentControlset / Services
3. Open msahci
4. In the right field double click on "start".
5. In the value Data field enter "0" and click "ok"
6. exit "Regedit"
restart your PC, back to BIOS again, and change the SATA mode to AHCI, your windows should start without any problem.
Monday, February 6, 2012
Wednesday, January 4, 2012
phpize error: unknown type name 'pval'
got this error ? suddenly unknown pval type ? because upgrading from php 5.3 to php 5.4 ?, sucks right ?
yeah, pval has been changed to zval, so if we find any source that use pval type, we need to find the newer source that has been updated to zval, if we unlucky to find one, edit the source by our self.
I got this problem when I tried to do 'pecl install stats' under php 5.4, the error was beginning with :
/var/tmp/stats/statistics.c:165:2: error: unknown type name 'pval'
well, then manually replace all pval with zval under statistics.c file (total 5 replacement, using %s vi command), but with one trick, since PECL will always reload from the source and delete any temporary local file, we have to make our updated file unwriteable, by issuing chattr +ui /var/tmp/stats/statistics.c., and the trick to get that statistic.c at the first time, press ctrl break on the first stage of pecl install when it decompressing the source, then update and lock the file with above trick.
Monday, June 20, 2011
TP-Link TL-MR3420 Wireless router is compatible with Nokia E52 Phone
I just realized today that my TP-Link Wireless router is supporting Nokia E52 phone on its native firmware, without any additional modem firmware.
although on their website, nokia support isnt mentioned anywhere, it does detect the nokia phone as 3G USB modem, here is the "officially" modem support from their website.
and here is my TL-MR3420 configuration that shows Nokia E52-1 as 3G USB Modem.
if somebody mind to ask, why I use my expensive phone as 3G modem on wireless router ???, why not ??, I have unlimited data plan on the phone, and the router is charging the phone too on its USB port. :-D
==========================
update for firmware version :
Firmware Version: 3.11.10 Build 100901 Rel.52652n
Hardware Version: MR3420 v1 00000000
==========================
although on their website, nokia support isnt mentioned anywhere, it does detect the nokia phone as 3G USB modem, here is the "officially" modem support from their website.
and here is my TL-MR3420 configuration that shows Nokia E52-1 as 3G USB Modem.
if somebody mind to ask, why I use my expensive phone as 3G modem on wireless router ???, why not ??, I have unlimited data plan on the phone, and the router is charging the phone too on its USB port. :-D
==========================
update for firmware version :
Firmware Version: 3.11.10 Build 100901 Rel.52652n
Hardware Version: MR3420 v1 00000000
==========================
Wednesday, June 8, 2011
J2ME: Graphic Text and Bars


Above J2ME graphic demonstration is a combination between text display, for the menu, and canvas for the graphic, here is the source code, each screen above is on separate file.
/*
* Filename : GraphicDemo.java
*/
package GraphicDemo;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class GraphicDemo extends MIDlet implements CommandListener {
private Command exitCommand; // The exit command
private Display display; // The display for this MIDlet
List lsMain;
GDBars GDBars = null;
GDText GDText = null;
static final Command EXIT_CMD = new Command("Exit", Command.EXIT, 1);
static final Command BACK_CMD = new Command("Back", Command.BACK, 1);
public GraphicDemo() {
display = Display.getDisplay(this);
lsMain = new List("Graphic Demo menu", Choice.IMPLICIT);
lsMain.append("Bars Demo",null);
lsMain.append("Text Demo",null);
lsMain.addCommand(EXIT_CMD);
lsMain.setCommandListener(this);
GDBars = new GDBars(this, lsMain);
GDText = new GDText(this, lsMain);
}
public void startApp() {
display.setCurrent(lsMain);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void setDisplay(Displayable d)
{
display.setCurrent(d);
}
public void commandAction(Command c, Displayable s) {
if (s instanceof List) {
List obj = (List)s;
if (obj == lsMain) {
if (c == EXIT_CMD)
{
destroyApp(false);
notifyDestroyed();
}
else {
switch(lsMain.getSelectedIndex()) {
case 0:
display.setCurrent(GDBars);
break;
case 1:
display.setCurrent(GDText);
break;
}
}
}
}
}
}
/*
* Filename : GDText.java
*/
package GraphicDemo;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Font;
/**
Draws Text on a Canvas using the drawing methods
in the javax.microedition.lcdui.Graphics class.
@see javax.microedition.lcdui.Graphics
*/
public class GDText extends Canvas implements CommandListener
{
// Constant representing the color white.
private static final int WHITE = 0xFF << 16 | 0xFF << 8 | 0xFF;
private Command back = new Command("Back",Command.BACK,1);
GraphicDemo graphicdemo; // Reference to display object
Displayable backscreen;
//private Display display = Display.getDisplay(GraphicsDemo.getInstance());
public GDText ( GraphicDemo graphicdemo, Displayable backscreen )
{
super();
this.graphicdemo = graphicdemo;
this.backscreen = backscreen;
addCommand(back);
setCommandListener(this);
}
/**
Paints the clip rectangle white, effectively erasing
whatever was displayed on the Canvas previously.
*/
protected void paintClipRect(Graphics g)
{
int clipX = g.getClipX();
int clipY = g.getClipY();
int clipH = g.getClipHeight();
int clipW = g.getClipWidth();
int color = g.getColor();
g.setColor(WHITE);
g.fillRect(clipX, clipY, clipW, clipH);
g.setColor(color);
}
/**
Paints the look of this Canvas subclass.
*/
public void paint(Graphics g)
{
paintClipRect(g);
int width = getWidth();
int height = getHeight();
g.setFont(Font.getDefaultFont());
g.drawString("Default", 5, 30,Graphics.LEFT | Graphics.BOTTOM);
g.setFont(Font.getFont(Font.FACE_SYSTEM,Font.STYLE_PLAIN,Font.SIZE_LARGE));
g.drawString("Large", 5, 53,Graphics.LEFT | Graphics.BOTTOM);
g.setFont(Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_ITALIC,Font.SIZE_MEDIUM));
g.drawString("Medium", 5, 71,Graphics.LEFT | Graphics.BOTTOM);
g.setFont(Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_UNDERLINED,Font.SIZE_SMALL));
g.drawString("Small", 5, 90,Graphics.LEFT | Graphics.BOTTOM);
g.setFont(Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_BOLD,Font.SIZE_MEDIUM));
g.drawString("V", width - 10, 20,Graphics.RIGHT | Graphics.BOTTOM);
g.drawString("E", width - 10, 32,Graphics.RIGHT | Graphics.BOTTOM);
g.drawString("R", width - 10, 44,Graphics.RIGHT | Graphics.BOTTOM);
g.drawString("T", width - 10, 56,Graphics.RIGHT | Graphics.BOTTOM);
g.drawString("I", width - 10, 68,Graphics.RIGHT | Graphics.BOTTOM);
g.drawString("C", width - 10, 80,Graphics.RIGHT | Graphics.BOTTOM);
g.drawString("A", width - 10, 92,Graphics.RIGHT | Graphics.BOTTOM);
g.drawString("L", width - 10, 104,Graphics.RIGHT | Graphics.BOTTOM);
g.drawChar('B', width - 25, 20,Graphics.RIGHT | Graphics.BOTTOM);
g.drawChar('O', width - 25, 32,Graphics.RIGHT | Graphics.BOTTOM);
g.drawChar('L', width - 25, 44,Graphics.RIGHT | Graphics.BOTTOM);
g.drawChar('D', width - 25, 56,Graphics.RIGHT | Graphics.BOTTOM);
}
public void commandAction(Command c, Displayable d)
{
if (c == back)
{
graphicdemo.setDisplay(backscreen);
}
}
}
/*
* Filename : GDBars.java
*/
package GraphicDemo;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Command;
/**
Draws rectangles on a Canvas using the drawing methods
in the javax.microedition.lcdui.Graphics class.
@see javax.microedition.lcdui.Graphics
*/
public class GDBars extends Canvas implements CommandListener
{
// Constant representing the color white.
private static final int WHITE = 0xFF << 16 | 0xFF << 8 | 0xFF;
private Command back = new Command("Back",Command.BACK,1);
GraphicDemo graphicdemo; // Reference to display object
Displayable backscreen;
//private Display display = Display.getDisplay(GraphicsDemo.getInstance());
public GDBars ( GraphicDemo graphicdemo, Displayable backscreen )
{
super();
this.graphicdemo = graphicdemo;
this.backscreen = backscreen;
addCommand(back);
setCommandListener(this);
}
/**
Paints the clip rectangle white, effectively erasing
whatever was displayed on the Canvas previously.
*/
protected void paintClipRect(Graphics g)
{
int clipX = g.getClipX();
int clipY = g.getClipY();
int clipH = g.getClipHeight();
int clipW = g.getClipWidth();
int color = g.getColor();
g.setColor(WHITE);
g.fillRect(clipX, clipY, clipW, clipH);
g.setColor(color);
}
/**
Paints the look of this Canvas subclass.
*/
public void paint(Graphics g)
{
paintClipRect(g);
int width = getWidth();
int height = getHeight();
int x0 = 5;
int y0 = 5;
int barW = 10;
int initHeight = height - 10;
int deltaH = 10;
g.drawRect(x0, y0, barW, initHeight);
g.fillRect(x0 + barW, y0 + deltaH, barW,
initHeight - deltaH + 1);
g.drawRect(x0 + barW * 2, y0 + deltaH * 2,
barW, initHeight - deltaH * 2);
g.setColor(255, 00, 00);
g.fillRect(x0 + barW * 3, y0 + deltaH * 3,
barW, initHeight - deltaH * 3 + 1);
g.setColor(0, 0, 0);
g.drawRect(x0 + barW * 4, y0 + deltaH * 4,
barW, initHeight - deltaH * 4);
g.fillRect(x0 + barW * 5, y0 + deltaH * 5,
barW, initHeight - deltaH * 5 + 1);
g.drawRect(x0 + barW * 6, y0 + deltaH * 6,
barW, initHeight - deltaH * 6);
g.fillRect(x0 + barW * 7, y0 + deltaH * 7,
barW, initHeight - deltaH * 7 + 1);
}
public void commandAction(Command c, Displayable d)
{
if (c == back)
{
graphicdemo.setDisplay(backscreen);
}
}
}
Thursday, June 2, 2011
Got error code 2869 on Vista or Seven ??
Basically this error is coming from MSI packages that build for system before Vista, means, installation process is not compatible with new security schemes that applied on Vista and 7.
on EXE file type installation, we can right click on the icon and choose "Run As Administrator", but on MSI packages, we dont have that option, here is the work around to get MSI packages run under administrator privileges.
1) Copy the .MSI file to the root directory of main hard drive (i.e. C:\).
2) Open Windows Notepad.
3) Copy this text into windows notepad:
msiexec /i C:\program_name.msi
4) Replace the text "program_name" in with the actual name of the .MSI file .
5) Click File -> Save ...
Instead of saving it as a .txt file, change the file name to installer.bat.
Save the file to place where we can find it easily, ie desktop.
6) right click on the file and select Run as Administrator.
Tuesday, May 24, 2011
Make Fedora Linux as Xserve file server for Mac
Apple need afp to connect to other server, and that means linux need to run one.
first install netatalk and avahi.
for RPM package, on my case, I use Fedora 9, so here is the RPM that my linux has :
avahi-0.6.22-10.fc9.i386, netatalk-2.0.3-21.fc9.i386
Configure Appletalk Netatalk
Change the following values:
Configure Netatalk to share home folders
allow: users and groups allowed to access share
rwlist: users and groups allowed read and write access
Change <users> to your users separated by commas jim.bob.doug
Change <@group> to your groups separated by commas @accounting, @marketing (keep the @ infront of the group name)
* Users and Groups must already exist in Linux
Add for Users Home Folders
Add a folder:
Configure Avahi and mDNS (linux version of bonjour)
We need to configure Avahi and mDNS so the Mac computers on the network can find our Appletalk file server
We need to create a service file for our afpd service:
Add the following:
Add mDNS to nsswitch
Add mdns to the line hosts:
source http://www.kernelhardware.org/appletalk-file-server-on-fedora-linux/>;
first install netatalk and avahi.
#yum install avahi netatalk
for RPM package, on my case, I use Fedora 9, so here is the RPM that my linux has :
avahi-0.6.22-10.fc9.i386, netatalk-2.0.3-21.fc9.i386
Configure Appletalk Netatalk
# vi /etc/atalk/afpd.conf
- -noddp -tcp -uamlist uams_randnum.so,uams_dhx.so,uams_dhx2.so -nosavepassword -advertise_ssh
# vi /etc/atalk/netatalk.conf
Change the following values:
ATALKD_RUN=no
PAPD_RUN=no
CNID_METAD_RUN=yes
AFPD_RUN=yes
TIMELORD_RUN=no
A2BOOT_RUN=no
Configure Netatalk to share home folders
# vi /etc/atalk/AppleVolumes.default
allow: users and groups allowed to access share
rwlist: users and groups allowed read and write access
Change <users> to your users separated by commas jim.bob.doug
Change <@group> to your groups separated by commas @accounting, @marketing (keep the @ infront of the group name)
* Users and Groups must already exist in Linux
Add for Users Home Folders
~/ "$u" allow:<users> rwlist:<user>,<@group> cnidscheme:cdb
Add a folder:
/home/folder <share_name> allow:<users>,<@group> rwlist:<users>,<@group> cnidscheme:cdb options:usedots,upriv
Configure Avahi and mDNS (linux version of bonjour)
We need to configure Avahi and mDNS so the Mac computers on the network can find our Appletalk file server
We need to create a service file for our afpd service:
# vi /etc/avahi/services/afpd.service
Add the following:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h Xserve</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>
Add mDNS to nsswitch
# vi /etc/nsswitch.conf
Add mdns to the line hosts:
hosts: files dns mdns
source http://www.kernelhardware.org/appletalk-file-server-on-fedora-linux/>;
Friday, February 4, 2011
add static route after vpn interface up on Mac OSX
to do this on mac is simply create a script and put it under /etc/ppp/ , and name it ip-up, here is my example, on script you can see I need both 10.10.20.0/24 and 10.10.10.0/24 to be routed to ppp interface after vpn interface get connected.
bash-3.2#
bash-3.2# cat /etc/ppp/ip-up
#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices; export PATH
ifppp=$(ifconfig ppp0 | grep inet | awk '(print $2}')
/sbin/route add -net 10.10.20.0/24 $ifppp
/sbin/route add -net 10.10.10.0/24 $ifppp
bash-3.2#
Subscribe to:
Posts (Atom)