Skip to content

Instantly share code, notes, and snippets.

View dsavchenko's full-sized avatar

Denys Savchenko dsavchenko

  • Astroparticule et Cosmologie, CNRS & UPCité
  • Paris
View GitHub Profile
@dsavchenko
dsavchenko / ghcr.sh
Created March 4, 2024 15:55 — forked from eggplants/ghcr.sh
How to get information from ghcr Docker Registry HTTP API V2 with curl
#!/usr/bin/env bash
# ref: https://github.community/t/how-to-check-if-a-container-image-exists-on-ghcr/154836/3
# public image's {USER}/{IMAGE}
USER_IMAGE=eggplants/asciiquarium-docker
# get token ('{"token":"***"}' -> '***')
TOKEN="$(
curl "https://ghcr.io/token?scope=repository:${USER_IMAGE}:pull" |
awk -F'"' '$0=$4'
@dsavchenko
dsavchenko / Python-CDATA.py
Last active February 16, 2024 17:18 — forked from zlalanne/Python-CDATA.py
Adds CDATA support to Python ElementTree
import xml.etree.ElementTree as ET
def CDATA(text=None):
element = ET.Element('![CDATA[')
element.text = text
return element
ET._original_serialize_xml = ET._serialize_xml
@dsavchenko
dsavchenko / shortcuts.md
Created February 9, 2024 14:35 — forked from memphys/shortcuts.md
Bash Shortcuts For Maximum Productivity

source: http://www.skorks.com/2009/09/bash-shortcuts-for-maximum-productivity/

Command Editing Shortcuts

  • Ctrl + a – go to the start of the command line
  • Ctrl + e – go to the end of the command line
  • Ctrl + k – delete from cursor to the end of the command line
  • Ctrl + u – delete from cursor to the start of the command line
  • Ctrl + w – delete from cursor to start of word (i.e. delete backwards one word)
  • Ctrl + y – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor