script or css file failed to load when using assetic

This problem happens when apache or nginx lacks the write permission to dump files to the web directory.

understanding drupal 7's render array api

drupal's render API provides great flexibility for themers and module developers to change the rendering of page, and it is the fundamental element of a drupal page rendering.
as the name implies, it is just an associative php array with predefined elements and data structure that conforms to drupal's theme system.
It took me some time to understand how the render APi actually work.Here i want to share my experience in learning about drupal render api with a simple module.

Create a drupal module

First of all, let's create 2 files under sites/all/modules/:


Unpack and pack Rockchip boot.img image (RK3066/RK3188)

Rockchip's boot image is different from standard Android boot image in that it does not contain a kernel image. actually, it's a gizped cpio ramdisk image that takes over the booting process from the kernel. In addition, there is a 8 byte header in the boot image and you need to strip that part off before you can uncompress it using gzip command.

unpack the boot images

As mentioned before, first we need to remove the 8 byte header from the image. The command is

dd if=boot.img of=boot.img.gz skip=8 bs=1 count=100000000000

Get USB HDD to sleep in Ubuntu automatically

I installed Ubuntu on my Android TV stick MK908 and have been using it as a low-powered home server. Tiny as it is , it delivers very decent performance. I set up mail, ftp, http, VPN ansd smb servers on it, and it’s been running pretty well so far. But one problem is that the USB HDD being attached to it got very hot in the morning. That means the USB HDD was not put into suspend mode even the computer had entered into standby mode. After googling for a while, i came across HD-IDLE, which can suspend your USB HDD after a specified period of time.

Install Ubuntu on Android TV sticks(MK908/MK802IV)


If you own a top-level domain and want to point it to a server in your home or office, you don't have to use paid services offered by orother DDNS service providers. There exist better free solutions. DNSPOD is one of these free DDNS services. DNSPOD is free DNS service from China and it provides very fast DNS update. Once you update your domains to new IP in your account, you can see the change almost instantly. Best of all, they have an API which allows you to write your own script to update your account automatically.

Install owncloud on OpenWrt router in 3 steps

There are an abundance of articles about Owncloud on the web so i will skip telling you about what Owncloud is for. But many of Owncloud howto articles focus on installing Owncloud on VPS or shared virtual host, which you don't have total control over. It's still possible that your service providers can access your data without you knowing it. So If you are really serious about protecting your data, you should host it on your home server.

Subscribe to gizfun RSS