Skip to content

Instantly share code, notes, and snippets.

View matrixik's full-sized avatar

Dobrosław Żybort matrixik

View GitHub Profile

Instructions for a mac on how to play with pyenv and poetry

Why both? Pyenv to manage multiple python versions. You can make virtualenvs with pyenv of course, but using poetry will simplify that process

# Install pyenv.
brew install pyenv

# Add pyenv initializer to shell startup script.
echo -e '\nif command -v pyenv 1>/dev/null 2>&1; then
@matrixik
matrixik / README.md
Last active August 29, 2023 18:18
[userscript] ISO Time on focus on github.com

ISO Time on focus on github.com

A userscript that allow you to see ISO date when you focus on dates on github.com

Install from gist.

@matrixik
matrixik / README.md
Last active August 9, 2023 13:59
Add specific folders and subfolders to Windows local profile `PATH` environment variable

Add specific folders and subfolders to Windows local profile PATH environment variable with exclusions.

  1. Save add-paths-to-env.ps1 to folder of with subfolders you want add to PATH.
  2. Edit lines 6, 7 and 12.
  3. Run: .\add-paths-to-env.ps1
  4. Restart.
@matrixik
matrixik / start_bash.sh
Last active August 9, 2023 14:03
Short starter for bash scripts
#!/usr/bin/env bash
# Uncomment for debugging
# set -o xtrace
set -eo pipefail # Exit the script if any statement returns error.
log() { echo -e "$(date --iso-8601=seconds)" "$1"; }
error() { log "ERROR: $1"; }
warn() { log "WARNING: $1"; }
@matrixik
matrixik / copy_to_pictures.desktop
Last active March 4, 2020 23:31
Geeqie copy file to ~/Pictures with changing name when clicking F12
[Desktop Entry]
Version=1.0
Type=Application
# The name which appears in the menu:
Name=Copy to Pictures
# Replace "command" with the actual command or script:
#Exec=yes | cp -rf %F ~/Pictures
Exec=geeqie_copy.sh %F &
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@matrixik
matrixik / monasca-in-docker.md
Last active September 12, 2018 09:55
Monasca in Docker

What went good

  • Ability to build from master and Gerrit (also common).
  • Finding more problems with Python 3 compatibility.
  • Every container provide information from what versions it was built.
  • Monasca-common Zuul jobs push base image to Docker Hub (as monasca/base). https://hub.docker.com/r/monasca/base/tags/
  • Standardized wait scripts.

What went bad (or mistakes)

  • Always requesting git repository.
@matrixik
matrixik / chef-stacktrace.out
Last active May 16, 2017 05:37
Suse Cloud 7 log
Generated at 2017-05-15 09:42:51 +0000
Mixlib::ShellOut::ShellCommandFailed: service[horizon] (horizon::server line 35) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of sleep 1 && pkill --signal SIGUSR1 -f "^\(wsgi:horizon\)" && sleep 1 ----
STDOUT:
STDERR:
---- End output of sleep 1 && pkill --signal SIGUSR1 -f "^\(wsgi:horizon\)" && sleep 1 ----
Ran sleep 1 && pkill --signal SIGUSR1 -f "^\(wsgi:horizon\)" && sleep 1 returned 1
/usr/lib64/ruby/gems/2.1.0/gems/mixlib-shellout-1.3.0/lib/mixlib/shellout.rb:253:in `invalid!'
/usr/lib64/ruby/gems/2.1.0/gems/mixlib-shellout-1.3.0/lib/mixlib/shellout.rb:239:in `error!'
/usr/lib64/ruby/gems/2.1.0/gems/chef-10.32.2/lib/chef/mixin/shell_out.rb:36:in `shell_out!'
@matrixik
matrixik / README.md
Last active March 14, 2017 09:05
Simple tornado test server

Start with:

python app.py some_info
curl 127.0.0.1:8888
curl 127.0.0.1:8888/get
curl --data 'supa=extra' 127.0.0.1:8888/post
@matrixik
matrixik / REDME.md
Last active February 5, 2017 15:48
Soup zsh theme

Add to ~/.zshrc

zplug "matrixik/d28c717108b0c1bfad233588da5cac31", \
  from:gist, \
  as:theme

Fix for prezto

# Fix for Soup theme