fbpx

Setup of ubuntu server or ubuntu desktop on VirtualBox

This tutorial will guide you to install and configure things like ubuntu 14.04, virtualbox, putty, apache, php, mysql, tweaking apache and php. Also give a brief intro to server administration panel called webmin. Download & Install VirtualBox and download Ubuntu 14.04. Once you have downloaded VirtualBox and Ubuntu click "Insert Guest...

Read more...

Batch replacing of multiple exact name in a single query with mysql REGEXP

MySQL allows the following regular expression metacharacters: . match any character ? match zero or one * match zero or more + match one or more {n} match n times {m,n} match m through n times {n,} match n or more times ^ beginning of line $ end of line [[:<:]] match beginning of words [[:>:]] match ending of...

Read more...

partition a mysql table with number of rows

Specify the table name where <TABLE_NAME> is given and specify the column name by which you want to do partition. 10, 20, 30, 40 are the numbers  by which the partition would be created. ALTER TABLE <TABLE_NAME> PARTITION BY RANGE(id) ( PARTITION p1 VALUES LESS THAN (10), PARTITION p2 VALUES LESS THAN (20), PARTITION...

Read more...

show mysql rows in one column

Using MySQL, I can list the category but want rows to transpose in single column comma separated. select category_name from categories Result: Rock POP Jazz Desired Result: Rock, POP,Jazz Solution: You can achive this by using group_concat function in mysql. select group_concat(category_name separator ', ') from categories;   Reference: http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat

Read more...

Capitalize the first letter of every word in MySql query

A simple MySQL function to capitalize the first letter of every word in a string. CREATE FUNCTION CAP_FIRST (input VARCHAR(255)) RETURNS VARCHAR(255) DETERMINISTIC BEGIN DECLARE len INT; DECLARE i INT; SET len = CHAR_LENGTH(input); SET input = LOWER(input); SET i = 0; WHILE (i < len) DO IF (MID(input,i,1) = ' ' OR i = 0) THEN IF (i < len)...

Read more...

How do sites prevent vanity URLs from colliding with future features?

It's easy to check if a vanity URL collides with a current feature, but hard to predict everything you would like to build in the future. Here is a list of some reserve keywords which can collide with the future features you would be implementing. about account activate add admin administrator api app apple apps archive archives auth better blog cache cancel careers cart changelog checkout codereview compare config configuration connect contact create delete direct_messages documentation download downloads edit email employment enterprise facebook faq favorites feed feedback feeds fleet fleets follow followers following friend friends gist github google group help groups home jobs hosting hosting url hostmaster idea ideas imulus index info invitations invite is it login logout job json language languages lists logs mail map maps mine mis news oauth oauth_clients offers openid order orders organizations plans popular post postmaster privacy projects put recruitment register remove replies root rss sales signup save search security sessions settings shop sitemap ssl ssladmin ssladministrator sslwebmaster stacks status stories styleguide subscribe subscriptions support supportdetails support-details sysadmin sysadministrator terms tour translations trends twitter unfollow unsubscribe url user twittr widget widgets wiki update xfn weather xmpp webmaster ww www wwww xml yaml yml

Read more...

How to bulk update mysql quries

This is a very short and handy mysql query to update all records. There was a small sql injection in my database and i replaced the specific code from the "tag" and updated all the records. UPDATE tags SET keywords = REPLACE( keywords, " , ABC.com", ""  ) There was another issue...

Read more...

What is MongoDB

What is NoSQL? NoSQL is a kind of database that, unlike most relational databases, does not provide a SQL interface to manipulate data. NoSQL databases usually organize the data in a different way other than tables. NoSQL databases are divided into three categories: column-oriented, key-value pairs, and document-oriented databases. This article...

Read more...

CHMOD Permissions sets

  U G W rwx rwx rwx chmod 777 filename rwx rwx r-x chmod 775 filename rwx r-x r-x chmod 755 filename rw- rw- r-- chmod 664 filename rw- r-- r-- chmod 644 filename U = User G = Group W = World r = Readable w = writable x = executable - = no permission   Here is another way of looking at...

Read more...

Google Search Cheat Sheet

Google Shortcut Finds Pages That Have... nokia phone the words nokia and phone sailing OR boating either the word sailing or the word boating "love me tender" the exact phrase love me tender printer -cartridge the word printer but NOT the word cartridge Toy Story +2 movie title including the number 2 ~auto looks up the word auto and synonyms define:serendipity definitions of the...

Read more...