⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
#!/usr/bin/env python3 | |
""" | |
License: MIT License | |
Copyright (c) 2023 Miel Donkers | |
Very simple HTTP server in python for logging requests | |
Usage:: | |
./server.py [<port>] | |
""" | |
from http.server import BaseHTTPRequestHandler, HTTPServer |
List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.
http://www.w3.org/TR/WebCryptoAPI/
This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.
Using py.test is great and the support for test fixtures is pretty awesome. However, in order to share your fixtures across your entire module, py.test suggests you define all your fixtures within one single conftest.py
file. This is impractical if you have a large quantity of fixtures -- for better organization and readibility, you would much rather define your fixtures across multiple, well-named files. But how do you do that? ...No one on the internet seemed to know.
Turns out, however, you can define fixtures in individual files like this:
tests/fixtures/add.py
import pytest
@pytest.fixture
nvidia-smi
said this required 11181MiB, at least to train on the sequence lengths of prompt that occurred initially in the alpaca dataset (~337 token long prompts).
You can get this down to about 10.9GB if (by modifying qlora.py) you run torch.cuda.empty_cache()
after PEFT has been applied to your loaded model and before you begin training.
All instructions are written assuming your command-line shell is bash.
Clone repository:
Collection of License badges for your Project's README file. Easily copy and paste the code under the badges into your Markdown files.
- Badges are made with Shields.io.
- This badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.
Comment this gist or write me an E-Mail (lukas@himsel.me)
I'm now working on big data processing with Pandas at scale, as a lightweight alternative to Spark. Fortunately, the Apache Arrow project brings with it an excellent and very fast Parquet reader and writer.
With the current push to ARM in both personal computers and the data center, I was curious to check the performance of my code on ARM - running on AWS' homegrown Graviton2 processor. Their c6g instance types are 20% cheaper than the equivalent Intel-based c5's, while promising faster performance. If that's the future, why not start getting ready now?
While there are already Python wheels for NumPy and Pandas, there is no official build yet for PyArrow. There's a pull request in the works,
extends TextEdit | |
export var expand = true | |
export var min_line = 3 | |
export var max_line = 6 | |
var scroll_bar | |
var font = get_font("") | |
var line_spacing |
Benchmark Code: https://github.com/CovenantSQL/CovenantSQL/blob/develop/crypto/asymmetric/signature_test.go#L204
BenchmarkSign/Secp256k1-12 20000 66413 ns/op
BenchmarkSign/Secp256k1-25%-12 20000 64881 ns/op
BenchmarkSign/C-Secp256k1-12 20000 77700 ns/op
BenchmarkSign/P224-12 2000 627489 ns/op
BenchmarkSign/P256-12 100000 22207 ns/op
BenchmarkSign/P384-12 300 3394950 ns/op