An experienced operators guide to streaming Kubernetes workload logs into Quickwit.
- install iterm2.com
- import and pick color preset (
Profiles > Colors > Color Presets) - install ohmyz.sh#install
- install theme powerlevel10k#oh-my-zsh
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 torch | |
| from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor | |
| from PIL import Image | |
| from pathlib import Path | |
| import sys | |
| # Toggle to switch between full response and extracted description | |
| OUTPUT_FULL_RESPONSE = False | |
| # Ensure we're using the MPS device if available |
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
| # AWS AppSync GQL directives | |
| # | |
| ## Scalars come from here: | |
| # https://raw.githubusercontent.com/aws-amplify/amplify-cli/master/packages/amplify-graphql-types-generator/awsAppSyncDirectives.graphql | |
| # https://docs.aws.amazon.com/appsync/latest/devguide/scalars.html | |
| # | |
| ## Directives came from a GitHub issue here: | |
| # https://github.com/apollographql/eslint-plugin-graphql/issues/263 | |
| ## And comparing with the JSON output of | |
| # https://docs.aws.amazon.com/appsync/latest/APIReference/API_GetIntrospectionSchema.html |
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
| class RepositoryNamespace<Entity = string, Metadata = {}> { | |
| private readonly ns: string | |
| private readonly kv: KVNamespace | |
| constructor(kv: KVNamespace, namespace: string) { | |
| this.ns = namespace | |
| this.kv = kv | |
| } | |
| put(key: string, entity: Entity) { |
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
| /** | |
| * Get a Google auth token given service user credentials. This function | |
| * is a very slightly modified version of the one found at | |
| * https://community.cloudflare.com/t/example-google-oauth-2-0-for-service-accounts-using-cf-worker/258220 | |
| * | |
| * @param {string} user the service user identity, typically of the | |
| * form [user]@[project].iam.gserviceaccount.com | |
| * @param {string} key the private key corresponding to user | |
| * @param {string} scope the scopes to request for this token, a | |
| * listing of available scopes is provided at |
For Chrome Canary:
alias hydra='/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --no-sandbox --js-flags="--user-data-dir=/tmp/profile --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces"'For regular ol' Chrome:
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
| ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
| # Don't add passphrase | |
| openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
| cat jwtRS256.key | |
| cat jwtRS256.key.pub |
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
| // data comes from here http://stat-computing.org/dataexpo/2009/the-data.html | |
| // download 1994.csv.bz2 and unpack by running: cat 1994.csv.bz2 | bzip2 -d > 1994.csv | |
| // 1994.csv should be ~5.2 million lines and 500MB | |
| // importing all rows into leveldb took ~50 seconds on my machine | |
| // there are two main techniques at work here: | |
| // 1: never create JS objects, leave the data as binary the entire time (binary-split does this) | |
| // 2: group lines into 16 MB batches, to take advantage of leveldbs batch API (byte-stream does this) | |
| var level = require('level') |
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
| Download EasySIMBL: https://github.com/norio-nomura/EasySIMBL | |
| Download Maximizer: http://chpwn.com/apps/maximizer.html | |
| EasySIMBL is SIMBL with some added compatibility for OS X Lion / Mount'n Lion. | |
| Drag the app to your applications folder, open it up and check the box that says "Use SIMBL". | |
| Then click the button that says "Show Plugin Folder" and drag the Maximizer into that folder. | |
| Close EasySIMBL and Emacs. | |
| When you reopen emacs, you'll be able to go into fullscreen emacs by clicking the arrows on the top right corner. | |
| The end. |
NewerOlder