Skip to content

Instantly share code, notes, and snippets.

@entropiae
entropiae / Install pyenv on Ubuntu 18.04 + fish shell
Last active February 5, 2024 22:24
Install pyenv on Ubuntu 18.04 + Fish shell
Install pyenv on Ubuntu 18.04 + fish shell
- Install the packages required to compile Python
$ sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
- Download pyenv code from github
$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
- Define environment variable PYENV_ROOT to point to the path where pyenv repo is cloned
$ echo "set --export PYENV_ROOT $HOME/.pyenv" > ~/.config/fish/conf.d/pyenv.fish
@anderl80
anderl80 / Bokeh_server_on_CloudFoundry.md
Last active September 16, 2020 06:31
How to setup a Bokeh server in a Cloud Foundry environment
  • Execute cf push in directory where manifest.yml is
  • Of course you can use pip install with the buildpack, then you need a requiremens.txt instead of environment.yml see cf python buildpack docs
@matthewwardrop
matthewwardrop / notebook_runner.py
Last active April 3, 2024 21:55
In-Process Jupyter Notebook Runner
# (c) Matthew Wardrop 2019; Licensed under the MIT license
#
# This script provides the ability to run a notebook in the same Python
# process as this script, allowing it to access to variables created
# by the notebook for other purposes. In most cases, this is of limited
# utility and not a best-practice, but there are some limited cases in
# which this capability is valuable, and this script was created for
# such cases. For all other cases, you are better off using the
# `nbconvert` execution API found @:
# https://nbconvert.readthedocs.io/en/latest/execute_api.html
@arno01
arno01 / docker-on-android.md
Last active October 19, 2023 07:48
Docker on Android

WORK IN PROGRESS

Docker on Android

Setup:

Samsung Galaxy Tab S5e SM-T720
Android Pie on Linux 4.9.112 (not rooted)
Termux
@aaronjensen
aaronjensen / init.el
Last active May 7, 2019 21:54
doom modeline for spacemacs
# Add to spacemacs-configuration-layers:
# theming
# doom-modeline
# Add to dotspacemacs-excluded-packages
# spaceline
# Set:
# dotspacemacs-mode-line-theme 'vanilla
@twlz0ne
twlz0ne / here-emacs
Last active December 15, 2022 08:25
Launch emacs from emacs.d folder you placed anywhere.
#!/usr/bin/env bash
#
# Launch emacs from emacs.d folder you placed anywhere.
#
# @author gongqijian@gmail.com
# @created 2016-07-21
# @version 0.6
# @last-updated 2022-12-15 15:51:23 +0800
#
@linar-jether
linar-jether / simple_python_datasource.py
Last active May 24, 2023 01:22
Grafana python datasource - using pandas for timeseries and table data. inspired by and compatible with the simple json datasource ---- Up-to-date version maintained @ https://github.com/panodata/grafana-pandas-datasource
from flask import Flask, request, jsonify, json, abort
from flask_cors import CORS, cross_origin
import pandas as pd
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
@alexlee-gk
alexlee-gk / configure_cuda_p70.md
Last active March 19, 2024 17:47
Use integrated graphics for display and NVIDIA GPU for CUDA on Ubuntu 14.04

This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)

A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly. In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers. This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa in the command-line.

@joedf
joedf / libdb[Tuncay2015-02-03].ini
Created June 23, 2016 15:56
Tuncay's AHK Library database (2015-02-03)
[HEADER]
Title=Ahk Standard Library Collection
Home=http://www.autohotkey.com/board/topic/50834-ahk-standard-library-collection-2010-sep-gui-libs-100/
Location=http://autohotkey.net/~Tuncay/ahkstdlib/ahkstdlib.zip
Creator=Tuncay
Timestamp=20150203
AhkTypeCompatible=Basic
AhkTypeCompatibleLocation=http://www.autohotkey.com/
CheckForUpdate=-1
@henriquemenezes
henriquemenezes / android-generate-keystores.md
Last active May 2, 2024 21:33
Android: Generate Release/Debug Keystores

Android: Generate Release/Debug Keystores

Generate Keystores

Debug Keystore

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"