Skip to content

Instantly share code, notes, and snippets.

@SunnyBingoMe
SunnyBingoMe / msg
Last active September 14, 2023 16:33
{"err":["Välkommen","Välkommen till Växla upp 2 !"]}
@SunnyBingoMe
SunnyBingoMe / .gitconfig
Last active April 12, 2022 08:43
warn: autocrlf for windows only !!!
[user]
name = Sunny
email = Sunny
[diff]
tool = vimdiff
[difftool]
prompt = true
@SunnyBingoMe
SunnyBingoMe / Dockerfile--spark8s-pyspark
Created February 14, 2019 09:35
spark-on-k8s python pyspark
# I was having problems to create docker images for spark-on-k8s using docker-image-tool.sh in spark (it always gives spark-r).
# Thus here is the docker file to creat for running pyspark.
# The image is available on sunnybingome/spark8s:pyspark240py368 with spark 2.4.0
# For clie-mode (interactive mode), please use pipenv to ensure py version. The image is in using py 3.6(.8).
# Sunny modified from spark-2.4.0-bin-hadoop2.7/kubernetes/dockerfiles/spark/Dockerfile
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@SunnyBingoMe
SunnyBingoMe / install_mosh_server_non_root.sh
Last active August 8, 2019 12:55 — forked from lazywei/install_mosh_locally.sh
Install mosh server without root permission
#!/bin/sh
# tested in Ubuntu 14.04 manually.
# this script does absolutely ZERO error checking. however, it worked
# for me on a RHEL 6.3 machine on 2012-08-08. clearly, the version numbers
# and/or URLs should be made variables. cheers, zmil...@cs.wisc.edu
mkdir mosh
cd mosh
@SunnyBingoMe
SunnyBingoMe / Simple Spark Tests - README.md
Last active March 5, 2019 22:34
Simple Spark Tests: simple demos to test if spark is installed well and working

This is a gist of collection of simple spark tests for Jupyter and spark-submit.

@SunnyBingoMe
SunnyBingoMe / Spark high availability.md
Created February 28, 2019 15:53 — forked from aseigneurin/Spark high availability.md
Spark - High availability

Spark - High availability

Components in play

As a reminder, here are the components in play to run an application:

  • The cluster:
    • Spark Master: coordinates the resources
    • Spark Workers: offer resources to run the applications
  • The application:
@SunnyBingoMe
SunnyBingoMe / get_ip.py
Last active February 10, 2019 21:53
get a non-127 ip address by python
import socket
print([l for l in ([ip for ip in socket.gethostbyname_ex(socket.gethostname())[2]
if not ip.startswith("127.")][:1], [[(s.connect(('8.8.8.8', 53)),
s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET,
socket.SOCK_DGRAM)]][0][1]]) if l][0][0])
# limit: only one IP, not getting multi-NIC IPs
@SunnyBingoMe
SunnyBingoMe / PS_promot_wo_git.ps1
Last active December 12, 2018 13:00
MS windows powershell promt, (without git)
# Import module from previous step
Import-Module -Name posh-git
function Test-Administrator {
$user = [Security.Principal.WindowsIdentity]::GetCurrent();
(New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
function mklink { cmd /c mklink $args }
# pip2
absl-py==0.2.2
adium-theme-ubuntu==0.3.4
astor==0.6.2
backports.functools-lru-cache==1.5
backports.shutil-get-terminal-size==1.0.0
backports.weakref==1.0.post1
bleach==1.5.0
certifi==2018.4.16
chardet==3.0.4
@SunnyBingoMe
SunnyBingoMe / cuda90.sh
Last active August 10, 2018 12:22
re-install cuda to v9.0 from v9.1, due to tf 1.10.0 does not know recognize 9.1 yet
apt-get purge cuda && \
apt-get purge libcudnn6 && \
apt-get purge libcudnn6-dev && \
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb && \
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb && \
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb && \
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl2_2.1.4-1+cuda9.0_amd64.deb && \
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl-dev_2.1.4-1+cuda9.0_amd64.deb && \
dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb && \
dpkg -i libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb && \