setup git server ubuntu 14.04 lts

install git on both gitserver and client

ssh-copy-id the publickey from client to server
mkdir -p /files/webdir.git
cd /files/webdir.git
git init --bare
chown -R gituser:gituser /files/

##On client-A

git config --global user.name "Joe blog"
git config --global user.email "joe@example.com"

we create our local git repo on /developer/djangoproject

mkdir -p /developer/djangoproject
cd /developer/djangoproject
git init .
git remote add origin root@gitserver:/files/webdir.git

to edit >> git remote set-url origin root@gitserver:/files/webdir.git

echo "hello" > index.html
git add .
git commit -m "first commits"

git push origin master

    Counting objects: 3, done.
    Writing objects: 100% (3/3), 212 bytes | 0 bytes/s, done.
    Total 3 (delta 0), reused 0 (delta 0)
    To root@gitserver:/files/webdir.git
    * [new branch]      master -> master

   
### On client-B
git clone root@gitserver:/files/webdir.git OR
git clone root@192.168.100.221:/files/webdir.git




enable ssh root login linux

vim /etc/ssh/sshd_config

#PermitRootLogin without-password

PermitRootLogin yes

enable ssh password authentication

vim /etc/ssh/sshd_config
#place below at end of file

PasswordAuthentication yes

##Enable root login

vim /etc/ssh/sshd_config

#PermitRootLogin without-password
PermitRootLogin yes

perl setting locale failed

root@server:~# /usr/lib/cgi-bin/awstats.pl -config=hottiehunter.com -update
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_PAPER = "ne_NP",
    LC_ADDRESS = "ne_NP",
    LC_MONETARY = "ne_NP",
    LC_NUMERIC = "ne_NP",
    LC_TELEPHONE = "ne_NP",
    LC_IDENTIFICATION = "ne_NP",
    LC_MEASUREMENT = "ne_NP",
    LC_NAME = "ne_NP",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

########## solution ################
http://stackoverflow.com/questions/2499794/how-can-i-fix-a-locale-warning-from-perl

"locale" is a subset of the user's environment that defines the user's language, country and any special variant preferences that the user wants to see in their user interface


locale             << shows locale variables
copy below export commands to ~/.bashrc  file or run below commands

export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_TYPE=en_US.UTF-8

dpkg-reconfigure locales

vim /etc/default/locale

LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8



setup NTP on ubuntu 14.04 for utc timezone

apt-get install ntp ntpdate

apt-get install ntp ntpdate

cat /etc/ntp.conf
driftfile /var/lib/ntp/ntp.drift
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org
server ntp.ubuntu.com
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict ::1


service ntp restart

service cron stop && service cron start

Check ntp stats
================

#ntpq -pn

-p : Print a list of the peers known to the server as well as a summary of their state.
-n : Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names.


# ntpq -pn

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*131.107.13.100  .ACTS.           1 u   39   64  377    6.668   -1.887   2.894
+199.101.100.221 130.207.244.240  2 u   12   64  377   89.209   -8.376   1.750
-129.250.35.251  129.250.36.26    2 u   36   64  377   25.029   -8.342   3.061
+129.6.15.28     .ACTS.           1 u   34   64  377   78.681   -4.869  27.612
-91.189.89.199   170.224.124.217  2 u   40   64  377  141.474   -6.736   2.311


watch command linux

 By default watch command runs a command or script for every two seconds by default, we can increase or decrease the interval by using -n option
minimum is 0.1 second

#watch -n 0.1 -t  lsof -i

-t = supresses the time on top of display

postfix header check

https://www.howtoforge.com/community/threads/howto-spam-control-for-postfix.48608/
http://mattshaw.org/news/how-to-filter-mail-with-postfix-header_checks/

https://posluns.com/guides/header-checks/
https://www.howtoforge.com/community/threads/postfix-header-checks.80/

ispconfig3 setup on debian jessie remove default page setting

https://www.howtoforge.com/tutorial/perfect-server-debian-8-jessie-apache-bind-dovecot-ispconfig-3

+ remove /etc/apache2/sites-enabled/000-default..conf
or echo >  /etc/apache2/sites-enabled/000-default..conf

python pip install without cache

From documentation at https://pip.pypa.io/en/latest/reference/pip_install.html#caching:
Starting with v6.0, pip provides an on by default cache which functions similarly to that of a web browser. While the cache is on by default and is designed do the right thing by default you can disable the cache and always access PyPI by utilizing the --no-cache-dir option.

pip install pillow --no-cache-dir













install nethogs on centos 7

I’ve just found that ‘nethogs’, a bandwidth monitoring software is not covered in the EPEL for Centos 7. This is a memo for how to install nethogs on CentOS 7.

1. Install the dependencies necessary.
yum install libpcap-devel -y
2. Download and install the RPM package.
rpm -ivh http://cdn.kanachan.me.uk/dl/rpms/nethogs/nethogs-0.8.0-1.el6.x86_64.rpm