Skip to content

Instantly share code, notes, and snippets.

@entropiae
entropiae / Install pyenv on Ubuntu 18.04 + fish shell
Last active March 15, 2025 06:14
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 April 2, 2025 03:08
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
@rszeto
rszeto / *pycharm-setup-2020.3.2.md
Last active December 17, 2024 07:32
Setting up PyCharm project with remote interpreter

Setting up PyCharm project with remote interpreter

Setting up a remote interpreter on PyCharm is awfully unintuitive. I've pared it down to what I think is the minimal number of steps, and leaves the fewest number of deployment configurations and Python interpreters lying around. This is designed for my specific configuration (specifically PyTorch); adapt as needed.

Configuring default project (only do after installing PyCharm for the first time):

  1. (Optional) Add virtual environment path to excluded files
    1. From Welcome Page, go to Configure > Settings > Build, Execution, Deployment > Deployment > Options
    2. Add virtualenv path. For example, if you always have the project's virtualenv in .env, add ";.env" to the "Exclude items by name" field
@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 [email protected]
# @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 September 10, 2024 19:46
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 10, 2025 15:31
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