For jupyter notebooks
to identify your virtual env kernels:
- Activate your env and install
ipykernel
:
pip install --user ipykernel
- Add your virtual environment to Jupyter:
python -m ipykernel install --user --name=myenv
projects=$(atlas projects list | jq -cr '.results[] | {id, name} | select(.name!="test-gpu-261023")') | |
for row in $projects; do | |
projectId=$(echo $row | jq -r '.id') | |
projectName=$(echo $row | jq -r '.name') | |
echo "Deleting serverless instance: $projectName (ID: $projectId)" | |
atlas serverless delete $projectName --projectId $projectId | |
done | |
for row in $projects; do |
import click | |
import json | |
import requests | |
import sys | |
import time | |
import pandas as pd | |
from tqdm.auto import tqdm | |
from rich.progress import track | |
from rich.console import Console |
# Encode audo to acc - keep video stream as it is | |
ffmpeg -i <inut-video>.mp4 -c:v copy -codec:a aac <output-video>.mp4 |
#!/usr/bin/env bash | |
say() { | |
echo "$@" | sed \ | |
-e "s/\(\(@\(red\|green\|yellow\|blue\|magenta\|cyan\|white\|reset\|b\|u\)\)\+\)[[]\{2\}\(.*\)[]]\{2\}/\1\4@reset/g" \ | |
-e "s/@red/$(tput setaf 1)/g" \ | |
-e "s/@green/$(tput setaf 2)/g" \ | |
-e "s/@yellow/$(tput setaf 3)/g" \ | |
-e "s/@blue/$(tput setaf 4)/g" \ | |
-e "s/@magenta/$(tput setaf 5)/g" \ |
#!/bin/bash | |
# Cron doesn't have access to env.vars as your user has, | |
# so we need to export these: | |
export TERM=xterm-256color | |
# Check current value with: 'echo $DBUS_SESSION_BUS_ADDRESS' and paste here | |
# see: https://stackoverflow.com/questions/53628122/git-libsecret-throws-cannot-autolaunch-d-bus-without-x11-display | |
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus | |
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection | |
# requires pycrypto lib (pip install pycrypto) | |
import sys | |
import base64 | |
import os | |
import json | |
from Crypto.Cipher import AES |
# increase history limit to 90K lines | |
set-option -g history-limit 90000 | |
# Enable mouse mode | |
set -g mouse on | |
# remap keys for copy-mode | |
# bind -t vi-copy y copy-pipe "xclip -sel clip -i" | |
setw -g mode-keys vi |
For jupyter notebooks
to identify your virtual env kernels:
ipykernel
:pip install --user ipykernel
python -m ipykernel install --user --name=myenv
# Download postman (instead of the snap from the Ubuntu Software Store) | |
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz | |
sudo tar -xzf postman.tar.gz -C /opt | |
rm postman.tar.gz | |
sudo ln -s /opt/Postman/Postman /usr/bin/postman | |
# Create a desktop entry | |
cat > ~/.local/share/applications/postman.desktop <<EOL | |
[Desktop Entry] | |
Encoding=UTF-8 |
pydeps: Python module dependency visualization
# Draw a graph for <package> with max depth of 3 and cluster expernal deps. Produces an .svg file
pydeps <my-package>
--noshow \
--max-bacon 3 \
--cluster \