Skip to content

Instantly share code, notes, and snippets.

{"timestamp":"2023-08-09T16:46:21.516032Z","level":"TRACE","fields":{"message":"drop_stream_ref; stream=Stream { id: StreamId(1), state: State { inner: Open { local: Streaming, remote: Streaming } }, is_counted: true, ref_count: 1, next_pending_send: None, is_pending_send: false, send_flow: FlowControl { window_size: Window(2097152), available: Window(1) }, requested_send_capacity: 1, buffered_send_data: 0, send_task: Some(Waker { data: 0x7ff56b0011e0, vtable: 0x55c994cc12c0 }), pending_send: Deque { indices: None }, next_pending_send_capacity: None, is_pending_send_capacity: false, send_capacity_inc: true, next_open: None, is_pending_open: false, is_pending_push: false, next_pending_accept: None, is_pending_accept: false, recv_flow: FlowControl { window_size: Window(1041514), available: Window(1048576) }, in_flight_recv_data: 0, next_window_update: None, is_pending_window_update: false, reset_at: None, next_reset_expire: None, pending_recv: Deque { indices: None }, is_recv: false, recv_task: Some(Waker { dat
@pH14
pH14 / new
Last active October 27, 2022 12:35
compaction upsert: 1000 rounds, 60 keys, 25ms pause
round 0
0: num_batches: 1, num_batch_parts: 1, num_entries: 60, num_fueled_merges: 0
round 1
1: num_batches: 2, num_batch_parts: 2, num_entries: 180, num_fueled_merges: 0
round 2
2: num_batches: 2, num_batch_parts: 3, num_entries: 300, num_fueled_merges: 1
round 3
3: num_batches: 3, num_batch_parts: 4, num_entries: 420, num_fueled_merges: 1
round 4
4: num_batches: 2, num_batch_parts: 5, num_entries: 540, num_fueled_merges: 1
@pH14
pH14 / 1-create-assignment-variables.java
Last active January 4, 2022 13:32
Vitess Balancer Code Snippets
List<IntVar> assignmentVariablesForCluster = new ArrayList<>();
for (String instance : mysqlCluster.getInstances()) {
IntVar primaryAssignmentToInstance = model.newIntVar(
0, // indicates instance is replica
1, // indicates instance is primary
String.format("(%s, %s)", mysqlCluster.getName(), instance)
);
assignmentVariablesForCluster.add(primaryAssignmentToInstance);
}
@pH14
pH14 / vitess-balancer-ensure-primary-assignment.java
Last active January 4, 2022 13:20
Vitess Balancer Code Snippet: Ensuring Primary is Assigned
model.addEquality(LinearExpr.sum(assignmentVariablesForCluster), 1);
@pH14
pH14 / vitess-balancer-assignment-variables.java
Last active January 4, 2022 13:19
Vitess Balancer Code Snippet: Assignment Variables
List<IntVar> assignmentVariablesForCluster = new ArrayList<>();
for (String instance : mysqlCluster.getInstances()) {
IntVar primaryAssignmentToInstance = model.newIntVar(
0, // indicates instance is replica
1, // indicates instance is primary
String.format("(%s, %s)", mysqlCluster.getName(), instance)
);
assignmentVariablesForCluster.add(primaryAssignmentToInstance);
}
@pH14
pH14 / gist:50ada0b953863ce3b9f60392618cbbc4
Created March 20, 2020 13:40
Distributed Compute for COVID19 Research

Maximize GPU Resources with Folding@Home

Folding@Home: https://foldingathome.org/start-folding/

  • Install etc
  • If asked, set the research focus to Any, which is currently prioritizing (but is not exclusively) COVID19 research
  • Remove the cpu slot of work, keep the gpu slot
  • Click Fold + move Folding Power to High

This will allow F@H to maximize any capacity on the GPU, and will barely touch the CPU.

@pH14
pH14 / gist:caee0c2be14e5db09c69e480be9f8a42
Created January 22, 2020 13:07
s3uploader partsize patch
diff --git a/go/vt/mysqlctl/s3backupstorage/s3.go b/go/vt/mysqlctl/s3backupstorage/s3.go
index b6e3261b2..66fa3b5e7 100644
--- a/go/vt/mysqlctl/s3backupstorage/s3.go
+++ b/go/vt/mysqlctl/s3backupstorage/s3.go
@@ -43,6 +43,7 @@ import (
"golang.org/x/net/context"
"vitess.io/vitess/go/vt/concurrency"
+ "vitess.io/vitess/go/vt/mysqlctl"
"vitess.io/vitess/go/vt/mysqlctl/backupstorage"
@pH14
pH14 / gist:4a234d79ddd4ea9fa487
Created October 15, 2015 13:35
building GoodNight errors
/GoodNight/GoodNight/AppDelegate.m:43:80: error: expected a type
- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL succeeded))completionHandler {
^
/GoodNight/GoodNight/AppDelegate.m:45:23: error: property 'type' not found on object of type '__strong id'
if ([shortcutItem.type isEqualToString:[NSString stringWithFormat:@"%@.enable", bundleIdentifier]]) {
^
/GoodNight/GoodNight/AppDelegate.m:56:28: error: property 'type' not found on object of type '__strong id'
else if ([shortcutItem.type isEqualToString:[NSString stringWithFormat:@"%@.disable", bundleIdentifier]]) {
^
3 errors generated.
@pH14
pH14 / gist:59febddcd066b3115cbc
Created March 3, 2015 17:45
rbx 2.5.2 rails app psych 2.0.13
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-03-03 12:44:45] INFO WEBrick 1.3.1
[2015-03-03 12:44:45] INFO ruby 2.1.0 (2015-01-30) [x86_64-darwin14.1.0]
[2015-03-03 12:44:45] INFO WEBrick::HTTPServer#start: pid=43749 port=3000
Started POST "/session" for 127.0.0.1 at 2015-03-03 12:44:54 -0500
@pH14
pH14 / gist:16ed5c2b20e712681b7d
Created February 27, 2015 02:29
rbx 2.5.0 rails app gems
bundle exec gem list --local
*** LOCAL GEMS ***
actionmailer (4.2.0)
actionpack (4.2.0)
actionview (4.2.0)
activejob (4.2.0)
activemodel (4.2.0)
activerecord (4.2.0)