2017年8月3日木曜日

★★★★★ manjaro linux 超簡単な日本語化 fictx-mozcで入力




一つのハードディスクにwin10とmanjaroとをいれると、
win10をupdateした後は win10しか立ち上がらなくなります。
これを修正するには supergrubをUSBメモリに焼き付けてこれからmanjaroを立ち上げて
grub-install /dev/sda (大概はsda)
しないといけませんね
https://distrowatch.com/dwres.php?resource=popularity でsupergrubを探してください

作家の百田氏が
柔道を例に挙げてましたが
相手を受け身だけで 全く攻撃せずにいなすには
かなりな実力差がいると言ってました。

ボクシングだともっとわかりやすくなります。
したがって専守防衛と言うのは ちょっとちょっとです


 恨み

恨む対象がないと 生きられないと この歌はいっている


この地図が戦前のアジアの実態


さて本論です。
グーグルドキュメントでの 音声入力が長い間できなかったのですが
ふと試すと2019年10月16日にはできるようになってました。

それから2019年10月22日時点の話ですが
スクリーンセーバーから回復したとき、キーボードのキーをchromiumで受け付けなくなるときは、端末でfcitx-autostartすれば治ります


1)ファイルシステムを XFS にして手動でインストールします。

普通のインストールは 次に書きます。


にてインスト開始








手動インストールです










UEFI領域を確保します



swapです



ピンぼけですが xfs で / です。









以上です









2)以下は昔書いた 単純なインストです、ext4です。









まず WIFIにつなぎます、 右下の扇形をクリックですね





インストールをクリックします。





日本人なので japanese を選びます




時間です



キーボードです。




自分のは
すでに
パーティション 1と2に windows10
パーティション 3に openbsd
が入ってます
それで 空きの パーティション4にいれます。











いつものことです






一応まとめがでて



インストールが終わります





再起動して ログインです。







3)日本語化です

もうすでに 日本の文字は入ってるので <ー読む
入れるのは 日本語入力だけです    <ー書く

そのため まず第一に .xprofile に 3行だけ付け加えます
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx




それから次に 
この後
pacman -Sy otf-ipafont fcitx-im fcitx-configtool fcitx-mozc cups ghostscript evince poppler-data yay

(poppler-dataは pdfの日本語表示をできるようにするため必要です, yaourtからyayへ移行した)



systemctl enable org.cups.cupsd.service

fcitx-mozc  fcitx-gtk3  fcitx-configtool
をいれます
つまり順番が大事。

これだけで再起動すれば日本語OKです
日本語フォントのインストールも不要です。


普通は以下は 無視していいです。

しかし 急にあかんようになりました;

https://wiki.manjaro.org/index.php?title=%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%AE%E8%A8%AD%E5%AE%9A
みて


 nano /etc/locale.gen
ja_jp.utf8の#をはずす。
 locale-gen
でロケールを生成。


nano /etc/locale.conf
LANG="en_US.UTF-8"のところを LANG="ja_JP.UTF-8"に書き換える。




~/.xprofile を以下のように編集。
export LANG="ja_JP.UTF-8"
export XMODIFIERS="@im=fcitx"
export XMODIFIER="@im=fcitx"
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export DefaultIMModule=fcitx


~/.bashrc を開き、以下のように編集
export GTK_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export QT_IM_MODULE=fcitx


pacman -S fcitx-mozc fcitx-gtk2 fcitx-gtk3 


これでどないだ

再起動すれば ほら日本語入力 OKになってます
簡単すぎます




画面が黒くなるのは
DPMS
のせいでしょう


tmux を導入して
% cat .zshrc
autoload -U compinit colors zcalc
compinit
colors

setopt correct          # Auto correct mistakes
setopt extendedglob     # Extended globbing
setopt nocaseglob       # Case insensitive globbing
setopt rcexpandparam    # Array expension with parameters
setopt nocheckjobs      # Don't warn about running processes when 
#exiting
setopt numericglobsort  # Sort filenames numerically when it makes sense
setopt nohup            # Don't kill processes when exiting
setopt nobeep           # No beep
setopt appendhistory    # Immediately append history instead of 
#overwriting
setopt histignorealldups #If a new command is a duplicate, remove the 
#older one

zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'       # Case 
#insensitive tab completion
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"         # 
# Colored completion (different colors for dirs/files/etc)

bindkey -e
bindkey '^[[7~' beginning-of-line                   # Home key
bindkey '^[[8~' end-of-line                         # End key
bindkey '^[[2~' overwrite-mode                      # Insert key
bindkey '^[[3~' delete-char                         # Delete key
bindkey '^[[A'  up-line-or-history                  # Up key
bindkey '^[[B'  down-line-or-history                # Down key
bindkey '^[[C'  forward-char                        # Right key
bindkey '^[[D'  backward-char                       # Left key
bindkey '^[[5~' history-beginning-search-backward   # Page up key
bindkey '^[[6~' history-beginning-search-forward    # Page down key

