Godaddy 40% Off

40% off your First Order with GoDaddy.com!

Search This Blog

Loading...

Thursday, May 9, 2013

Error: Failed to retrieve directory listing

I'm trying to connect to my hosting site using filezilla and hit error


Command: LIST
Response: 150 Opening BINARY mode data connection.
Error: Could not read from transfer socket: ECONNRESET - Connection reset by peer
Response: 550
Error: Failed to retrieve directory listing


This is a big trouble for me because cannot update/upload my latest file into the server.

Finally found that the problem can be solved by change the transfer mode to passive in the Site Manager.



Now can upload the file like normal.

Wednesday, January 16, 2013

Enable TCP/IP Protocol and set Login mode to Mixed mode in C#

Try to enable Microsoft SQL Server 2008 TCP/IP Protocol and set the Login mode to Mixed mode using C# without involve registry. Come across information below http://stackoverflow.com/questions/2266697/changing-sql-server-settings-programmatically

The information is really helpful but when try it in SQL Server 2008 using the C# source code given, it's not working very well. Then try to do some testing and finally it's work. I've added a line srv.Settings.Alter();



private static bool SetServerProperties()
    {
        #region standardize Connection String
        string tempCatalog = "master";
        string temp = @"Data Source=" + dataSource + ";Initial Catalog=" + tempCatalog + ";Integrated Security=True;MultipleActiveResultSets=True";
        #endregion

        SqlConnection sqlconnection = new SqlConnection(temp);
        SqlCommand cmd = new SqlCommand("select @@ServerName", sqlconnection);
        sqlconnection.Open();
        string serverName = "";
        try
        {
            SqlDataReader dr = cmd.ExecuteReader();
            while (dr.Read())
                serverName = dr[0].ToString();
        }
        catch
        {
            MessageBox.Show("Failed to Set SQL Server Properties for remote connections.");
        }

        Server srv = new Server(serverName);
        srv.ConnectionContext.Connect();
        srv.Settings.LoginMode = ServerLoginMode.Mixed;
srv.Settings.Alter(); 

        ManagedComputer mc = new ManagedComputer();

        try
        {
            Service Mysvc = mc.Services["MSSQL$" + serverName.Split('\\')[1]];

            if (Mysvc.ServiceState == ServiceState.Running)
            {
                Mysvc.Stop();
                Mysvc.Alter();

                while (!(string.Format("{0}", Mysvc.ServiceState) == "Stopped"))
                {
                    Mysvc.Refresh();
                }
            }

            ServerProtocol srvprcl = mc.ServerInstances[0].ServerProtocols[2];
            srvprcl.IsEnabled = true;
            srvprcl.Alter();


            Mysvc.Start();
            Mysvc.Alter();

            while (!(string.Format("{0}", Mysvc.ServiceState) == "Running"))
            {
                Mysvc.Refresh();
            }
            return true;
        }
        catch
        {
            MessageBox.Show("TCP/IP connectin could not be enabled.");
            return false;
        }
    }


Thanks to http://stackoverflow.com/users/1635051/reza-ameri

Friday, January 4, 2013

EC2: Access to PHP (Apache) in windows server

My Amazon EC2 is running in Windows 2008 Server R2 with IIS. I can access to aspx pages via Elastic IP http://xxx.xxx.xxx.xxx easily without any problem.

Now i want to have my php application with Apache running in the same server with same IP but port http://xxx.xxx.xxx.xxx:81 to display in the web

There are mainly 3 important steps



  1. Change httpd.config (configuration file for apache)
    Find line with Listen xxx.xxx.xxx.xxx (or localhost) and change to Listen 0.0.0.0:81
    Find line with ServerName  xxx.xxx.xxx.xxx  (or localhost)  and change to ServerName  0.0.0.0:81
    Save the file and restart apache 
  2. Go to windows firewall and add Port 81 in inbound rules
  3. Add Port 81 to EC2 Security Group. Remember to apply the rule after added.

Done. It's work like charm!

Thursday, December 6, 2012

Paper jam in HP LaserJet 3050 series (3052)

This is difficult. Normally when a paper stuck / jam in LaserJet 3050 series (my case is 3052), we can open the printer lid, take out the toner cartridge and pull the paper out. Close the lid and can print again. 

 

In case, i cannot see any paper jam/stuck after take out the toner cartridge but i know it's jam inside there. I've tried to turn off the printer for one minute and turn on again. I can hear the warming up sound is different from usual but when i try to check to see any paper stuck inside there, i can't find any. The paper is hidden inside some where. BIG ISSUE.

Finally, i found something. I followed the instruction below and try to clean the paper path.


It's work. The paper successfully pull out by the printer.

For those who not understand what is all-in-one control panel, please refer to photo below


This save my time and money with no need to send to repair.

This is the paper that cause me a lots of trouble.


Thursday, October 18, 2012

How to block facebook apps / games request

It's very annoying that the friends send the same facebook app request again and again.This article shows how to block same facebook apps or facebook game request in future.

Click on App Center



In App Center, click on Requests



Click on "X" on the app that you wish to block


Click on Block xxxxxx



Done.

Check on video below to have better understanding.







Monday, October 1, 2012

The bulk load failed. The column is too long in the data file for row 1, column x. Verify that the field terminator and row terminator are specified correctly.


Hit error below when try to execute bulk insert script

Msg 4866, Level 16, State 1, Line 3
The bulk load failed. The column is too long in the data file for row 1, column 6. Verify that the field terminator and row terminator are specified correctly.
Msg 7399, Level 16, State 1, Line 3
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 3
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".

