Convert Ubuntu Server to authenticate with SSH key only and make user sudoer with no password

Make user Sudoer:

[code]
adduser ubuntu
usermod -aG sudo ubuntu
Edit sudoers "/etc/sudoers"password to don’t require password:
%sudo ALL=(ALL) NOPASSWD: ALL
[/code]

Edit SSH configuration to authenticate by SSH key only: /etc/ssh/sshd_config

[code]
PermitEmptyPasswords yes
PasswordAuthentication no
[/code]

ubuntu” by DudeOmega is licensed under CC BY

Install PHP with Postgres support using HomeBrew

Most of the information is taken from this article:
http://justinhileman.info/article/reinstalling-php-on-mac-os-x/

1. Add the Formulas

[code]
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
[/code]

2. Install PHP with Postgres support

[code]
brew install php56 –without-mysql –without-apache –with-pgsql

[/code]

3. Make sure it uses the Right Path

[code]
export PATH="$(brew –prefix)/bin:$PATH"
[/code]

command ‘x86_64-linux-gnu-gcc’ failed with exit status in Python Django project

Typical error when a library that you want to install needs to compile and use some system libraries.

First make sure you have:

python-dev

gcc

[code]
apt get install python
[/code]

Other libraries that could be needed:

[code]
sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev

[/code]

 

How to install Varnish on CPANEL Server

Installation

1. Make Apache listen in any other port other than 80. Here I am making Apache to listen in port 8080. It can be done in two ways. Either editing the httpd.conf file or editing the Tweak settings in WHM

a) Editing httpd.conf file

# vi /usr/local/apache/conf/httpd.conf

Locate the following line in /usr/local/apache/conf/httpd.conf file and change the port from 80 to 8080

Listen 0.0.0.0:80

Once edited, the Apache config file for “Listen” should be as follows:

# grep -iw listen /usr/local/apache/conf/httpd.conf
Listen 0.0.0.0:8080

OR

b) Editing WHM – Tweak settings

WHM > Tweak Settings > Apache non-SSL IP/port

Set the port to 8080 and save the settings.

varnish1

2. Install Varnish repository

Download and install the varnish repository depending on your architecture. For CentOS 5 and Redhat5 use el5 whereas for CentOS 6 and Redhat6 use el6.

For me, it was el5.

# wget http://repo.varnish-cache.org/redhat/varnish-3.0/el5/noarch/varnish-release/varnish-release-3.0-1.noarch.rpm
 # rpm -Uvh varnish-release-3.0-1.noarch.rpm

3. Install Varnish

# yum install varnish

4. Edit the configuration file for varnish /etc/sysconfig/varnish and change the value of VARNISH_LISTEN_PORT to 80

# grep VARNISH_LISTEN_PORT /etc/sysconfig/varnish
VARNISH_LISTEN_PORT=80

5. Edit Varnish config: /etc/varnish/default.vcl . Correct the IP address in this file to your IP address and port to 80

backend default {
  .host = "YOUR IP ADDRESS";
  .port = "80";
}

6. Start Varnish service on your server

# chkconfig varnish on
# service varnish start
# service varnish start
Starting Varnish Cache:                                    [  OK  ]

That’s it!!

You can check this by using the netstat command.

#netstat -plan | grep :80

Example:

# netstat -plan | grep :80
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      15129/varnishd      
tcp        0      0 0.0.0.0:8080                0.0.0.0:*                   LISTEN      12897/httpd        

Now, you can start monitor your Varnish with varnishstat

varnish2

If you need to change your Varnish configuration file and you can test the configuration before restarting Varnish service by

# varnishd -C -f /etc/varnish/default.vcl

Note: While doing “yum install varnish” if you are getting libedit error, then follow the steps below:

varnish-3.0.5-1.el5.centos.x86_64 from varnish-3.0 has depsolving problems
  --> Missing Dependency: libedit.so.0()(64bit) is needed by package varnish-3.0.5-1.el5.centos.x86_64 (varnish-3.0)
Error: Missing Dependency: libedit.so.0()(64bit) is needed by package varnish-3.0.5-1.el5.centos.x86_64 (varnish-3.0)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.

In this case, you need to install the libedit rpm which is suitable for your architecture. You can find the rpm from http://rpmfind.net/linux/rpm2html

# wget ftp://rpmfind.net/linux/dag/redhat/el5/en/x86_64/dag/RPMS/libedit-20090923-3.0_1.el5.rf.x86_64.rpm
# rpm -ivh libedit-20090923-3.0_1.el5.rf.x86_64.rpm

Example:

# rpm -ivh libedit-20090923-3.0_1.el5.rf.x86_64.rpm
warning: libedit-20090923-3.0_1.el5.rf.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
   1:libedit                ########################################### [100%]

Done!!!

Reference:

How to enable Varnish in cPanel server

Phonegap Cross-platform Mobile development

PhoneGap is a mobile development framework produced by Nitobi, purchased by Adobe Systems.[3][4] It enables software programmers to build applications for mobile devices using JavaScript, HTML5 and CSS3, instead of device-specific languages such as Objective-C.[5] The resulting applications are hybrid, meaning that they are neither truly native (because all layout rendering is done via web views instead of the platform’s native UI framework) nor purely web-based (because they are not just web apps, but are packaged as apps for distribution and have access to native device APIs). From 1.9 version onward it is even possible to freely mix native and hybrid code snippets. The software underlying PhoneGap is Apache Cordova.[6] The software was previously called just “PhoneGap”, then “Apache Callback”.[7][8] Apache Cordova is open source software.

Getting Started Guide:

http://docs.phonegap.com/en/edge/guide_platforms_index.md.html

Phonegap Build

https://build.phonegap.com/

PhoneGap 0.8 on Android 2.0 SDK isn’t working” by Kai Hendry is licensed under CC BY