2015-07-10

Remove grub boot menu and ubuntu system from Win8 and ubuntu dual system

environment:
   win8 (x64) + ubuntu system

target:

  1. remove grub boot menu
  2. remove ubuntu system/partition

2015-06-24

MySql in ubuntu, and replication.


mysql install in Ubuntu:


  1. sudo apt-get update
  2. sudo apt-get install mysql-server
    1. modify for my.cnf (in /etc/mysql) :
      1. bind-address  = 10.1.1.1
    2. allow remote hosts to use root to login:
    1. mysql -u root -p
    1. mysql>use mysql;
    1. mysql>update user set host = '%' where user = 'root';
    1. mysql>flush privileges;
  3. replications:
    1. source db:
      • in my.cnf:
        • log-bin=C:/Program Files/MySQL/MySQL Server 5.0/log/replication.log
        • server-id=1
        • restart mysql
      • mysql --user=user --password=password
        • FLUSH TABLES WITH READ LOCK;
        • SHOW MASTER STATUS;
        • keep File, Position
      • mysqldump --user=user --password=password --all-databases --master-data | gzip > dbdump.db.gz
        • 備份部份 DB: mysqldump --databases db1 db2
      • after mysqldump, 
        • mysql>UNLOCK TABLES;
    2. slave db:
      • gunzip < dbdump.db.gz | mysql -p
        • or mysql --user=user --password=password < dbdump.db
      • mysql>STOP SLAVE;
        
        mysql>CHANGE MASTER TO 
        MASTER_HOST='host name',
        MASTER_PORT=3306,
        MASTER_USER='username',
        MASTER_PASSWORD='password',
        MASTER_LOG_FILE='logfile',
        MASTER_LOG_POS=recorded_log_position;
        
        mysql>START SLAVE;
      •  show slave status
    3. in Ubuntu, mysql table name 預設是區分大小寫:
      1. (in my.cnf) lower_case_table_names=1   不區分大小寫

others:
  1. ubuntu 時間設定:
    1. 如果有 ntp service: service ntp stop
    2. ntpdate xx.xx.xx.xx   (time server)

2015-06-07

First Python practice


  • 第一個 Python 練習
  • Environment:
    • windows 8
    • Python 3.4
    • IDE:
      • Visual Studio 2013 + Python Tool for Visual Studio (PTVS)
      • PyScripter
      • test other IDE:
        • Sublime Text
        • PyCharm: seems to need more resources to run it, like busy CPU.
  • Target:
    1. 跟 python 親近一點
    2. write function in another file
    3. read/write file (IO) with utf-8 encoding
    4. access MariaDB/MySQL database
    5. use GitHub: workingrichard/PythonFirst