Thursday, October 18, 2012

XAMPP phpmyadmin access forbidden

XAMPP is a great tool for web application development and testing.  It provides a self-contained environment for running web applications.

It has been a while since I have used it, and the new edition seems to have enhanced the default security.  For instance, if you run phpmyadmin on a fresh install, you will be greeted with ACCESS FORBIDDEN error.  I had anyway.  To overcome this (and my circumvents the security), I have done the below:

1) Open the /opt/lampp/etc/extra/httpd-xampp.conf with your choice of text editor
2) Update the two sections below as shown, then restart lampp.  You should be all set!

<directory lampp="lampp" opt="opt" phpmyadmin="phpmyadmin">
    AllowOverride AuthConfig Limit
Require all granted
</directory>

<LocationMatch "^/(?i:(?:xampp|licenses|phpmyadmin|webalizer|server-status|server-info))">
        Order allow,deny
        Allow from all

        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</locationmatch>

Wednesday, October 17, 2012

Setting Environment as normal user

Just a note to myself, to edit the environment variables for a standard use, I need to type "environment" into the start menu, and use the "Edit environment variables for your account" option.

Saturday, October 13, 2012

Ainol ELF Firmware 4.0.4

One of the ongoing problems with the Ainol ELF is WiFi.  It often fails to come back when wakes up from sleep.  The only way to get the WiFi back is to restart the machine.  This is very annoying.  Few days ago, I had flashed my ELF with the latest firmware which upgraded it to 4.0.4.  It seems the WiFi problem has finally been addresses.  The new firmware behaves a lot better than the latest Essential Clean Rom (1.1a).  With the 1.1a, my tablet often has troubles to get into proper sleep mode.

One thing I miss after upgrade is the hardware volume button.  1.1a remaps the home and menu buttons to act as volume button, whereas the official one put them back to what they were before.  To make the matter even worse is that there is no soft volume button too!  So to adjust the volume, I need to go to settings -> sound to adjust the volume.  However, comparing this to the WiFi problem, I would much prefer to have the WiFi problems fixed.

Saturday, September 8, 2012

Slow transfer speed ...

As media files are getting larger and larger, it is becoming a pain to transfer files between computers over a 100Mbps network.  So I upgraded my network with a gigabit switch.  The speed has improved but is only marginally, e.g. from about 7MB/s to 12MB/s.  I have tried to look for an answer and have not had much luck till yesterday.

It seems the culprit is this thing called Large Send Offload.  Once I disable this option on my network card, the speed jumps from pathetic 12MB/s to 60-80MB/s.

Sunday, August 5, 2012

Medibuntu Update

Just update the instructions for installing Medibuntu on 12.04.

http://www.unixmen.com/how-to-add-medibuntu-repository-in-ubuntu-via-terminal-and-gui/

LibreOffice and OpenOffice

When Sun was brought by Oracle, OpenOffice was replaced by LibreOffice.  Although they are supposedly very similar, it seems the LibreOffice is a bit less polished then the OpenOffice, and a bit slower too it seems.

Luckily putting back OpenOffice is not that difficult.   With three easy steps, and you are there:

  1. sudo add-apt-repository ppa:upubuntu-com/office
  2. sudo apt-get update
  3. sudo apt-get install openoffice

Saturday, August 4, 2012

Kubuntu and VirtualBox

I have hold back the upgrade from 11.10 to 12.04 as I have learnt my lessons not to upgrade to the latest as soon as it arrives as it is better to wait a while for all the initial teething problems getting fixed.

And 11.10 is working fine for me, well on my netbook anyway.  I know it is running the same Linux under the hood, but Kubuntu seems to handle power management a lot better.  At least my netbook won't put into sleep whenever I pull the power plug.

Anyway, the urge for me to upgrade to 12.04 is VirtualBox.  11.10 is just painfully slow running on VirtualBox.  Hence, I decided to upgrade to the newer version to see if it helps.  Gladly, it seems to work better.  At least I don't need to wait for a minutes for responses.

Update: The latest version of VirtualBox 4.2 seems to fixed the performance issue.  In fact, the new version has improved the speed across the board.

Sunday, May 20, 2012

Replacing hard drives in a Buffalo Linkstation Duo

I have trouble with the original disks within my Buffalo Linkstation Duo.  The two 500GB original hard drives that came with my drive failed one after another (luckily, not together!).  Be fair to Buffalo, their after sale service is good (well for the first replacement).  Emails were replied promptly - though I have problems with the second replacement, their customer services team is good, but their RMA team is dreadful.  I had waited for over two months for a reply from them.

Anyway, the reason I wrote this post is that I fed up the waiting for the replacement and decided to use two spared 250GB drives I have to safe keep my files.  I need the fail-safe provided by RAID1.

Unfortunately, it is not easy as putting two empty drives into the unit and configure the NAS.  It seems Buffalo stores the OS of the NAS on the hard drive rather than on the drive's ROM.  Hence, if you have replaced both drives, the NAS will not know what to do at the boot time.

