1.最小化安裝centos7。 2.安裝X11。yum groupinstall "X Window System"。 3.安裝gnome。 全安裝:yum groupinstall -y "GNOME Desktop"。 最小安裝:yum install gnome-classic-session gnome-terminal。 nautilus-open-terminal control-center liberation-mono-fonts。 4.開機啓動圖形界面:ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target。 5.重啓:reboot。 6.安裝字體:yum groupinstall Fonts。 7.更新字體緩存: fc-cache。 8.安裝優化工具:yum install gnome-tweak-tool.noarch。 9.安裝歸檔工具:yum install file-roller。
1.官網下載python。 2.解壓下載好的壓縮包。 3.建立目錄mkdir /usr/local/python_3.5.2。 4.進入解壓目錄sudo ./configure --prefix=/usr/local/python_3.5.2 。 5.make。 6.make install。 7.建立鏈接 ln -s /usr/local/python_3.5.2/bin/python3.5 /usr/local/bin/python3。 說明:yum和supversion等使用python2,因此不將/usr/bin/python鏈接到python3.使用python3時加#!/usr/bin/env python3。 8.python資源。 編程網站:The Python Challenge,Project Euler。 語法參考:《python學習手冊》,官方網站。
1.下載。
在postgresql的官方便可找到源碼文件目錄,地址以下:https://www.postgresql.org/ftp/source/,在下載列表中根據需求選擇版本。 2. 配置編譯安裝。 進入pg壓縮包目錄經過tar -zxvf ./postgresql-9.5.5.tar.gz進行解壓,進入解壓目錄。 經過./configure --help能夠看到編譯相關的幫助信息。 編譯時指定一個安裝目錄./configure --prefix=/usr/local/postgresql。配置完成了。 接下來就能夠編譯安裝了:make install clean。 (新系統安裝過程當中可能出現的問題)沒有c編譯器,提示缺乏readline庫,缺乏zlib庫。分別執行yum install gcc,yum install readline-devel,yum install zlib-devel。 3.用戶權限與環境變量。 編譯安裝成功後,接下來要作的就是建立一個普通用戶,由於默認超級用戶(root)不能啓動postgresql,因此須要建立一個普通用戶來啓動數據庫,執行如下命令建立用戶:useradd postgres。 接下來須要設置權限,將postgres的數據目錄所有賦權給postgres用戶(此處我將postgres的數據目錄指定在在/usr/local/postgresql/data目錄下):chown -R postgres:postgres /usr/local/postgresql/。 最後爲了方便起見設置一下相關的環境變量,此處僅僅設置postgres用戶的環境變量,因此首先經過su - postgres切換到postgres用戶,打開.bash_profile文件並追加如下內容:PGHOME=/usr/local/postgresql,export PGHOME,PGDATA=/usr/local/postgresql/data,export PGDATA。 ln -s /usr/local/postgresql/bin/pg_ctl /usr/local/bin/pg_ctl。 4.初始化數據庫。 因爲配置了環境變量,因此此處咱們直接執行initdb便可完成db初始化,但在這以前咱們能夠經過initdb --help看一下初始化相關的幫助信息。能夠看到在使用initdb進行初始化的同時咱們能夠指定參數來同時進行一些初始化工做,例如指定pgdata(postgresql數據目錄)、指定encoding(編碼)、指定數據庫超級用戶的用戶名和密碼等等,在最後面我標記出的這段話指出了若是data目錄沒有指定,則會默認使用環境變量中的PGDATA,因爲以前咱們剛剛設置了PGDATA環境變量,因此此處咱們也就無需再額外指定,最後執行初始化命令便可:initdb。同時在postgresql的目錄能夠看到生成的數據目錄data以及該目錄的相關數據和配置文件。 5.配置文件。 pg_hba.conf和postgresql.conf兩個配置文件,一個是訪問控制配置(127.0.0.1改成信任的客戶端ip網段使其能夠遠程訪問),一個是postgresql主配置文件(listen_address=localhost改成星號使其監聽整個網絡),方便起見我這裏將pg_hba.conf的ip地址修改成0.0.0.0/0,而加密方式改成md5,就表示須要密碼訪問,算是提供一個最低級的安全防禦。開放pg的5432端口。 6.將端口加入防火牆。 firewall-cmd --zone=public --add-port=5432/tcp --permanent 或者 firewall-cmd --add-service=postgresql --permanent 開放postgresql服務 firewall-cmd --reload 重載防火牆 7.啓動和鏈接。 pg_ctl start -D /usr/local/postgresql/data -l /usr/local/postgresql/log/pg_server.log 8.設置postgres用戶的密碼(默認爲空)。 切換用戶,su - postgres。 登陸數據庫,psql -U postgres ,執行後提示符變爲 'postgres=#'。 設置postgres用戶密碼, ALTER USER postgres WITH PASSWORD 'abc123' ,會提示輸入兩次密碼。 退出數據庫, \q 。 9.postgresql服務腳本。 vim /lib/systemd/system/postgresql.service 。 # It's not recommended to modify this file in-place, because it will be # overwritten during package upgrades. If you want to customize, the # best way is to create a file "/etc/systemd/system/postgresql.service", # containing # .include /lib/systemd/system/postgresql.service # ...make your changes here... # For more info about custom unit files, see # http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F # For example, if you want to change the server's port number to 5433, # create a file named "/etc/systemd/system/postgresql.service" containing: # .include /lib/systemd/system/postgresql.service # [Service] # Environment=PGPORT=5433 # This will override the setting appearing below. # Note: changing PGPORT or PGDATA will typically require adjusting SELinux # configuration as well; see /usr/share/doc/postgresql-*/README.rpm-dist. # Note: do not use a PGDATA pathname containing spaces, or you will # break postgresql-setup. # Note: in F-17 and beyond, /usr/lib/... is recommended in the .include line # though /lib/... will still work. [Unit] Description=PostgreSQL database server After=network.target [Service] Type=forking User=postgres Group=postgres # Port number for server to listen on Environment=PGPORT=5432 # Location of database directory Environment=PGDATA=/usr/local/postgresql_9.6.2/data # Where to send early-startup messages from the server (before the logging # options of postgresql.conf take effect) # This is normally controlled by the global default set by systemd # StandardOutput=syslog # Disable OOM kill on the postmaster OOMScoreAdjust=-1000 ExecStart=/usr/local/postgresql_9.6.2/bin/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300 -l /usr/local/postgresql_9.6.2/data/log/pg_server.log ExecStop=/usr/local/postgresql_9.6.2/bin/pg_ctl stop -D ${PGDATA} -s -m fast ExecReload=/usr/local/postgresql_9.6.2/bin/pg_ctl reload -D ${PGDATA} -s # Give a reasonable amount of time for the server to start up/shut down TimeoutSec=300 [Install] WantedBy=multi-user.target 10.自啓動腳本都可以添加到systemctl自啓動服務。 systemctl enable postgresql.service systemctl start/restart/stop postgresql.service
1.安裝supervisor。 pip install supervisor。 2.產生配置文件。 echo_supervisord_conf > /usr/local/etc/supervisord.conf。 3.supervisor服務啓動腳本。 vim /lib/systemd/system/supervisord.service 。 supervisord開機自啓動腳本(各版本系統):https://github.com/Supervisor/initscripts 。 # supervisord service for systemd (CentOS 7.0+) # by ET-CS (https://github.com/ET-CS) [Unit] Description=Supervisor daemon [Service] Type=forking ExecStart=/usr/bin/supervisord -c /usr/local/etc/supervisord.conf ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown ExecReload=/usr/bin/supervisorctl $OPTIONS reload KillMode=process Restart=on-failure RestartSec=42s [Install] WantedBy=multi-user.target 4.自啓動腳本都可以添加到systemctl自啓動服務。 systemctl enable supervisord.service systemctl start/restart/stop supervisor.service
1.下載解壓。 進入解壓目錄:ln -s /usr/local/sublime-text-3/sublime_text /usr/local/bin/sublime3。 2.安裝插件管理器。 從 Sublime Text 3 官方獲取用於安裝Package Control 的代碼。依次點擊 View > Show Console (快捷鍵Ctrl + `)打開控制檯。在控制檯中粘貼官方代碼,而後點擊回車。最後重啓。 3.安裝插件。 主題Flatland,Agila,Material Theme,Brogrammer;擴展側邊欄中菜單選項SideBarEnhancements;終極 Python 插件Anaconda;文件建立AdvancedNewFile;版本控制git;函數生成描述DocBlockr_python;代碼靜態檢查工具框架SublimeLinter-pyflakes。 4.配置。 修改快捷鍵 Sublime Text > Preferences > Package Settings > 插件 > Key Bindings – User。 修改配置Sublime Text > Preferences > Package Settings > 插件 > Settings – User。 5.配置python3版本。 Sublime Text > Preferences > Package Settings >Anaconda> Settings – default。將"python_interpreter": "python"改成"python_interpreter": "python3"。
原文地址:http://click.aliyun.com/m/20124/python