第0 軟件開發實現幸福人生
第16篇
Manjaro Linux
2019年4月3日更新,共1.0万字
本文摘要:Manjaro Linux是基于Arch Linux的發行版,和Arch一樣采用滾動更新。Manjaro擁有自己獨立的軟件倉庫,目標是讓強大的Arch更方便用戶使用。

Manjaro Linux是基于Arch Linux的發行版,和Arch一樣,采用滾動更新。Manjaro擁有自己獨立的軟件倉庫,目標是讓強大的Arch更方便用戶使用,使用著名的Pacman軟件包管理工具,可以直接利用AUR上的資源。

安裝系統

1. 下載安裝盤
https://manjaro.org/download
gnome
https://mirrors.tuna.tsinghua.edu.cn/osdn/storage/g/m/ma/manjaro/gnome/18.1.0-pre1/manjaro-gnome-18.1.0-pre1-testing-x86_64.iso
kde
https://mirrors.tuna.tsinghua.edu.cn/osdn/storage/g/m/ma/manjaro/kde/18.0.4/manjaro-kde-18.0.4-stable-x86_64.iso
xfce
https://mirrors.xtom.com.hk/osdn//storage/g/m/ma/manjaro/xfce/18.0.4/manjaro-xfce-18.0.4-stable-x86_64.iso

2. 清空U盤
(1) windows command run as administrator
(2) diskpart
(3) list disk
(4) select disk 1
(5) list partition
(6) clean

3. 制作USB啟動盤
下載Rufus: https://rufus.ie
啟動rufus, 選擇下載的ISO文件,partition schema選GPT,點擊start,寫入方式選DD Image

4. 按F8選擇從USB啟動電腦
Welcome to Manjaro, 選擇Boot: Manjaro.x86_64 kde/gnome

5. 設置Wifi,連上網絡
點擊桌面上的Install Manjaro Linux圖標,安裝系統到硬盤
Language: American English
Region: Asia, Zone: Shanghai, numbers and dates locale: en_us.utf-8 (English United States)
Keyboard: English(US) , Default

6. replace a partition

7. setup user name and password

8. summary, click install button

9. install complete, restart computer

10. 再次設置Wifi,連上網絡
配置速度最快的更新源,點擊左下角開始菜單,打開terminal, 測試國內的源:
# sudo pacman-mirrors -i -c China -m rank
# sudo pacman-mirrors -gb testing -c China

測試全部的源sudo pacman-mirrors -f 0
This will test the speed of all currently available mirrors and set your machine to use the best.

測試結果寫入下列文件中:
/etc/pacman.conf
/etc/pacman.d/mirrolist

Once this command has completed, you should force a download of the package lists with the command:
sudo pacman -Syyu

display package info
pacman -Si packagename

install a package
pacman -S packagename

search for packages both in packages' names and descriptions:
pacman -Ss chromium


share files with windows

地址欄輸入 smb://192.168.0.120/folder
make a link to it by create a location link



安裝遠程桌面服務

1. sudo pacman -S krfb
2. search krfb, set passwords, enable control
3. install nvcviewer on windows, connect to krfb



安裝基本工具

sudo pacman -S vim cmake clang openssh git chromium go yaourt yay

在optopi中啟用aur

# 查找軟件
yay visual-studio-code-bin
yay mongodb-bin
yay mongodb-tools-bin

# 安裝軟件
yay -S visual-studio-code-bin

# 卸載軟件
yay -R packagename

# 更新系統以及軟件(包含 AUR)
yay -Syu

# 查詢不被依賴的軟件包
yay -Qdt



設置科學上網

1. 安裝ss client

cd ~/Projects
git clone https://github.com/shadowsocks/shadowsocks-go

go get github.com/shadowsocks/shadowsocks-go/cmd/shadowsocks-local
cd ~/go/bin

cp ~/Projects/shadowsocks-go/sample-config/client-multi-server.json ~/go/bin
mv client-multi-server.json config.json

啟動ss client
~/go/bin/shadowsocks-local

2. 設置proxy

點擊左下角圖標,在type to search的地方輸入proxy
啟動proxy
選擇use proxy auto configuration url:
https://zaahan.us:888/files/p.js

3. 啟動chromium,這時已經可以科學上網了,因為它使用的是剛才設置的proxy

4. 啟動firefox, 點擊右上角菜單,打開preferences ,拖到最下面Network Proxy, 點擊settings,
選擇automatic proxy configuration url
https://zaahan.us:888/files/p.js
勾上proxy dns when using socks5
現在firefox可以科學上網了


為terminal命令行設置http代理

將socks5代理鑽換爲http代理
pacman -S glider
glider -listen http://:8123 -forward socks5://127.0.0.1:1080

