Thursday, October 30, 2014

mediatemple Premium WordPress hosting for just $5.

mediatemple Premium WordPress hosting for just $5.


For two days only, promote our unbeatable web hosting at an unbelievable introductory price: $5 for the first month of Premium WordPress hosting. Just use promo code PremiumWP5 at checkout. Offer valid for the first month only.

This offer is only good for 2 days only, so hurry up, click below link:



mediatemple Premium WordPress hosting for just $5.

How To Set Up SSH Keys on Debian/Ubuntu

How To Set Up SSH Keys on Debian/Ubuntu


ssh-keygen -t rsa

You will be prompted for a location to save the keys, and a passphrase for the keys. This passphrase will protect your private key while it’s stored on the hard drive and be required to use the keys every time you need to login to a key-based system:


Generating public/private rsa key pair.

Enter file in which to save the key (/home/b/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/b/.ssh/id_rsa.

Your public key has been saved in /home/b/.ssh/id_rsa.pub.


cp id_rsa.pub authorized_keys
chmod 700 ~/.ssh
chmod 600 authorized_keys

Then edit your /etc/ssh/sshd_config to:


AuthorizedKeysFile /etc/ssh/%u/authorized_keys

Finally, restart ssh with:



service ssh restart

On the host computer, ensure that the /etc/ssh/sshd_config contains the following lines, and that they are uncommented;


PubkeyAuthentication yes

RSAAuthentication yes


if disable the PasswordAuthentication,change

PasswordAuthentication yes

to

PasswordAuthentication no



How To Set Up SSH Keys on Debian/Ubuntu

How To Install and Configure Varnish 3 with Apache on Debian

How To Install and Configure Varnish 3 with Apache on Debian


About Varnish

Varnish is an HTTP accelerator designed for content-heavy dynamic web sites as well as heavily consumed APIs. In contrast to other web accelerators, such as Squid, which began life as a client-side cache, or Apache and nginx, which are primarily origin servers, Varnish was designed as an HTTP accelerator. Varnish is focused exclusively on HTTP, unlike other proxy servers that often support FTP, SMTP and other network protocols.


Setup

Apache and Varnish


apt-get install apache2

Step One—Install Varnish


The varnish site recommends installing the varnish package through their repository.


You can start that process by grabbing the repository:


curl http://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add -

The next step is to add the repository to the list of apt sources. Go ahead and open up that file.


vim /etc/apt/sources.list

Once inside the file, add the varnish repository to the list of sources.


deb http://repo.varnish-cache.org/ubuntu/ lucid varnish-3.0

Save and exit.


Finally, update apt-get and install varnish.


apt-get update
apt-get install varnish

Step Two—Configure Varnish

Varnish will serve the content on port 80, while fetching it from apache which will run on port 8080.

vim /etc/default/varnish


DAEMON_OPTS="-a :80 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,256m"

Once you save and exit out of that file, open up the default.vcl file:


vim /etc/varnish/default.vcl

The configuration should like this:


backend default 
.host = "127.0.0.1";
.port = "8080";

if enbale esi


 sub vcl_fetch 
set beresp.do_esi = true; /* Do ESI processing */
set beresp.ttl = 24 h; /* Sets the TTL on the HTML above */

Step Three—Configure Apache


vim /etc/apache2/ports.conf

Change the port number for both the NameVirtualHost and the Listen line to port 8080, and the virtual host should only be accessible from the localhost. The configuration should look like this:


NameVirtualHost 127.0.0.1:8080
Listen 127.0.0.1:8080

Change these settings in the default virtual host


vim /etc/apache2/sites-available/default

<VirtualHost 127.0.0.1:8080>

Save and exit the file and proceed to restart Apache and Varnish.


service apache2 restart
service varnish restart

or manual start varnish


varnishd -f /etc/varnish/default.vcl -s malloc,128M -T 127.0.0.1:2000 -a 0.0.0.0:999 -d


How To Install and Configure Varnish 3 with Apache on Debian

Wednesday, October 22, 2014

How to uninstall gnome environment on debian

How to uninstall gnome environment on debian


aptitude purge liborbit2


How to uninstall gnome environment on debian

Grails Service Get session,response,request,servletContext

Grails Service, Get session,response,request,servletContext


import org.codehaus.groovy.grails.web.util.WebUtils
import org.springframework.web.context.request.RequestContextHolder

……

//Getting the Request object

def getRequest()
def webUtils = WebUtils.retrieveGrailsWebRequest()
webUtils.getCurrentRequest()


//Getting the Response object

def getResponse()
def webUtils = WebUtils.retrieveGrailsWebRequest()
webUtils.getCurrentResponse()


//Getting the ServletContext object

def getServletContext()
def webUtils = WebUtils.retrieveGrailsWebRequest()
webUtils.getServletContext()


//Getting the Session object

def getSession()
RequestContextHolder.currentRequestAttributes().getSession()



Grails Service Get session,response,request,servletContext

Getting Spring Context in Grails BootStrap

Getting Spring Context in Grails BootStrap


import org.springframework.web.context.support.WebApplicationContextUtils

class BootStrap

def init = servletContext ->
// Get spring
def springContext = WebApplicationContextUtils.getWebApplicationContext( servletContext )



Getting Spring Context in Grails BootStrap