Skip to content

Instantly share code, notes, and snippets.

@yashk
yashk / TmpFileFilter.scala
Last active April 20, 2023 18:08
spark underscore
package underscore
import org.apache.hadoop.fs.{Path, PathFilter}
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat
import org.apache.spark.sql.SparkSession
class TmpFileFilter extends PathFilter {
override def accept(path: Path): Boolean = {
println(path)
@yashk
yashk / hdu.sh
Last active December 14, 2022 16:03
hdu.sh - get list of dir on a hdfs path sorted by disk space descending, good tool for figuring out what us occupying space on hdfs
hdfs dfs -du "$1" | awk '{print $1,$2,$3}' | sort -nr | xargs -n3 sh -c 'printf "%s %s %s\n" $(numfmt --to=iec $0) $(numfmt --to=iec $1) $2'
✔️Tech-Powered Sales by Justin Michael
✔️The Incredible History of India's Geography by Sanjiv Sanyal
✔️The Art of Saying No by Damon Zahariades
✔️No Limits by Mukesh B.
✔️Measure What Matters by John Doerr
✔️How I Almost Blew It by Sidharth Rao
✔️Meetings That Get Results by Brian Tracey
✔️Linked Inbound by Sam Rathling
✔️The Million Pound Linkedin Message by Daniel Disney
✔️The Psychology of Money by Morgan Housel
@yashk
yashk / TestCsv
Created September 18, 2020 15:20
csv with ^A
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class TestCsv {
private static final String CSV_FILE_NAME = "hive_out.csv";
~/work/st/notes/gist.txt
@yashk
yashk / usethis.md
Created June 17, 2020 06:13
my usethis version

Primary editor(s) :

  • Intellij Idea ,
  • VS Code
  • VIM

Command line :

  • Iterm2 with solazied dark theme
  • Shell - fish (give it a try it is better than zsh or bash)
  • command prompt starship
  • autojump (no need for cd after it learns your dirs)
@yashk
yashk / gist:985de6435b8455c93b86d35bfd4434a8
Created June 2, 2020 07:00
spark no space on disk how-do-i-avoid-the-no-space-left-on-device-error
https://forums.databricks.com/questions/277/how-do-i-avoid-the-no-space-left-on-device-error.html
@yashk
yashk / ns-cheatsheet.clj
Created October 27, 2019 10:43 — forked from ghoseb/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.
@yashk
yashk / SparkScaling.md
Last active July 9, 2019 13:56
Sparkg Scaling