ubuntu开发环境的配置

早就想补篇开发环境的配置了!

自己常用的本地开发有两种,一种是window下samba映射Linux,另一种就是Ubuntu桌面系统了。

win映射linux,我也很无奈啊,谁不想用原生的开发呢。。。工作中从最开始debian到centos6.5,自己私下却最习惯ubuntu。

samba配置很繁琐,这里只简单记录相关配置,包括了ssh的安装等。windows下用secureCRT还是比较方便的,ssh连接本地或者连接云都好。

详细配置如下,shell脚本运行,一了百了。


#!/bin/bash
# for ubuntu development yyq
echo "\nfffffffffff start \n"

echo "sudo passwd \n su root \n"

echo "1314" |sudo -S apt-get update
var_curuser="$USER"


if ! dpkg -s samba |grep Status > /dev/null; then 
    sudo apt-get install samba

    # sudo vim /etc/samba/smb.conf
    samba_f="/etc/samba/smb.conf"
    sudo sh -c "/bin/cat >>$samba_f" <<EOM
[$var_curuser]
path=/home/$var_curuser
available=yes
browseable=yes
public=yes
writable=yes
valid users=$var_curuser
read only=no
EOM

    sudo smbpasswd -a $var_curuser
    # nmbd start with smbd
    sudo service smbd restart
    echo "\nsamba installed \n"
else
    echo "\nsamba installed already \n"
fi


if ! dpkg -s ssh |grep Status > /dev/null; then 
    sudo apt-get install ssh
    setenforce 1
    echo "\nif err,del /var/run/nologin"
    echo "ssh installed \n"
else
    echo "\nssh installed already \n"
fi


if ! dpkg -s mysql-server |grep Status > /dev/null; then
    sudo apt-get install mysql-server
    sudo apt-get install libmysqlclient-dev
    sudo apt-get install libmariadbclient-dev
    sudo ufw allow mysql
    sudo systemctl start mysql
    sudo systemctl enable mysql

    /bin/cat <<EOF
to remote login, vim '/etc/mysql/mysql.conf.d/mysqld.cnf' and comment out 'bind-address = 127.0.0.1' 

UPDATE mysql.user SET Password = PASSWORD('password') WHERE User = 'root';
GRANT ALL PRIVILEGES ON *.* to root@'%' identified by 'pwd';
FLUSH PRIVILEGES;
EOF
    mysql -u root -p
    echo "\nmysql-server installed \n"
else
    echo "\nmysql-server installed already \n"
fi


if ! dpkg -s git |grep Status > /dev/null;then
    sudo apt-get install git
    echo "\ngit installed \n"
else
    echo "\ngit installed already \n"
fi


if ! command -v python3.6 > /dev/null;then
    sudo apt-get install build-essential checkinstall
    sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
    wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
    tar xvf Python-3.6.0.tar.xz
    cd Python-3.6.0/
    ./configure
    sudo make altinstall

    sudo apt-get install virtualenv
    echo "\npython3.6 and virtualenv installed \n"
else
    echo "\npython3.6 and virtualenv installed already \n"
fi


: '
#others depends install
sudo apt-get install redis-server

sudo apt-get install rabbitmq-server
'


echo "\n************ end \n"