分类 系统 下的文章

git 推送本地版本库到 github

1. 在github上建repository
先注册github账号,假设账号名zhangsan,repository名test

2. 配置git用户名和email
git config --global user.name "zhangsan"
git config --global user.email "zhangsan@163.com"

3. cd 到工程根目录,执行以下命令
git init .
git add .
git commit -m "first create"
git remote add origin https://github.com/zhangsan/test.git
git pull origin master
git push -u origin master

ubuntu 配置静态 ip

1. 修改/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp0s3
iface enp0s3 inet static
address 192.168.1.154
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
dns-nameservers 192.168.1.1

2. 重启网卡
/etc/init.d/networking restart

linux下web安装

  1. apache

    apt-get install apache2

  2. MySQL

    apt-get install mysql-server mysql-client

  3. PHP

    apt-get install php5 libapache2-mod-php5

  4. phpmyadmin

    apt-get install phpmyadmin

    ln -s /usr/share/phpmyadmin phpmyadmin

  5. 重启

    /etc/init.d/apache2 restart

ubuntu重置mysql密码

  1. 修改配置文件/etc/mysql/mysql.conf.d/mysqld.cnf
    在[mysqld]段下加入一行 skip-grant-tables

  2. 重启mysql服务
    service mysql restart

  3. 用空密码进入mysql,切换到mysql数据库
    mysql
    use mysql;

  4. 更新数据库密码记录
    update mysql.user set authentication_string=password('123qwe') where user='root' and Host ='localhost';
    update user set plugin="mysql_native_password";
    flush privileges;
    quit;

  5. 把skip-grant-tables去掉,再次执行步骤2

  6. 用新密码重新登录即可

ubuntu-16.04.2-server-amd64 连接wifi

首先查看自己网卡的信息:一般人的都是eth0,和wlan0,但在Ubuntu Server 16.04里面变成了enp4s0和wlp5s0,算是第一个坑吧,
ubuntu@ubuntu:~$ ip addr
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp4s0: mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 28:d2:44:98:33:2a brd ff:ff:ff:ff:ff:ff
3: wlp5s0: mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 18:cf:5e:00:84:ba brd ff:ff:ff:ff:ff:ff
inet 192.168.224.102/24 brd 192.168.224.255 scope global wlp5s0
valid_lft forever preferred_lft forever
inet6 fe80::1acf:5eff:fe00:84ba/64 scope link
valid_lft forever preferred_lft forever

把WiFi-ssid和密码写入一个配置文件
wpa_passphrase ssid password > xxx.conf
编辑网络配置文件vi /etc/network/interfaces
source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback
auto wlp5s0
iface wlp5s0 inet dhcp
wpa-conf /home/ubuntu/xxx.conf
# The primary network interface
接下来有几种方法获取ip地址:
自动获取ip地址:如果不行可以先reboot一下
dhclient wlp5s0
或者手动获取ip:如果不行可以先reboot一下
-B - fork into background
-c filename - path to configuration file
-i interface - interface to listen on
wpa_supplicant -i wlp5s0 -c /home/ubuntu/xxx.conf