Skip to content

Instantly share code, notes, and snippets.

View haim0n's full-sized avatar

Haim Daniel haim0n

View GitHub Profile
@haim0n
haim0n / mount_snap_for_edit.sh
Created September 18, 2024 16:43
Mount Ubuntu snap package for editing
#!/bin/bash -x
function mount_snap() {
local snap_name=$1
local snap_version=$(snap list | grep $snap_name | awk '{print $3}')
local snap_name_escaped=$(echo $snap_name | sed 's/-/\\x2d/g')
local snap_dir=/var/lib/snapd/snaps
local tmp_dir=$(mktemp -d)
sudo systemctl stop snap-$snap_name_escaped-$snap_version.mount
@haim0n
haim0n / clip_magic_python3.py
Last active December 1, 2020 09:55 — forked from nova77/clip_magic.py
copy to clipboard ipython magic
"""
Add copy to clipboard from IPython!
To install, just copy it to your profile/startup directory, typically:
~/.ipython/profile_default/startup/
Example usage:
%clip hello world
# will store "hello world"
a = [1, 2, 3]
%clip a
# will store "[1, 2, 3]"