Skip to content

Instantly share code, notes, and snippets.

postgres@wikidb# explain select a.p_id,b.p_id from priv.tab as a, priv.tab as b where a.p_id = b.p_id + 0;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------------
Merge Join (cost=1088522.44..33024969.06 rows=1787314118 width=16)
Merge Cond: (a.p_id = ((b.p_id + 0)))
-> Index Only Scan using tab_p_id_p_attr1_p_attr2_p_attr3_p_attr4_p_attr5_p_attr6_p__idx on tab a (cost=0.56..618141.27 rows=8061768 width=8)
-> Sort (cost=1088521.89..1108676.31 rows=8061768 width=8)
Sort Key: ((b.p_id + 0))
-> Seq Scan on tab b (cost=0.00..163729.68 rows=8061768 width=8)
(6 rows)
#define _GNU_SOURCE
#include <pthread.h>
#include <sched.h>
#include <dlfcn.h>
#include <stdlib.h>
typedef int (*set_affinity_type)(pthread_t thread, size_t cpusetsize,
const cpu_set_t *cpuset);
# always
export EDITOR='/usr/bin/emacs'
# show branch where there is git
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(git::\1)/'
}
#shows git branch and last exit status
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;31m\]$?\[\033[00m\]:\[\033[01;34m\]\w$(parse_git_branch)\[\033[00m\]\$ '
# filename pattern -> package matching
dpkg -S '*foo*'
# installed package -> installed files
dpkg-query -L 'foopackage'
# package name -> package file contents
apt-file list <package_name>
sudo kprobe 'p:vfs_read inode=+64(+32(%di)):u64 size_requested=%dx:u64 offset=+0(%cx):u64' 'inode == 0x3e20003'
CP=$(for f in $(find ~/.ivy2/cache/ -name '*jar'); do echo -n $f:; done)
java -cp $CP <mainclass> <args>
eg.
java -cp $CP org.apache.parquet.tools.Main meta --debug /nvme_drive/parquet_data/blue_prius_cambridge_2017-02-04-15-18-34_parquet_dir.4/sensor_msgs_CompressedImage.parquet
% and an sbt file like this to download the stuff you want
import Dependencies._
initialCommands in console := s"""
import org.apache.spark.SparkConf
@orm011
orm011 / docker_commands.bash
Last active June 10, 2017 20:43
knightriderdocker
# two important docker types to distinguish: $DOCKER_IMAGE vs. $DOCKER_CONTAINER. (think executable vs process)
# docker run takes an image and makes a container
# docker commit takes a container and makes an image
# docker start, stop, exec operate on containers only.
# start running a new container instance as a daemon, starting from a docker image
# some settings like volume mappings need to be set here
# you will probably need to remove the inline comments. SORRY!
{"type": "FeatureCollection", "features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.039882,38.898321]},"properties":{"marker-symbol":"bar","name":"The Exchange","address":"1719 G St NW"}}]}
@orm011
orm011 / a
Created July 18, 2018 15:41
test gist 123
testing gist api
@orm011
orm011 / a
Created July 18, 2018 15:43
gjo
{"type": "FeatureCollection", "features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.039882,38.898321]},"properties":{"marker-symbol":"bar","name":"The Exchange","address":"1719 G St NW"}}]}