Skip to content

Instantly share code, notes, and snippets.

alias ..='cd ..'
alias ...='cd ../../../'
################################################
# [bash - aliasing cd to pushd - is it a good idea? - Unix & Linux Stack Exchange](https://unix.stackexchange.com/a/4291/187865)
# You can then navigate around on the command-line a bit like a browser.
# - cd changes the directory.
# - back goes to the previous directory that you cded from.
# - flip will move between the current and previous directories without popping them from the directory stack.
# weresync backup
#
# autobackup on disk connect via udev rules :
# - [How to Auto Backup Files to USB Media When Connected](https://www.tecmint.com/auto-backup-files-to-usb-media-in-linux/)
# - [udev - ArchWiki](https://wiki.archlinux.org/index.php/udev)
# - [[SOLVED] automatic usb-backup with udev-rules + script / Newbie Corner / Arch Linux Forums](https://bbs.archlinux.org/viewtopic.php?id=32639)
# udevadm info -a -n sda > disk info
stop_weresync(){
WSPID=$(sudo pgrep weresync-daemon)
# this code rearrange numeric labels based on an input array.
# I normally use some feature of the input data.
# X is the data matrix as pandas.Dataframe
# X.shape : [ROWS, COLUMNS]
# get the k labels
n_clusters=k
k_means = cluster.KMeans(n_clusters=n_clusters, random_state=0).fit(scaler.transform(X))
labels = k_means.labels_
bind t set-window-option synchronize-panes # synchronize all panes in a window
# synchronize all panes in a window ; send : clear, ls , pwd , un-synchronize.
bind y set-window-option synchronize-panes \; \
send-keys clear Enter ls Enter pwd Enter \; \
set-window-option synchronize-panes
filter_not_zero = lambda x : list(filter(None,x))
def extract_history(opusdata, histkey=None):
if histkey is None:
histkey='History'
history = filter_not_zero([s for s in opusdata['History'].split('COMMAND_LINE')])
return [extract_single_history(h) for h in history]
version: "2"
services:
mariadb:
image: mariadb
ports:
- "8081:3306"
restart: on-failure:5
# questo monta la cartella locale mariadb-data in /var/lib/mysql nel container
# quando lui scrive nel db ti trovi la roba in locale.
volumes:
.ipynb_checkpoints
#!python
#cython: language_level=3, boundscheck=False
# distutils: language = c++
from setuptools import setup
from setuptools.extension import Extension
from Cython.Distutils import build_ext
import os
import numpy
from Cython.Build import cythonize
KPL/MK
Meta-kernel for BepiColombo Dataset v210 -- Operational 20191025_001
==========================================================================
This meta-kernel lists the BepiColombo Operational SPICE kernels
that provide information for the Operational scenario.
The kernels listed in this meta-kernel and the order in which
they are listed are picked to provide the best data available and
def find_nearest(value,
array,
return_value=False):
"""Find nearest value in a numpy array
Parameters
----------
value : value to search for
array : array to search in, should be sorted.