Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View glowinthedark's full-sized avatar

glowinthedark glowinthedark

  • URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
  • HTTPError: HTTP Error 403: Forbidden
View GitHub Profile
@glowinthedark
glowinthedark / immich-orphan-cleaner.py
Created February 6, 2024 20:14 — forked from sircharlo/immich-orphan-cleaner.py
I modified @T-One 's excellent Gist somewhat for my purposes: I had alot of orphaned files in my Immich instance! I was getting impatient and wanted to see progress and ETA. Here it is in case anyone is impatient like me lol; all credit goes to @T-One though. Original Gist: https://gist.github.com/T-One/c857005e58286149914ad38f24a891e1
#!/usr/bin/env python3
# Note: you might need to run "pip install halo tabulate tqdm" if these dependencies are missing on your machine
import argparse
import json
import requests
from datetime import datetime
from halo import Halo

Setup nut and netdata on Ubuntu

In this document, I will explain how to setup nut (Network UPS Tools) on Ubuntu 18.04 and 20.04.

It is basically the next chapter of my previous gist, Upgrade nut on Ubuntu 18.04.

I'll only document USB connected UPS and not the other supported connection modes.

Install required dependencies

@glowinthedark
glowinthedark / telegram_bot_api_curl.cpp
Created January 4, 2024 20:43 — forked from ozlb/telegram_bot_api_curl.cpp
Telegram bot API via curl
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include <ctype.h>
#include <string>
//https://github.com/DaveGamble/cJSON
#include "cJSON.h"
@glowinthedark
glowinthedark / vimeo-download.py
Last active November 26, 2023 21:38 — forked from alexeygrigorev/vimeo-download.py
Downloading segmented video from vimeo
#!/usr/bin/env python3
import subprocess
import sys
from pathlib import Path
import requests
import base64
from tqdm import tqdm
@glowinthedark
glowinthedark / NSAuthorization.h
Created October 8, 2023 12:06 — forked from TomLiu/NSAuthorization.h
Ask for privilege to execute command
//
// NSAuthorization.h
// OSXvnc
//
// Created by Jonathan Gillaspie on Fri Dec 12 2003.
// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
package my.example.compat;
/*
* NOTICE: modified since 2023 and later.
*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@glowinthedark
glowinthedark / build-mpv_silicon.sh
Created February 14, 2023 14:48 — forked from dbrookman/build-mpv_silicon.sh
How to build mpv & mpv.app on an Apple silicon (M1 / M2) Mac
#!/usr/bin/env bash
# builds mpv & mpv.app on Apple silicon (M1 / M2) Macs
# run this script from the root directory of the mpv repo
# if anything fails, gtfo
set -ex
meson setup build
meson compile -C build
from fairseq.models.transformer import TransformerModel
zh2en = TransformerModel.from_pretrained(
'/path/to/checkpoints',
checkpoint_file='checkpoint_best.pt',
data_name_or_path='data-bin/wmt17_zh_en_full',
bpe='subword_nmt',
bpe_codes='data-bin/wmt17_zh_en_full/zh.code'
)
zh2en.translate('你好 世界')
@glowinthedark
glowinthedark / whisper-mock-en.ipynb
Created November 23, 2022 15:55 — forked from Kazuki-tam/whisper-mock-en.ipynb
whisper-mock-en.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@glowinthedark
glowinthedark / how-to-find-forks-of-deleted-repo.md
Created November 14, 2022 21:51 — forked from rjeczalik/how-to-find-forks-of-deleted-repo.md
How to find forks of a deleted repository?