Skip to content

Instantly share code, notes, and snippets.

View juandesant's full-sized avatar

Juande Santander-Vela juandesant

View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active April 30, 2024 13:31
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@juandesant
juandesant / Einstein's Riddle.pl
Created December 10, 2022 21:20
Solving Einstein's Riddle with Prolog
right_of(X, Y) :- X =:= Y+1.
left_of(X, Y) :- right_of(Y, X).
next_to(X, Y) :- right_of(X, Y).
next_to(X, Y) :- left_of(X, Y).
solution(Street) :-
/* There are 5 houses in the street, all of different colours;
and their owners all have different nationalities, smoke different brands,
have different pets, and have different drinks */
@jasonsnell
jasonsnell / airquality.scpt
Created August 26, 2020 17:50
Air Quality AppleScript
-- PurpleAir station ID
set theStationID to "6732"
tell application "JSON Helper"
set theWeather to (fetch JSON from ("https://www.purpleair.com/json?show=" & theStationID) with cleaning feed)
set theStatsA to (read JSON from (Stats of item 1 of results of theWeather))
set theStatsB to (read JSON from (Stats of item 2 of results of theWeather))
set theLocation to Label of item 1 of results of theWeather
set theLat to (Lat of item 1 of results of theWeather)
set theLon to (Lon of item 1 of results of theWeather)
@trisberg
trisberg / local-registry.md
Last active January 26, 2024 17:47
Using a Local Registry with Minikube

Using a Local Registry with Minikube

Install a local Registry

These instructions include running a local registry accessible from Kubernetes as well as from the host development machine at registry.dev.svc.cluster.local:5000.

  1. Use the docker CLI to run the registry:2 container from Docker, listening on port 5000, and persisting images in the ~/.registry/storage directory.
@simonbs
simonbs / Slack Status.js
Last active November 23, 2021 02:37
Peforms OAuth flow against Slack and sets a Slack Status. Meant to be used with Shortcuts.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: pink; icon-glyph: user;
// In order to use the script, you must create a Slack app and install it on your workspace. Go here to create your app: api.slack.com/apps
// There's two important configurations you must make to the app:
// 1. Add the users.profile:write scope to the app. This scope is necessary to set a Slack status.
// 2. Add the following redirect URL, so Slack will redirect to Scriptable after authorizing.
// https://open.scriptable.app
// Run the script to grant your newly created app authorization to access your Slack account. After you've done this, you can use the script in Shortcuts.
@juandesant
juandesant / SafariUrls.scpt
Created April 8, 2020 17:02
Get all URLs from all tabs in all Safari windows
tell application "Safari"
set theWindows to the windows
set theURLs to {}
repeat with theWindow in theWindow
set theTabs to the tabs of theWindow
repeat with theTab in theTabs
copy the URL of theTab to the end of theURLs
end repeat
end repeat
end tell
@juandesant
juandesant / atlassian_api_confluence.py
Last active July 28, 2023 14:48
Confluence API examples
from atlassian import Confluence # requires atlassian-python-api
cf_user = os.environ['CONFLUENCE_USER'] # requires environment variable
cf_pwd = os.environ['CONFLUENCE_PWD']
cf_url = os.environ['CONFLUENCE_URL']
cf_space = os.environ['CONFLUENCE_SPACE']
# Content preparation
my_title = "Testing Confluence API"
html_body = """<p>Paragraph 1</p>
<p>Paragraph 2</p>
@StuartLittlefair
StuartLittlefair / astropy_speedups.py
Last active May 18, 2020 17:10
Speedups for astropy coordinate transformations with >1000s of obstimes (works best for roughly regular spaced grid of obstimes)
"""
Contains some faster coordinate transformations than the ones currently used in astropy.
This is based on an idea put forward by @bwinkel in the pull request located at
at https://github.com/astropy/astropy/pull/6068. This may be merged into the astropy
master at some point. If this happens, this module can be removed.
Simply import into code to experience the speedups; the astropy coordinate transforms are
overwritten on modeul import.
"""
@ryerh
ryerh / jekyll-and-liquid.md
Created April 16, 2018 15:35 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes: