Skip to content

Instantly share code, notes, and snippets.

@kidpixo
kidpixo / update_metakernel.py
Last active Jul 5, 2022
Write metakernel to custom location and update KERNELS. Optionally, create symlink to Kernels location.
View update_metakernel.py
# -*- coding: utf-8 -*-
"""This module contains code related to NAIF/SPICE.
"""
import pathlib
def update_metakernel(metakernel_path=pathlib.Path,
metakernel_version=None,
KPATH=None,
outdir=None,
symlink=None,
@kidpixo
kidpixo / link_to_tmp.sh
Last active Jun 28, 2022
quickly symlink current directory to /tmp/
View link_to_tmp.sh
@kidpixo
kidpixo / overload_division_dict.ipynb
Created Jun 16, 2022
extend python dict class to use overload division operator à la pathlib
View overload_division_dict.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kidpixo
kidpixo / extract_rpm.sh
Created May 6, 2022
rpm - yum install in user home for non-admins : unpack rpm and move executable, manpages etc to $USER home.
View extract_rpm.sh
#!/bin/bash
# see : rpm - yum install in user home for non-admins
# http://unix.stackexchange.com/questions/61283/yum-install-in-user-home-for-non-admins
# Usage:
# 0. check your architecture
# uname -a
# Linux laser.pe.ba.dlr.de 3.10.0-514.21.1.el7.x86_64 #1 SMP Sat Apr 22 02:41:35 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux
#
# 1. search a packet for your architecture.
# Example: gnu parallel for x86_64 architecture.
@kidpixo
kidpixo / .gitignore
Last active May 5, 2022
Interactively search command options from man with fzf
@kidpixo
kidpixo / lpsc2022_fees.ipynb
Last active Feb 18, 2022
lpsc2022 fees analysis
View lpsc2022_fees.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kidpixo
kidpixo / mark_fzf.sh
Last active Apr 6, 2022
create a soft symlink directory in ~/.marks with directories and cdmark jump with fzf preview
View mark_fzf.sh
#------------------------------------------------
# Name : mark
# Input : path
# Purpose : soft symlink passed path to ~/.marks
# empty input raises error cose 1
#------------------------------------------------
mark() {
# # add help option == print and exit
# if [ "$1" == "-h" ]; then
# echo "Usage:"
@kidpixo
kidpixo / archiwiki_2021_dark.css
Created Dec 26, 2021
My mod to adapt to latest Archwiki version end 2021, based on "ArchLinux Wiki Dark" https://userstyles.org/styles/154653/archlinux-wiki-dark
View archiwiki_2021_dark.css
/* My mod to adapt to latest Archwiki version end 2021 */
/* based on [ArchLinux Wiki Dark | Userstyles.org](https://userstyles.org/styles/154653/archlinux-wiki-dark)*/
div.mw-page-container,#mw-content-container,
#mw-page-container,
#vector-menu-content-list,
#mw-panel,
div.wvui-typeahead-search
{
background-color: #0B0B0B !important;
@kidpixo
kidpixo / python_version_checker.py
Last active Jun 27, 2022
Pyhton function to check installed packages version from shell. Pure python, no requirements. Now with CLI colors!
View python_version_checker.py
#!/usr/bin/env python
"""Pyhton function to check installed packages version from shell. Pure python, no requirements.
"""
# define CLI colors
RED = '\033[31m' # mode 31 = red forground
GREEN = '\033[1;32m' # mode 32 = green forground
CYAN = '\033[34m' # mode 32 = green forground
RESET = '\033[0m' # mode 0 = reset
@kidpixo
kidpixo / .gitignore
Last active Nov 24, 2021
Read binary data from Lunar Prospector Reduced Spectrometer Data Special Products (how to read binary data from [PDS Geosciences Node Data and Services)
View .gitignore
data/
# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class