JFS_BASE=/Users/yujunz/JuiceFS
JFS_NAME=rogerz-s3-cn-east-1-qiniu
BUNDLE=TimeMachine.sparsebundle
VOLUME=/Volumes/TimeMachine
# Mount JuiceFS
juicefs mount --cache-dir $JUICEFS_BASE/cache --batch 10 --writeback --metacache --opencache $JFS_NAME $JFS_BASE/$JFS_NAME
# Create sparse bundle
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
| /* | |
| How to export | |
| * mongo is mongoshell command | |
| mongo dbname --quiet mongodbIndexExporter.js > index.js | |
| */ | |
| let collectionNames = db.getCollectionNames(); | |
| let index_data = {'collections': []}; | |
| for (let i in collectionNames) { |
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
| function countDuplicate(arr) { | |
| let map = new Map(); | |
| arr.forEach(num => { | |
| if (map.get(num) > 0) { | |
| // set(key, value) | |
| map.set(num, map.get(num) + 1); | |
| } else { | |
| // set(key, value) | |
| map.set(num, 1); | |
| } |
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
| function decrypt(word) { | |
| // string to char array | |
| let chars = []; | |
| for (let c of word) { | |
| chars.push(c); | |
| } | |
| // step 3 | |
| let asciiValues = chars.map(c => c.charCodeAt(0)); | |
| console.log(asciiValues); |
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.util.*; | |
| class Main { | |
| public static void main(String[] args) { | |
| System.out.println(modifyStr("").equals("")); | |
| System.out.println(modifyStr("Automotive parts").equals("A6e p3s")); | |
| System.out.println(modifyStr("Automotive par").equals("A6e p1r")); | |
| System.out.println(modifyStr("Automotive pa").equals("A6e p0a")); | |
| System.out.println(modifyStr("Automotive p").equals("A6e p0p")); | |
| System.out.println(modifyStr("**Automotive p").equals("**A6e p0p")); |
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
| document.getElementsByTagName('body')[0].innerHTML = document.querySelectorAll('.question-description__3U1T')[0].innerHTML; | |
| var css = 'body {line-height:1.2} p { font-size: 11px; margin:0px; padding:0px } pre {font-size:8px; margin:0px; padding:2px 4px} code {font-size:8px}', | |
| head = document.head || document.getElementsByTagName('head')[0], | |
| style = document.createElement('style'); | |
| style.type = 'text/css'; | |
| if (style.styleSheet){ | |
| // This is required for IE8 and below. | |
| style.styleSheet.cssText = css; |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> |
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
| docker images |
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
| ALTER USER 'root'@'localhost' IDENTIFIED BY '<password>'; |
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
| java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed |
NewerOlder