Skip to content

Instantly share code, notes, and snippets.

@rolandjitsu
rolandjitsu / spark.md
Last active February 25, 2021 08:51 — forked from ololobus/Spark+ipython_on_MacOS.md
Apache Spark installation for Mac OS X

Apache Spark

Install steps for Apache Spark on Mac OS X using Homebrew.

Install Java Development Kit


Download and install it from oracle.com, then add following code to your .bash_profile, .zshrc, etc.:

# Apache Spark
if which java > /dev/null; then export JAVA_HOME=$(/usr/libexec/java_home); fi
@ArseniyShestakov
ArseniyShestakov / add.sh
Last active August 25, 2023 14:14
My compiler alternatives
# Cleanup old alternatives
update-alternatives --remove-all cc
update-alternatives --remove-all c++
update-alternatives --remove-all gcc
update-alternatives --remove-all g++
update-alternatives --remove-all clang
update-alternatives --remove-all clang++
update-alternatives --remove-all icc
update-alternatives --remove-all icc++
@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active June 23, 2025 01:06
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@timss
timss / log.py
Created April 11, 2017 07:56
Python logging across multiple modules with custom handler/filter and splitting loglevels between stdout/stderr
#!/usr/bin/env python3
import logging
import sys
import sublog
logger = logging.getLogger()
# http://stackoverflow.com/a/24956305/1076493
#count=0
for idx, item in enumerate(list):
print item
#count +=1
#if count % 10 == 0:
if idx % 10 == 0:
print 'did ten'
## get sqs messages
for idx, item in enumerate(response['Messages']):
# create list of dictionaries to process
self.logger.debug('idx %d', idx)
messages.append(json.loads(item['Body']))
tmp_dict = {'Id': item['MessageId'], 'ReceiptHandle': item['ReceiptHandle']}
self.logger.debug('id: %s', item['MessageId'])
delete_list.insert(idx,tmp_dict)
try:
@doppiomacchiatto
doppiomacchiatto / gist:bcf879b09761fc4871bd623839b4cd52
Created August 27, 2017 18:29 — forked from dpapathanasiou/gist:2790864
Using lxml to parse the Microsoft API translation result from the xml
#!/usr/bin/python
from lxml import etree
def get_text_from_msmt_xml (xml):
"""Parse the xml string returned by the MS machine translation API, and return just the text"""
text = []
doc = etree.fromstring(xml)
for elem in doc.xpath('/foo:string', namespaces={'foo': 'http://schemas.microsoft.com/2003/10/Serialization/'}):
@simonw
simonw / redis-docker-for-mac.md
Last active August 26, 2024 17:27
How to run a redis server using Docker-for-Mac

How to run a redis server using Docker-for-Mac

This will work with other flavours of Docker as well.

Run the following command:

docker run --name my-redis -p 6379:6379 --restart always --detach redis

This will download and run redis, set to auto-restart when your machine starts and bound to port 6379 on your machine.

@doppiomacchiatto
doppiomacchiatto / docker-destroy-all.sh
Last active May 24, 2018 20:04 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi -f $(docker images -q)

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes