Skip to content

Instantly share code, notes, and snippets.

View meatcar's full-sized avatar

Denys Pavlov meatcar

View GitHub Profile
@meatcar
meatcar / README.md
Created September 22, 2019 23:08
WSL2 wsltty + wslbridge2

Install/copy:

Run keybinds.ahk with autohotkey, Win+Enter spawns new terminal.

Re-map Surface Pro 3 buttons

This how I remap my SP3's screen buttons to something more useable than the default binding.

By default Linux binds the windows key to LWIN, which overlaps with my window manager's meta binding, and is pretty useless when using the Surface with the keyboard folded. I remap it to F13 so I can bind it to custom scripts with xbindkeys, but you can customize it to suit your needs.

There's probably a better place to put the xkb and have it loaded at system

How to make a SOCKSv5 proxy with only SSH

Theory

The remote machine needs to ssh into a machine available to the internet to create a proxy.

What to run

ssh -t -R :localhost:22 remote "ssh -C2TNv -D  @localhost -p "
@meatcar
meatcar / snippet.java
Last active October 30, 2015 20:58
How would you refactor this?
/**
* Get associated terms for this measurement with the given standard deviation value.
*
* @param standardDeviation the measurement's standard deviation value or {@code null} for all associated terms
* @return a list of terms
*/
public Collection<VocabularyTerm> getAssociatedTerms(Double standardDeviation)
{
ResourceBundle configuration = ResourceBundle.getBundle("measurementsAssociatedTerms");

Keybase proof

I hereby claim:

  • I am meatcar on github.
  • I am meatcar (https://keybase.io/meatcar) on keybase.
  • I have a public key whose fingerprint is B62B 215F 735C 6290 9B69 EF8A F458 4A74 4A42 E48E

To claim this, I am signing this object:

@meatcar
meatcar / packing.md
Last active September 8, 2015 20:24

Camping Checklist

September 11th 2015

  • tent (or make sure you have room in someone's)
  • sleeping bag (make sure it's rated for the weather)
  • therma-rest (keeps you off the ground, warm. Example)
  • pillow (optional, just ball up a sweater instead)
  • long-sleved shirt or sweater
  • long pants
  • t-shirts
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
public class FutureManager {
Executor executor = Executors.newSingleThreadExecutor();
Map<String, Future> futures;
long timeToSleep;
public class DrillJDBCTestTrial {
public static void main(String[] args) throws SQLException, ClassNotFoundException {
Class.forName("org.apache.drill.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:drill:zk=local");
String query = "select N_NAME from dfs.`/home/meatcar/dev/drill/apache-drill-0.7.0/sample-data/nation.parquet`";
PreparedStatement statement = connection.prepareStatement(query);
// hangs here
ResultSet rs = statement.executeQuery();
@meatcar
meatcar / avro+ga4gh.md
Last active January 27, 2023 15:33
These notes should help you undestand Avro, and give you an entrypoint to start understanding the ga4gh API.

What is Avro?

Parsing the ga4gh API requires you first to understand what is Avro.

Avro is a project that allows you to

  • formaly declare and define data structures (schemas in Avro) to be later used in different languages.
  • store data in a file
  • fetch data from a file