上手Markdown,你只需要先熟悉以下几种语法就够了:

  1. 标题、章节
  2. 粗体、斜体
  3. 无序列表、有序列表
  4. 代码、链接、图片
  5. 表格

下面开始一一讲解


1. 标题、章节

标题很简单,用#号就可以。
一级标题是#,二级标题就用##,三级标题就用###,以此类推。
例如以下内容:

# 一级标题
## 二级标题
### 三级标题

在页面中展示的样子就是:

一级标题

二级标题

三级标题

至于章节,一般用—来表示,这样在页面中会显示章节线。

例如:

Area 1

--- 
Area 2

效果就是:


Area 1


Area 2


2. 粗体、斜体

粗体用**内容**来表示,斜体用*内容*来表示。

例如:

*斜体*

**粗体**

效果:

斜体

粗体


3 . 无序列表、有序列表

列表一般用

+ 无序列表1级
    + 无序列表2级
        + 无序列表3级

1. 有序列表1
2. 有序列表2

来表示

显示的效果如下:

  • 无序列表1级
    • 无序列表2级
      • 无序列表3级
  1. 有序列表1
  2. 有序列表2

4. 代码、链接、图片

  • 代码
    大段的代码,以tab开头就可以。或是用三个`来表示。小段的代码,用两个反引号来表示。例如:
1
2
3
4
5
6

\`\`\`ruby
#test code
puts "hello"
\`\`\`
#去掉\

显示的效果就是:

1
2
#test code
puts "hello"
  • 链接和图片

这个稍微复杂点,链接用:

[链接描述](URL) 

图片用

![图片描述](URL)

例如:

[百度](https://www.baidu.com/)

![百度Logo](https://www.baidu.com/favicon.ico)

效果:

百度

百度Logo


5. 表格

表格一般是以下形式:

|表格|表格|表格|表格|表格|
|:-|:-|:-|:-|:-|
|1|2|3|4|5
|6|7|8|9|0

效果:

表格 表格 表格 表格 表格
1 2 3 4 5
6 7 8 9 0

0x00 Create a new post/page

1
2
~# hexo new "Post Title"
~# hexo new page "Download"

0x01 Put codes blocks on your post

Use keyword tag codeblock and endcodeblock

1
2
3
{% codeblock lang:javascript %}
alert('Hello World!');
{% endcodeblock %}

Or just use three backquotes

1
2
3
4
\`\`\`[language] [title] [url] [link text] 
code snippet
\`\`\`
#remove the \ before `

Images

1
{% img [class names] /path/to/image [width] [height] [title text [alt text]] %}

Links

1
{% link text url [external] [title] %}

0x03 Organize your posts resources

In _config.yml, set post_asset_folder as true

1
post_asset_folder: true

Then your _posts directory maybe such as this

1
2
3
4
5
6
7
8
9
root@debian:~/chorder.net/source# tree _posts/
_posts/
├── hello-world
│   └── 20180510.jpg
├── hello-world.md
├── hexo-start-up
└── hexo-start-up.md

2 directories, 3 files

You can directly include images from resources directory:

1
{% asset_img xxx.jpg ALT TITLE %}

0x04 Organize your post categories / tags

Your may want to organize your posts as different categories and tags.
First you need to define categories and tags directories in _config.yml, default is like this

1
2
3
4
5
6
# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories

Then you can generate a new page to navigate the posts

1
2
~# hexo new page "categories"
~# hexo new page "tags"

After that, the tags and categories directory will being created in source:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
root@debian:~/chorder.net/source# tree
.
├── categories
│   └── index.md
├── _posts
│   ├── hello-world
│   │   └── 20180510.jpg
│   ├── hello-world.md
│   ├── hexo-start-up
│   └── hexo-start-up.md
└── tags
└── index.md

5 directories, 5 files

And on the next time when you creating a new post, you could statement the category and tags of your post,
on the head of post markdown file, just like:

1
2
3
4
5
6
---
title: 10 basic operations of Hexo
date: 2018-05-17 17:05:24
categories: default
tags: default
---

The archives of tags and categories will showing in the site automatically.

0x05 Publish pages on a simple local server

In your hexo directory, run

1
~# npm install hexo-server --save

Then start the server:

1
~# hexo server -p PORT

Or if your want publish static pages as an production envirement, you should first generate static files:

1
~# hexo generate

And then start the server as static mode, it will only deploy pages which included in public directory:

1
~# hexo server -s

