Categories
- FFMpeg (5)
- Libav (1)
- Google (3)
- iBeacon (1)
- LDAP (3)
- Me (2)
- Network (11)
- OS (149)
- RTMP (4)
- SIP (1)
- Kamailio (1)
- SNMP (1)
- VMware (20)
- VCP考試 (1)
- 伺服器 網站服務 (105)
- 名詞解釋 (4)
- 專案管理 (1)
- 工具軟體 (50)
- Adobe (1)
- FMS (1)
- Cloudera (1)
- Docker (1)
- Eclipse (4)
- Intellij (2)
- OBS (2)
- Office (10)
- Excel (4)
- PowerPoint (5)
- Postman (1)
- Splunk (13)
- Virtualbox (2)
- Visual Studio (2)
- 文字編輯器 (10)
- Sublime Text 2 (6)
- Sublime Text 3 (3)
- Vim (3)
- 連線工具 (1)
- Xshell (1)
- Adobe (1)
- 程式語言 (79)
- CSS (2)
- HTML (2)
- iOS (1)
- Java (30)
- JavaScript (5)
- jQuery (4)
- jsTree (2)
- JSP (3)
- PHP (16)
- Python (7)
- Ruby (1)
- sed (1)
- Shell Script (8)
- Windows Bash Script (1)
- XML (1)
- 資料庫 (37)
- FFMpeg (5)
Category Archives: Ubuntu
[Apache] wordpress permalink 404 issue
edit site conf (vim /etc/apache2/sites-available/pr.site.org.conf)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<VirtualHost pr.site.org:80> ServerName pr.site.org ServerAdmin webmaster@localhost DocumentRoot /var/www/pr.site.org # !-- add this section <Directory /var/www/pr.site.org> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> # !-- ErrorLog ${APACHE_LOG_DIR}/pr_error.log CustomLog ${APACHE_LOG_DIR}/pr_access.log combined </VirtualHost> |
enable apache2 rewrite module
1 |
a2enmod rewrite |
restart apache2 service
1 |
service apache2 restart |
Ref. [1] Victor Hung’s Diary: 「教學」解決 WordPress 固定網址設定 404 錯誤 [2] DigitalOcean: WordPress permalinks tried everything
Posted in Apache, Ubuntu, WordPress
Leave a comment
Add git branch name to bash prompt
edit ~/.bash_profile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
if [ -f $(xcode-select -p)/usr/share/git-core/git-completion.bash ]; then . $(xcode-select -p)/usr/share/git-core/git-completion.bash . $(xcode-select -p)/usr/share/git-core/git-prompt.sh fi #enables color in the terminal bash shell export CLICOLOR=1 #sets up the color scheme for list export LSCOLORS=ExFxCxDxBxegedabagacad #sets up the prompt color (currently a green similar to linux terminal) export PS1='\n\[\e[1;30m\]┌─\[\e[0m\]\[\e[01;343m\]\u@\h\[\e[00m\]:\[\e[01;34m\]\w\[\e[00m\]\n\[\e[1;30m\]└──\[\e[0m\]\$ \[\e[00;33m\]$(__git_ps1 "(%s)")\[\e[00m\]' #enables color for iTerm export TERM=xterm-color |
Install aglio in Ubuntu 14.04
Install nodejs Ref. NodeSource Node.js Binary Distributions
1 2 |
apt-get install -y nodejs nodejs-legacy |
Install python
1 2 |
apt-get install python-dev |
Install aglio Ref. Github : aglio
1 2 |
npm install -g aglio |
Posted in Aglio, Ubuntu
Leave a comment
[Apache HBase] Install Apache HBase in Ubuntu 14.04
Java 1.7
1 2 3 4 5 |
add-apt-repository ppa:webupd8team/java apt-get update apt-get install oracle-java7-installer apt-get install oracle-java7-set-default |
Cloudera HBase Ref. installing-apache-hbase-on-ubuntu-for-standalone-mode Note. hbase tar file choose http://archive.apache.org/dist/hbase/hbase-0.98.5/hbase-0.98.5-hadoop1-bin.tar.gz (or http://ftp.mirror.tw/pub/apache/hbase/hbase-0.98.11/hbase-0.98.11-hadoop1-bin.tar.gz )
Posted in HBase, Ubuntu
Leave a comment
[Ubuntu] Enable exFAT support
All you need is install the exfat-* packages.
1 2 |
sudo apt-get install exfat-fuse exfat-utils |
Posted in Ubuntu
Leave a comment
[Ubuntu] Enable power saving in Lenovo X61
Ref: http://www.webupd8.org/2014/04/prevent-your-laptop-from-overheating.html Because I installed Ubuntu 14.04 in my Lenovo X61. Although it could switch into the sleep mode after closing the lid. It’s not really using the power saving mode. So we must edit the GRUB file.
1 2 |
sudo vim /etc/default/grub |
Find … Continue reading
Posted in Ubuntu
Leave a comment
開啟 Ubuntu Console 彩色顯示
編輯 ~/.bashrc 將
1 |
#force_color_prompt=yes |
變為
1 |
force_color_prompt=yes |
Posted in Ubuntu
Leave a comment
Xibo & Nginx-rtmp
20141226 更新 不要用這個~~因為不穩定~Orz 環境: Ubuntu 14.04.01 1. 安裝build deb需要的套件
1 |
apt-get install dpkg-dev |
創建source code目錄
1 2 |
mkdir -p /usr/src/nginx cd /usr/src/nginx |
透過apt-get下載nginx的source code
1 |
apt-get source nginx |
安裝git
1 |
apt-get install git |
透過git下載nginx-rtmp-module的source code
1 |
git clone https://github.com/arut/nginx-rtmp-module.git |
將rtmp、xlst模組功能加入設定檔中
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
cd nginx-1.4.6/ vim debian/rules <略> common_configure_flags := --with-cc-opt="$(debian_cflags)" --with-ld-opt="$(debian_ldflags)" --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_xslt_module --add-module=/usr/src/nginx/nginx-rtmp-module <略> |
安裝nginx的相依性套件
1 |
apt-get build-dep nginx |
建置nginx deb
1 |
dpkg-buildpackage -b |
安裝編譯後的檔案
1 |
dpkg --install nginx-common_1.4.6-1ubuntu3.1_all.deb nginx-full_1.4.6-1ubuntu3.1_amd64.deb |
安裝php5-fpm、mysql-server、php5-mysql
1 |
apt-get install php5-fpm php5-mysql mysql-server |
修改nginx default site設定,加入php功能及相關host
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
vim /etc/nginx/sites-available/default server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /usr/share/nginx/html; index index.html index.htm index.php; # Make site accessible from http://localhost/ server_name xibo; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests #location /RequestDenied { # proxy_pass http://127.0.0.1:8080; #} error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .php$ { fastcgi_split_path_info ^(.+.php)(/.+)$; # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini # # # With php5-cgi alone: # fastcgi_pass 127.0.0.1:9000; # # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } location /obs-remote { root html; index index.html index.htm; #allow #deny all; #auth_basic "Restricted Area"; #auth_basic_user_file /usr/local/nginx/conf/.htpasswd; } location /stat { rtmp_stat all; # Use this stylesheet to view XML as web page # in browser rtmp_stat_stylesheet stat.xsl; #auth_basic "Restricted Area stat"; #auth_basic_user_file /usr/local/nginx/conf/.htpasswd; } location /stat.xsl { # XML stylesheet to view RTMP stats. # Copy stat.xsl wherever you want # and put the full directory path here root html; # auth_basic "Restricted Area stat.xsl"; # auth_basic_user_file /usr/local/nginx/conf/.htpasswd; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /.ht { # deny all; #} } |
修改nginx設定,加入rtmp模組
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
vim /etc/nginx/nginx.conf rtmp { server { listen 1935; chunk_size 4096; application live { live on; record off; #allow publish 10.0.0.0/8; #deny publish all; #allow play 10.201.80.107; #deny play all; } } } |
重新啟動
1 |
service nginx restart |
Posted in Nginx, Ubuntu, Xibo
Leave a comment
upstart service 建立
這邊先貼幾個基本的,在etherpad及wisemapping建置的時候使用的conf來看一下 /etc/init/etherpad.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
description "etherpad" #start on started networking start on started mysql stop on runlevel [!2345] env EPHOME=/home/etherpad/etherpad-lite env EPLOGS=/var/log/etherpad-lite env EPUSER=etherpad respawn pre-start script cd $EPHOME mkdir $EPLOGS ||true chown $EPUSER:admin $EPLOGS ||true chmod 0755 $EPLOGS ||true chown -R $EPUSER:admin $EPHOME/var ||true $EPHOME/bin/installDeps.sh >> $EPLOGS/error.log || { stop; exit 1; } end script script cd $EPHOME/ exec su -s /bin/sh -c 'exec "$0" "$@"' $EPUSER -- node node_modules/ep_etherpad-lite/node/server.js >> $EPLOGS/access.log 2>> $EPLOGS/error.log end script |
/etc/init/wisemapping.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
description "Wisemapping Service" author "cowman" start on started mysql stop on runlevel [!2345] env WHOME=/wisemapping env WLOGS=/var/log/wisemapping expect fork pre-start script chdir $WHOME mkdir $WLOGS ||true end script respawn script chdir $WHOME java -Xms512m -Xmx1024m -Dorg.apache.jasper.compiler.disablejsr199=true -jar $WHOME/start.jar >> $WLOGS/wisemapping.log 2>> $WLOGS/error.log emit wisemapping_running end script |
當conf檔案放入/etc/init後便可以透過以下指令進行 start {service name} stop {service name} restart {service name} status {service name} 以下大概作個說明
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
description "描述說明" author "作者名稱" start on [程序] # start on started mysql <= 等 mysql 啟動完畢在啟動 # start on runlevel [345] <= 伴隨系統runlevel設定一起啟動 # 說明請見 http://upstart.ubuntu.com/cookbook/#runlevels stop on [程序] env 環境變數 expect fork #保護程序 pre-sstart script # 啟動預備程序 <內容> chdir 目錄 # 切換目錄 end script respawn # 當程序崩潰時重新啟動 script # 主程序 內容 end script |
更詳細的說明可以參考 http://blog.fens.me/linux-upstart/
Posted in Ubuntu
Leave a comment
安裝Ubuntu在VMware環境出現 Host SMBus controller not enabled!
修改/etc/modprobe.d/blacklist.conf
1 2 3 |
vim /etc/modprobe.d/blacklist.conf # 最後面加上 blacklist i2c-piix4 |
Posted in Ubuntu, VMware
Leave a comment