在开发 celeborn 的时候,往往需要打包部署验证。这样的流程比较长。而如果只是使用 celeborn 内部自带的单测,又很难模拟真实环境。 所以在此分享一下本机调试分布式系统的经验。
笔者使用 Macbook, 所以安装了 Colima. 其他系统只要安装了 docker 环境即可。
首先启动 docker 环境。celeborn 对于内存还是有一定要求的,所以设置 cpu 和 memory。
在开发 celeborn 的时候,往往需要打包部署验证。这样的流程比较长。而如果只是使用 celeborn 内部自带的单测,又很难模拟真实环境。 所以在此分享一下本机调试分布式系统的经验。
笔者使用 Macbook, 所以安装了 Colima. 其他系统只要安装了 docker 环境即可。
首先启动 docker 环境。celeborn 对于内存还是有一定要求的,所以设置 cpu 和 memory。
| #ifndef __LANCE_TOKENIZER_H__ | |
| #define __LANCE_TOKENIZER_H__ 1 | |
| #include <stddef.h> | |
| #include <stdint.h> | |
| typedef struct LanceTokenizerFactoryT* LanceTokenizerFactory; | |
| typedef struct LanceTokenizerT* LanceTokenizer; | |
| typedef struct LanceTokenStreamT* LanceTokenStream; | |
| struct LanceTokenT { |
| """ | |
| Usage: | |
| Make sure that redis is running on localhost (or adjust the url) | |
| Install uvicorn or some other asgi server https://asgi.readthedocs.io/en/latest/implementations.html | |
| pip install -u uvicorn | |
| Install dependencies |
| import { For } from "solid-js"; | |
| import store from "./store"; | |
| import { ToastObject, ToastType } from "./types"; | |
| const Toast = () => { | |
| return ( | |
| <div class="toast-container"> | |
| <For each={store.toastStore.toasts}> | |
| {(toast: ToastObject) => ( | |
| <div class="toast" className={toast.toastType}> |
| STDOUT.sync = true | |
| require 'queue' | |
| start_time = Time.now.to_i | |
| msg = 0 | |
| queue = Queue.new("testing") | |
| queue.subscribe do |obj| | |
| msg += 1 |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
Sublime Text 3 is a very popular text editor among developers. It is provided for free, but every few saves, you get a popup asking you to purchase Sublime Text for $80.
Now this is a wonderful piece of software, but not everyone has the $80+ to purchase a license for Sublime Text. However, I strongly recommend to eventually buy a license if you have the money to spare to support the development of ST.
Now, let's get into the cracking
Note: At the license prompt for MacOS, enter in any garbage, even a single letter and click Use License.
| #!bin/bash | |
| # grab labeled dataset | |
| wget http://downloads.tatoeba.org/exports/sentences.tar.bz2 | |
| bunzip2 sentences.tar.bz2 | |
| tar xvf sentences.tar | |
| # macos only for gshuf | |
| brew install coreutils | |
| awk -F"\t" '{print"__label__"$2" "$3}' < sentences.csv | gshuf > all.txt |
Ref: https://gist.github.com/vertexclique/9839383
| VERSION | PLATFORM | OFFSET | ORIGINAL | CRACKED |
|---|---|---|---|---|
| 3143 | macOS | 0x65D4 | 55 | C3 |
| 3143 | macOS | 0x6219 | 55 | C3 |
| 3143 | macOS | 0x75214 | 55 48 89 E5 41 57 41 56 | 48 C7 C0 01 00 00 00 C3 |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000