第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条评论,被阅览2877次
©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
关闭