This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| nodejs的实现: | |
| var CryptoJS = require("crypto-js"); | |
| var password="password123"; | |
| var key,iv; | |
| key=iv=CryptoJS.enc.Utf8.parse(CryptoJS.MD5(password).toString().substring(0,16)); | |
| //加密 | |
| var encrypted = CryptoJS.AES.encrypt('123中文',key,{iv:iv,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.ZeroPadding}); | |
| console.log(encrypted.ciphertext.toString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function openssl_aes_cbc_zeropadding_128_encrypt($msg, $key, $iv) { | |
| $msgLength = strlen($msg); | |
| $blockSize = 16; | |
| if ($msgLength % $blockSize != 0) { | |
| $msg .= str_repeat("\0", $blockSize - ($msgLength % $blockSize)); | |
| } | |
| return bin2hex(openssl_encrypt($msg, 'AES-128-CBC', $key, OPENSSL_NO_PADDING, $iv)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.math.BigInteger; | |
| import java.security.MessageDigest; | |
| import javax.crypto.Cipher; | |
| import javax.crypto.spec.IvParameterSpec; | |
| import javax.crypto.spec.SecretKeySpec; | |
| public class Test { | |
| public static String encrypt(String data, String key, String iv) { | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1.需要安装VirtualBox Extension Pack,下载地址https://www.virtualbox.org/wiki/Downloads | |
| 2.添加当前用户到组,执行sudo usermod -a -G vboxusers $USER | |
| 3.重启linux系统 | |
| 4.在虚拟机的usb里面启用usb2.0 | |
| 5.启动虚拟机,然后查看右下角usb标签,就会发现识别了usb设备. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://github.com/pyenv/pyenv-installer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/bin/bash | |
| echo "#/bin/sh -e">/etc/rc.local | |
| echo "#your commands at here ...">>/etc/rc.local | |
| echo "exit 0">>/etc/rc.local | |
| chmod +x /etc/rc.local | |
| #/etc/systemd/system/rc-local.service | |
| echo "[Unit]">/etc/systemd/system/rc-local.service | |
| echo " Description=/etc/rc.local Compatibility">>/etc/systemd/system/rc-local.service | |
| echo " ConditionPathExists=/etc/rc.local">>/etc/systemd/system/rc-local.service | |
| echo "">>/etc/systemd/system/rc-local.service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/bin/bash | |
| apt-get install -y language-pack-zh-hans language-pack-zh-hant | |
| #/etc/environment | |
| echo "LANG=\"zh_CN.UTF-8\"">>/etc/environment | |
| echo "LANGUAGE=\"zh_CN:zh:en_US:en\"">>/etc/environment | |
| #/var/lib/locales/supported.d/local | |
| echo "en_US.UTF-8 UTF-8">/var/lib/locales/supported.d/local | |
| echo "zh_CN.UTF-8 UTF-8">>/var/lib/locales/supported.d/local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dpkg-reconfigure tzdata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 在/etc/udev/rules.d/目录下找到70-persistent-net.rules这个文件(没有则新建), | |
| 在文件末尾添加 | |
| SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="b8:27:eb:d6:74:00", NAME="wlan0" | |
| SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="f0:b4:29:36:07:26", NAME="wlan1" | |
| 将其中的ATTR换位你的硬件MAC地址 | |
| NAME就是设备名。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ctrl_interface=/var/run/wpa_supplicant | |
| network={ | |
| ssid="xxxx" | |
| key_mgmt=WPA-EAP | |
| eap=PEAP | |
| identity="username" | |
| password="password" | |
| phase2="MSCHAPV2" | |
| } |