Skip to content

Instantly share code, notes, and snippets.

@AlexanderWillner
AlexanderWillner / icloud-album-download.sh
Created June 18, 2019 17:12 — forked from fay59/icloud-album-download.sh
Download entire iCloud shared albums
#!/bin/bash
# Description: Downloads Web Albums shared by Apple Photos
# Requirements: jq
# Usage: ./icloud-album-download.sh <URL> [<target folder>]
# Source: https://gist.github.com/AlexanderWillner/b8124af1979e88d4046987c953b8260f
# Author: @zneak, @WildDIC, @AlexanderWillner
if [[ -z "$1" ]]; then
echo "Syntax: $0 <URL> [<target folder>]" >&2
@sarthology
sarthology / regexCheatsheet.js
Created January 10, 2019 07:54
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@rolfn
rolfn / restic.md
Last active May 1, 2024 13:49
Backup auf Cloud-Speicher mit »restic«

Automatische Backups auf Online-Speicher mit »Restic«

Das Programm »Restic« ist ein modernes Backup-Programm, welches als Speicherort sowohl lokale Verzeichnisse als auch per Netzwerk erreichbare Speicher (Online-Speicher) nutzen kann. Der Autor von »Restic« zeigt in anschaulicher Weise in zwei Videos viele Details zur Arbeitsweise seines Programms: »FOSDEM 2015« (2015-01-28) und »CCCCologne« (2016-01-29).

Im Folgenden soll gezeigt werden, wie man unter Linux automatische Backups mit »Restic« einrichten kann. Als Speicherort wird per WebDAV-Protokoll erreichbarer Online-Speicher genutzt. Sinngemäß können die Hinweise aber auch auf andere Netzwerkprotokolle übertragen werden. Getestet wurde unter »openSUSE« und »Linux Mint« (»Ubuntu«), wobei aber auch alle anderen systemd-basierten Linux-Distributionen in derselben Art oder mit geringfügigen Änderungen geeignet sind.

Install

@wassname
wassname / jupyter_logging.py
Last active November 11, 2022 10:11
simple logging for jupyter or python which outputs to stdout (or a console or terminal) and a log file
"""
In jupyter notebook simple logging to console
"""
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
# Test
logger = logging.getLogger('LOGGER_NAME')
@rstanleyhum
rstanleyhum / restic-windows-vss.ps1
Last active January 13, 2023 21:55
Restic Backup Windows Volume Shadow Copy Service script taken from https://github.com/restic/restic/issues/340
# Windows PowerShell Script to use restic to backup files using the Volume Shadow Copy Service, allowing
# that are in use to be backed up. The script must be run with elevated privileges.
# The Volume Shadow Copy Service must be enabled for the disk volume that contains the files to be backed up.
#
# Parameters
$resticExe = 'C:\Users\Username\go\bin\restic.exe'
$resticRepository = '\\SYNOLOGY212J\backups\restic-workstation'
$rootVolume = "C:\"
# List of folders to backup, separated by commas
$foldersToBackup = @(
@fbecart
fbecart / Leo-Anki.js
Last active May 1, 2024 19:57
Bookmarklet to export Leo Trainer words to an Anki deck.
/**
* This bookmarklet makes it possible to transfer words from Leo Trainer to Anki.
* It is configured for fr-de (French to German) translations, but can easily be
* adapted to other languages.
*
* Prerequisites:
* - a Leo account (http://www.leo.org/) with a few words saved in the trainer
* - an Anki account (https://ankiweb.net/account/register)
*
* 1. Crunch the following code and add it to your bookmarks
@n8henrie
n8henrie / html_to_csv.py
Created January 22, 2015 00:37
Prompts for a URL, displays HTML tables from that page, then converts the selected table to a csv file.
#! /usr/bin/env python3
"""html_to_csv.py
Prompts for a URL, displays HTML tables from that page, then converts
the selected table to a csv file.
"""
import sys
import pandas
url = input("Enter the URL: ")
@thomaswitt
thomaswitt / VPN_FritzBox_OnDemand.mobileconfig
Last active March 17, 2022 12:23
iOS VPN configuration file: Connect to FritzBox VPN if connected to the internet through any insecure WiFi Network (all except than trusted) … customize all strings starting with REPLACE_
Check out the newer version of this gist at:
https://gist.github.com/thomaswitt/2f847199863a103dfcf004fec3c538d0
and the corresponding blog post:
https://thomas-witt.com/auto-connect-your-ios-device-to-a-vpn-when-joining-an-unknown-wifi-d1df8100c4ba
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@L3viathan
L3viathan / kinox
Last active August 27, 2018 01:38
Using the undocumented kinox.to API, extract stream URLs from a query.
#!/bin/sh
# Get stream URLs for the second episode of the seventh season of futurama:
# kinox.sh futurama 7 2
# for shows with spaces, insert a plus sign instead:
# kinox.sh it+crowd 3 1
# grab the stream by searching for the show on kinox.to, filtering to only show english versions, and extracting the internal show name
export stream_page=$(curl -sL "http://kinox.to/Search.html?q=$1" | pcregrep -M 'lng\/2\.png(\n|.)+?class="Title"' | pcregrep -o1 'Stream\/(.+?)\.html' | head -n 1)
# get the show's page, with the undocumented additional parameters for season and episode, and grab the "rel" attribute of the hoster list