Richard
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # LINUX-- ubuntu 16 共用方法1掛CD 2共用 3windows共用 ###### tags: `learn` USE 練習庫 INSERT INTO [練習庫].[dbo].[ 客戶](客編,名稱,信用額度) VALUES('C06','宏碁資訊','95000'), ('C07','聯強資訊','85000'), ('C08','大同資訊','90000') USE 練習庫 INSERT [dbo].[資一乙] ([學號],[NAME],[MALE],[國文],[英文]) SELECT [學號], [NAME],[SEX] AS [MALE],[國文],[英文] FROM [dbo].[資一甲] WHERE [SEX]='男' USE 練習庫 SELECT * INTO #主管薪資表 FROM [dbo].[華中資訊] WHERE [薪資]>60000 GO SELECT * FROM #主管薪資表 GO USE 練習庫 UPDATE [dbo].[華中資訊] SET [薪資]=[薪資]+2000 OUTPUT DELETED.員工編號 ,DELETED.姓名 ,DELETED.薪資 ApS 加薪前,INSERTED.薪資 AS 加薪後 WHERE [部門]='資訊部' [1](https://drive.google.com/drive/u/1/folders/1c_zoY_ySGDuV3E25f4lX_vo6ksja5-Go) ## 4月底 #### 0. 安裝失敗時刪除~ sudo rm -R /var/lib/apt/lists/lock 1.安裝插件 sudo apt-get install libaio1 libaio-dev 2.解壓縮 loaaaaaaadiiiiiing sudo tar -vxzf mariadb-10.1.38-linux-glibc_214-x86_64.tar.gz 3.add群組 sudo groupadd mysql 4.add user sudo useradd -r -g mysql -s /bin/false mysql 5.移動(cd download) sudo mv mariadb-10.1.38-linux-x86_64 /usr/local/mysql mariadb-10.1.38-linux-x86_64 位置:: cd /usr/local/mysql [change owner | group] sudo chown -R mysql . sudo chgrp -R mysql . [連結link-s]sudo rm /etc/my.cnf sudo ln -s /usr/local/mysql/support-files/my-medium.cnf /etc/my.cnf 6.建立安裝的資料夾,權限設定 sudo mkdir /MySQLData sudo chmod 777 -R /MySQLData [create a customer profile ||mysql -u root -p ] sudo gedit /etc/profile.d/customer.sh //add export PATH=/usr/local/mysql/bin:$PATH !!!save #### ------------------------------------ ## 7.安裝 sudo scripts/mysql_install_db --user=mysql --datadir=/MySQLData 8.[change] sudo chown -R root . sudo chown -R mysql MySQLData 9.[more] sudo gedit /etc/my.cnf ////////////////////////////add below line at mysqld datadir =/MySQLData 10.啟用 sudo bin/mysqld_safe --user=mysql& sudo ln -s /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql sudo /etc/init.d/mysql start 11.[create a customer profile ||mysql -u root -p ] sudo gedit /etc/profile.d/customer.sh //add export PATH=/usr/local/mysql/bin:$PATH !!!save 12.enable # sudo systemctl enable mysql # sudo systemctl is-enabled mysql ### testing /* login mysql */ mysql -u root -p MariaDB [(none)]> show databases ; /* exit mysql */ exit /* change mysql root password */ mysqladmin -u root password 'yourpassword' show database show tables use mysql ; create database sam >>dir [ login mysql ] mysql -u root -p MariaDB [(none)]> show databases ; /* exit mysql */ exit /* change mysql root password */ mysqladmin -u root password 'yourpassword' ## 5/1 ### 清除single server 列出 # ps -ef |grep mysql 停用 sudo systemctl disable mysql 停用 sudo /etc/init.d/mysql stop 刪除啟動檔 init.d sudo rm -f /etc/init.d/mysql 刪除 sudo rm -f /etc/my.cnf cd /MySQLData 清空 # sudo rm -fr * ls看一下 //清除 ### multi 3個server cd to MySQLData #### 1 sudo mkdir MySQL1 sudo mkdir MySQL2 sudo mkdir MySQL3 更改權限 sudo chown mysql:root * sudo chmod 777 -R * 進入/usr/local/mysql cd /usr/local/mysql 安裝x3 sudo scripts/mysql_install_db --user=mysql --datadir=/MySQLData/MySQL1 sudo scripts/mysql_install_db --user=mysql --datadir=/MySQLData/MySQL2 sudo scripts/mysql_install_db --user=mysql --datadir=/MySQLData/MySQL3 ### 建立multi sever to suport-file cd support-files 複製cnf sudo cp my-medium.cnf my-multi.cnf sudo chown root:mysql my-multi.cnf 調整權限 sudo chgrp mysql * 更改cnf要參考 網址 https://dev.mysql.com/doc/refman/8.0/en/mysqld-multi.html gedit sudo gedit /usr/local/mysql/support-files/my-multi.cnf 網址複製貼上 手動安裝路竟沒錯==local ;如果是自動安裝位置會跑掉 碼掉 [mysql] # # #在[mysqld] 後面加入 multi server 環境設定如下 [mysqld_multi] mysqld = /usr/local/mysql/bin/mysqld_safe mysqladmin = /usr/local/mysql/bin/mysqladmin user = multi_admin password = my_password [mysqld1] socket = /tmp/mysql.sock1 port = 3306 pid-file = /MySQLData/MySQL1/mysql1.pid datadir = /MySQLData/MySQL1 [mysqld2] socket = /tmp/mysql.sock2 port = 3307 pid-file = /MySQLData/MySQL2/mysql2.pid datadir = /MySQLData/MySQL2 [mysqld3] socket = /tmp/mysql.sock3 port = 3308 pid-file = /MySQLData/MySQL3/mysql3.pid datadir = /MySQLData/MySQL3 --- == ll /etc/my.cnf ll /etc/init.d/mysql== sudo rm -f /etc/my.cnf #產生/etc/my.cnf 連結 sudo ln -s /usr/local/mysql/support-files/my-multi.cnf /etc/my.cnf --- ps -ef |grep mysql sudo rm -f /etc/my.cnf cd /usr/local/mysql #建立my_print_defaults 程式連結 sudo ln -s /usr/local/mysql/bin/my_print_defaults /usr/bin/. #啟動safe 模式,目錄一 sudo bin/mysqld_safe --user=mysql --datadir=/MySQLData/MySQL1 & #啟動safe 模式,目錄二 sudo bin/mysqld_safe --user=mysql --datadir=/MySQLData/MySQL2 & #啟動safe 模式,目錄三 sudo bin/mysqld_safe --user=mysql --datadir=/MySQLData/MySQL3 & 建立起動的程式 #建立務啟動程式程式連結 sudo ln -s /usr/local/mysql/support-files/mysqld_multi.server /etc/init.d/mysql #啟動mysql sudo /etc/init.d/mysql start --- ### 複製貼上 cd /usr/local/mysql/support-files sudo gedit mysql.server # Comments to support LSB init script conventions ### BEGIN INIT INFO # Provides: mysql # Required-Start: $local_fs $network $remote_fs # Should-Start: ypbind nscd ldap ntpd xntpd # Required-Stop: $local_fs $network $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop MariaDB # Description: MariaDB is a very fast and reliable SQL database engine. ### END INIT INFO /etc/init.d/mysql version> --- #變更資料庫一密碼 mysqladmin -u root password '1' -h 127.0.0.1 -P 3306 #變更資料庫二密碼 mysqladmin -u root password '2' -h 127.0.0.1 -P 3307 #變更資料庫三密碼 mysqladmin -u root password '3' -h 127.0.0.1 -P 3308 mysql -u root -p 127.0.0.1 -P 3307 mysql -u root -p ## mid1 sudo rm -R /var/lib/apt/lists/lock sudo apt-get install openssl libssl-dev >>y extract zip ### __to your dir >>download right termi. 2.2.24 sudo ./configure --prefix=/usr/local/ZZZ --enable-so --enable-headers --enable-expires --enable-rewrite --enable-ssl ~~sudo ./configure --prefix=/opt/apache2 --enable-so --enable-headers --enable-expires --enable-rewrite --enable-ssl ~~ :+1: sudo make sudo make install [sudo rm /etc/init.d/httpd] sudo ln -s /usr/local/ZZZ/bin/apachectl /etc/init.d/httpd ~~sudo ln -s /opt/apache2/bin/apachectl /etc/init.d/httpd~~ :+1: # sudo /etc/init.d/httpd start sudo mkdir /var/html :+2: sudo chmod 777 -R /var/html :+2: /*變更資料夾用戶讀寫權限 */ new index.html++ <html> <body> Hello this is from new area </body> </html> sudo gedit /opt/apache2/conf/httpd.conf :+1: 啟動 gedit 後 找到 Listen 80 改成 Listen 808 /*將 http 連接 port 變更成 808 */ 存檔後重新啟動 apache 嘗試連結 http://localhost:808 sudo gedit /usr/local/ZZZ/conf/httpd.conf :+1: 1 找到 DocumentRoot "/usr/local/apache/htdocs" 改成 DocumentRoot "/html" /*變更網頁根目錄 , 到指定 /**www** 資料夾 */ 找到 <Directory "/usr/local/apache/htdocs"> 改成 <Directory "/html"> /*變更網頁根目錄 , 到指定 /**www** 資料夾 */ 存檔後重新啟動 apache 嘗試連結 http://localhost:808 [sudo /etc/init.d/httpd start] sudo systemctl enable httpd /*設定 httpd 服務於開機時自動啟動 */ sudo systemctl is-enabled httpd ## 2/27 期中考: ubuntu OS,Appache,php,防火牆 sudo ln -s /usr/local 1. 喜好設定 2. [virtualbox] 3. 在資訊欄光碟處 上ISO 4. 語言 打勾打勾 erase,LVM 英文語系 密碼 [顯示部OK靠tab] 5. 只移除不刪除 靠新增 6. 使用資料夾複製 匯入 7. 共享功能掛載 8. sudo gedit /edit/group 9. 顯示(4:3) other: GCP(google cloud platform) 區塊鍊 hash 暴力破解(易算難解) IoT AI ## 3/06 other: 服務&應用程式 UI圖形介面 開機背景執行 multithread同時n人執行 ### SOP sudo password / unzip y/n download -> 下載 unzip -> 解壓縮 address -> 找到解壓縮位置 configure-> 組態(簡單來說就是我們windows10安裝程式時,打勾的步驟) make -> 編譯 make install -> 安裝 start -> 啟動 --- ### CODE [cd .. Tab/] //sudo gcc sudo apt-get install gcc cd Download* cd http* --- sudo apt-get install openssl libssl-dev [安裝SSL擴充包] ![](https://i.imgur.com/VqhAAZX.jpg) ./configure --prefix=/usr/local/apache --enable-so --enable-headers --enable-expires --enable-rewrite --enable-ssl --disable-env --disable-userdir [組態] ![](https://i.imgur.com/5sVxsKH.jpg) sudo make [編譯] sudo make install [安裝] cd /usr/local/apache/bin [到檔案位置] sudo ./apachectl start [啟動] <? (other) loclhost sudo ./apachectl stop ?> ![](https://i.imgur.com/p9pxpMR.jpg) conf ->設定 到htdos ->編輯127.0.0.1 sudo gedit index.html | owner | group | others | | -------- | -------- | -------- | | r w x | _ _ _ | _ _ _ | | 讀 寫 執行 | Text | Text | | 111 | 101 | 101 drwxr -xr -x [7 5 5] d是資料夾 ![](https://i.imgur.com/ia9Ec5H.jpg) --- file address computer/usr/local/apache rm remove ----------------- [sudo rm /etc/init.d/httpd] ### 1.link 開機啟用init sudo ln -s /usr/local/apache/bin/apachectl /etc/init.d/httpd[移動link] sudo /etc/init.d/httpd start 測試1 ps -ef | grep httpd [host ssl密碼 在extra設定]<? ### 變更document dir win10 不要放在c槽 放D ?> sudo mkdir /www ll /usr/local/apache 2.打開檔案 之後編輯 sudo gedit /usr/local/apache/conf/httpd.conf 改port__[ Listen 80 ] [# DocumentRoot] 文字編輯器: sudo gedit /usr/local/apache/conf/httpd.conf [/www] 3.創建html sudo gedit /www/index.html <html><body> 123 </body></html> sudo /etc/init.d/httpd stop sudo /etc/init.d/httpd start 完成>> 關掉重開 之後要重新整理 4.改掉LISTEN : 80 88 檔案刪掉怎麼辦? copy別人的>>644 rwrr 644 不能執行 要改成rwxr 755 sudo chmod 755 -R 檔案/目錄 sudo chmod 755 -R /www rwx rwx 766 755都可 但是我們可以做777 (owner group others)底下都直接套用[R大寫] --- 找到document root sudo gedit /usr/local/apache/conf/httpd.conf 1 "/www" 2 ![](https://i.imgur.com/YUiVQf0.png) ## 4/3 開機自動啟用 ![](https://i.imgur.com/MRsXmuq.png) ![](https://i.imgur.com/bh8RZej.jpg) ![](https://i.imgur.com/IyV33LZ.jpg) 指令:工作管理員 pf -ef 指令:工作管理員_停用服務[PID =4260] kill -9 4260 進度: 最高權限 系統control 狀態 [檔案name] sudo systemctl status httpd 啟用 sudo systemctl enable httpd 確認是否啟用 sudo systemctl is-enabled httpd httpd.conf 重要文件 sudo gedit /etc/init.d/httpd 下載 marriaDB 10.1版本 linux https://downloads.mariadb.org/mariadb/10.1.38/#os_group=linux_generic ``` #### BEGIN INIT INFO # Provides: httpd # Required-Start: $local_fs $network # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Apache # Description: Apache ### END INIT INFO# ``` --- sudo gedit /etc/init.d/httpd 在 #!/bin/sh 下加入這段內容 ``` #### BEGIN INIT INFO # Provides: httpd # Required-Start: $local_fs $network # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Apache # Description: Apache ### END INIT INFO# ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully