博客:https://antkillerfarm.github.io/
VMWare 自帶的 tools 在新版 Ubuntu 上總是裝不上,解法其實很簡單:
sudo apt-get install linux-headers-virtual open-vm-dkms open-vm-tools # 圖形界面 sudo apt-get install --no-install-recommends linux-headers-virtual open-vm-dkms open-vm-tools # 純命令行
apt-get install nautilus-gksu
用 alsamixer 調一下配置即可。
Ubuntu 12.04 LTS 改用 Unity 桌面後,一些 GNOME 工具不再可用。想顯示實時網速可以用 indicator-netspeed:
sudo apt-get install build-essential libgtop2-dev libgtk-3-dev libappindicator3-dev git-core mkdir git_project && cd git_project git clone git://github.com/mgedmin/indicator-netspeed.git make ./indicator-netspeed
順帶一提,我最初給它建了桌面快捷方式,但每次開機還要手動點一下太麻煩。後來發現「關機」菜單上方有個「啟動應用程序」,名字像 Windows 的 Run,實際上就是開機自啟動管理。注意修改 ~/.profile 之類的文件沒用,那是在進入桌面之前執行的,桌面還沒 ready,很多 GUI 程序跑不起來。Ubuntu 14.04 裡「啟動應用程序」界面找不到了,但機制沒變——在 ~/.config/autostart 下建 desktop 文件即可。
在 Win7 上搭 Ubuntu 14.04 虛擬機,因為 VMware 8.0 自帶的 VMTool 在新內核下編譯報錯,只能改用 FTP 共享文件。
最初想在 Ubuntu 虛擬機裡架 vsftpd,Windows 用 FileZilla 訪問,結果沒成功,關鍵點如下:
1)Ubuntu 用 vsftpd 作服務端,虛擬機內可正常訪問,宿主機不行;
2)做好 Host 與 Guest 的 21 端口映射後,FTP 登錄成功但 LIST 列目錄失敗;
3)主動/被動模式、端口映射反覆折騰仍不通。
對比虛擬機與真實機器的組網差異後我意識到:虛擬機處在虛擬內網中,默認外網無法訪問虛擬機,而虛擬機可以訪問外網。於是反過來,在 Win7 上用 IIS 搭 FTP 服務,Ubuntu 虛擬機用 FileZilla 訪問,終於成功。
sudo apt-get install p7zip # 7zip sudo apt-get install rar unrar # rar,注意壓縮與解壓是不同的包
cd - 可回到上一次所在路徑,在兩個相距很遠的目錄間切換時很實用。常按 Win 鍵會彈出 Unity 的鍵盤快捷鍵列表。
Monkey's Audio 是常見的無損音頻格式,擴展名 .ape。Rhythmbox 能播 ape 但不支援配套的 cue,解法如下:
1) 在 /etc/apt/sources.list 中加入: deb https://www.deb-multimedia.org squeeze main 2) sudo apt-get update 3) sudo apt-get install deb-multimedia-keyring 4) sudo apt-get install monkeys-audio 5) sudo apt-get install shntool flac 6) shnsplit -f CDImage.cue -i ape -t '%t' -o flac CDImage.ape
推薦 https://pkgs.org,很多 deb 包都能在那裡找到。
1)最好的辦法是裝開發環境時讓包自動裝好,比如研究 GTK3 時安裝相關包,GObject 之類的文檔就一併就位;
2)有些項目源碼帶 doc 目錄,若其中有 devhelp(或 devhelp2)擴展名的文件,說明支持 devhelp 查看,把該文件夾複製到 devhelp 放書的目錄並改名為主文件名即可。各版本放書路徑不同,可先找 gtk-doc 的位置:
sudo apt-get install libgtk-3-doc
Unity 側邊欄類似 Win7 任務欄,鎖定圖標過多會干擾切換,而 Unity 沒有 Win 那種自動收起的快速啟動欄。利用右鍵菜單可以達到類似效果:
1)新建文件夾並在其中創建 MyQuickStart.desktop;
2)編輯內容:
[Desktop Entry] Version=1.0 Type=Application Name=MyQuickStart Exec=/usr/bin/emacs23 %F Icon=warrior Terminal=false X-Ayatana-Desktop-Shortcuts=StarDict;Devhelp;SystemMonitor;SystemSettings;Glade;LibreOffice [StarDict Shortcut Group] Name=StarDict Name[zh_CN]=星際譯王 Exec=stardict TargetEnvironment=Unity [Devhelp Shortcut Group] Name=Devhelp Exec=devhelp TargetEnvironment=Unity [SystemMonitor Shortcut Group] Name=SystemMonitor Name[zh_CN]=系統監視器 Exec=gnome-system-monitor TargetEnvironment=Unity [SystemSettings Shortcut Group] Name=SystemSettings Name[zh_CN]=系統設置 Exec=gnome-control-center --overview TargetEnvironment=Unity [Glade Shortcut Group] Name=Glade Exec=glade TargetEnvironment=Unity [LibreOffice Shortcut Group] Name=LibreOffice Exec=libreoffice TargetEnvironment=Unity
本質上就是個桌面啟動文件,有興趣可用「Desktop Entry」為關鍵字搜索寫法,/usr/share/applications 下已有的 .desktop 文件也是很好的參考。
3)把權限改為可執行,拖到側邊欄即可看到效果。
源配置在 /etc/apt/sources.list,官方源分四類:main(官方維護的基礎庫)、restricted(官方維護的其他自由軟件)、universe(自由軟件但官方不維護)、multiverse(非自由軟件,官方不維護)。
sudo apt-cache search gstreamer # 搜索包含 gstreamer 的包 sudo add-apt-repository ppa:tualatrix/ppa # 添加新源
1. Ubuntu Tweak,官網 https://ubuntu-tweak.com/,代碼 https://github.com/tualatrix/ubuntu-tweak:
sudo apt-get install python-pip python-aptdaemon.gtk3widgets python-gi python-lxml libwebkitgtk-3.0-dev libgconf2-dev python-compizconfig libdbus-glib-1-dev python-dbus python-xdg python-cairo
2. BleachBit,支援平台廣泛,多數發行版都有對應包。
Ubuntu 下有三套:tftp/tftpd、atftp/atftpd、tftp-hpa/tftpd-hpa,目前最流行的是最後一套:
sudo apt-get install tftp-hpa tftpd-hpa
sudo ifconfig eth0 192.168.2.1 netmask 255.255.255.0
iwconfig # 查看無線網卡狀態 wpa_cli iwlist scanning # 掃描周圍 wifi
VMPK 是俗稱的「虛擬電子琴」,本身只產生 MIDI 輸出,需要配合 Qsynth、TiMidity 等後處理軟件才能發聲。
一類支持超鏈接且可全文檢索,如 Gnote、Tomboy;另一類是桌面隨意貼,如 Indicator Stickynotes(無檢索)與 Knotes(有檢索)。
sudo apt-get install unity-tweak-tool sudo add-apt-repository ppa:noobslab/themes sudo apt-get update sudo apt-get install mac-ithemes-v3 mac-icons-v3 sudo apt-get install cairo-dock
Cairo Dock 風格眾多,我用的是 Chrome 風格。更多主題見 https://www.ubuntuthemes.org/(需註冊,部分收費)。
Linux 下主要有 RealVNC(VNC 協議)與 rdesktop(MS RDP 協議,可連 Windows):
sudo apt-get install rdesktop rdesktop -u administrator -p ****** -a 16 192.168.1.1
常用 MD5 與 SHA 系列命令:md5sum、sha1sum、sha224sum、sha256sum、sha384sum、sha512sum。
Office:微軟 MS Office,免費替代 LibreOffice;流程圖:MS Visio,替代 DIA、Kivio;思維導圖:MindManager,替代 FreeMind;快速原型:Axure RP,替代 pencil。
Linux 以發行版眾多聞名,https://distrowatch.com/ 可以對各發行版做簡單比較。
1. StarOffice → OpenOffice.org → LibreOffice,最初由 Sun 主導,後轉為 Google 主導;
2. KOffice → Calligra Office,KDE 項目成果;
3. GOffice,Gnome 項目成果,組件較獨立,協同能力偏弱。