在 java 中 try catch 的时候,大多数情况下是使用的 Exception,但是今天看代码有些却 catch 了 Throwable,于是总结下。
看 JDK 源码知道 Throwable 是 Exception 的超类,也同样是 Error 的超类,所以可想而知,如果 catch 了 Throwable,那么会连同 Exception 和 Error 一同 catch,这样也不会丢异常。
Error
通常是不可恢复的错误当程序发生不可控错误,抛出 Error 错误,与异常不同的是 Error 及其子类对象不应该被抛出。通常发生 Error 时需要介入处理。
功能比较强大,比较重要的几个 Plugin 都在单独的文章中做了介绍,这里单独的列举一些特定场景使用的插件,带有语法高亮等的插件,比如针对 Nginx 配置, Dockerfile 文件等等的插件。
优化 nginx 配置
Plug 'chr4/nginx.vim'
Plug 'fatih/vim-go'
Plug 'kchmck/vim-coffee-script'
" CoffeeScript
Plugin 'mtscout6/vim-cjsx'
tr 是 translate 的缩写。
tr [OPTION] SET1 [SET2]
translate SET1 to SET2
cat "abc" | tr a-z A-Z
cat "abc" | tr [:lower:] [:upper:]
echo "a b" | tr [:space:] '\t'
echo ‘{abc}’ | tr ‘{}’ ‘()’ (abc)
删除 -d
指定的字符集
echo "abc" | tr -d 'a'
bc
删除数字
➜ echo "123abc123" | tr -d [:digit:]
abc
删除连续空白
➜ echo "emmmmmmmmmm no" | tr -s [:space:] ' '
emmmmmmmmmm no %
echo "abbbbccccbd" | tr -s a-z A-Z
ABCBD
比如说想要删除除了数字之外的内容
➜ echo "my id is 123" | tr -cd [:digit:]
123%
单独使用 -c
选项则表示将 不是 SET1 中的内容,替换为 SET2 中内容
➜ echo 'abc123' | tr -c [:digit:] x
xxx123x%
You can install lua in Linux Mint/Debian/Ubuntu.. You can find all verions of lua here.
wget http://www.lua.org/ftp/lua-5.3.1.tar.gz
tar zxf lua-5.3.1.tar.gz
cd lua-5.3.1
make linux test
Finally, if test have passed, then install lua into the right place by running sudo make install
:
einverne@mint ~/Downloads/lua-5.3.1 $ sudo make install
[sudo] password for einverne:
cd src && mkdir -p /usr/local/bin /usr/local/include /usr/local/lib /usr/local/man/man1 /usr/local/share/lua/5.3 /usr/local/lib/lua/5.3
cd src && install -p -m 0755 lua luac /usr/local/bin
cd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h lua.hpp /usr/local/include
cd src && install -p -m 0644 liblua.a /usr/local/lib
cd doc && install -p -m 0644 lua.1 luac.1 /usr/local/man/man1
According to the output, we know that lua header files are located under /usr/local/include
. And liblua.a
lib is located under /usr/local/lib
. This two paths may be used later when coding with C/C++. And most important thing executalbe file is located under /usr/local/bin
. Most of the Linux distributions are installed lua by default. But most of them don’t have liblua.a installed.
If you want to build from source code like under linux, just change make linux test
into make macosx test
. And all the following steps are the same as I mentioned in the Linux section.
If you want a more convenient way to install lua, you can download binary package here. And click next and next to finish installation.Default installation path is same as in Linux.
And id you are using Homebrew just run brew install lua
, everything is done.
And you can find more ways to install lua on lua-users.org
please see: http://lua-users.org/wiki/LuaDistributions
After installation , run lua -v
to check the lua version. Test lua by printing “hello world” using following code. Run lua
in terminal:
einverne@mint ~ $ lua
Lua 5.3.1 Copyright (C) 1994-2015 Lua.org, PUC-Rio
> print "hello world"
hello world
Type Control+D to exit.
If you want to find a lua IDE, I highly recommend Zerobrane Studio. It is cross-platform and support different versions of lua from 5.1 to lastest 5.3. And it has a debugger build-in, which is great for debug lua code from local or remote. It is worth to have a try.
I have changed my desktop environment to Linux, and after I tried Ubuntu and Debian, I finally choose the Linux Mint distribution. I think there are some reasons why this distribution take the first place in distrowatch. User-friendly desktop environment and convenient software package manager make me very comfortable. Cause it is based on the Debian and Ubuntu, most of the applications are familiar.
The simplest way to install a new Cinnamon theme is with the Themes manager in System settings.
Go to System Settings -> Themes -> Get More Online -> Refresh list. You can choose Most Popular or Latest. The theme will be installed to your hidden folder ~/.themes
I highly recommend my modified Dark Blue Glass theme link. It is a mix of Dark Glass and mint numix blue theme. Or you can find more themes on the following sites:
You can install a new icon set in two ways. One is by adding a PPA. You add the PPA, install the icon set. But you won’t find icon sets for all the icon themes. Therefore, the other way round is to download the compressed file and extract it to ~/.icons
or ~/.local/share/icon
. If this directory doesn’t exist, create one using the following command:
mkdir ~/.icons
The icons extracted in the above directory will be available for the current user only. If you want the icons to be available for all the users, you should extract the icons to /usr/share/icons
.
Now, once you have installed the icon set, you can use a Unity Tweak Tool to change the icon theme. Use the following command to install Unity Tweak Tool:
sudo apt-get install unity-tweak-tool
Or in Linux mint you can just change icons under setting -> theme -> icons.
I highly recommend this one: papirus icons
sudo add-apt-repository ppa:varlesh-l/papirus-pack
sudo apt update
sudo apt install papirus-icons
You didn’t need to edit/etc/apt/sources.list
and files under /etc/apt/sources.list.d/
mannually. All customs can be changed through UI. Just click “start menu” and choose the “Software Sources”. And this application can even custom the PPAs.
First is web browser, and of course Chrome. I am crazy about Google, and all Google related things. I have used Chrome since year 2011, after I am tried of the Firefox’s slowness. Although Firefox become more and more light, faster this years, I get used to Chrome. And what Chrome done makes me really happy. First thing is the bookmark and extension etc sync. I can reach all of my staff and customizations, after I login into my account. I don’t even need to worry about anything. All my Apps, Extensions, Settings, Autofill informations, History, Themes, Bookmarks, Passwords, and even Open tabs always follow my account. I can reach my opening tab on desktop from my Android phone. I can reopen bookmarks on my home laptop, which I added in my laboratory computer. And I can open chrome://history
page to check all current opening tags from signed-in devices, and even check the unread article in the opening tab on my phone and browser all my chrome history.
It is necessary to have an input method for typing Chinese which I speak. I choose the sogou input method, because it is easy to use and have a very Good word dictionary. Sogou input method is based on fcitx. In Linux mint setting panel, we have the Language setting, we can choose to install fcitx components.
More detail information can be found in this blog article.
Following can be done through user interface, no need to run. Pasting here only for reference.
sudo apt-get install fcitx fcitx-table-wubi-large fcitx-frontend-all fcitx-frontend-gtk2 fcitx-frontend-gtk3 fcitx-frontend-qt4 fcitx-config-gtk fcitx-ui-classic fcitx-module-kimpanel fcitx-module-dbus fcitx-libs-qt
sudo apt-get install fcitx fcitx-bin fcitx-config-common fcitx-config-gtk fcitx-data fcitx-frontend-all fcitx-module-cloudpinyin fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-modules fcitx-qimpanel-configtool
After installation, “start”, “Fcitx Configuration” can config the input method, just add “Sogou Pinyin” to the panel.
Use to cross China’s great firewall. Don’t need to talk more.
pip install shadowsocks # install command line tool
If pip is missing, install pip first.
PPA is for Ubuntu >= 14.04.
sudo add-apt-repository ppa:hzwhuang/ss-qt5
sudo apt-get update
sudo apt-get install shadowsocks-qt5
To install Qt version of shadowsocks. From:GitHub.
“System settings” , “Driver Manager”, choose the right latest driver and install. After installation, you will find Nvidia icon at the right-bottom corner. Double click the icon to open the setting panel. In order to save the battery , you can use Intel(Power Saving Mode) for most time. And if choose NVIDIA(Performance Mode) for high performance need.
Install hardinfo tool to check hardware information through GUI
sudo apt-get install hardinfo
If there is no special instruction, all of the following applications can be installed from the Software Manager in Linux Mint.
As it official introduction said “Do things as quickly as possible (but no quicker) with your files, bookmarks, applications, music, contacts, and more!”. I set a shortcut Alt+Space to launch Gnome do. And you can just type several keys to start any application quickly.
install following package:
Use F12 to open a terminal. Dropdown terminal, you can right click the terminal after you press F12 to configure your guake.
“PlayOnLinux is a front-end for wine. It permits you to easily install Windows Games and software on Linux. It is advised to have a functional internet connection.” I use playonlinux to install Evernote and cloudmusic(网易云音乐). Although I met a lot of problems during installation of Evernote. But finally evernote 5.8.x can be installed on wine 1.7.x.
There are several packages you need to install to make PlayOnLinux work.
Most of the following can be installed from default Software Manager. Just type name of the application and search then click install.
cloud music client and my favourite music client. Here is the link to it’s official site, where you can found clients for all platforms include linux.
my favourite cloud notebook with a very clean Android client.
Linux mint 17 has a default screenshot software called Screenshot. It is a very simple screenshot software. Shutter is more powerful.
Sync all my files. When I installed Dropbox through it’s offical installer, there was a problem I cannot connect to Dropbox directly from China. Here is a solution to redirect connections to shadowsocks sock5 proxy. You should install proxychains
.
sudo apt install proxychains
# config socks4 127.0.0.1 9050 To socks5 127.0.0.1 1080 which is the default of shadowsocks
vi /usr/local/etc/proxychains.conf
# then use proxychains to start dropbox
proxychains4 dropbox start -i
Then dropbox will start to start and install, then after installation you can set sock5 proxy in dropbox settings.
Baidu pan linux port. It is really a great work. Thank the author.
You can download here
Remote desktop connection client able to display and control a remote desktop seesion. It supports multiple network protocols in an integrated and consistant user interface. Currently RDP, VNC, NX, XDMCP and SSH protocols are supported.
linux firewall.
E-book manager, 电子书管理. It is very efficient when you plug in kindle using USB port Calibre is prepare to serve.
Evernote like cloud notebook client. Find more information here. You can install through PPA:
$ sudo add-apt-repository ppa:wiznote-team
$ sudo apt-get update
$ sudo apt-get install wiznote
one of the screenrecoders I use.
Best image and picture manager ever from Google.
record and edit audio files
non-linear video editing suite.
Office software include writer, spreadsheets and presentation.
Password manager. But I prefer LastPass.
This client really make me impressed. It is faster and simple than any other platform client. Launch it with Gnome do, and use it to check English word is a very happy work. Someone used to recommand me the StarDict, but I think youdao dict is a better choice for me.
Elegant, powerful, clean dock.
Or there is another choice Cairo Dock.
Install this tool using this command:
sudo apt-get install ntfs-config
and you can find NTFS Configuration Tool in the menu. It is a very efficient tool to auto mount windows NTFS partitions. You can setup to auto-mount when your Linux mint start up. It is really useful if you have a second hard drive installed and you want it to auto-mount each time you restart your system.
video player always need one. Personally, I like smplayer more.
You can follow the instruction on it’s official site. It was great, espcially when you want to listen to music at Google Play Music, or other cloud stream music. It support a lot of services, like Amazon Cloud Player, Play Music, Plex Music, Spotify, Tuneln, etc.
Birdie is beautiful Twitter client for GNU/Linux.
PPA (14.04) Birdie can be installed from our PPA, which provides automatic updates whenever we improve the application.
$ sudo add-apt-repository ppa:birdie-team/stable
$ sudo apt-get update
$ sudo apt-get install birdie
from it official site:http://www.birdieapp.eu
all the detail information can be found at it’s official site.
$ sudo add-apt-repository ppa:mc3man/trusty-media
$ sudo apt-get update
$ sudo apt-get install ffmpeg
Remote control application. I need it to help to connect my mac in lab and other Windows machine. You can download here. And because it is cross-platform. You can install in other OS and connect it easily.
Use apt-get search vim
to search related vim packages, you will find several packages,like vim-gtk, vim-gnome etc. Install vim and vim-gtk package to install vim and gvim. And config my vim with my dotfile, https://github.com/einverne/dotfiles.
best version control system. And I am using SmartGit.
Git GUI
Text Editor. Later I found Atom which is also great.
markdown editor.
sometime need java and c++ IDE for test.
install boost library from source using the following code:
sudo apt-get install libboost-all-dev
all boost library is located at /usr/include/boost
Check official site for more information.
Python IDE
Lua IDE
Sqlite manager
You can have your local weather forecast in desktop.
Screenshot and screencasting tools which saves me a lot of time.
I have created a list in Youtube, you can check it for information.
Most of computer fonts people using are TrueType fonts. TrueType fonts end with .ttf
, which stand for TrueType Font. This tutorial shows how to install TrueType fonts in Linux (Debian, Ubuntu, Linux Mint, etc).
Linux 下默认安装的字体都被存放在 /usr/share/fonts
下。
如果是个人使用可以将字体文件拷贝到 ~/.fonts
目录中。所有支持的字体文件路径可以通过系统的 /etc/fonts/fonts.conf
文件查看到。
把字体文件拷贝到对应的目录之后,需要执行
# create an index of scalable font files for X
mkfontscale
# create an index of X font files in a directory
mkfontdir
fc-cache -fv
使用如下命令来查看已安装字体:
fc-list
# 查看中文字体
fc-list :lang=zh
All of the TrueType fonts are under /usr/share/fonts/truetype
, simplest way is to copy ttf file to this directory and give it the right permission. For example, if you want to install Ubuntu font family manually. You can download the font file from official site.
In the terminal, download the package:
wget http://font.ubuntu.com/download/ubuntu-font-family-0.80.zip
unzip the file into directory ubuntu-font-family-0.80
unzip ubuntu-font-family-0.80.zip
and then use copy command to copy all the files to /usr/share/fonts/truetype
,/usr/share/fonts
directory and sub directory need root to write, so you should add sudo
before command. The -r
paramater represent recursive, it means all the files under ubuntu-font-family-0.80 will be copied to the right place.
sudo cp -r ubuntu-font-family-0.80/ /usr/share/fonts/truetype/
finally, you shoulde give this directory and all the ttf under this directory right permission. All the new fonts now can only be used by root. We need to change the permission to let all the users to use these fonts:
sudo chmod 755 /usr/share/fonts/truetype/ubuntu-font-family-0.80/ -R
then, refresh the font cache to let system detect these fonts:
fc-cache -f -v
As I mentioned in the first part, if you copy the ttf file to /usr/share/fonts
directory, all the users can use these new fonts. But if you only want to provide these fonts to specific user, like current login user , you can just copy the file to ~/.fonts
directory. If there is no such directory, just create it. The ~ stand for current user’s home directory, full path is /home/<username>
. So repeat the operation to install Ubuntu font family:
mkdir ~/.fonts
cp -r ubuntu-font-family-0.80/ ~/.fonts/
fc-cache -fv
Microsoft Core Fonts include these fonts:
Debian/Ubuntn/Linux Mint user just open terminal and run these command:
sudo apt-get install ttf-mscorefonts-installer
or Linux Mint user can find this package in the Software Manager, just search it and click install.
.ttf
files are the English fonts, while .TTF files are Chinese fonts. If we check the C:\Windows\Fonts
under Microsoft Windows, there are 3 kind of fonts. One is the .fon
fonts, which is the DOS system font, and other two fonts are .ttf
and .TTF
. We can just make a copy of all .ttf
and .TTF
file and copy all the files to /usr/share/fonts/
directory under Linux. Although it is illegal under Microsoft’s TOC, but we can still do it. :)
If you dual boot your computer, mount the Windows and copy the files
sudo mkdir /usr/share/fonts/truetype/WindowsFonts
sudo cp -r /media/Windows/Fonts/*.ttf /usr/share/fonts/truetype/WindowsFonts/
sudo cp -r /media/Windows/Fonts/*.TTF /usr/share/fonts/truetype/WindowsFonts/
Install open source Chinese fonts, like 文泉驿 - 微米黑 文泉驿 - 正黑
sudo apt-get install ttf-wqy-microhei ttf-wqy-zenhei
several Chinese font we can choose:
To check more about Chinese font visit Arch wiki
Linux Mint user can find a font manager under Software Manager. It is really a cool tool to manager your fonts.
fc-list
is a quick and handy command to lists fonts and styles available on the system for applications using fontconfig. You can use fc-list to find out whether particular language font is installed or not.
To list all font faces:
$ fc-list
To lists font faces that cover Chinese language:
$ fc-list :lang=zh
Output will be all available Chinese fonts.
After I installed WPS for Linux under Linux Mint 17.2, I met this problem, “系统缺失字体 symbol、wingdings、wingdings 2、wingdings 3、wedding”. According to the copyright, WPS for Linux doesn’t contains these five fonts. You can only find these five fonts and install them in the right place like I said before. One way to find these fonts is to find them in Microsoft Windows system. And another way is to download these files from Internet and install.
Use following command to search Korean font
apt-cache search korean font
and use this command to install Korean font to linux:
sudo apt-get install fonts-unfonts-core fonts-unfonts-extra
字体类型:
Sans-serif
无衬线体 = 黑体:并不是具体一款字体,而是一类字体,选择它其实等于选择这类字体中优先级最高的那款字体。Serif
衬线体 = 白体:同上Monospace
等宽字体,意思是字符宽度相同:同上点阵字体
位图字体无衬线体更适合电脑屏幕阅读,衬线体适合打印。因为衬线可以使得人视线平齐于一行。也就是说不会读破行。
中文显示时有不同的方式,一方面因为中文本身拥有的横和同高度就可以导致这种平齐。行距对中文更重要。
For more information check Debian page Arch wiki and Ubuntu wiki
之前做过一个简单的 git 的介绍,下面是 PPT 的摘录。
Git is a free and open source distributed version control system(VCS) designed to handle everything from small to very large projects with speed and efficiency.
Git 是一个分散式版本控制软件,最初由林纳斯·托瓦兹(Linus Torvalds)创作,于 2005 年以 GPL 发布。最初目的是为更好地管理 Linux 内核开发而设计。Linus Torvalds 自嘲的取名“git”,该词源自英国俚语,意思大约是“混账 1”。
Microsoft Word 如果你用 Microsoft Word 写过长篇大论,那你一定有这样的经历:
想删除一个段落,又怕将来想恢复找不回来怎么办?有办法,先把当前文件“另存为……”一个新的 Word 文件,再接着改,改到一定程度,再“另存为……”一个新文件,这样一直改下去,最后你的 Word 文档变成了这样:
Wikis
https://zh.wikipedia.org/w/index.php?title=Git&action=history
Undo Windows: Ctrl+z Mac: Command+z
Version control has a very long histroy.
BitKeeper SCM
Git is born
Git become popular, GitHub launched in 2008 to host Git repositories:
Git 是一种分布式版本控制,不需要服务器端软件也可运行
anyone wanting to track edits
anyone needing to share changes with collaborators
anyone not afraid of command-line tools
需要注意以下几点:
只能跟踪文本文件的改动,二进制文件不行,也就是说 如果使用 Git 追踪 Word ,版本控制系统并不知道改动了那些行,只能知道二进制变化了。
programmer
not as useful for tracking non-text files
编码问题,如果在多平台使用请千万使用 UTF-8 编码
使用 Windows 的童鞋要特别注意: 千万不要使用 Windows 自带的记事本编辑任何⽂文本⽂文件。原因是 Microsoft 开发记事本的团 队使⽤用了⼀一 个非常弱智的⾏行为来保存 UTF-8 编码的⽂文件,他们⾃自作聪明地在每个⽂文件开头添 加了 0xefbbbf(⼗十六进制)的字符,你会遇到很多不可思议的问题,比 如,网页第一⾏行可 能会显⽰示⼀一个“?”,明明正确的程序⼀一编译就报语法错误,等等,都是由记事本的弱智⾏行 为带来的。建议你下载 Notepad++ 代替记事本,不但功能强⼤大,而且免费!记得把 Notepad++ 的默认编码设置为 UTF-8 without BOM 即可
sudo apt-get install git
or sudo yum install git
brew install git
在开始使用 Git 之前有些配置
git config --global user.name "John Doe" # 配置提交用户名
git config --global user.email johndoe@example.com # 配置提交邮箱
git init
git status
git add filename
# 暂存区
git commit -m “"
git log
commit message best practices
git branch <branchname>
git checkout <branchname>
git checkout -b <branchname>
git push origin <branchname>
git push origin --delete <branchname>
http://nvie.com/posts/a-successful-git-branching-model/
git remote add origin git@blcu.tk:einverne/gitdemo.git
git push -u origin master
git remote show origin
git tag # list all tags
git tag v0.9
git tag -a v1.0 -m “my version 1.0"
git show tag name #show tag details
git push origin tag name
git push origin --tags
https://github.com/github/gitignore
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.br branch
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
http://server.address
http://git.or.cz/gitwiki/GitFaq#head-90fa13ebe170116f1586156e73b549cc2135b784 ↩
注意如果使用 Java SE 8 及以上,建议使用 java.time
(JSR-210) 来代替使用 Joda-time。
Java 中日期,时间处理类库 Joda time
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.10.2</version>
</dependency>
最新的版本官网查看 1
5 个最常用的 date-time 类:
表示时刻,瞬时的时间
表示时间间隔,是一个半开区间,包括开始时刻,但不包括结束时刻。结束时刻永远要大于或者等于开始时刻。有两个实现 Interval 和 MutableInterval
表示持续时间,用 milliseconds 表示,duration 通常从 interval 中获取。
instant + duration = instant
一段时间,通常比如三年五个月两天 7 小时。他和 Duration 的区别在于,Period 是不精确的(在 milliseconds 级别)。比如有一个月的时间段,那么在二月一号加上一个月会得到三月一号,而在三月一号加上一个月,会得到四月一号,但是这两个 duration(in milliseconds)是完全不一样的。
instant + period = instant
有两个实现 Period 和 MutablePeriod
有很多构造方法
DateTime dateTime1 = new DateTime();
DateTime dateTime2 = new DateTime(2015,11,11,0,0,0);
DateTime dateTime3 = new DateTime(1447171200000L);
DateTime dateTime4 = new DateTime(new Date());
DateTime dateTime5 = new DateTime("2015-11-11T00:00:00.000+08:00");
Joda Time 中的 LocalTime 表示的是一个没有日期的时间
常用方法
LocalTime.now()
Joda-Time 为时间段的表示提供了支持。
因为 Joda Time 非常稳定可靠,在 JDK 8 以前成为了 Java 处理时间相关的事实标准,JDK 8 中引入了 java.time
等一组新 api 用来处理时间日期,遵守 JSR 310,弥补了 Java 在时间处理方面的不足。Joda-Time 的作者 Stephen Colebourne 和 Oracle 一起共同参与了这些 API 的设计和实现。
JDK 8 以前 Date 和 Calendar 类存在的问题:
相关类:
基本上他们的接口定义都是 ofXX 来构造一个实例,而通过 parseXX 来将一个现有的时间戳转变成对应的实例。
https://mvnrepository.com/artifact/joda-time/joda-time ↩
wget 是一个非常常用的下载命令,但其实 wget 非常强大,这里就列举一些很常用的选项。
备份或者下载整站:
wget -r -np http://www.mysite.com/Pictures/
wget -r --no-parent --reject "index.html*" http://www.mysite.com/Pictures/
说明:
-r
表示 recursively 递归下载-np
或者 --no-parent
表示不延伸到父目录,当想要下载特定目录下的文件时,记得加上这个选项当然如果你的目的非常单纯只是想备份网站,之前也写过一篇 Httrack 备份全站 的文章。
使用 -A
或者 -R
wget -A jpg,pdf http://site
wget --accept jpg,pdf http://site
wget -R "index.html" http://site
说明:
-A
或者 --accept
后面接逗号分割的后缀或者模式,表示下载接受的文件格式,或者符合正则表达式的内容-R
或者 --reject
表示不下载匹配的需要注意的是如果书写正则表达式,那么需要用双引号。
在使用 wget 备份网站目录时可能遇到网站路径编码下载到本地之后乱码的情况,这个时候需要使用 --restrict-file-names=nocontrol
有些时候可能要离线文档用来在本地浏览,这个时候需要用到 -k
wget --mirror --convert-links --adjust-extension --page-requisites
--no-parent http://example.org
wget -mkEpnp http://example.org
说明:
-m
或者 --mirror
镜像网站,这个选项会开启递归和时间戳,并且保持目录结构,等效于 -r -N -l inf --no-remove-listing
-k
或者 --convert-links
表示将连接转成 localhost,方便本地浏览-E
或者 --adjust-extension
表示会根据文件的 MIME 类型,将一些文件调整为 HTML 等等后缀,方便在不同的 WEB 服务器中托管-p
或者 --page-requisites
会将任何 HTML 页面显示需要的资源都下载下来,包括 images,sounds,css,js 等等wget 使用选项 --limit-rate
来限制速度:
wget --limit-rate=423k
单位是 bytes per second,如果要表示 kiloBytes,在结尾加上 k
.
使用 --tries=70
来自定义重试次数,默认情况下 wget 会重试 20 次。
接触韩国电影并不是很长时间,而之前在我看过的电影中推荐过《10部不得不看的韩国电影》,这之后通过周围的推荐和影评,渐渐的看到了更多的韩国电影。《追击者》《太极旗飘扬》《汉江怪物》,这些都是非常不错的片子,可惜当时并不知道。而这部《太极旗飘扬》终于在昨天看完了。
如何去定义这部电影呢?战争片,历史片,影片主要讲述朝鲜战争,也就是韩国说的6.25战争,兄弟俩被强制征兵到前线抵抗北朝鲜的进攻,而哥哥为了保护弟弟屡次铤而走险,完成战功,获得勋章,而过程中哥哥却变的残暴。故事中的哥哥多次的反转,或许这里真的要称赞一下电影的编剧,从来没想到故事的发展会如此的曲折,而最后终也能将电影所要衬托出的主题凸显出—-这是一部彻彻底底的反战电影—-就像之前看的一篇影评中所说,历史上的朝鲜战争,在世界各国的书本中都描述成中国,前苏联和美国的势力角逐。而这部电影让我们看到韩国人对这次战争的思考,当世界两大力量在小小的朝鲜半岛展开时,血腥,暴力是无法想象的,而导演也同样没有回避,用大量的镜头描写战争场面的残酷。
作为一个中国人来看,或许很多人的印象中都是“雄赳赳气昂昂,踏过鸭绿江”,我们的教科书,我们的老师,我们的教育从来没有教育我们战争对于人类来说是什么。多少次观影的过程中,我希望中国从来没有参战,没有之后的更加疯狂的杀戮,也同样不会有那些年战死的中国志愿军。而历史就是历史,一直知道中国会参战,而当韩国军队获得胜利朝鸭绿江挺近的时候,我依然会和主人公一样的开心。这是一部很长的电影,长得让人难受的电影,导演用镜头诉说着那段历史,一个个的反转让人思考。
其中最大的反转就是哥哥这个角色,最开始哥哥弟弟并不愿意参战,而后来哥哥为了弟弟变得疯狂,看到北朝鲜屠杀村民,哥哥变得嗜血,屠戮战俘,哥哥甚至为了功勋而忘记了初心,勋章荣誉让哥哥沉迷其中,成为战争英雄。而之后哥哥看到自己的未婚妻因为战时投奔共产党讨得一点饭吃而被韩国同胞处死,而自己的弟弟被关在仓库烧死(哥哥并不知道弟弟侥幸逃走),从而变得更加疯狂,被北朝鲜俘虏之后成为了北朝鲜的主力“大旗部队”,哥哥的一生,为自己的弟弟,为自己的国家战斗过,也为北朝鲜战斗过,他甚至并不知道为什么要打来打去,莫名其妙的被拉上战场,而之后的一切都被动的产生了。导演很聪明,没有直接明了的说道理,去站在上帝的视角去评价这场战争,同样也很聪明的屏蔽了外界的一切的干扰,中国志愿军只出现了一幕,而美国军队的登陆也只是在收音机中出现,所有的镜头都是正面的战场,保留了观众对这场战争的评价,是非曲直,看完的观众心中自有一个定论。
而弟弟的表现则告诉我们,一个人保留有一丝的人性是多么的重要,即使战争再残酷,人作为人最基本的人性应该保存着,这也就是他即使再忙也会跑到家里去看望自己的母亲和嫂嫂,这也就是他即使所有人都认为那个投降朝鲜的天真擦皮鞋的老乡该杀的时候他会跑出来保护他,这也就是他即使知道前线的危险也会再跑到战场去寻找他的哥哥的原因。人作为人,是应该像哥哥那样,还是像弟弟那样?就像电影中弟弟告诉他哥哥的那样,“如果把那些战俘都杀死,那我们和那些北朝鲜的人又有什么两样?”。
很多人提到这部片子会想到另外一部战争大片《拯救大兵瑞恩》,有的时候我真的会问自己,“为了一个人,又牺牲了那么多的人,真的值得吗?”,我的回答肯定是“值!”,因为这里面就包含着人对生命的尊敬,对战争的敬畏,我相信看完这些电影的人一定是反战的,战争是反人类的。说到底战争只是政府政治斗争的一枚棋子,而受到伤害的永远都是社会底层的平民。
PS.
写完本来是要分享到豆瓣的,只是又不过审了。