Saturday, April 26, 2014

website security: disable apache signature

1. open apache config and set ServerTokens to Prod.
 /etc/apache2/conf.d/security

2. set ServerSignature to Off

3. set expose_php to off in php.ini file.


GIT: How to secure git deployment on website

follow below instructions to secure git folder on website:

a) create .htaccess in .git folder

b) add below lines to it

Order deny,allow
Deny from all

Friday, April 25, 2014

Android: How to get listview item with class object

refer below code:

    public void onItemClick(AdapterView<?> parent, View arg1, int position, long arg3) {
   
     StringIdRowItem entry= (StringIdRowItem) parent.getAdapter().getItem(position);

Friday, April 11, 2014

MySql: How to check status

run below query:

mysqladmin -u root -p status

Know slow queries..

enable below lines in /etc/mysql/my.conf

log-slow-queries
long_query_time = 1

Memcached: How to check status

use below command:

echo stats | nc 127.0.0.1 11211


Wednesday, April 9, 2014

Ubuntu 13.10- webserver setup

few things to install

sudo apt-get install php5-json


Right ownership:

1. add admin user to www-data group
sudo adduser <user> www-data


Give ownership of /var/www to www-data group

sudo chown -R :www-data /var/www

sudo chmod -R 775 /var/www

7=> user all permission
7=> group all permission




Tuesday, April 8, 2014

Android dev on ubuntu 64 bit

Launch eclipse:

UBUNTU_MENUPROXY= /home/bhola/android-sdk/eclipse/eclipse

x386 libraries needed:

sudo apt-get install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386


sudo apt-get install libsdl1.2debian:i386

Fix flickering mouse in ubuntu

Fix: Open system-> Display

2. select "unknown display"

3. Disable it.

Sunday, April 6, 2014

Ubuntu: Light weight Desktop install

Install Lubuntu

sudo apt-get install lubuntu-desktop

it is very fast.

Ubuntu: Important keyboard short-cuts

Terminal: Alt+ Ctr+ T

virtual session to UI switch: Alt+F7

virtual session: Cntr+ Alt+F1




Ubuntu: How to speed it up

1. check "Start Up Preferences"
2. Install BUM  (boot up manager)
3. Move /tmp to RAM

sudo vim /etc/fstab

tmpfs /tmp tmpfs defaults,noexec,nosuid 0 0