HISTFILE=~/.zhistory
HISTSIZE=10000
SAVEHIST=10000

alias sudo='sudo '
alias ls='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" 
--color=auto -F'
alias ll='ls -l --group-directories-first --time-style=+"%d.%m.%Y %H:%M" 
--color=auto -F'
alias la='ls -la --group-directories-first --time-style=+"%d.%m.%Y 
%H:%M" --color=auto -F'
alias grep='grep --color=tty -d skip'
alias cp="cp -i"                        # Confirm before overwriting 
#something
alias df='df -h'                        # Human-readable sizes
alias free='free -m'                    # Show sizes in MB

# ex - archive extractor
# usage: ex <file>
ex() {
  if [ -f $1 ] ; then
    case $1 in
      *.tar.bz2)   tar xjf $1   ;;
      *.tar.gz)    tar xzf $1   ;;
      *.bz2)       bunzip2 $1   ;;
      *.rar)       unrar x $1     ;;
      *.gz)        gunzip $1    ;;
      *.tar)       tar xf $1    ;;
      *.tbz2)      tar xjf $1   ;;
      *.tgz)       tar xzf $1   ;;
      *.zip)       unzip $1     ;;
      *.Z)         uncompress $1;;
      *.7z)        7z x $1      ;;
      *)           echo "'$1' cannot be extracted via ex()" ;;
    esac
  else
    echo "'$1' is not a valid file"
  fi
}

# zaw
# source /home/manjaro/dotfiles/.zsh/tools/zaw/zaw.zsh

# prompt
# source /home/manjaro/dotfiles/.zsh/tools/zsh_prompt/.zshrc.prompt

# autojump
export FPATH="$FPATH:/usr/share/zsh/site-functions/"
[[ -s /home/manjaro/.autojump/etc/profile.d/autojump.sh ]] && source 
#/home/manjaro/.autojump/etc/profile.d/autojump.sh

# http://d.hatena.ne.jp/yarb/20110126/p1
function mkcd() {
if [[ -d $1 ]]; then
echo "It already exsits! Cd to the directory."
cd $1
else
echo "Created the directory and cd to it."
mkdir -p $1 && cd $1
fi
}

# http://d.hatena.ne.jp/hiboma/20120315/1331821642
pbcopy-buffer(){
print -rn $BUFFER | xsel
zle -M "xsel: ${BUFFER}"
}

zle -N pbcopy-buffer
bindkey '^p^p' pbcopy-buffer

#google
function go() {
local str opt
if [ $ != 0 ]; then
for i in $*; do
str="$str+$i"
done
str=`echo $str | sed 's/^\+//'`
opt='search?num=50&hl=ja&lr=lang_ja'
opt="${opt}&q=${str}"
fi
w3m http://www.google.co.jp/$opt
}

# complete
autoload -U compinit
compinit
zstyle ':completion:*:default' menu select=2
zstyle ':completion:*' verbose yes
zstyle ':completion:*' completer _expand _complete _match _prefix 
_approximate _list _history
zstyle ':completion:*:messages' format '%F{YELLOW}%d'$DEFAULT
zstyle ':completion:*:warnings' format '%F{RED}No matches 
for:''%F{YELLOW} %d'$DEFAULT
zstyle ':completion:*:descriptions' format '%F{YELLOW}completing 
%B%d%b'$DEFAULT
zstyle ':completion:*:options' description 'yes'
zstyle ':completion:*:descriptions' format '%F{yellow}Completing 
%B%d%b%f'$DEFAULT
zstyle ':completion:*' list-separator '-->'
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*' group-name ''

# zaw
bindkey '^x^x' zaw

# cd ls
function chpwd() { ls -aF }

# color
autoload colors
colors
#source 
#/home/manjaro/dotfiles/.zsh/tools/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

# code
export LANG=ja_JP.UTF-8

# alias
alias tmux="tmux -2"
alias ll="ls -Fa"
alias zs="source ~/.zshrc && exec $SHELL"
alias vs="vim ~/.vimrc"
alias ts="vim ~/.tmux.conf"

# tmux
# tmux自動起動
if [ -z "$TMUX" -a -z "$STY" ]; then
if type tmux >/dev/null 2>&1; then
if tmux has-session && tmux list-sessions | /usr/bin/grep -qE '.*]$'; 
then
tmux attach && echo "tmux attached session "
else
tmux new-session && echo "tmux created new session"
fi
fi
fi




X-A) IPSET (アクセス拒否)