(0 row(s) affected)

Script that hit error:


CREATE TABLE GeoIPCountryWhois2
(
[startIp] [nvarchar](50) NULL,
[endIp] [nvarchar](50) NULL,
[startIpNum] [nvarchar](50) NULL,
[endIpNum] [nvarchar](50) NULL,
[CountryCode] [nvarchar](50) NULL,
[Country] [nvarchar](150) NULL
) ON [PRIMARY]
GO


BULK INSERT GeoIPCountryWhois2
FROM 'C:\GeoIPCountryWhois.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '/n'

)
GO
--Check the content of the table.
SELECT *
FROM GeoIPCountryWhois2
GO

Fix:



CREATE TABLE GeoIPCountryWhois2
(
[startIp] [nvarchar](50) NULL,
[endIp] [nvarchar](50) NULL,
[startIpNum] [nvarchar](50) NULL,
[endIpNum] [nvarchar](50) NULL,
[CountryCode] [nvarchar](50) NULL,
[Country] [nvarchar](150) NULL
) ON [PRIMARY]
GO


BULK INSERT GeoIPCountryWhois2
FROM 'C:\GeoIPCountryWhois.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '0x0a'
)
GO
--Check the content of the table.
SELECT *
FROM GeoIPCountryWhois2
GO

Saturday, September 8, 2012

Mars power bank 3000 mAh review

Recently bought a external battery charger for my Samsung mobile phone called Mars Power Bank 3000 mAh.




Since the instruction or manual behind the box written in Chinese, i will share this in English so that more people can understand how it's work.




The description is rather brief as below:



  • Please read the instruction behind this box before using this.
  • This product suitable to use in most smart phone and digital camera.
  • Please recharge this product at least once if didn't use for a period of 3 months.
  • During the charging process, you can feel slight heat which is normal.  
  • Please make sure this product in dry condition. Please do not clear this product with chemical cleanser.



For: Fix for various mobile and devices
Capacity: 3000 mAh
Input: DC 5V -1000mAh (Max)
Output: DC 5V -1000 mAh (Max)

Mentioned in the box, this device support most of the mobile phone brand like Apple, Samsung, Nokia and etc. 




It's very flexible where user can change the adapter to suit the different needs.





Adapters that come with this external battery





For my case, i recharge this external charger with my USB adapter. 



How we know that it's fully charged? There is a LED light indicator. When you start to charge the power bank, the LED is in Red color. Once fully charged, it will turn to Blue. It will takes about 2-3 hours.




Once it's fully charge, you can use it to charge you smart phone and it should work like charm. It will takes 2-3 hours to get the handphone battery fully charge. I'm using Samsung Galaxy S2




Is it safe? Mentioned in the Box, it's certified by CE. I guess it's safe.



Sunday, August 12, 2012

The virtual machine could not start - VMware Workstation

Hit error below when try to start windows 7 in my VMware workstation

The virtual machine could not start. Make sure VMware Workstation is installed correctly and you have rights to run the software and to access all directories it uses, including directories in which the software is installed, directories containing the virtual disk and configuration files, and directories for temporary files.


How to solve it?

Restart your computer or stop VMware services that is running and delete all of the .lck folders and also the .vmem file in the vm guest directory. Guest directory is where your install the virtual machine. For my case, i install my virtual machine in "C:\Documents and Settings\user\My Documents\My Virtual Machines\Windows 7 - Base"



Now i'm able to start my VM. Thanks to suggestion http://darktraining.com/vmware/66/


Wednesday, July 25, 2012

MYSQL Error 1053: The service did not respond to the start or control request in a timely fashion

I'm running mysql in windows server 2003 and was running well all the while. Today, my colleague execute some script and cause mysql hang. So, we have decided to restart the server. After restart the server, window service show that mysql in starting status after 20 minutes. So, i have decided to kill the process in task manager and start the service manually.

Then i hit error message  "Error 1053: The service did not respond to the start or control request in a timely fashion" and fail to start mysql. I've tried to restart windows server again but it doesn't work. I'm not sure what is the reason. What i decide to do is take out the database my my colleague work with previous and try to restart mysql service again. Where is mysql data file store? The location can be found in my.ini file.In my case, my file is stored in "C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1". I cut the paste the database out of the folder and restart mysql. It's work!!

Hope this experience can share with friend who hit the similar scenario. For friends who face the same error, maybe this link might helps http://support.microsoft.com/kb/886695

Saturday, May 19, 2012

"Licensing for this product has stopped working" when launch Adobe CS 4 Dreamviewer


Facing error message below when try to launch Adobe CS4 product, in my case, i try to open Dreamweaver.


This product has has encountered a problem which requires that you restart your computer before it can be launched.
If you continue to see this message after restarting your computer, please contact either your IT adminstrator or Adobe technical support for helps, and mention the error code shown at the bottom of this screen.
Error: 148.3









How I Fix it in my XP Pro


  1. Click on Start 
  2. Click on Run 
  3. Enter: Services.msc 
  4. Click on OK button
  5. A Services windows will be displayed
  6. Go to find  FLEXnet Licensing Services
  7. Double-click on FLEXnet Licensing Services 
  8. Change the Startup type: Automatic 
  9. In Service Status, click on Start button to start the service
  10. Click on Apply button
  11. Click on OK button to close the Services window
  12. Done

Click to support me

Click to support me
If you think my article helps, please click on below advertisement to suppoart me to write more. Thanks