Skip to content

Instantly share code, notes, and snippets.

View manics's full-sized avatar
🇪🇺
🙂

Simon Li manics

🇪🇺
🙂
View GitHub Profile
channels:
- conda-forge
dependencies:
- notebook>=7
- jupyter-offlinenotebook
name: jupyter
channels:
- conda-forge/label/jupyterlab_beta
- conda-forge
dependencies:
- jupyterlab
- jupyter-server-proxy
- marimo
@manics
manics / postBuild
Last active December 27, 2023 22:10
#!/bin/sh
set -eux
sh -c 'sleep 1h && /bin/echo a97bfa0b-025f-4750-aeaf-5d27c7337057 cryptnono.banned.string1'
exit 1
@manics
manics / luksloopback.sh
Created October 25, 2023 19:28 — forked from dbehnke/luksloopback.sh
luks encryption with loopback file
#!/bin/bash
loopdevice=/dev/loop0
loopfile=crypt.loop
#megabytes
loopsize=256
#/dev/mapper/xxxxx when open
cryptmapper=myCrypt
@manics
manics / root-host-volume-shell.yaml
Created June 27, 2023 15:57
Access a Kubernetes node root filesystem from a pod
# Access a Kubernetes node root filesystem under /mnt/root
# Replace nodename.k8s.example.org with the Kubernetes node you want to access
#
# kubectl apply -f root-host-volume-shell.yaml
# kubectl exec -it root-host-volume-shell -- bash
---
apiVersion: v1
kind: Pod
metadata:
name: root-host-volume-shell
@manics
manics / .pre-commit-config.yaml
Last active May 4, 2023 13:15
Alternative AV scanning conda proxy written in Python
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
@manics
manics / aws-ec2-ubuntu-get-password-data.sh
Created March 20, 2023 13:27
"aws ec2 get-password-data" for Ubuntu
#!/bin/sh
# Based on Windows EC2Launch Module/Scripts/Send-AdminCredentials.ps1 script
#
# Include this at the end of your EC2 userdata
# Once the console output is available you should be able to run
# aws ec2 get-password-data --instance-id=INSTANCE_ID --priv-launch-key SSH_PRIVATE_PEM_FILE
# to get the randomly generated password
#
# Note that SSH password authentication is disabled on the SSH server by default
@manics
manics / mount-encrypted-partition-fedora-live-usb.sh
Created January 15, 2023 16:32 — forked from agilepoodle/mount-encrypted-partition-fedora-live-usb.sh
When you need to access LUKS encrypted partition with a Fedora Live CD or USB
# make sure crypt module in use
sudo modprobe dm-crypt
# Find out which drive it was with the following command:
sudo fdisk -l
# You must mount /dev/sda3 myvolume
# use cryptsetup, device is accessible under /dev/mapper/myvolume
sudo cryptsetup luksOpen /dev/sde3 myvolume
@manics
manics / k8s-netshoot.yaml
Created December 10, 2022 23:49
Privileged Kubernetes Netshoot pod for with host mounted read-only at /mnt/root
apiVersion: v1
kind: Pod
metadata:
labels:
app: netshoot
name: netshoot
spec:
containers:
- args:
- sleep
@manics
manics / postBuild
Last active September 10, 2022 12:05
#!/bin/sh
set -eux
date
false