操屁眼的视频在线免费看,日本在线综合一区二区,久久在线观看免费视频,欧美日韩精品久久综

新聞資訊

    • 1 常用軟件
    • 2 軟件安裝命令2.1 安裝軟件包2.2 查找軟件包2.3 靜默安裝
    • 3 軟件安裝與配置3.1 安裝Libreoffice3.2 安裝firefox及flash插件3.3 安裝chromium3.4 Dillo顯示中文3.5 圖像處理軟件GIMP3.6 安裝virtualbox
    • 4 游戲
    • 5 7個頂級Xfce應用軟件5.1 文件管理器:Thunar5.2 網絡瀏覽器: Midori5.3 CD/DVD burner:Xfburn5.4 音樂/視頻播放器:Xfmedia5.5 查看圖片:Ristretto5.6 文本編輯器:Mousepad5.7 終端程序:Xfce Terminal
    • 6 Error: /etc/fstab: Read-only file system 錯誤解決辦法

    常用軟件

    1. 虛擬終端:xterm sakura gnome-terminal
    2. 圖片瀏覽:feh ristretto(一個輕巧的Xfce項目)
    3. 登錄管理:slim
    4. 文件管理:pcmanfm xfe
    5. 面板管理:lxpanel fbpanel pypanel
    6. 系統監視:conky
    7. 光盤刻錄:isomaster brasero
    8. 影音播放:Mplayer SMplayer
    9. 音頻播放:audacious (audacious-plugins)
    10. 文檔閱讀:Evince
    11. 辦公軟件:Libreoffice abiword gedit gnumeric gnucash
    12. 即時通訊:pidgin
    13. 網絡瀏覽:firefox chromium dillo
    14. 窗口管理:openbox fluxbox fvwm icewn
    15. 圖片瀏覽:feh mirage
    16. 電子表格:abacus
    17. 郵件管理:thunderbird (thunderbird-i18n)
    18. 文件壓縮:p7zip unzip unrar
    19. ftp客戶端:filezilla
    20. pdf軟件:zathura-pdf-poppler
    21. 計算器: galculator

    軟件安裝命令

    安裝軟件包

     # pkg install packageName 或者
     # cd /usr/ports/xxx && make install clean; rehash
    

    查找軟件包

     # pkg search packageName 或者
     # cd /usr/ports/
     # make search name/key = packageName
    

    靜默安裝

      # make BATCH=YES install clean
    

    軟件安裝與配置

    安裝Libreoffice

     cd /usr/ports/editors/libreoffice
     make LOCALIZED_LANG=zh-CN install clean
    

    安裝firefox及flash插件

     #pkg install firefox 或 #cd /usr/ports/www/firefox/ && make BATCH=YES install clean
     在/boot/loader.conf中加入: sem_load="YES"
    

    安裝firefox中文包(port安裝時可選擇語言:LANG_CN;pkg 安裝后可選擇語言)

     #cd /usr/ports/www/firefox-i18n/ && make install clean  或 pkg install firefox-i18n
    

    在瀏覽器中設置:地址欄中輸入about:config general.useragent.locale zh-CN 插件里啟用中文

    安裝flash插件

     cd /usr/ports/www/nspluginwrapper && make install clean 
     cd /usr/ports/www/linux-f10-flashplugin11 && make install clean
    

    插件必須由每個用戶運行 nspluginwrapper 安裝

     nspluginwrapper -v -a –i
    

    安裝chromium

     # pkg install chromium
     # vi /etc/sysctl.conf   加入一行: kern.ipc.shm_allow_removed=1
     # vi /etc/X11/xorg.conf 加入一行: FontPath  "/usr/local/share/fonts/Droid/"
    

    Dillo顯示中文

    vi /usr/local/etc/dillo/dillorc 修改下面5行:

     font_serif=”Serif”
     font_sans_serif=”Sans”
     font_cursive=”Sans”
     font_fantasy=”Sans”
     font_monospace=”Sans Mono”
    

    圖像處理軟件GIMP

    軟件安裝

     #pkg install gimp
     #cd /usr/ports/graphics/gimp && make  install clean
    

    中文手冊

     #pkg install zh_CN-gimp-help-html
     #cd /usr/ports/graphics/gimp-manual-html && make install clean
    

    安裝virtualbox

    Installing VirtualBox:

     # pkg install virtualbox-ose
    

    /boot/loader.conf,添加

     vboxdrv_load="YES"
    

    For bridged networking please add the following line to your /etc/rc.conf:

     vboxnet_enable=”YES”
    

    Reboot the machine to load the needed kernel modules.

    You also have to add all users to your vboxusers group in order to use box

     % pw groupmod vboxusers -m yourusername
    

    USB support: For USB support your user needs to be in the operator group and needs read and write permissions to the USB device.

     % pw groupmod operator -m yourusername
    

    Add the following to /etc/devfs.rules(create if it doesn’t exist):

     [system=10]
    

    add path ‘usb/*’ mode 0660 group operator

    To load these new rule add the following to /etc/rc.conf:

     devfs_system_ruleset=”system”
    

    Then restart devfs to load the new rules:

     % /etc/rc.d/devfs restart
    

    Host DVD/CD access Atapicam kernel module needs to be loaded via /boot/loader.conf atapicam_load=”YES” HAL has to run at the moment so enable it in /etc/rc.conf and start it if not yet done: hald_enable=”YES” # /usr/local/etc/rc.d/hald start Your account needs permissions to access /dev/xpt0,/dev/cdN and /dev /ppassN so add thes to /etc/devfs.conf: perm cd0 0660 perm xpt0 0660 perm pass0 0660 Running VirtualBox as non-root user man fail with a fatal error NS_ERROR_FACTORY_NOT_REGISTERED.In this case delete /tpm/.vbox-*-ipc file. Check wiki page for known issues and troubleshooting: http://wiki.freebsd.org/VirtualBox

    游戲

    • 超級瑪麗 supertux2
    • cs射擊 xonotic
    • 連連看 llk_linux (pkg install lianliankan)
    • 韋諾之戰(類似紅警) wesnoth

    話說以下這些是我當年在 linux 下裝過的游戲,可以挑有興趣的找找看。

    berusky escape uqm atomix freedroid lucidlife enigma freeciv gl-117 tremulous spring alienarena Wesnoth smc(Secret Maryo Chronicles) scorched3d worldofpadman vdrift extremetuxracer torcs supertuxkart Vegastrike Wesnoth vdrift maniadrive wormux chromium-bsu frozen-bubble foobillard chess Astromenace stormbaancoureur solarwolf gltron vodovod xmoto pinball overgod barrage slingshot BlockOut* seahorse* bubbros

    nexuiz atomorun ballz blobwars clanbomber duel3 atomix ksudoku magicor mirrormagic neverball

    trackballs ularn uqm(The Ur-Quan Masters) The Ur-Quan Masters bzflag dd2 Maelstrom njam penguin-command

    rafkill raidem powermanga overgod gemdropx

    enigma BlockOut* barrage wormux frozen-bubble Vegastrike alex4

    7個頂級Xfce應用軟件

    多年來,Xfce作為KDE和GNOME(Linux兩個重要的桌面環境)的輕量級替代品而贏得了聲譽。這是因為Xfce運行時通常使用更少的資源,它為應用程序提供了基本的功能和簡潔的接口,并且,相對KDE和GNOME,Xfce的整體表觀是比較好的,至少在涉及到內存占用上。 如果硬件比較老,無法運行Ubuntu和Kubuntu的最新版本,建議使用Xubuntu。 在這篇文章中我將概述Xfce桌面環境的7個基本應用軟件,包括它們的截圖、優點和不足。

    文件管理器:Thunar

    Thunar是Xfce默認的文件管理器,它有一個簡潔的界面(如果其它Xfce軟件一樣)、側欄、可配置的區域選擇器(如果你希望在工具欄顯示典型的地址欄)、項目排序、放大與縮小、三種顯示模式(圖標、詳細列表、緊湊列表)、圖片預覽。Thunar比Nautilus簡單,反過來,它使用了更少的資源。它只提供了基本的配置項,但它能完成常用的操作,特別是如果只需要執行基本的文件瀏覽和管理。

    網絡瀏覽器: Midori

    我認為第一次嘗試Midori的感覺和嘗試Epiphany一樣,它有瀏覽器常見的簡單的界面,提供足夠的選項使它成為一個簡單并且有用的網絡瀏覽器。Midori使用了強大的WebKit做網頁的渲染,所以它成功支持所有WebKit支持的網頁。Midori支持擴展應用、書簽、歷史、編碼、放大與縮小網頁、源代碼查看工具和網頁的全屏模式瀏覽。它也支持標簽(必須有的功能),它包括一個快速撥號,默認情況下打開網頁時,可以快速在一個新的標簽上訪問您喜歡的網頁。 關于配置,Midori有非常豐富的選擇:除了首頁和啟動頁面等常規設置之外,它還允許拼寫檢查,打開/關閉顯示圖像、腳本,接口,外部應用,代理,隱私和外觀設置。

    CD/DVD burner:Xfburn

    這個Xfce提供的刻錄軟件有不少常見的功能,外表像一個基本的GnomeBurners。它有一個拖放界面,使用了一個樹形文件查看和一個文件瀏覽區,它支持刻錄CDs、DVDs、ISO鏡像、音樂CD的制作。非常簡單和容易使用,沒有任何其它選項。如果你渴望一個最小體積、占用資源少的刻錄軟件,Xfburn非常適合。

    音樂/視頻播放器:Xfmedia

    Xfmedia是Xfce的默認媒體播放器,基于Xine,支持任何Xine支持的音頻和視頻格式。Xfmedia提供了一個基本的界面,最適合播放音頻文件,基于Xine使它也可以播放視頻和電影。

    查看圖片:Ristretto

    Ristretto可能是界面最簡單的圖片瀏覽器之一,它的界面分為兩個區域:圖像顯示區(in full size or zoomed in or out)和縮略圖查看區,通過菜單(“查看”->“縮略圖查看”)可以轉移或隱藏縮略圖區域。首選項窗口允許用戶自定義幻燈片選項、圖像高速緩存的大小、背景顏色和縮放。還有全屏瀏覽模式和旋轉圖像等功能。

    文本編輯器:Mousepad

    和其它Xfce應用一樣流行,Mousepad提供了一個基本的文本編輯工具,剝離了像語法高亮、拼寫檢查等文本編輯工具上高級的功能。Mousepad,顧名思義,就是一個簡單的文本編輯工具,快速地編輯配置文件或其它文本文件。它特別提供了字體選擇、顯示行號、自動縮進和文字換行。

    終端程序:Xfce Terminal

    因為所有用Linux做事的人都需要終端程序來提高效率,Xfce Terminal是xterm、konsole或GNOME Terminal等程序最理想的替代應用,特別是你爭取簡單時。Xfce4 Terminal允許您配置外觀、背景圖片、字體、顏色、快捷鍵。它甚至還支持標簽,當您需要一個以上的實例時這非常有用。




    Thunar 使用技巧 SEARU 發布于 2015-10-11分類:Linux 新聞閱讀(12)評論(0) Thunar 是十分輕量的文件管理器,它不僅運行快速,而且容易使用。同時,Thunar 也是 Xfce 桌面環境中默認的文件管理器。在使用 Thunar 的過程中,我積累了一些經驗和技巧,現與 Thunar 的同好分享。

    模式選擇

    對于使用 Ctrl 鍵與 Shift 鍵來單選和多選文件,可能大家都比較熟悉了。除此之外,Thunar 還支持模式選擇,使用這種方式可以實現某種類型文件的快速選擇。舉個例子,假設你要選擇文件夾中為 png 格式的所有圖片,那么可以在執行 Ctrl + S 快捷鍵后,輸入 *.png 即可。

    / 與 ~

    在 Thunar 中,使用 / 和 ~ 可以實現特定目錄的快速導航。其中,/ 是打開根目錄;而 ~ 就是打開用戶主目錄了。如果你需要導航其他目錄,則可以按 Ctrl + L 快捷鍵打開定位對話框。值得一提的是,此定位框也繼承了 Linux 中 Tab 鍵自動補全的優秀特性。

    鼠標手勢

    Thunar 內置簡單的鼠標手勢操作,不過需要在圖標視圖中按鼠標中鍵才能生效:

    向左 — 打開上次訪問的文件夾 向上 — 打開父文件夾 向右 — 打開下次訪問的文件夾 向下 — 刷新當前的文件夾 使用側面板

    使用下列快捷鍵可以操作 Thunar 的側面板:

    F9 — 顯示/隱藏側面板 Ctrl + B — 顯示/隱藏快捷面板 Ctrl + T — 顯示/隱藏樹狀面板




    在 FreeBSD 10.0 上安裝 SmokePing 2014年03月29日 | 標簽: freebsd, smokeping | 作者:vpsee SmokePing 是一款開源網絡延遲監控工具,其作者 Tobi Oetiker 還開發了一些我們熟悉的 MRTG 和 RRDtool. SmokePing 能采用多種方式對網絡延遲(性能)進行監測和警告,支持插件的方式對網絡的其他指標進行監控,并且支持 Matser/Slave 分布式架構,多節點監控數據可以匯集到一起并通過顏色和陰影來展現網絡延遲和丟包。以下操作在 FreeBSD 10.0 上測試通過。 在開始之前,最好升級一下系統:

    1. freebsd-update fetch
    2. freebsd-update install

    現在 FreeBSD 有了一套新的軟件包管理工具 pkg,目的是用來替代老的 pkg_info/pkg_create/pkg_add. 這里用新工具 pkg 來安裝 smokeping,并把 smokeping 加到系統啟動文件里:

    1. pkg install smokeping
    2. echo 'smokeping_enable="YES"' >> /etc/rc.conf

    修改 smokeping_secrets 文件權限后啟動 smokeping:

    1. chmod 600 /usr/local/etc/smokeping/smokeping_secrets
    2. /usr/local/etc/rc.d/smokeping start

    smokeping 是 Perl 寫的,還需要安裝幾個 perl 模塊:

    1. perl -MCPAN -e shell

    Terminal does not support AddHistory.

    cpan shell -- CPAN exploration and modules installation (v1.9800) Enter 'h' for help.

    cpan[1]> install FCGI cpan[1]> install CGI 要看 web 界面的話 smokeping 還需要 apache 的支持,安裝 apache 并加到系統啟動文件:

    1. pkg install apache24
    2. echo 'smokeping_enable="YES"' >> /etc/rc.conf

    因為 pkg 里面沒有 mod_fcgid,不能 pkg install mod_fcgid,所以需要使用 FreeBSD 傳統的 port 編譯安裝:

    1. portsnap fetch extract
    2. portsnap fetch update
    1. cd /usr/ports/www/mod_fcgid
    2. make install clean

    配置 apache:

    1. vi /usr/local/etc/apache24/Includes/smokeping.conf

    LoadModule fcgid_module libexec/apache24/mod_fcgid.so


       AddHandler fcgid-script .fcgi
    


    Alias /smokeping "/usr/local/smokeping/htdocs"

       Options Indexes FollowSymLinks ExecCGI
       AllowOverride All
       Require all granted
    
    1. vi /usr/local/etc/apache24/httpd.conf

    ...


    1. DirectoryIndex: sets the file that Apache will serve if a directory
    2. is requested.

       DirectoryIndex index.html smokeping.fcgi
    

    ... 配置 smokeping,在 *** Targets *** 一欄加入要監控的機器:

    1. vi /usr/local/etc/smokeping/config

    ...

        • Targets ***

    probe = FPing

    menu = Top title = Network Latency Grapher remark = Welcome to vpsee.com

    + Local

    menu = Local title = Local Network

    ++ node11

    menu = node11 title = node11 host = node11.vpsee.com ... 做了配置后,別忘了重啟服務:

    1. service smokeping restart
    2. service apache24 restart

    打開瀏覽器訪問 http://192.168.2.123/smokeping/



    Error: /etc/fstab: Read-only file system 錯誤解決辦法

    原因:mount成readonly了

    方法:

     # mount -o remount, rw / 或
     # mount -o rw /dev/ada0p2
     
    



    http://www.tiecou.com/552p2.html










       網絡校時
    #ntpdate time.windows.com
    

    (time服務器地址time.nist.gov 、chime.utoronto.ca 、ntp.pipex.net 、time.windows.com)

       安裝、更新源代碼
    
    1. csup -L 2 -h cvsup.freebsdchina.org /usr/share/examples/cvsup/standard-supfile
        安裝、更新doc文檔
    
    1. csup -L 2 -h cvsup.freebsdchina.org /usr/share/examples/cvsup/doc-sufile
        安裝、更新Ports Collection
    #portsnap fetch extract
    

    (以后更新執行portsnap fetch update就可以了。參見HandBook:24.3 Portsnap: 一個 Ports Collection 更新工具,

    地址:http://cnsnap.cn.freebsd.org/doc ... ading-portsnap.html)
    
       升級、編譯、安裝內核
    

    (對于桌面用戶我覺得用GENERIC內核就很好了,當然如果你想感受下定制內核那就另當別論了。) 參見/usr/src/Makefile文件。或者http://cnsnap.cn.freebsd.org/doc ... book/makeworld.html

        給bsd打補丁(自動打補丁只能用于默認內核)
    #freebsd-update
    #freebsd-install
    

    設置本地化(中文)

    登錄分類法(管理員級設置)
    在/etc/login.conf加入:
    

    chinese:Chinese Users Account:\

            :charset=UTF-8:\
            :lang=zh_CN.UTF-8:\
            :tc=default:
    

    然后執行:

    #cap_mkdb /etc/login.conf
    

    然后:

    #pw user mod 用戶名 -L chinese  (我習慣在安裝系統的時候就建立一個用戶所以這里之修改用戶的登錄類型就可以了。)
    查看
    #pw user show 用戶名
    

    XX:*:1001:1001:chinese:0:0:用戶名:/home/用戶名目錄:/bin/sh

    su -用戶名
    

    $ locale

    LANG=zh_CN.UTF-8
    LC_CTYPE="zh_CN.UTF-8"
    LC_COLLATE="zh_CN.UTF-8"
    LC_TIME="zh_CN.UTF-8"
    LC_NUMERIC="zh_CN.UTF-8"
    LC_MONETARY="zh_CN.UTF-8"
    LC_MESSAGES="zh_CN.UTF-8"
    LC_ALL=
    

    設置成功

       登錄分類(用戶級設置)
    在用戶根目錄文件.login_conf加入:
    

    me:\

            :charset=zh_CN.UTF-8:\
            :lang=zh_CN.UTF-8:\
            :setenv=LC_ALL=zh_CN.UTF-8:\
            :setenv=LC_COLLATE=zh_CN.UTF-8:\
            :setenv=LC_CTYPE=zh_CN.UTF-8:
    
        安裝axel(多線程下載工具)
    #cd /usr/ports/ftp/axel && make install clean
    

    在/etc/make.conf中加入FETCH_CMD=axel -a -n 2

    #echo 'FETCH_CMD=axel -a -n 2 
    

    詳細配置參見man手冊

    我只是在安裝非常大的軟件,像xorg、gnome、openoffice的時候才使用。(如果你用腳本自動安裝最好還是用FreeBSD默認的fetch。)
    
        加載聲卡驅動(我的聲卡是板載alc883)
    在/boot/loader.conf 加入 snd_hda_load="YES"
    #echo 'snd_hda_load="YES"'>> /boot/loader.conf
    

    (更詳細的說明參見http://cnsnap.cn.freebsd.org/doc ... ok/sound-setup.html)

       安裝配置xorg
    #cd /usr/ports/x11/xorg && make BATCH=YES install clean
    

    生成xorg.conf.new配置文件并移動到/etc/X11/下

    1. Xorg -configure
    #mv xorg.conf.new /etc/X11/xorg.conf
    

    在/etc/rc.conf內加入hald_enable="YES" 和 dbus_enable="YES"

    #echo 'hald_enable="YES"'>> /etc/rc.conf
    #echo 'dbus_enable="YES"'>> /etc/rc.conf
    

    詳細說明參見HandBook 配置X11 地址:http://cnsnap.cn.freebsd.org/doc ... dbook/x-config.html

        安裝文泉驛字庫
    
    1. cd /usr/ports/x11-fonts/wqy &&make install clean

    在/etc/X11/xorg.conf里面的Section "Files"小節加入: FontPath "/usr/ports/lib/X11/fonts/wqy"

        安裝Linux二進制兼容模式 (安裝nvidia顯卡驅動所必須的)
    
    1. kldload linux
    #cd /usr/ports/emulators/linux_base-f10 && make BATCH=YES install distclean
    

    在/etc/rc.conf中增加 linux_enable="YES"

    #echo 'linux_enable="YES"'>> /etc/rc.conf
    

    參見http://cnsnap.cn.freebsd.org/doc ... mu-lbc-install.html

        安裝nvidia顯卡驅動(我的是7600gs)
    
    1. cd /usr/ports/x11/nvidia-driver && make BATCH=YES install clean

    在/boot/loader.conf中加入nvidia_load="YES"

    #echo 'nvidia_load="YES"'>> /boot/loader.conf
    
        安裝nvidia顯卡驅動自動配置工具
    
    1. cd /usr/ports/x11/nvidia-xconfig/ && make install clean

    執行

    1. rehash
    #nvidia-xconfig --add-argb-glx-visuals
    #nvidia-xconfig --composite
    #nvidia-xconfig --depth=24
    

    上面三行是為了compiz-fusion所設置的,如果不裝compiz-fusion執行nvidia-xconfig就可以了。 (會在/etc/X11下生成新的xorg.conf文件并把舊的xorg.conf備份為org.conf.backup)

        安裝xfce4
    

    (小巧玲瓏的桌面速度快)

    1. cd /usr/ports/x11-wm/xfce4 && make BATCH=YES install clean (如果需要GDM就不要加BATCH=YES這句,裝的時候吧GDM前面的X打上就行了。)
    如果你想允許用戶關閉或重啟(指在xfce4下)計算機那么在/usr/local/etc/PolicyKit/PolicyKit.conf中加入:
    

    <match action="org.freedesktop.hal.power-management.shutdown">

        <return result="yes"/>
    </match>
    
    <match action="org.freedesktop.hal.power-management.reboot">
        <return result="yes"/>
    </match>
    

    注意吧上面的加在兩個<config>和</config>之間。

    再普通用戶下執行
    

    % echo "/usr/local/bin/startxfce4" >> ~/.xinitrc 以后startx就可以進桌面了。我有時候需要在非X下所以我沒有裝GDM。如果需要開機直接進入桌面就吧GDM裝上就可以。

       安裝scim 拼音輸入法
    
    1. cd /usr/ports/chinese/scim-pinyin/ && make install clean

    在.xinitrc里加入(我用的是sh)

    %echo 'export XMODIFIERS='@im=SCIM>> ~/.xinitrc %echo 'scim -d'>> ~/.xinitrc
    
        安裝firefox
    #cd /usr/ports/www/firefox/
    #make BATCH=YES install clean
    

    在/boot/loader.conf中加入sem_load="YES"

    echo 'sem_load="YES"'>> /boot/loader.conf
    
        安裝firefox中文包
    
    1. cd /usr/ports/www/firefox-i18n/
    #make install clean
    
        讓firefox支持flash
    

    安裝nspluginwrapper

    #cd /usr/ports/www/nspluginwrapper
    #make install clean
    

    安裝linux-f10-flashplugin10

    #cd /usr/ports/www/linux-f10-flashplugin10
    #make install clean
    

    建一個符號鏈接

    1. ln -s /usr/local/lib/npapi/linux-f10-flashplugin/libflashplayer.so \/usr/local/lib/browser_plugins/

    然后在用戶下執行 % nspluginwrapper -v -a -i 在/etc/fstab中加入: linproc /usr/compat/linux/proc linprocfs rw 0 0 參見handbook:http://cnsnap.cn.freebsd.org/doc ... sktop-browsers.html 如果平時不用flash還是建議不要裝了。現在的這個版本占用資源還是有點高,有時候firefox會卡。

       安裝Ristretto
    Xfce項目。一個輕巧的圖像查看器。
    
    1. cd /usr/ports/graphics/ristretto
    #make install clean
    
        安裝Xfburn
    Xfce項目。Xfburn是一個使用cdrtools(cdrecord、cdrdao、mkisofs)來燒制CD和DVD的前端燒錄程序。
    
    1. cd /usr/ports/sysutils/xfburn
    #make install clean
    
        安裝xfce4-media
    Xfce項目。Xfmedia 是一個簡單易用的媒體播放器,基于 xine 引擎。GTK+ GUI 旨在播放與管理音頻文件,但是,由于它是基于 xine 的,所以同樣支持視頻文件。
    #xfce4-media: /usr/ports/multimedia/xfce4-media
    

    #make install clean

        安裝audacious(音頻播放器。如果你覺得xfce4-media不太適合你也可以裝這個。)
    #cd /usr/ports/multimedia/audacious
    #make install clean
        安裝audacious-plugins(音頻播放器插件。必須安裝)
    
    1. cd /usr/ports/multimedia/audacious-plugins
    #make install clean
    
       安裝mplayer
    

    (這不用介紹了吧。全公能播放器幾乎支持所有的視頻格式。) cd /usr/ports/multimedia/mplayer

    make WITH_LANG=zh_CN install clean
    (如果你喜歡看搞清電影并且你的顯卡支持VDPAU別忘了吧這個點上。)
    
        安裝galculator(計算器)
    #cd /usr/ports/math/galculator
    #make install clean
    
        安裝Thunderbird(郵件客戶端)
    
    1. cd /usr/ports/mail/thunderbird
    #make BATCH=YES install clean
    
        安裝Thunderbire語言包
    
    1. cd /usr/ports/mail/thunderbird-i18n
    #make install clean
    
        安裝MLDonkey(電驢、BT)
    
    1. cd /usr/ports/net-p2p/mldonkey
    #make WITHOUT_GUI=yes WITHOUT_X11="YES" WITHOUT_TK="YES" install clean
    

    %ln -s ~/.mldonkey/incoming ~ 在/etc/rc.conf加入mlnet_enable="YES" 和 mlnet_user="用戶名非root“ %/usr/local/etc/rc.d/mlnet start (注意是%) 1.%telnet 127.0.0.1 4000

    2.>auth admin ""
    3.>passwd 鍵入你想設置的密碼
    

    4.>set allowed_ips "127.0.0.1 192.168.0.0/24" (根據你自己的情況設置) 5.>save

    6.>exit
    

    (mldonkey需要一個非root用戶來運行。我習慣在裝系統的時候就建立一個wheel組的用戶,所以這里我就不用在建立用戶了。)

    具體情況可以參考http://forums.freebsd.org/showthread.php?t=227
    

    現在就可以在瀏覽器里輸入:localhost:4080來設置和下載文件了。

    默認mldonkey的文件夾是隱藏的,在用戶目錄下。找下載好的電影有點不方便,把incoming連接到你的用戶目錄下就好了。當然你也可以自己修改默認下載路徑。
    
       mldonkey簡單設置:
    

    enable_kademlia的選項為true――打開kad減少對服務器的依賴。 max_hard_upload_rate默認是10 (全局最大上傳,根據自己情況設置) max_hard_download_rate默認是50 (全局最大下載,根據自己情況設置) mldonkey有兩組兩組帶寬控制模式,通過點擊Bandwidth toggle來更改帶寬控制模式。

        添加服務器列表:
    點擊servers>Import Server.met輸入http://ed2k.im/server.met(放心都是安全服務器列表)
    

    或者下載下來手工導入:servers "/home/username/server.met"

        添加overnet啟動用戶列表:
    

    ov_load "/home/username/contact.dat"

        添加kad節點信息
    下載地址:http://emulefans.com/emule-kad-node-dat/ kad_load "/home/username/nodes.dat"
    
      添加firefox for mldonkey插件:
    下載地址:http://www.informatik.uni-oldenburg.de/~dyna/mldonkey/ 
    OpenOffice.org
    #cd /usr/ports/editors/openoffice.org-3 && make LOCALIZED_LANG=zh-CN install clean
    

    注意:在安裝的時候會提示讓你手工下載幾個文件放在/usr/ports/distfiles/下。 JDK US DST Timezone Update Tool這個文件需要在網站(http://java.sun.com/javase/downloads/index.jsp)注冊才能下載。

    關鍵是版本和Makefile里的對不上,我下載的時候Makefile里的是tzupdater-1_3_29-2010f.zip可是網站上給的已經是JDK DST Timezone Update Tool - 1.3.31了,沒辦法有點小崩潰。
    

    freebsd.org的論壇上發現也有幾個哥們兒遇到了這問題,他們給出的解決辦法是取消TZUPDATE的默認選項。cd /usr/ports/java/diablo-jdk16 && make config 取消TZUPDATE前面的X。

       安裝compiz-fusion(桌面3D效果)
    

    cd /usr/ports/x11-wm/compiz-fusion

    make BATCH=YES install clean
    

    創建個啟動腳本start-compiz名并加入:

    #! /bin/sh 
    compiz --replace --sm-disable --ignore-desktop-hints ccp & 
    emerald --replace & 
    

    給這個腳本執行權限 %chmod +x start-compiz 把這個腳本加入Session和啟動以后進入Xfce4就自動啟動compiz了。

    簡單設置
    點開CompizConfig設置管理器>首選項>在后端選擇GConf Configuration Backed (這樣你以后選擇的效果就可以即時生效了。)
    

    另外在CompizConfig里吧 最小化效果、窗口裝飾、震顫窗口、移動窗口、調整窗口大小、應用程序切換條都起用了,這樣基本的3d桌面就好了。還有很多效果看自己喜好吧。

    說明參見http://www.freebsd.org/doc/en/articles/compiz-fusion/article.html
    

    -------------------------------------------------------------------------------------------------

    以下是簡單的自動安裝腳本
    
    1. !/bin/sh
    #make DEPENDS_TARGET=package package 這個命令的意思是 打包一個ports并將依賴也一起打包
    
    1. make BATCH=YES 這個命令的意思是 使用默認選項
    2. 把用ports安裝的軟件都打包到下面的目錄
    3. mkdir -p /usr/ports/packages/All/
    #安裝并打包
    
    1. make BATCH=YES DEPENDS_TARGET=package package install clean
    #安裝xorg
    cd /usr/ports/x11/xorg &&make BATCH=YES install clean
    echo 'hald_enable="YES"'>> /etc/rc.conf
    echo 'dbus_enable="YES"'>> /etc/rc.conf
    
    #安裝wqy
    cd /usr/ports/x11-fonts/wqy/ && make BATCH=YES install clean
    
    #安裝Linux二進制兼容模式
    

    kldload linux

    cd /usr/ports/emulators/linux_base-f10/ && make BATCH=YES install distclean
    echo 'linux_enable="YES"'>> /etc/rc.conf
    
    #安裝nvidia顯卡驅動
    

    cd /usr/ports/x11/nvidia-driver/ && make BATCH=YES install clean

    echo 'nvidia_load="YES"'>> /boot/loader.conf
    
    #安裝nvidia顯卡自動配置工具
    

    cd /usr/ports/x11/nvidia-xconfig/ && make install clean

    #安裝Xfce4
    cd /usr/ports/x11-wm/xfce4/ && make BATCH=YES install clean
    
    #安裝scim
    

    #cd /usr/ports/chinese/scim-pinyin/ && make BATCH=YES install clean

    #安裝firefox
    cd /usr/ports/www/firefox/ && make BATCH=YES install clean
    echo 'sem_load="YES"'>> /boot/loader.conf
    
    #安裝firefox中文包
    

    cd /usr/ports/www/firefox-i18n/ && make BATCH=YES install clean

    MybatisPlus數據安全

    概述

    存在數據庫中的數據對于普通用戶而言是不可見的,好像是藏起來了一樣,但對于開發者,只要知道數據庫的連接地址、用戶名、密碼,則數據不再安全;這也意味著,一旦連接數據庫的配置文件暴露出去,則數據不再安全。

    應用場景

    開發中的數據庫配置文件或配置中心中的配置信息

    API介紹

    MybatisPlus中有個針對配置項加密處理的

    代碼實現

    1 創建mp工程

    創建maven工程,結構如下:

    2 代碼編寫

    pom.xml

        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-boot-starter</artifactId>
                <version>3.4.1</version>
            </dependency>
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <scope>provided</scope>
            </dependency>
        </dependencies>

    application.yml

    spring:
      datasource:
        url: jdbc:mysql://localhost:3306/springboot?useSSL=false&characterEncoding=utf8&serverTimezone=Asia/Shanghai
        driver-class-name: com.mysql.cj.jdbc.Driver
        username: root
        password: root
    mybatis-plus:
      type-aliases-package: com.itheima.pojo

    啟動類

    package com.itheima;
    
    import org.mybatis.spring.annotation.MapperScan;
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    
    /**
     * @version 1.0
     * @description 說明
     * @package com.itheima
     */
    @SpringBootApplication
    @MapperScan(basePackages = "com.itheima.mapper")
    public class App {
        public static void main(String[] args) {
            SpringApplication.run(App.class,args);
        }
    }
    

    pojo

    package com.itheima.pojo;
    
    import com.baomidou.mybatisplus.annotation.TableField;
    import lombok.Data;
    
    /**
     * @version 1.0
     * @description 說明
     * @package com.itheima.pojo
     */
    @Data
    public class User {
        private Integer id;
        private String username;
        @TableField(select = false)
        private String password;
        private String salt;
    
    }
    

    mapper

    package com.itheima.mapper;
    
    import com.baomidou.mybatisplus.core.mapper.BaseMapper;
    import com.itheima.pojo.User;
    import org.springframework.stereotype.Repository;
    
    /**
     * @version 1.0
     * @description 說明
     * @package com.itheima.mapper
     */
    @Repository
    public interface UserMapper extends BaseMapper<User> {
    }
    

    service接口與實現類

    package com.itheima.service;
    
    import com.baomidou.mybatisplus.extension.service.IService;
    import com.itheima.pojo.User;
    
    /**
     * @version 1.0
     * @description 說明
     * @package com.itheima.service
     */
    public interface UserService extends IService<User> {
    }
    
    package com.itheima.service.impl;
    
    import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    import com.itheima.mapper.UserMapper;
    import com.itheima.pojo.User;
    import com.itheima.service.UserService;
    import org.springframework.stereotype.Service;
    
    /**
     * @version 1.0
     * @description 說明
     * @package com.itheima.service.impl
     */
    @Service
    public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    }
    

    controller

    package com.itheima.controller;
    
    import com.itheima.pojo.User;
    import com.itheima.service.UserService;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.web.bind.annotation.GetMapping;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RestController;
    
    import java.util.List;
    
    /**
     * @version 1.0
     * @description 說明
     * @package com.itheima.controller
     */
    @RestController
    @RequestMapping("user")
    public class UserController {
    
        @Autowired
        private UserService userService;
    
        @GetMapping
        public List<User> listAll(){
            return userService.list();
        }
    
    }
    

    啟動測試

    生成加密后的內容

    package com.itheima;
    
    import com.baomidou.mybatisplus.core.toolkit.AES;
    import org.mybatis.spring.annotation.MapperScan;
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    
    /**
     * @version 1.0
     * @description 說明
     * @package com.itheima
     */
    @SpringBootApplication
    @MapperScan(basePackages = "com.itheima.mapper")
    public class App {
        public static void main(String[] args) {
            String secretKey = AES.generateRandomKey();
            System.out.println("secretKey:" + secretKey);
    
            String url = AES.encrypt("jdbc:mysql://localhost:3306/springboot?useSSL=false&characterEncoding=utf8&serverTimezone=Asia/Shanghai", secretKey);
            String username = AES.encrypt("username", secretKey);
            String password = AES.encrypt("password", secretKey);
            System.out.println("url=" +url );
            System.out.println("username=" +username );
            System.out.println("password=" +password );
    
            SpringApplication.run(App.class,args);
        }
    }
    

    替換配置文件

    spring:
      datasource:
        url: mpw:wT9PqZ9Hf4VWgXDuZ/Z1JKfdDyS0sSu3+O2qDkJ/Ulnabpq3z1lZbiThWseQ4DQSx3+SWpufsTysjdYhn6Scsa77AzIIaUgv8DZ17gPxAq88AISmxd9OjxidmY50uBVMkGhP9qAted45zuHBzVrw6Q==
        driver-class-name: com.mysql.cj.jdbc.Driver
        username: mpw:Pnh++mI45YrC4s6JveJYaA==
        password: mpw:Pnh++mI45YrC4s6JveJYaA==
    mybatis-plus:
      type-aliases-package: com.itheima.pojo

    添加啟動參數

    運行效果

    3 優化

    目的

    啟動時,需要指定密鑰 才能使用,如果我們把它封裝到一個jar里,讓它啟動時自動去加載密鑰,且密鑰可配置,那這樣就更靈活了。

    分析

    通過查看MybatisPlus加載的源碼,其做解密處理的類如下:

    /*
     * Copyright (c) 2011-2020, baomidou (jobob@qq.com).
     * <p>
     * Licensed under the Apache License, Version 2.0 (the "License"); you may not
     * use this file except in compliance with the License. You may obtain a copy of
     * the License at
     * <p>
     * https://www.apache.org/licenses/LICENSE-2.0
     * <p>
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
     * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
     * License for the specific language governing permissions and limitations under
     * the License.
     */
    package com.baomidou.mybatisplus.autoconfigure;
    
    import com.baomidou.mybatisplus.core.toolkit.AES;
    import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
    import com.baomidou.mybatisplus.core.toolkit.StringUtils;
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.env.EnvironmentPostProcessor;
    import org.springframework.boot.env.OriginTrackedMapPropertySource;
    import org.springframework.core.env.ConfigurableEnvironment;
    import org.springframework.core.env.MapPropertySource;
    import org.springframework.core.env.PropertySource;
    import org.springframework.core.env.SimpleCommandLinePropertySource;
    
    import java.util.HashMap;
    
    /**
     * 安全加密處理器
     *
     * @author hubin
     * @since 2020-05-23
     */
    public class SafetyEncryptProcessor implements EnvironmentPostProcessor {
    
        @Override
        public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
            /**
             * 命令行中獲取密鑰
             */
            String mpwKey = null;
            for (PropertySource<?> ps : environment.getPropertySources()) {
                if (ps instanceof SimpleCommandLinePropertySource) {
                    SimpleCommandLinePropertySource source = (SimpleCommandLinePropertySource) ps;
                    mpwKey = source.getProperty("mpw.key");
                    break;
                }
            }
            /**
             * 處理加密內容
             */
            if (StringUtils.isNotBlank(mpwKey)) {
                HashMap<String, Object> map = new HashMap<>();
                for (PropertySource<?> ps : environment.getPropertySources()) {
                    if (ps instanceof OriginTrackedMapPropertySource) {
                        OriginTrackedMapPropertySource source = (OriginTrackedMapPropertySource) ps;
                        for (String name : source.getPropertyNames()) {
                            Object value = source.getProperty(name);
                            if (value instanceof String) {
                                String str = (String) value;
                                if (str.startsWith("mpw:")) {
                                    map.put(name, AES.decrypt(str.substring(4), mpwKey));
                                }
                            }
                        }
                    }
                }
                // 將解密的數據放入環境變量,并處于第一優先級上
                if (CollectionUtils.isNotEmpty(map)) {
                    environment.getPropertySources().addFirst(new MapPropertySource("custom-encrypt", map));
                }
            }
        }
    }
    

    其使用了SPI原理,在類所在的jar下的META-INF/spring.factories中配置了這個SafetyEncryptProcessor。那我們能否也來定義一個這樣的配置處理器,判斷環境配置中是否配置了--mpw.key,如果沒有配置,則給它配置上,這樣就不用在啟動時添加參數來運行了。

    實現

    創建配置工程mysafe

    代碼清單

    pom.xml

    <parent>
        <artifactId>spring-boot-starter-parent</artifactId>
        <groupId>org.springframework.boot</groupId>
        <version>2.3.8.RELEASE</version>
    </parent>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
    </dependencies>

    SafetyEncryptProcessor

    package com.itheima;
    
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.env.EnvironmentPostProcessor;
    import org.springframework.core.Ordered;
    import org.springframework.core.env.ConfigurableEnvironment;
    import org.springframework.core.env.PropertySource;
    import org.springframework.core.env.SimpleCommandLinePropertySource;
    import org.springframework.core.io.ClassPathResource;
    import org.springframework.util.StringUtils;
    
    import java.io.IOException;
    import java.util.Properties;
    
    /**
     * @version 1.0
     * @description 說明
     * @package com.itheima
     */
    public class SafetyEncryptProcessor implements EnvironmentPostProcessor, Ordered {
    
        @Override
        public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
            Properties pro = new Properties();
            try {
                pro.load(new ClassPathResource("ert.properties").getInputStream());
            } catch (IOException e) {
                e.printStackTrace();
            }
            /**
             * 命令行中獲取密鑰
             */
            String mpwKey = null;
            for (PropertySource<?> ps : environment.getPropertySources()) {
                if (ps instanceof SimpleCommandLinePropertySource) {
                    SimpleCommandLinePropertySource source = (SimpleCommandLinePropertySource) ps;
                    mpwKey = source.getProperty("mpw.key");
                    break;
                }
            }
            if(StringUtils.isEmpty(mpwKey)){
                environment.getPropertySources().addFirst(new SimpleCommandLinePropertySource("mySpringApplicationCommandLineArgs", "--mpw.key=" + pro.getProperty("ert.version")));
            }
        }
    
        @Override
        public int getOrder() {
            return 0;
        }
    }
    

    spring.factories

    ert.version=b440fe7fd55dbe26
    org.springframework.boot.env.EnvironmentPostProcessor=\
    com.itheima.SafetyEncryptProcessor

    ert.properties

    ert.version=2ac6625cb3188f52

    安裝到本地倉庫

    修改mp工程添加依賴

    修改pom.xml,添加mysafe的依賴

    <dependency>
        <groupId>com.itheima</groupId>
        <artifactId>mysafe</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>

    4 測試結果

    去除啟動時的參數設置。再啟動后訪問頁面、效果如下:

    總結

    1. MybatisPlus利用了springboot的配置信息增強器與SPI機制來實現對配置文件中敏感數據的解密處理。
    2. mysafe工程打成的jar包,將來就上傳到企業的內部服務器上,當密鑰變更時,重新打包即可。
    3. 而我們將來布署項目到服務器上時,也肯定存在配置文件,一旦配置信息暴露,則數據庫就危險了。通過加密手段能夠讓破解者增加破解阻礙。
    4. 此次練習僅做拋磚引玉作用,關于加密與解密是沒有做到那么嚴謹的,需要結合自己公司實際情況去調整。
網站首頁   |    關于我們   |    公司新聞   |    產品方案   |    用戶案例   |    售后服務   |    合作伙伴   |    人才招聘   |   

友情鏈接: 餐飲加盟

地址:北京市海淀區    電話:010-     郵箱:@126.com

備案號:冀ICP備2024067069號-3 北京科技有限公司版權所有