This file contains 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
db.inventory.find( { tags: 'fruit' } ) |
This file contains 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
/// <summary> | |
/// aes-256-cbc 解码 | |
/// </summary> | |
/// <param name="cipherData"></param> | |
/// <param name="keyString"></param> | |
/// <param name="ivString"></param> | |
/// <returns></returns> | |
public static string Decrypt(string cipherData, string keyString, string ivString) | |
{ | |
byte[] key = Encoding.UTF8.GetBytes(keyString); |
This file contains 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
//require cyrpto module | |
var crypto=require('crypto'); | |
//key and iv should be same as the one in encrypt.php | |
var decipher=crypto.createDecipheriv('aes-256-cbc','12345678901234561234567890123456','1234567890123456'); | |
//since we have already added padding while encrypting, we will set autopadding of node js to false. | |
decipher.setAutoPadding(false); | |
// copy the output of encrypt.php and paste it below |
This file contains 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
var crypto = require('crypto'); | |
var cipher = crypto.createCipher('aes256', 'passphrase'); | |
var encrypted = cipher.update("test", 'utf8', 'base64') + cipher.final('base64'); | |
console.log(encrypted); | |
var decipher = crypto.createDecipher('aes256', 'passphrase'); | |
var plain = decipher.update(encrypted, 'base64', 'utf8') + decipher.final('utf8'); | |
console.log(plain); |
This file contains 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
private string Unicode2Chinese(string strUnicode) | |
{ | |
string[] splitString = new string[1]; | |
splitString[0] = "\\u"; | |
string[] unicodeArray = strUnicode.Split(splitString, StringSplitOptions.RemoveEmptyEntries); | |
StringBuilder sb = new StringBuilder(); | |
foreach (string item in unicodeArray) | |
{ | |
byte[] codes = new byte[2]; |
This file contains 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
//macos | |
brew update | |
brew doctor | |
sudo chown -R $USER /usr/local | |
brew install ImageMagick | |
//ubuntu | |
apt-get install ImageMagick | |
brew link libtool | |
//liunx |
This file contains 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
sudo chown -R $USER /usr/local |
This file contains 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
sudo ln <oriFilePath> /usr/bin/<quickname> |
This file contains 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
fuser -n tcp 12004 | |
sudo kill 9358 |
This file contains 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/supermarin/Alcatraz/blob/master/Scripts/install.sh | |
#!/bin/sh | |
DOWNLOAD_URI=https://github.com/supermarin/Alcatraz/releases/download/1.0.4/Alcatraz.tar.gz | |
PLUGINS_DIR="${HOME}/Library/Application Support/Developer/Shared/Xcode/Plug-ins" | |
mkdir -p "${PLUGINS_DIR}" | |
curl -L $DOWNLOAD_URI | tar xvz -C "${PLUGINS_DIR}" | |
echo "Alcatraz successfuly installed!!1!🍻 Please restart your Xcode." |
NewerOlder