make proxy script file at ~/proxy
vim ~/proxy
------------------
#!/bin/bash
export http_proxy=http://127.0.0.1:8123
export HTTP_PROXY=$http_proxy
export https_proxy=$http_proxy
export HTTPS_PROXY=$http_proxy
export ftp_proxy=$http_proxy
export FTP_PROXY=$http_proxy
export rsync_proxy=$http_proxy
export RSYNC_PROXY=$http_proxy
export all_proxy=$http_proxy
export ALL_PROXY=$http_proxy
export no_proxy="localhost,127.0.0.1,192.168.0.120,.zaahan.us"
export NO_PROXY="localhost,127.0.0.1,192.168.0.120,.zaahan.us"

echo "http_proxy setup at : "
echo $http_proxy
------------------

vim ~/unsetproxy
-----------
#!/bin/bash

unset http_proxy https_proxy ftp_proxy rsync_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY all_proxy ALL_PROXY no_proxy NO_PROXY

echo "Proxy environment variable removed."
-------------

make these 2 script files exe: right click the files, click properties, check is executable

要使用代理的時候:
source ~/proxy
取消使用代理的時候:
source ~/unsetproxy


安裝輸入法

安裝字體
pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji wqy-microhei wqy-microhei-lite
安裝輸入法
pacman -S ibus-rime ibus-qt

在 ~/.xprofile (create it if not exist) 添加下面的內容
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
ibus-daemon -drx

重啟系統

相關設置命令:命令行中輸入ibus-setup, qtconfig-qt4

https://gythialy.github.io/manjaro-config/
https://blog.csdn.net/tangcuyuha/article/details/80297905
https://gianthard.rocks/a/18
https://wiki.archlinux.org/index.php/IBus
http://caosiyang.github.io/2018/02/20/manjaro
https://itsfoss.com/why-use-manjaro-linux

設置模糊音,默認簡體中文
再文件夾 /home/jianyin/.config/ibus/rime/ 中
添加以下兩個文件:

luna_pinyin.custom.yaml
------------------------------------
patch:
switches: # 注意縮進
- name: ascii_mode
reset: 0 # reset 0 的作用是當從其他輸入法切換到本輸入法重設為指定狀態
states: [ 中文, 西文 ] # 選擇輸入方案后通常需要立即輸入中文,故重設 ascii_mode = 0
- name: full_shape
states: [ 半角, 全角 ] # 而全/半角則可沿用之前方案的用法。
- name: simplification
reset: 1 # 增加這一行:默認啟用「繁→簡」轉換。
states: [ 漢字, 漢字 ]
'speller/algebra':
- erase/^xx$/ # 第一行保留

# 模糊音定義
# 需要哪組就刪去行首的 # 號,單雙向任選
- derive/^([zcs])h/$1/ # zh, ch, sh => z, c, s
- derive/^([zcs])([^h])/$1h$2/ # z, c, s => zh, ch, sh

- derive/^n/l/ # n => l
- derive/^l/n/ # l => n

# 這兩組一般是單向的
#- derive/^r/l/ # r => l

#- derive/^ren/yin/ # ren => yin, reng => ying
#- derive/^r/y/ # r => y

# 下面 hu <=> f 這組寫法複雜一些,分情況討論
#- derive/^hu$/fu/ # hu => fu
#- derive/^hong$/feng/ # hong => feng
#- derive/^hu([in])$/fe$1/ # hui => fei, hun => fen
#- derive/^hu([ao])/f$1/ # hua => fa, ...

#- derive/^fu$/hu/ # fu => hu
#- derive/^feng$/hong/ # feng => hong
#- derive/^fe([in])$/hu$1/ # fei => hui, fen => hun
#- derive/^f([ao])/hu$1/ # fa => hua, ...

# 韻母部份
#- derive/^([bpmf])eng$/$1ong/ # meng = mong, ...
- derive/([ei])n$/$1ng/ # en => eng, in => ing
- derive/([ei])ng$/$1n/ # eng => en, ing => in

# 樣例足夠了,其他請自己總結……

# 反模糊音?
# 誰說方言沒有普通話精確、有模糊音,就能有反模糊音。
# 示例爲分尖團的中原官話:
#- derive/^ji$/zii/ # 在設計者安排下鳩佔鵲巢,尖音i只好雙寫了
#- derive/^qi$/cii/
#- derive/^xi$/sii/
#- derive/^ji/zi/
#- derive/^qi/ci/
#- derive/^xi/si/
#- derive/^ju/zv/
#- derive/^qu/cv/
#- derive/^xu/sv/
# 韻母部份,只能從大面上覆蓋
#- derive/^([bpm])o$/$1eh/ # bo => beh, ...
#- derive/(^|[dtnlgkhzcs]h?)e$/$1eh/ # ge => geh, se => sheh, ...
#- derive/^([gkh])uo$/$1ue/ # guo => gue, ...
#- derive/^([gkh])e$/$1uo/ # he => huo, ...
#- derive/([uv])e$/$1o/ # jue => juo, lve => lvo, ...
#- derive/^fei$/fi/ # fei => fi
#- derive/^wei$/vi/ # wei => vi
#- derive/^([nl])ei$/$1ui/ # nei => nui, lei => lui
#- derive/^([nlzcs])un$/$1vn/ # lun => lvn, zun => zvn, ...
#- derive/^([nlzcs])ong$/$1iong/ # long => liong, song => siong, ...
# 這個辦法雖從拼寫上做出了區分,然而受詞典制約,候選字仍是混的。
# 只有真正的方音輸入方案纔能做到!但「反模糊音」這個玩法快速而有效!