0x06 Directly include code from resource

1
{% include_code [title] [lang:language] path/to/file %}

0x07 Insert a video from youtube / vimeo

1
{% youtube video_id %}
1
{% vimeo video_id %}

0x08 Quote an article / resource

1
2
3
4
5
6
7
8
# article
{% post_path slug %}
{% post_link slug [title] %}

# resource
{% asset_path slug %}
{% asset_img slug [title] %}
{% asset_link slug [title] %}

0x09 Sitemap & robots.txt

As for optimize your site with a better SEO, ensure you has create sitemap:

1
2
3
4
#for google sitemap, install this package
npm install hexo-generator-sitemap --save
#for baidu(China) sitemap, instal this package
npm install hexo-generator-baidu-sitemap --save

Over that, tell the spider what you have done, write this in your robots.txt, and save it at source directory:

1
2
Sitemap: http://YOUR DOMAIN/sitemap.xml
Sitemap: http://YOUR DOMAIN/baidusitemap.xml

Example robots.txt as mine:

1
2
3
4
5
6
7
User-agent: *
Allow: /
Allow: /archives/
Allow: /categories/
Allow: /tags/
Sitemap: https://chorder.net/sitemap.xml
Sitemap: https://chorder.net/baidusitemap.xml

You can see both above at:

Sitemap Baidu Sitemap robots.txt

Welcome to chorder.net, which is…

Somewhere for coding.

1
2
3
loop do
puts "hello vistor"
end

Somewhere for learning.

Talk is cheap, show me the code.

Linus Benedict Torvalds

Somewhere for sharing.

A new hexo blog, themed by alpha-dust(Jonathan Klughertz)

Somewhere for me.

A New Beginning.

by Chorder, May 10, 2018.

Get System Info

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@echo off
ipconfig /all
net start
tasklist /v
net user
net localgroup administrator
netstat -ano
net use
net view
net view /domain
net group /domain
net group "domain users" /domain
net group "domain admins" /domain
net group "domain controllers" /domain
net group "exchange domain servers" /domain
net group "exchange servers" /domain
net group "domain computers" /domain
echo #########system info collection
systeminfo
ver
hostname
net user
net localgroup
net localgroup administrators
net user guest
net user administrator
echo #######at- with atq#####
echo schtask /query
echo
echo ####task-list#############
tasklist /svc
echo
echo ####net-work infomation
ipconfig/all
route print
arp -a
netstat -anipconfig /displaydns
echo
echo #######service############
sc query type= service state= all
echo #######file-##############
cd \
tree -F

Get Task List

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
''''''''''''''''''''''''''''''''''''
' tasktool.vbs@b4dboy
''''''''''''''''''''''''''''''''''''

On Error Resume Next
Dim obj, pross, pid, killName
pid = WScript.Arguments(1)
killName = WScript.Arguments(0)

