- ~$:# fcitx export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS="@im=fcitx"
- ~$: vim ~/.xinitrc
export LC_ALL=zh_CN.UTF-8 export GTK_IM_MODULE=fcitx export QT_IM_MODULE=fcitx export XMODIFIERS=“@im=fcitx”
- find the fastest mirror
~$:sudo pacman-mirrors -gb testing -c China #chose region
~$:sudo pacman -Syyu #update
- auto find the best mirror base on your location (deb mirror) just add the code below to the top of your /etc/apt/sources
> deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse
- locale
~$: vim /etc/defalut/locale
~$: locale-gen
~$: locale -a
~$: locale
~$: sudo /usr/share/locales/install-language-pack en_US
- declare (create a variables )
~$: declare { variables }
- set (show all variables of current shell)
~$: set
- env(show variables related to current user)
~$: env
- export (export variables )
~$: export
- location to save variables to make them permanent
/etc/bashrc
/etc/profile - ☆path
~$: echo $path
~$: PATH=$PATH:/home/shiyanlou/mybin (add path)
~$: echo "PATH=$PATH:/home/shiyanlou/mybin" >> .bashrc
- whereis
- locate
~$: locate /etc/sh (find all file or floder start with sh in /etc) locate /usr/share/\*.jpg (find all jpg file in /usr/share)
- chown
~$: chown owner filename (change the owner of file)
- file (show the propetry of a file)
~$: file filename
- df
~$: df -h (check the storage)
- dd
~$: dd if=... (input file is) of=... (output file is) bs=num (block size num+unit{unit:Byte is default ,can be K M G etc} ) count=num(the number of bs)
- find && replace
:%s/str1/str2/g(equal to :g/str1/s//str2/g) replace all str1 to str2
- install Resurrect
~$:mkdir ~/.tmux ~$:cd ~/.tmux ~$:git clone https://github.com/tmux-plugins/tmux-resurrect.git ~$:run-shell ~/.tmux/tmux-resurrect/resurrect.tmux ~$:tmux source-file ~/.tmux.conf
- install Tmux Continuum
~$:mkdir ~/.tmux ~$:cd ~/.tmux ~$:git clone clone https://github.com/tmux-plugins/tmux-continuum.git ~$:run-shell ~/.tmux/tmux-continuum/continuum.tmux ~$:tmux source-file ~/.tmux.conf
- jpegoptim (image optimization)
jpegoptim file
- optipng (image optimization)
optipng -o<0-7> filename #<0-7> is the optimization level
- ImageMagick (image tool)
SYNOPSIS
convert input-file [options] output-file
command- line.
convert
convert between image formats as well as resize an image, blur,
crop, despeckle, dither, draw on, flip, join, re-sample, and
much more.
identify
describes the format and characteristics of one or more image
files.
mogrify
resize an image, blur, crop, despeckle, dither, draw on, flip,
join, re-sample, and much more. Mogrify overwrites the original
image file, whereas, convert writes to a different image file.
composite
overlaps one image over another.
montage
create a composite image by combining several separate images.
The images are tiled on the composite image optionally adorned
with a border, frame, image name, and more.
compare
mathematically and visually annotate the difference between an
image and its reconstruction..
stream
is a lightweight tool to stream one or more pixel components of
the image or portion of the image to your choice of storage for‐
mats. It writes the pixel components as they are read from the
input image a row at a time making stream desirable when working
with large images or when you require raw pixel components.
display
displays an image or image sequence on any X server.
animate
animates an image sequence on any X server.
import
saves any visible window on an X server and outputs it as an
image file. You can capture a single window, the entire screen,
or any rectangular portion of the screen.
conjure
interprets and executes scripts written in the Magick Scripting
Language (MSL).
SEE ALSO convert(1), identify(1), composite(1), montage(1), compare(1), dis‐ play(1), animate(1), import(1), conjure(1), quantize(5), miff(4)
- fbida (image viewer)
~$: fbi filename #view image file in tty
- fbgrab (grab image)
~$: fbgrab -h ... -w ... -s ... -f ... -f filename -h height -w width -s second
####the internet
- irssi
/network add -nick {yournick} Freenode /server add -auto -network Freenode irc.freenode.net 6667 /channel add -auto #channel Freenode password(if the channel require) /network add -autosendcmd "/^msg nickserv identify {yourpasswd};wait 2000" freenode ####compression and decompression
- zip
~$: zip -r (recursion) -x (1-9 compression level ) -q (quite) -e (encryption)-o (output) filename path -x (except) filename
- unzip
~$: unzip -q (quit) filename -d (decompression path) path ~$: unzip -l filename (just list the files in the compressed package)
- rar
~$: rar a(create) filename path ~$: rar d filename file (delete a file in package) ~$: rar l filename (just list)
- unrar
~$: unrar x filename (decompression)
- tar
~$: tar -cf filename path (create a package) ~$: tar -czf filename path (create a .tar.gz package) ~$: tar -cjf filename path (create a .tar.bz2 package) ~$: tar -cJf filename path (create a .tar.xz package) ~$: tar -xf filename -C path (decompress file to a specific directory) ~$: tar -tf (view the content of the package)
####ffmpeg 1.add subtitle to a movie
~$: ffmpeg -i filename.ssa[srt.etc.] filename.ass #transform subtitle files into ass format
~$: ffmpeg -i videofilename -vf "ass=subtitle.ass" output
2.transform mp3 to flac
bash shell code :
#/bin/sh
for f in .mp3
do
ffmpeg -i $f ${f%%.}.flac
done
3.record Desktop shell
ffmpeg -f x11grab -s 1360x768 -r 60 -i $DISPLAY -c:v h264 -s 1360x768 a.mp4
- change default path of terminal
~$: vim ~/.bashrc add cd path
- git ssh
~$: git config --global user.name "username" ~$: git config --global user.email "[email protected]" ~$: ssh-keygen -t rsa -C “[email protected]” ~$: ssh [email protected]
- curl
~$: curl -f 'name=@filename' http://img.vim-cn.com/
#upload an image file(or anyother files) to http://img.vim-cn.com ~$: curl -v --data-urlencode 'content@/home/beval/Desktop/filename' -d 'poster=beval' 'syntax=text' http://paste.ubuntu.com/
~$: curl https://api.streamable.com/upload/ -u username:password -F 'name=@filename'
- system infomation
~$:head -n 1 /etc/issue #veiw system os info
~$:uname -a # view core/operat system/CPU info
~$:cat /proc/cpuinfo # view CPU info
~$:hostname # view hostname
~$:lspci -tv # list all pci devices
~$:lsusb -tv # list all usb devices ~$:lsmod # list all loaded core module ~$:free -m # view the free memory
~$:df -h #view the info of each partition ~$:du -sh filename # view the size of the file
- commend history
~$:sudo !! # execute the last command use root authority
~$:$!! # execute the last command
ctrl+r # shortcut for command fuzzy match
- github create a new repository on the command line
~$: echo "# self-learning" >> README.md
~$: git init
~$: git add README.md
~$: git commit -m "first commit"
~$: git remote add origin https://github.com/BevalZ/self-learning.git
~$: git push -u origin master