# 模糊音定義先於簡拼定義,方可令簡拼支持以上模糊音
- abbrev/^([a-z]).+$/$1/ # 簡拼(首字母)
- abbrev/^([zcs]h).+$/$1/ # 簡拼(zh, ch, sh)

# 以下是一組容錯拼寫,《漢語拼音》方案以前者爲正
- derive/^([nl])ve$/$1ue/ # nve = nue, lve = lue
- derive/^([jqxy])u/$1v/ # ju = jv,
- derive/un$/uen/ # gun = guen,
- derive/ui$/uei/ # gui = guei,
- derive/iu$/iou/ # jiu = jiou,

# 自動糾正一些常見的按鍵錯誤
#- derive/([aeiou])ng$/$1gn/ # dagn => dang
#- derive/([dtngkhrzcs])o(u|ng)$/$1o/ # zho => zhong|zhou
#- derive/ong$/on/ # zhonguo => zhong guo
#- derive/ao$/oa/ # hoa => hao
#- derive/([iu])a(o|ng?)$/a$1$2/ # tain => tian

# 分尖團後 v => ü 的改寫條件也要相應地擴充:
#'translator/preedit_format':
# - "xform/([nljqxyzcs])v/$1ü/"
------------------------------------


default.custom.yaml
------------------------------------
patch:
"menu/page_size": 9
------------------------------------

然后左鍵單擊rime圖標,點擊部署,搞定!




install apache php

sudo pacman -S apache php php-apache

in /etc/httpd/conf/httpd.conf
------------------------------------------
Listen 800
#LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

Place this at the end of the LoadModule list:
LoadModule php7_module modules/libphp7.so
AddHandler php7-script .php

Place this at the end of the Include list:
Include conf/extra/php7_module.conf

multiple ports and websites:

Listen 80
Listen 8080

<VirtualHost 172.20.30.40:80>
ServerName www.example.com
DocumentRoot "/www/domain-80"
</VirtualHost>

<VirtualHost 172.20.30.40:8080>
ServerName www.example.com
DocumentRoot "/www/domain-8080"
</VirtualHost>
----------------------------------------
sudo systemctl enable httpd.service
sudo systemctl start httpd.service
sudo systemctl restart httpd.service

allow write files:
chown -R http:http filder

https://www.linode.com/docs/web-servers/lamp/how-to-install-a-lamp-stack-on-arch-linux/
https://wiki.archlinux.org/index.php/Apache_HTTP_Server#PHP



安裝配置開發工具

yaourt -S visual-studio-code-bin


git config credential.helper store
git config --global user.email "jinmin.si@outlook.com"
git config --global user.name "SiJinmin"
git config --global http.proxy socks5h://localhost:1080
git add * && git commit -m'sync' && git push
git config --list

install nvm:
curl -x socks5h://localhost:1080 -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

close terminal and reopen it to make nvm effective

list available versions:
nvm ls-remote

install lastest node
nvm install node

check installed versions
nvm ls



upgrade npm
npm install npm@latest -g

npm config list
npm config delete proxy
npm config delete https-proxy
npm config delete proxy --global
npm config delete https-proxy --global


修改源地址為淘寶 NPM 鏡像
npm config set registry http://registry.npm.taobao.org/
修改源地址為官方源
npm config set registry https://registry.npmjs.org/



其它常用命令

ps -aux | grep processname

ssh hostname -l username
0位明友赞赏支持了本文:
我最先支持!
70%
第0 软件开发实现幸福人生
第16篇
简体版 繁體版 写评论 放大 缩小
本文已获得0条评论,被阅览4459次
©2014-2018 乐法明
愿天下父母长寿安康,愿天下子女富裕安详
联系我们:
【Email】jinmin.si@outlook.com
【微信】sidinzi
【QQ群】546445153
宣传推广
手机自适应网站开发
帮您开发像本站一样能自动适应手机、平板、PC等任意大小屏幕的网站。
您也可以直接购买一个和本站功能类似的网站,可将内容替换成您喜欢的内容。
需要的朋友请加微信号sidinzi详谈
本站广告位招商
10元/月 25元/季 80元/年
支付金额的一半会作为投资入股本站,公开发布在『贡献记』页面 上。

联系本站站长微信号:sidinzi
乞请您资助本站的发展,可通过以下任一种方式:
发微信红包到
微信号:sidinzi
发支付宝红包到
jinmin.si@outlook.com
发QQ红包到
QQ号: 914899525
Paypal转账到
jinmin.si@outlook.com
布施乐法明
您的IE浏览器版本太低,页面可能会显示不正常,建议您升级到最新版的IE,或者使用Chrome浏览器访问本站。
点击这里安装最新版的IE
关闭