kk Blog —— 通用基础


date [-d @int|str] [+%s|"+%F %T"]
netstat -ltunp
sar -n DEV 1

华为、博达、H3C端口聚合

华为

1
2
3
4
5
6
7
8
9
10
11
12
13
14
interface Eth-Trunk 1
description to xxxxxx
port link-type trunk
port trunk allow-pass vlan 2 to 4094


interface GigabitEthernet3/0/44
description to 2chang
eth-trunk 1
broadcast-suppression 5


shutdown
undo shutdown

博达

https://wenku.csdn.net/doc/23o9boi5qj

https://www.renrendoc.com/paper/112234581.html

1
2
3
4
5
6
7
8
9
10
interface  port-aggregator 2
switchport mode trunk

interface GigaEthernet0/1
switchport mode trunk
aggregator-group 2 mode static


shutdown
no shutdown

锐捷

https://www.ruijie.com.cn/fw/wt/93443/

https://search.ruijie.com.cn:8902/kc/rqs/index.html#/d/2018092015040800258

php AES、DES java

一、AES

java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
byte[] tmp = asBin(encrypted);
byte[] key = asBin(sKey);

SecretKeySpec skeySpec = new SecretKeySpec(key, "AES");
Cipher cipher = Cipher.getInstance("AES");
cipher.init(2, skeySpec);
byte[] decrypted = cipher.doFinal(tmp);
return new String(decrypted);


private static byte[] asBin(String src) {
	byte[] encrypted = new byte[src.length() / 2];
	for (int i = 0; i < src.length() / 2; i++) {
		int high = Integer.parseInt(src.substring(i * 2, i * 2 + 1), 16);
		int low = Integer.parseInt(src.substring(i * 2 + 1, i * 2 + 2), 16);
		encrypted[i] = (byte)(high * 16 + low);
	}
	return encrypted;
}

php

1
2
3
$d1 = hex2bin($src);
$d2 = hex2bin($key);
$out0 = openssl_decrypt($d1, 'aes-128-ecb', $d2, OPENSSL_RAW_DATA);

二、DES

1
2
3
4
5
6
7
8
9
10
  public static byte[] decrypt1(byte[] msg, String key) throws Exception {
    Security.addProvider(new SunJCE());
    byte[] keyBytes = genKey(key);
    SecretKey deskey = new SecretKeySpec(keyBytes, "DESede");
    IvParameterSpec ivspec = genIV();
    byte[] src = msg;
    Cipher c1 = Cipher.getInstance("DESede/CBC/NoPadding");
    c1.init(2, deskey, ivspec);
    return c1.doFinal(src);
  }

php

1
$out0 = openssl_decrypt($d1, 'DES-EDE3-CBC', $d2, OPENSSL_RAW_DATA | OPENSSL_NO_PADDING);

phpgd 透明背景

可以露出底层内容

1
2
3
4
5
6
7
8
9
$image = imagecreatetruecolor($image_width, $image_height);
$bg_color = imagecolorallocatealpha($image, 0, 0, 0, 127);
imagefill($image, 0, 0, $bg_color);
imagealphablending($image, false);
imagesavealpha($image, true);

$font_color = imagecolorallocate($image, 0, 0, 0);

imagettftext($image, $font_size, 0, 3, 27, $font_color, $font, $text);