Installing pear php in ubuntu machine helps you to use existing libraries to make our development easy. In terminal, run the following command: [code] sudo apt-get install php-pear [/code]
Category: Linux
Permanent link to this article: https://blog.openshell.in/2013/02/how-to-install-pear-php-in-ubuntu/
Jan 17
Loop mysql result set multiple times or twice in php
First we will select something from the database and loop through it like so: [php] $result = mysql_query("SELECT * FROM my_table"); while($row = mysql_fetch_assoc($result)) { // inside the loop } [/php] Problem: if you want to loop through the same result set again, you will get an error because the internal pointer is currently at …
Permanent link to this article: https://blog.openshell.in/2013/01/loop-mysql-result-set-multiple-times-or-twice-in-php/
Jan 15
SSH Login without password
Steps to ssh login into remote server without entering password. ssh-keygen creates the public and private keys. ssh-copy-id copies the local-host’s public key to the remote-host’s authorized_keys file. ssh-copy-id also assigns proper permission to the remote-host’s home, ~/.ssh, and ~/.ssh/authorized_keys. 1) Create public and private keys using ssh-keygen thangaraj@thangaraj-Insp:~$ ssh-keygen -t dsa Generating public/private dsa …
Permanent link to this article: https://blog.openshell.in/2013/01/ssh-login-without-password/
Jan 15
Cassandra basic commands:
Create keyspace: create keyspace Keyspace1; Create column family: // This command is used to create column family and mention comparator, default_validation_class and key_validation_class to insert rows for undefined column. create column family column_family1 with comparator=UTF8Type and default_validation_class=UTF8Type and key_validation_class=UTF8Type; Update column family: update column family column_family1 with column_metadata = [ {column_name: first, validation_class: UTF8Type}, {column_name: …
Permanent link to this article: https://blog.openshell.in/2013/01/cassandra-basic-commands/
Jan 15
Export Hive data into CSV file
Use the following command used to export hive data into CSV file. set hive.io.output.fileformat = CSVTextFile; INSERT OVERWRITE LOCAL DIRECTORY ‘dir_path’ SELECT FIELD1, FIELD2, FIELD3 FROM TABLE1;
Permanent link to this article: https://blog.openshell.in/2013/01/export-hive-data-into-csv-file/
Jan 01
How to reload your bashrc file
How to reload your bashrc file Here’s a quick way to reload your bachrc file without having to invoke a new shell. [code] [root@user]# source ~/.bashrc or [root@user]# . ~/.bashrc [/code]
Permanent link to this article: https://blog.openshell.in/2013/01/how-to-reload-your-bashrc-file/
Apr 15
YII Primary Key error
Error: Table “user” does not have a primary key. Solution: The crud command requires primary key to be defined in your tables. If you are working with legacy tables and can’t specify primary key, you can declare it in primaryKey() method of your model class. override method primaryKey in protected/models/User.php [php] public function primaryKey() { …
Permanent link to this article: https://blog.openshell.in/2012/04/yii-primary-key-error/
Sep 23
PHP characters limitation
Characters limitation will helps to display limited number of characters to display. [php] function limit_characters( $str, $n ) { if ( strlen ( $str ) <= $n ) { return $str; } else { return substr ( $str, 0, $n ) . ‘…’; } } [/php]
Permanent link to this article: https://blog.openshell.in/2011/09/php-characters-limitation/
Aug 10
Setting up dual ip address in ubuntu
Hi, here is a simple way to setup dual ip in your ubuntu system if you already have eth0 as 192.168.0.10 then if you want 192.168.1.10 then use the following command to bring up a alias but this is temporary sudo ifconfig eth0:0 192.168.1.11 up To have a permanent dual ip update the /etc/network/interfaces file like the below …
Permanent link to this article: https://blog.openshell.in/2011/08/setting-up-dual-ip-address-in-ubuntu/
Aug 10
Using Dialup modems in ubuntu
hi all, Everyone will be familiar with configuring wired and wireless network in Ubuntu. But still at some point of time we may have the need to use dialup modem in ubuntu. here is a simple way to configure dialup modems in ubuntu. The following command will install gnome-ppp which is a gui based configuration tool for …
Permanent link to this article: https://blog.openshell.in/2011/08/using-dialup-modems-in-ubuntu/