顯示具有 Ubuntu 標籤的文章。 顯示所有文章
顯示具有 Ubuntu 標籤的文章。 顯示所有文章

2016年3月24日 星期四

Nginx PPA

Nginx Ubuntu設定

sudo add-apt-repository -y ppa:nginx/stable
sudo apt-get update
sudo apt-get install -y nginx

2016年3月23日 星期三

Ezame Menu Editor PPA

Ubuntu Unity選單編輯

sudo add-apt-repository -y ppa:caldas-lopes/ppa
sudo apt-get update
sudo apt-get install -y ezame

2016年3月16日 星期三

移除Docky圖示


先安裝gconf-editor
sudo apt-get install -y gconf-editor

再執行terminal
gconftool-2 --type Boolean --set /apps/docky-2/Docky/Items/DockyItem/ShowDockyItem False

2015年12月1日 星期二

Ubuntu 14.04改成Mac 風格

※ 就只是Script而已,詳情請參考NoobsLab的這篇文章

請把他複製貼上到您的script檔案裏面,有沒有副檔名不要緊。

程式碼如下:E.g.macstyle.sh...etc.
# -*- coding: utf-8 -*-
#/usr/bin/env bash
sudo add-apt-repository -y ppa:docky-core/ppa
sudo add-apt-repository -y ppa:noobslab/themes
sudo add-apt-repository -y ppa:noobslab/apps
sudo apt-get update
sudo apt-get install -y docky mac-ithemes-v3 mac-icons-v3 mbuntu-bscreen-v3 mbuntu-lightdm-v3 indicator-synapse ubuntu-tweak libreoffice-style-sifr unzip
cd && wget -O Mac.po http://drive.noobslab.com/data/Mac-14.04/change-name-on-panel/mac.po
cd /usr/share/locale/en/LC_MESSAGES
sudo msgfmt -o unity.mo ~/Mac.po;rm ~/Mac.po;cd
gsettings set com.canonical.desktop.interface scrollbar-mode normal
sudo xhost +SI:localuser:lightdm
sudo su lightdm -s /bin/bash
gsettings set com.canonical.unity-greeter draw-grid false;exit
sudo mv /usr/share/unity-greeter/logo.png /usr/share/unity-greeter/logo.png.backup
wget -O launcher_bfb.png http://drive.noobslab.com/data/Mac-14.04/launcher-logo/apple/launcher_bfb.png
sudo mv launcher_bfb.png /usr/share/unity/icons/
wget -O mac-fonts.zip http://drive.noobslab.com/data/Mac-14.04/macfonts.zip
sudo unzip mac-fonts.zip -d /usr/share/fonts; rm mac-fonts.zip
sudo fc-cache -f -v

2015年11月27日 星期五

下拉式滾動條 Scrollbar設定為Normal


下拉式滾動條 Scrollbar設定為Normal


程式碼如下,

gsettings set com.canonical.desktop.interface scrollbar-mode normal

2015年11月21日 星期六

Ubuntu .desktop檔案

Ubuntu .desktop檔案格式。


[Desktop Entry]
Version=1.0       /* 程式版本 */
Name=             /* 程式名稱 */
GenericName=      /* 程式通用名稱,可以跟名稱相同 */
Comment=          /* 程式相關的提示 */
Exec=             /* 程式本體位置 */
Icon=             /* 程式的圖示(icon) */
Type=             /* 程式類型 */
Terminal=         /* 預設為false,如果用true的話程式執行會出現terminal */
Categories=       /* 程式類別 */
StartupWMClass=   /* 預設程式名稱 */ 



參考網址:Desktop files: putting your application in the desktop menus

2014年11月6日 星期四

建立Eclipse的程式捷徑(eclipse.desktop)


因為懶惰,所以找方法!!
這個就只是我懶的進入eclipse的路徑來開啟eclipse,我的方法不一定對你有用,先說說環境,我的環境是Ubuntu Studio 14.04。

開啟Terminal
>>> sudo gedit /usr/share/applications/eclipse.desktop


eclipse.desktop的程式碼

[Desktop Entry]
Encoding=utf-8
Name=Eclipse
Comment=Eclipse IDE
Exec=/home/your/eclipse/eclipse
Icon=/home/your/eclipse/icon.xpm
Categories=Application;Development;
Type=Application
Terminal=0

