Tagged: tips

How to setup Xubuntu on Ubuntu-Server

I recently started using Ubuntu and I really liked the way things work in Ubuntu. I really like that when you setup Ubuntu Server distribution it does not come with GUI at all and that way it saves us from spending few mega-bytes of memory and we won’t be wasting around 200MB behind graphical display and related processes, which we won’t be using on the Server OS which usually does it’s job without requiring us to install any GUI application on the Server.
But well many a time we may want to setup light weight x-window system on our Linux (Ubuntu) system and we can do that with setting up Xface or it’s Ubuntu name as “Xubuntu”.
To setup lightweight Xface or Xubuntu system on your Ubuntu Server setup you just need to follow some simple commands and that’s it, you are done.

Truncate last N lines of a file using PHP

For one of my project I needed to remove certain footer / tail-end lines from the file to make it clean as it was containing some summary of records within the file. Because if I do that it can be directly loaded into database by LOAD DATA command. To remove lines from the end of file you can use following snippet of code:

jQuery case-insensitive Contains Expression..!

Most of the time to search through DOM and filter text we need a jQuery Expression/filter which gives us case-insensitive result. I believe it’s required to have it as a part of jQuery base-library but anyway writing your own is very simple.

I have gone through some of other implementation before writing this but here this version is complete copy of jQuery library’s “contains” filter except it is case-insensitive.

Reading MSSQL BLOG column data with PHP

I was working on a migration script to transfer data from legacy desktop software to Portal we have developed. While migrating attachments (stored as TIFF files) in BLOB (Long Binary) in Microsoft SQL Database Server using PHP it was not a cake-walk. When I observed every time it was creating a file of same size (4KB). I quickly understood that there is some limitation (of size) for reading records in PHP configuration.

Posting or Uploading Files using cURL with PHP

cURL is very important tool for PHP programmers, we tends to do so many thing with using this tool. Posting data, imitating a form post and lot more, it’s usage is countless. Some time back I came across situation where we have to post files to a 3rd party faxing service. I knew there are many possibilities but I didn’t wanted to get into sockets and file stream to get this done, just wanted to post FILE in addition to rest of the post data.

How to auto-restart Windows Service upon failure

If you’re one of those who is administering Windows as a web-server administrator or as a windows admin and you need to take some action upon failure of your windows-service then right click on service for which you want to set recovery go to “Properties > Recovery” and choose action for First, Second and Subsequent failures of the service.