1)curl -O http://nami.jp/ipv4bycc/cidr.txt.gz && gunzip -f cidr.txt.gz






2)sed -n 's/^\(CN\|KP\|KR\)\t//p' cidr.txt > wa.txt

head wa.txt 
1.0.1.0/24
1.0.2.0/23
1.0.8.0/21
1.0.32.0/19
1.1.0.0/24
1.1.2.0/23
1.1.4.0/22
1.1.8.0/21
1.1.16.0/20
1.1.32.0/19


3) sed "s/^/ipset add wa /g" wa.txt >wa.bat

# head wa.bat 
ipset add wa 1.0.1.0/24
ipset add wa 1.0.2.0/23
ipset add wa 1.0.8.0/21
ipset add wa 1.0.32.0/19
ipset add wa 1.1.0.0/24
ipset add wa 1.1.2.0/23
ipset add wa 1.1.4.0/22
ipset add wa 1.1.8.0/21
ipset add wa 1.1.16.0/20
ipset add wa 1.1.32.0/19


4)chmod +x wa.bat


5)reboot



6)
# ipset destroy
# ipset create wa hash:net
# ./wa.bat 



7)nat.bat 
cp /etc/resolv.conf-8888 /etc/resolv.conf
sleep 3
ifconfig enp1s0 192.168.17.1
sleep 3
systemctl restart ipset
systemctl restart dnsmasq
mac='wlp0s18f2u4'
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables --flush
    ipset destroy
    ipset create wa hash:net
    ipset flush wa
    iptables -A INPUT -m set --match-set wa src -j DROP
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t nat -F PREROUTING
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t filter -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o $mac -j MASQUERADE
iptables-save
iptables -L
echo
cp /etc/resolv.conf-8888 /etc/resolv.conf
ifconfig | grep 192





以上で

ipset list は以下
Name: wa
Type: hash:net
Revision: 6
Header: family inet hashsize 1024 maxelem 65536
Size in memory: 344
References: 1
Number of entries: 0
Members:





X-B)アンチヴィルス
ClamAV は clamav パッケージでインストール

# freshclam
ClamAV update process started at Wed Oct 16 11:53:08 2019
Downloading main.cvd [100%]
main.cvd updated (version: 58, sigs: 4566249, f-level: 60, builder: sigmgr)
Downloading daily.cvd [100%]







# mkdir /Virus---


# ./virus-scan.bat
clamscan --recursive --infected --remove /home --move=/Virus---

----------- SCAN SUMMARY -----------
Known viruses: 6491403
Engine version: 0.101.4
Scanned directories: 766
Scanned files: 4046
Infected files: 0
Data scanned: 601.02 MB
Data read: 371.36 MB (ratio 1.62:1)
Time: 292.980 sec (4 m 52 s)




X-C) $ yay pip-tools
して python の素敵な世界が展開します

https://qiita.com/tyokai/items/d8494fbc8fca00453cd1





X-D) 参考は

https://qiita.com/tyokai/items/06a6a44dc3fcfa0e503a



X-E)いろいろ
# crontab -l

@reboot shutdown -h +120


##
## Manjaro Linux default mirrorlist
## Generated on 2020-03-22 04:15
##
## Please use 'pacman-mirrors -f [NUMBER] [NUMBER]' to modify mirrorlist
## (Use 0 for all mirrors)
##

## Country : Japan
Server = http://ftp.tsukuba.wide.ad.jp/Linux/manjaro/stable/$repo/$arch

## Country : South_Korea
Server = https://mirror.d-tl.com/manjaro/stable/$repo/$arch

## Country : Japan
Server = http://ftp.riken.jp/Linux/manjaro/stable/$repo/$arch

## Country : Bangladesh
Server = http://mirror.xeonbd.com/manjaro/stable/$repo/$arch

## Country : Indonesia
Server = https://mirror.deace.id/manjaro/stable/$repo/$arch

## Country : Singapore
Server = https://download.nus.edu.sg/mirror/manjaro/stable/$repo/$arch

## Country : India
Server = https://mirrors.piconets.webwerks.in/manjaro-mirror/stable/$repo/$arch

## Country : Russia
Server = http://mirror.truenetwork.ru/manjaro/stable/$repo/$arch

## Country : Philippines
Server = http://mirror.rise.ph/manjaro/stable/$repo/$arch

## Country : United_States
Server = https://mirror.math.princeton.edu/pub/manjaro/stable/$repo/$arch

## Country : United_States
Server = http://distro.ibiblio.org/manjaro/stable/$repo/$arch

## Country : United_States
Server = https://repo.ialab.dsu.edu/manjaro/stable/$repo/$arch

## Country : Hong_Kong
Server = http://ftp.cuhk.edu.hk/pub/Linux/manjaro/stable/$repo/$arch






X-C)