2014年10月25日 星期六

Tornado (一個Python微型的Framework)


有段時間沒來更新這個網誌了,最近在如火如荼的進行著專題抗戰,現在就來寫一篇最近學的framework。

系統環境:Ubuntu 14.04 Server、Python3.4、Tornado 4.0.2、MongoDB 2.6、PyMongo


Tornado全稱Tornado Web Server,是一個用Python語言寫成的Web伺服器Web應用框架,由FriendFeed公司在自己的網站FriendFeed中使用,被Facebook收購以後框架以開源軟體形式開放給大眾。     以上節錄自Wiki

簡介就自行去估一下吧!就不進行簡介了。
我的架構大概像這樣,有點在抄django的寫法。
/ static/         -->  靜態檔案。
/ templates/  -->  範本(HTML檔案)。
/ manage.py -->  執行的檔案。
/ view.py       -->  主程式。
/ models.py  -->  模型(資料庫操作)。

manage.py
# -*- coding: utf-8 -*-
#!/usr/bin/env python3.4

import os, sys, views
import tornado.httpserver, tornado.ioloop, tornado.web, tornado.autoreload
from tornado.options import define, options
define('port', default=8000, help='run on the given port', type=int)

def main():
    tornado.options.parse_command_line()
    app = views.App()
    server = tornado.httpserver.HTTPServer(app)
    server.listen(options.port)
     
    tornado.autoreload.start()
    for dir, _, files in os.walk('templates'):
        [tornado.autoreload.watch(dir + '/' + f) for f in files if not f.startswith('.')]
    tornado.ioloop.IOLoop.instance().start()

if __name__ == '__main__':
    main()

view.py
# -*- coding: utf-8 -*-
#!/usr/bin/env python3.4
import models, os
import tornado.httpserver, tornado.ioloop, tornado.web


class App(tornado.web.Application):
    # Application init settings
    def __init__(self):
    handlers = [
        (r'/', MainHandler),
    ]
    settings = {
        'template_path': os.path.join(os.path.dirname(__file__), 'templates'),
        'static_path': os.path.join(os.path.dirname(__file__), 'static'),
        'cookie_secret':
        'GKPu279PjY28Kkb2z3TA6N3ue497Z3haiQHzT4ti6JWrq5ds8H2GP6qT85ZR77MU',
        '/login': True,
        'xsrf_cookies': True,
        'debug': True
    }
    self.db = models.dbConnection()
    tornado.web.Application.__init__(self, handlers, **settings)

class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.render('index.html')

models.py
# -*- coding: utf-8 -*-
#!/usr/bin/env python3.4

from pymongo import MongoClient

settings = {
    'host': '資料庫位置',# Database's host.
    'port': '資料庫的Port', # Database's port.
   
}

def dbConnection():
    # 資料庫連線
    db = MongoClient(**settings)['自行設定你的資料庫']
    return db

index.html
跟上篇我自己的宣告












2014年8月29日 星期五

Ubuntu安裝Apache+Mariadb+PHP+phpMyAdmin



久久沒來寫個網誌,就來記錄一下自己曾學過的東西,至於出處我就不清楚了,如果有侵犯到您的網誌或者文章就請跟我說。


安裝Apache
$~ sudo apt-get install apache2





安裝Mariadb(用來取代MySQL的)
$~ sudo apt-get install mariadb-server





安裝PHP5
$~ sudo apt-get install php5 php5-mysql libapache2-mod-php5





安裝phpMyAdmin
$~ sudo apt-get install phpmyadmin



完畢,接下來就好好享受開發網站的過程吧!不過我都用Python來取代PHP就對了。XD


可以在這裡下載安裝文件ampp.sh












2013年10月16日 星期三

Linux $PATH 設定

terminal 開啟

sudo gedit .bashrc

路徑設定-
> export PATH=/xxx/xxx/:$PATH

source .bashrc

2013年5月23日 星期四

Ubuntu 12.10與Win7 雙系統,預設Win7啟動

指令簡簡單單

1.開啟終端機。
2.下下面指令。
sudo gedit /etc/default/grub

3.選擇你的開機選單的找GRUB_DEFAULT這選項,通常都會在第4個GRUB_DEFAULT=4
,這樣設定就差不多了。

4.修改後,下下面指令。
sudo update-grub