iSCSI
说明:
172.166.10.16 Target端
在服务端:
### Target端:(172.16.10.16)
1、准备要共享的设备,这里使用本地磁盘上的新分区代替(只需要分区,不需要格式化即可)
fdisk /dev/sda
partx -d /dev/sda
partx -a /dev/sda
或者使用文件:
dd if=/dev/zero of=/var/lun1.bin count=0 bs=1 seek=50G
说明:
172.166.10.16 Target端
### Target端:(172.16.10.16)
1、准备要共享的设备,这里使用本地磁盘上的新分区代替(只需要分区,不需要格式化即可)
fdisk /dev/sda
partx -d /dev/sda
partx -a /dev/sda
或者使用文件:
dd if=/dev/zero of=/var/lun1.bin count=0 bs=1 seek=50G
配置 X2Go PPA 库。对于 Ubuntu 14.04 以及更高版本,有可用的 X2Go PPA。
sudo add-apt-repository ppa:x2go/stable
sudo apt-get update
sudo apt-get install x2goserver x2goserver-xsession
1、立即下载基于 x64 的 Windows Server 2012 R2 的KB2919442补丁。
2、立即下载基于 x64 的 Windows Server 2012 R2 更新软件包。
3、安装 VC14(C++运行库)。
注意:必须按以下顺序安装更新,先安装前置补丁KB2919442,然后安装 clearcompressionflag.exe、 KB2919355、 KB2932046、 KB2959977、 KB2937592、 KB2938439 和 KB2934018。
附:win8 安装
1、立即下载基于 x86 的 Windows 8.1 更新软件包。
2、立即下载基于 x64 的 Windows 8.1 更新软件包。
注意:适用于Windows RT 8.1的更新只能从Windows Update获取。
示例:添加别名
cd ~
touch .bashrc
touch .bash_profile
echo 'if [ -f ~/.bashrc ]; then . ~/.bashrc; fi' > .bash_profile
echo 'alias java="java -Dfile.encoding=UTF-8"' > .bashrc # 在windows下java输出乱码的解决办法
. ~/.bashrc
打开 chrome 浏览器,按 F12
,在 Console
中输入:
window.sessionStorage.setItem("P_l_h5", true);
打开优酷视频就可以实现 HTML5 播放了。还有去广告的疗效哦。
Certbot 其实就是维护 Let’s Encrypt 的 Package。
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
# nginx 服务器
sudo apt-get install python-certbot-nginx
# apache 服务器
sudo apt-get install python-certbot-apache
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.sql.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Connection conn = null;
User user = null;
Gson gson = new Gson();
try {
# JDK6 之前的版本需要加载驱动
# new com.mysql.jdbc.Driver();
# 连接数据库
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/dbname?" +
"useSSL=false&useUnicode=true&characterEncoding=UTF8", "root", "root");
# 使用 prepareStatement 查询数据库
PreparedStatement preStatement = conn.prepareStatement("select * from tables");
ResultSet res = preStatement.executeQuery();
List<User> users = new ArrayList<User>();
while (res.next()) {
user = new User();
user.setId(Integer.parseInt(res.getString("id")));
user.setUser(res.getString("user"));
users.add(user);
}
# 导出为 json
String strJson = gson.toJson(users);
System.out.println(strJson);
} catch (SQLException e) {
e.printStackTrace();
} finally {
if (conn != null) {
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}
}
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
public class Main {
public static void main(String[] args) {
User user = new User();
user.setId(1);
user.setUser("admin");
# 实例化 Gson
Gson gson = new Gson();
# 序列化 json
String jsonUser = gson.toJson(user);
System.out.println(jsonUser);
# 反序列化 json
User user1 = gson.fromJson(jsonUser, User.class);
System.out.println(user1);
System.out.println("==============================");
# 列表,使用 List
List<User> users = new ArrayList<>();
for (int i = 0; i < 2; i++) {
users.add(user);
}
String jsonUsers = gson.toJson(users);
System.out.println(jsonUsers);
List<User> users1 = gson.fromJson(jsonUsers, new TypeToken<List<User>>() {
}.getType());
for (User _user : users1) {
System.out.println(_user);
}
System.out.println("==============================");
# 多属性键值对,使用 Map
Map<String, String> ips = new HashMap<>();
for (int i = 0; i < 9; i++) {
ips.put(i + "", "192.168.1.10" + i);
}
String jsonIps = gson.toJson(ips);
System.out.println(jsonIps);
Map<String, String> ips1 = gson.fromJson(jsonIps, new TypeToken<Map<String, String>>() {
}.getType());
Set<String> set = ips1.keySet();
for (String _string : set) {
System.out.println(_string + ":" + ips1.get(_string));
}
}
}
public
全局,类内部外部子类都可以访问private
私有,只有本类内部可以使用protected
受保护,只有本类或子类或父类中可以访问https://www.ventoy.net/cn/doc_disk_layout.html
http://liveusb.info/dotclear/index.php?pages/install
sudo apt-add-repository 'deb http://liveusb.info/multisystem/depot all main'
wget -q -O - http://liveusb.info/multisystem/depot/multisystem.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install multisystem
sudo usermod -a -G adm "$SUDO_USER"