Skip to content

Instantly share code, notes, and snippets.

@CsBigDataHub
CsBigDataHub / presentation.org
Created August 15, 2019 16:14 — forked from abrochard/presentation.org
Notes from the "Conquering Kubernetes with Emacs" presentation

Conquering Kubernetes with Emacs

Specific Annoying workflow

Listing pods with kubectl get pods, then select a pod name and copy paste it into kubectl logs [pod name]

Why?

  • I want to streamline my workflow and stop using the terminal
  • learn more about kubernetes
  • main kubernetes extension for Emacs out there is greedy for permissions
@CsBigDataHub
CsBigDataHub / README.md
Created August 5, 2019 18:41 — forked from joyrexus/README.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.*;
import org.apache.hadoop.io.IOUtils;
import java.io.IOException;
public class MyFileUtil {
public static boolean copyMergeWithHeader(FileSystem srcFS, Path srcDir, FileSystem dstFS, Path dstFile, boolean deleteSource, Configuration conf, String header) throws IOException {
dstFile = checkDest(srcDir.getName(), dstFS, dstFile, false);
import scala.util.Try
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
import org.apache.hadoop.io.IOUtils
import java.io.IOException
def copyMerge(
srcFS: FileSystem, srcDir: Path,
dstFS: FileSystem, dstFile: Path,
deleteSource: Boolean, conf: Configuration
name := "playground"
version := "1.0"
scalaVersion := "2.10.4"
libraryDependencies += "org.apache.spark" %% "spark-core" % "1.1.0"
libraryDependencies += "net.sf.opencsv" % "opencsv" % "2.3"
@CsBigDataHub
CsBigDataHub / autowire-resttemplate.md
Created April 30, 2019 19:42 — forked from RealDeanZhao/autowire-resttemplate.md
How to autowire RestTemplate using annotations

From StackOverflow

Errors you'll see if a RestTemplate isn't defined

Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration.

or

No qualifying bean of type

@CsBigDataHub
CsBigDataHub / init.vim
Created November 11, 2018 15:57 — forked from matthewbdaly/init.vim
My NeoVim config
call plug#begin()
" NERDTree
Plug 'scrooloose/nerdtree'
" Git integration
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
" Linting
<?xml version="1.0" encoding="UTF-8"?>
<workflow-app xmlns='uri:oozie:workflow:0.4' name='sparkjob'>
<start to='spark-process' />
<action name='spark-process'>
<spark xmlns='uri:oozie:spark-action:0.1'>
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<configuration>
<property>
<name>oozie.service.SparkConfigurationService.spark.configurations</name>

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r <session_name>
@CsBigDataHub
CsBigDataHub / spacemacs-cheshe.md
Created October 16, 2018 17:54 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers