Skip to content

Instantly share code, notes, and snippets.

@dvryaboy
dvryaboy / letter_to_nikolai.md
Created March 28, 2023 17:54
chatgpt transcript - ru vs en

Dmitriy Ryaboy: write a letter to my friend Nikolay wishing him a happy birthday and reminiscing about skiing in Tahoe

Dear Nikolay,

Happy birthday, my friend! I hope this letter finds you well and in good spirits. As another year passes, I want to take a moment to wish you all the best and remind you of the memories we've shared together.

One of my fondest memories with you was our skiing trip to Tahoe. I can still remember the thrill of speeding down the slopes with the wind rushing past us. It was a cold day, but the sun was shining bright, and the snow was perfect. I remember laughing with you as we took a break at the top of the mountain, sipping hot cocoa and admiring the stunning view.

It's hard to believe that it's been a year since we were there, but I'm glad we had that experience together. You always know how to make any moment more enjoyable, and I'm grateful for that.

@dvryaboy
dvryaboy / VertexMemBench.java
Created September 12, 2011 03:33
Giraph Memory Benchmarks, v2
package org.giraph.util;
import java.util.Arrays;
import java.util.Map;
import org.apache.giraph.graph.Edge;
import org.apache.hadoop.io.FloatWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.mahout.math.map.OpenLongFloatHashMap;
import com.google.common.collect.Maps;
@dvryaboy
dvryaboy / VertexMemBench.java
Created September 11, 2011 23:01
Test memory consumption for Giraph Vertex implementations
package org.giraph.util;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.SortedMap;
@dvryaboy
dvryaboy / pig_default_semicolons.sh
Created August 24, 2011 22:10
How Pig treats semicolons in variable declarations
# Pay attention to where you put your semicolons lest they become part of the value!
cat tmp/default.pig
%default QUOTED '20090101';
%default UNQUOTED $QUOTED;
l = load '/logs/$QUOTED';
l = load '/logs/$UNQUOTED';
@dvryaboy
dvryaboy / kill_hadoop_orphans.sh
Created April 28, 2011 01:03
Shell script to kill orphaned Hadoop Task processes
#!/bin/bash
# Kill tasks holding on to deleted userlogs. These are most likely abandoned jobs.
function get_bad_pids {
for i in `ps -ef | grep java | awk '{print $2;}'`; do
cnt=`/usr/sbin/lsof -p $i | grep deleted | grep /var/log/hadoop-0.20/userlogs/attempt | wc -l`;
if [ $cnt -gt 0 ]; then
PIDS=$i:$PIDS;
fi
@dvryaboy
dvryaboy / HBaseRSAlerter.java
Created March 16, 2011 22:13
HBase Alerter thing.
package com.twitter.twadoop.monitoring;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;