Set obj = GetObject("Winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set pross = obj.Execquery("Select * From Win32_Process")
Wscript.echo "[PID]" & VbTab & "[ProName]"

For Each proccess In pross
If (WScript.Arguments.Count = 2) And (CStr(pid) = CStr(proccess.ProcessID)) Then
proccess.Terminate 0
ElseIf Ucase(proccess.Name) = Ucase(killName) Then
proccess.Terminate 0
Else
WScript.echo proccess.ProcessID & VbTab & proccess.Name
End If
Next

之前研究Linux设备驱动时做的零零散散的笔记,整理出来,方便以后复习。

驱动程序的的角色

  • 提供机制

例如:
unix图形界面分为X服务器和窗口会话管理器,X服务器理解硬件及提供统一的接口给用户程序,窗口管理器实现了特别的策略但对硬件一无所知。

目标:实现对策略透明

  • 划分内核

进程管理
负责创建和销毁进程,并处理它们与外部的联系(输入和输出)。
实现了多个进程在一个单个或几个CPU之上的抽象。

内存管理
为每一个进程在有限的可用资源上建立了虚拟地址空间。

文件系统
在非结构化的硬件之上建立了一个结构化的文件系统。

设备控制
全部设备的控制操作都由特定的寻址设备相关的代码来进行。

网络
系统负责在程序和网络接口之间递送数据报文。

可加载模块

Linux特性:可以在运行时扩展由内核提供的特性,可以在系统正在运行的时候增加内核的功能(也可以去除)。
每块可以在运行时添加到内核的代码被称为一个模块。通过insmod和rmmod程序去连接。

设备和模块的分类

字符设备

字符(char)设备是一种可以当作字节流来存取的设备。这样的驱动常常实现open,close,read,write系统调用。
例如:文本控制台(/dev/console),串口(/dev/ttyS0)

块设备

通过位于/dev目录的文件系统节点来存取,可以驻有文件系统。与字符设备的区别在于内部管理数据的方式上–块设备允许一次传送任意数据的字节。

网络接口

负责发送和接收数据报文

安全问题

小心对待输入,未初始化的内存等,从内核获取的任何内存应当清零或者在其可用之前进行初始化。

版本编号

Linux系统中使用的每一个软件包存有自己的发行版本号,它们之间存在相互依赖性。

版权条款

字符驱动

scull
Simple Character Utility for Loading Localities

设备编号

[root@centos ~]$ ll /dev
total 0                                        主编号,次编号
drwxr-xr-x. 2 root    root         640 May 12 22:24 block
crw-------. 1 root    root     10, 234 May 12 22:24 btrfs-control
drwxr-xr-x. 3 root    root          60 May 12 22:24 bus
lrwxrwxrwx. 1 root    root           3 May 12 22:24 cdrom -> sr0
drwxr-xr-x. 3 root    root          80 May 12 22:24 cpu
crw-rw----. 1 root    root     10,  62 May 12 22:24 crash
drwxr-xr-x. 6 root    root         120 May 12 22:24 disk
brw-rw----. 1 root    disk    253,   0 May 12 22:24 dm-0
drwxr-xr-x. 2 root    root          60 May 12 22:24 dri
lrwxrwxrwx. 1 root    root           3 May 12 22:24 fb -> fb0
crw-rw----. 1 root    root     29,   0 May 12 22:24 fb0
crw-rw-rw-. 1 root    root      1,   7 May 12 22:24 full

主编号标识设备相连的驱动,次编号被内核用来决定引用哪个设备。

默认安装的MySQL数据库,无法远程连接。
登录MySQL之后,运行

1
SELECT user,host from mysql.user;

如果只有一条记录,说明是这个原因。
将下面的脚本保存成user.sql,登录MySQL,运行:

1
2
3
use mysql;
source user.sql;
flush privileges;

Notice: 会重置MySQL user表,并且将root用户密码设置为空。

脚本内容: 点这里直接下载

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for `user`
-- ----------------------------
USE mysql;
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
`User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
`Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
`Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
`ssl_cipher` blob NOT NULL,
`x509_issuer` blob NOT NULL,
`x509_subject` blob NOT NULL,
`max_questions` int(11) unsigned NOT NULL DEFAULT '0',
`max_updates` int(11) unsigned NOT NULL DEFAULT '0',
`max_connections` int(11) unsigned NOT NULL DEFAULT '0',
`max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`Host`,`User`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges';

-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', '0', '0', '0', '0');
INSERT INTO `user` VALUES ('127.0.0.1', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', '0', '0', '0', '0');
INSERT INTO `user` VALUES ('%', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', '0', '0', '0', '0');
flush privileges;

Python
先按F5,之后将下面的命令保存,再设置快捷键。

1
cmd /k  c:\python27\python "$(FULL_CURRENT_PATH)" & PAUSE & EXIT

我使用的是Ctrl+F9
之后按Ctrl+s保存更改,再按Ctrl+F7即可快速在cmd中运行代码,方便调试。

Ruby

1
cmd /k  C:\Ruby22-x64\bin\ruby "$(FULL_CURRENT_PATH)" & PAUSE & EXIT

1.数组遍历方法总结

1
array = (1..10).to_a
1
2
3
4
5
length = array.length 
length.times do t
print "#{array[t]} "
end
puts "n"
1
2
3
4
5
length = array.length-1 
for i in 0..length do
print "#{array[i]} "
end
puts "n"
1
2
3
4
for i in array do 
print "#{i} "
end
puts "n"
1
2
array.each{x print x," "} 
puts "n"
1
2
3
4
5
6
7
length = array.length 
i = 0
while i< length do
print "#{array[i]} "
i = i+1
end
puts "n"
1
2
3
4
5
6
7
length = array.length 
i = 0
until i==length do
print "#{array[i]} "
i += 1
end
puts "n"
1
2
array.each_index do i 
print "#{array[i]} "

2.Ruby连接数据库

  • mysql

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    require 'mysql'  
    begin
    db = Mysql.init
    db.options(Mysql::SET_CHARSET_NAME, 'utf8')
    db = Mysql.real_connect("127.0.0.1", "root", "123456", "test", 3306)
    db.query("SET NAMES utf8")
    db.query("drop table if exists tb_test")
    db.query("create table tb_test (id int,
    text LONGTEXT) ENGINE=MyISAM DEFAULT CHARSET=utf8")
    db.query("insert into tb_test (id, text) values (
    1,'first line'),(2,'second line')")
    printf "%d rows were inserted\n",db.affected_rows
    rslt = db.query("select text from tb_test")
    while row = rslt.fetch_row do
    puts row[0]
    end
    rescue Mysql::Error => e
    puts "Error code: #{e.errno}"
    puts "Error message: #{e.error}"
    puts "Error SQLSTATE: #{e.sqlstate}" if e.respond_to?("sqlstate")
    ensure
    db.close if db
    end
  • redis

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    #!/bin/ruby

    require 'redis'

    def writeToFile(file,content)
    fp = File.new(file,"a+")
    if fp
    fp.syswrite(content)
    else
    puts "..."
    end
    end

    def connect(host)
    redis = Redis.new(:host => host,:port => 6379)
    redis.info.keys.each do |key|
    puts "#{key}:\t"+redis.info["#{key}"]
    end
    end

    connect("1.1.1.1")
  • sqlite3

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    require 'sqlite3'

    db = SQLite3::Database.new('test.db')

    db.execute("create table test(
    ID integet not null,
    Username varchar(20) null,
    Password varchar(64) null)")
    db.execute("insert into test(ID.Username,Password)
    values('0','admin','admin')")
    db.execute("select * from test")
    db.execute("update test set password='12345' where id=0")

3.Ruby socket

  • 服务端:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    require 'socket'

    server = TCPServer.open('0.0.0.0', 8080)
    loop do
    Thread.start(server.accept) do |client|
    begin
    while true
    puts "#{client.to_i} online"
    data = client.read()
    throw "empty" if data.empty?
    #puts data.length
    puts data
    end
    rescue Exception => e
    puts "#{client.to_i} offline"
    end
    end
    end
  • 客户端:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    require 'socket'

    hostname = '127.0.0.1'
    port = 8080
    buf = 'test'
    s = TCPSocket.open(hostname, port)
    s.write buf
    sleep(1)
    s.close

4.ruby gem 文档服务

rubygems.org上的gem文档访问起来太慢了,其实gem本身就自带doc的功能
安装gem的时候会默认安装相应gem的doc,如果不想占用空间安装doc,则gem install XXX –no-doc 即可。
使用下列命令可以启动gem自带的文档:

1
gem server --port 1234

然后访问

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

### 5.ruby改变控制台输出内容的颜色
```Ruby
puts "\033[1m前景色\033[0m\n"
puts " \033[30mBlack (30)\033[0m\n"
puts " \033[31mRed (31)\033[0m\n"
puts " \033[32mGreen (32)\033[0m\n"
puts " \033[33mYellow (33)\033[0m\n"
puts " \033[34mBlue (34)\033[0m\n"
puts " \033[35mMagenta (35)\033[0m\n"
puts " \033[36mCyan (36)\033[0m\n"
puts " \033[37mWhite (37)\033[0m\n"
puts ''
puts "\033[1m背景色\033[0m\n"
puts " \033[40m\033[37mBlack (40), White Text\033[0m\n"
puts " \033[41mRed (41)\033[0m\n"
puts " \033[42mGreen (42)\033[0m\n"
puts " \033[43mYellow (43)\033[0m\n"
puts " \033[44mBlue (44)\033[0m\n"
puts " \033[45mMagenta (45)\033[0m\n"
puts " \033[46mCyan (46)\033[0m\n"
puts " \033[47mWhite (47)\033[0m\n"
puts ''
puts "\033[1m其他\033[0m\n"
puts " Reset (0)"
puts " \033[1mBold (1)\033[0m\n"
puts " \033[4mUnderlined (4)\033[0m\n"

colors

6.一些比较特别的包

Ruby json gem
https://rubygems.global.ssl.fastly.net/gems/json-1.8.3.gem
树莓派wiringpi gpio包
http://pi.gadgetoid.com/article/wiringpi-as-a-ruby-gem

7.安装rvm的正确姿势

参考自:http://rvm.io/rvm/install
首先添加gpg公钥:

1
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

安装稳定版本的rvm

1
curl -sSL https://get.rvm.io | bash -s stable --ruby

8.解决kali2.0中RVM不能编译ruby-2.3.3

  • 错误详情:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    ruby-2.3.3 - #compiling.......................................................................-
    Error running '__rvm_make -j4',
    showing last 15 lines of /usr/local/rvm/log/1488041042_ruby-2.3.3/make.log
    exts.mk:210: recipe for target 'ext/openssl/all' failed
    make[1]: *** [ext/openssl/all] Error 2
    make[1]: *** Waiting for unfinished jobs....
    installing default nkf libraries
    compiling objspace_dump.c
    linking shared-object json/ext/generator.so
    make[2]: Leaving directory '/usr/local/rvm/src/ruby-2.3.3/ext/json/generator'
    linking shared-object objspace.so
    make[2]: Leaving directory '/usr/local/rvm/src/ruby-2.3.3/ext/objspace'
    linking shared-object nkf.so
    make[2]: Leaving directory '/usr/local/rvm/src/ruby-2.3.3/ext/nkf'
    make[1]: Leaving directory '/usr/local/rvm/src/ruby-2.3.3'
    uncommon.mk:203: recipe for target 'build-ext' failed
    make: *** [build-ext] Error 2
    ++ return 2
    There has been an error while running make. Halting the installation.

查看/usr/local/rvm/log/1488041042_ruby-2.3.3/make.log发现是openssl版本过老导致的。

  • 解决:
    第一步:先安装用于rvm的openssl:
    1
    rvm pkg install openssl

第二步:编译安装ruby,指定openssl目录(我的是/usr/local/rvm/usr/)

1
rvm install ruby-2.3.3 --with-openssl-dir=/usr/local/rvm/usr/

9.设置Gems默认源为ruby-china

现在没有淘宝源了,只有ruby-china源

1
gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/

设置Bundler默认源为ruby-china:

1
bundle config mirror.https://rubygems.org https://gems.ruby-china.org

这样修改以后,即使Gemfile中指定了Source,也会用国内的源。

使用Phantomjs访问网页并截图

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var page = require('webpage').create();

page.onResourceRequested = function(request) {
console.log('Request ' + JSON.stringify(request, undefined, 4));
console.log( '---------------------------------------------------------------------' );
};
page.onResourceReceived = function(response) {
console.log('Receive ' + JSON.stringify(response, undefined, 4));
console.log( '---------------------------------------------------------------------' );
};

page.open('https://www.baidu.com', function(status) {
console.log("Status: " + status);
if(status === "success") {
page.render('example.png');
}
phantom.exit();
});

example.png

example.png

Phantomjs已经接近废弃,如今推荐使用google的headless技术。

SP Flash Tools Download

SP Flash Tool For Windows Download

SP_Flash_Tool_v3.1216_Win.zip
SP_Flash_Tool_v3.1222_Win.zip
SP_Flash_Tool_v3.1238_Win.zip
SP_Flash_Tool_v3.1304_Win.zip
SP_Flash_Tool_v3.1312_Win.zip
SP_Flash_Tool_v3.1316_Win.zip
SP_Flash_Tool_v3.1328_Win.zip
SP_Flash_Tool_v3.1332_Win.zip
SP_Flash_Tool_v3.1344_Win.zip
SP_Flash_Tool_v5.1343_Win.zip
SP_Flash_Tool_v5.1352_Win.zip
SP_Flash_Tool_v5.1436_Win.zip
SP_Flash_Tool_v5.1452_Win.zip
SP_Flash_Tool_v5.1504_Win.zip
SP_Flash_Tool_v5.1512_Win.zip
SP_Flash_Tool_v5.1516_Win.zip
SP_Flash_Tool_v5.1520_Win.zip
SP_Flash_Tool_v5.1524_Win.zip
SP_Flash_Tool_v5.1528_Win.zip
SP_Flash_Tool_v5.1532_Win.zip
SP_Flash_Tool_v5.1548_Win.zip
SP_Flash_Tool_v5.1552_Win.zip
SP_Flash_Tool_v5.1604_Win.zip
SP_Flash_Tool_v5.1612_Win.zip
SP_Flash_Tool_v5.1616_Win.zip
SP_Flash_Tool_v5.1620_Win.zip
SP_Flash_Tool_v5.1624_Win.zip
SP_Flash_Tool_v5.1628_Win.zip
SP_Flash_Tool_v5.1632_Win.zip
SP_Flash_Tool_v5.1636_Win.zip
SP_Flash_Tool_v5.1640_Win.zip
SP_Flash_Tool_v5.1644_Win.zip
SP_Flash_Tool_v5.1648_Win.zip
SP_Flash_Tool_v5.1708_Win.zip
SP_Flash_Tool_v5.1712_Win.zip
SP_Flash_Tool_v5.1716_Win.zip
SP_Flash_Tool_v5.1720_Win.zip
SP_Flash_Tool_v5.1724_Win.zip
SP_Flash_Tool_v5.1728_Win.zip
SP_Flash_Tool_v5.1736_Win.zip
SP_Flash_Tool_v5.1744_Win.zip
SP_Flash_Tool_v5.1752_Win.zip
SP_Flash_Tool_v5.1804_Win.zip
SP_Flash_Tool_v5.1812_Win.zip
SP_Flash_Tool_v5.1816_Win.zip
SP_Flash_Tool_v5.1820_Win.zip
SP_Flash_Tool_v5.1824_Win.zip
SP_Flash_Tool_v5.1828_Win.zip
SP_Flash_Tool_v5.1836_Win.zip
SP_Flash_Tool_v5.1844_Win.zip

SP Flash Tool For Linux Download

SP_Flash_Tool_v5.1512_Linux.zip
SP_Flash_Tool_v5.1520_Linux.zip
SP_Flash_Tool_v5.1524_Linux.zip
SP_Flash_Tool_v5.1528_Linux.zip
SP_Flash_Tool_v5.1532_Linux.zip
SP_Flash_Tool_v5.1548_Linux.zip
SP_Flash_Tool_v5.1552_Linux.zip
SP_Flash_Tool_v5.1604_Linux.zip
SP_Flash_Tool_v5.1612_Linux.zip
SP_Flash_Tool_v5.1616_Linux.zip
SP_Flash_Tool_v5.1620_Linux.zip
SP_Flash_Tool_v5.1624_Linux.zip
SP_Flash_Tool_v5.1628_Linux.zip
SP_Flash_Tool_v5.1632_Linux.zip
SP_Flash_Tool_v5.1636_Linux.zip
SP_Flash_Tool_v5.1640_Linux.zip
SP_Flash_Tool_v5.1644_Linux.zip
SP_Flash_Tool_v5.1648_Linux.zip
SP_Flash_Tool_v5.1708_Linux.zip
SP_Flash_Tool_v5.1712_Linux.zip
SP_Flash_Tool_v5.1716_Linux.zip
SP_Flash_Tool_v5.1724_Linux.zip
SP_Flash_Tool_v5.1728_Linux.zip
SP_Flash_Tool_v5.1744_Linux.zip
SP_Flash_Tool_v5.1752_Linux.zip
SP_Flash_Tool_v5.1804_Linux.zip
SP_Flash_Tool_v5.1812_Linux.zip
SP_Flash_Tool_v5.1816_Linux.zip
SP_Flash_Tool_v5.1824_Linux.zip
SP_Flash_Tool_v5.1828_Linux.zip
SP_Flash_Tool_v5.1836_Linux.zip
SP_Flash_Tool_v5.1844_Linux.zip

SN Write Tool For Windows Download

SN_Write_Tool_v1.1516.00.zip
SN_Write_Tool_v1.1520.00.zip
SN_Write_Tool_v1.1528.00.zip
SN_Write_Tool_v1.1532.00.zip
SN_Write_Tool_v1.1536.00.zip
SN_Write_Tool_v1.1544.00.zip
SN_Write_Tool_v1.1552.00.zip
SN_Write_Tool_v1.1604.00.zip
SN_Write_Tool_v1.1620.00.zip
SN_Write_Tool_v1.1632.00.zip
SN_Write_Tool_v1.1636.00.zip
SN_Write_Tool_v1.1640.00.zip
SN_Write_Tool_v1.1648.00.zip
SN_Write_Tool_v1.1712.00.zip
SN_Write_Tool_v1.1716.00.zip
SN_Write_Tool_v1.1728.00.zip
SN_Write_Tool_v1.1752.00.zip
SN_Write_Tool_v1.1828.00.zip
SN_Write_Tool_v2.1408.00.zip
SN_Write_Tool_v2.1416.00.zip
SN_Write_Tool_v2.1436.00.zip
SN_Write_Tool_v2.1440.00.zip
SN_Write_Tool_v2.1452.00.zip

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×