If you really need to replace both drives at the same time, you need to use TFTP to transfer essential files to the NAS to make it operative.  Step can be found at: http://forums.buffalotech.com/t5/Storage/FAQ-3-of-5-TFTP-boot-procedure-please-read-this/td-p/68094 .  There is a point you may want to note. You don't need to take the drive off your network. In fact, it is better to keep it in your network as after receiving the necessary files through TFTP for booting, it will try to obtain an IP from your DHCP server.  If the drive is still in your network, it can get an IP from your DHCP server.  All you need to do is to set you PC to the static IP 192.168.11.1 to allow the NAS to locate the files intially.

If everything went well, you should have your Buffalo drive in EM mode, and your PC is at static IP 192.168.11.1 . Now, you can put your PC back to your network, i.e. use your normal IP (from DHCP or a static IP within your subnet).

The next step is to run the firmware updater in debug mode, and the instructions can be found at this video:

http://www.youtube.com/watch?v=Pu4HI6XoSB8

With the debug mode, you can ask the NAS to rebuild the drives partition and put back all necessary files onto the hard drive for normal boot.


Monday, May 14, 2012

SSIS Tips and Tricks

Recently I have got myself involved in developing Sql Server Integrate Services (SSIS) packages.  While I was doing it I had picked up a few tips and tricks that I would like to share here.

First trick is to pass parameters from Job Agent into SSIS.  It is possible to assign values to your package on Agent Job's configuration tool.  Details can be found at:

http://www.buildingmeaning.com/?p=171

For example, if you are a package variable called Subject, then you can set (override) this variable with the steps decribed in the link by adding the property path \Package.Variables[User::Subject].Properties[Value] with the desired value.

Second trick is to connect to your data source setup in your package from Script Task.  For example, if you have a data source called "My Data Source" setup in your SSIS, and you can use it in Script Task by doing:-

SqlConnection conn = Dts.Connections["My Data Source"].AcquireConnection(Dts.Transaction) as SqlConnection;


http://msdn.microsoft.com/en-us/library/ms136018.aspx


Third is actually a tip for preventing SQL injection by using parameterized sql

SqlCommand command = new SqlCommand(commandText, conn);
command.Parameters.Add("@ID", SqlDbType.Int);
command.Parameters["@ID"].Value = customerID;

The above specifics the ID is an integer type, so it can prevent values that is not a valid integer.

Hope you find them useful.


Monday, April 23, 2012

Create Playlist for Android Device

Today, I stumble upon this blog on creating playlist for Android device.  What a life saver it is.  It is great to have large capacity memory card for your musics, however, it is can be a pain to create playlist.

Anyway, this blog (http://foss-boss.blogspot.co.uk/2009/11/create-mega-playlists-from-your-pc.html) just makes things so easy.

However, I would like to add some of my inputs to it.  The command

dir /b > playlist.m3u

works great if you have all your mp3 in a flat file structure, i.e. no directories.  However, if you have sub-directories, you need to do a bit more than running the command, and here are the steps:

1) dir /s /b > playlist.m3u
2) open the playlist.m3u with a text editor
3) use find and replace to remove any trace of parent directory path.  For instance, if you are in c:\media\mp3 and your playlist.m3u is within this directory, then you need to search for all trace of c:\media\mp3, and replace with blank.
4) use find and replace to look for backward slashes (\), and replace them with forward slashes (/)
5) Save the file, and you are good to go!

Friday, February 24, 2012

Moving from Ubuntu 11.10 to Kubuntu 11.10

When KDE moves to 4, I move to Gnome with Ubuntu mainly due to its file manager.  However, lately Gnome and Unity (not just Unity, in fact, it isn't that bad ... try Metro in Windows 8) gives me issues here and there.  These issues are all minor, but enough to annoy me.  Anyway, as you can guess what this post is about.  I move back to Ubuntu after gave KDE another go.  On the same hardware, it just runs better than Gnome.  It fews things are smoother, and things seem to work better.  For instance, simple thing as notifications.  With Compiz on, it gives me issues occasionally.  For instance, the transparency not display properly etc.

So far, my experience with KDE (Kubuntu) is much more pleasant than than Gnome 3 or Unity.

Update:
I had problem problems with DVD/CD writings with Gnome's bundled software.  On the same machine, K3b works perfectly.  I guess I am safely to say it is software issues.

Tuesday, January 3, 2012

Ubuntu ... where are you?!

I know Ubuntu 11.10 is not a LTS release, but it surely can't be this bad, can it?

One of the reason I upgrade to the new version of Ubuntu is the new version 3 Linux kernel.  However, I do not know where I should point my fingers to, many thinks works well in version 2.x are seriously broken.  For instance, ever since I have upgraded my machines to Ubuntu 11.10, both my laptop and my desktop (okay, both machines use Intel crappy graphics) fails to switch back on the screens after the screen goes into power saving.  I have tried different suggestions from different forums, at the end, I have to disable the power saving (for screen) at least completely (with little success).  Even after I have switched off the options to switch off the screen when idles for both machine, I still having problem at certain situations.  Now, I am really worry each time when I close my laptop lid as I do not know it will come back properly.  There are many time I need to restart the machine complete to regain the screen.

Another problem I have is the sound on my desktop.  It is still broken.  Although the new kernel is certainly running faster and seemingly lighter, I would advise you to stay on the old version of Ubuntu if you can.