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 / svg2icns.sh
Created November 16, 2024 09:59 — forked from adriansr/svg2icns.sh
Convert SVG file to macOS icon (icns) format
#!/bin/sh -x
set -e
SIZES="
16,16x16
32,16x16@2x
32,32x32
64,32x32@2x
128,128x128
@glowinthedark
glowinthedark / countryFlagsNamesAndDialCodes.json
Created November 5, 2024 18:33 — forked from angusjf/countryFlagsNamesAndDialCodes.json
Country Emoji Flags, Names and Dial Codes JSON Mapping
{
"ad": {
"flag": "🇦🇩",
"name": "Andorra",
"dialCode": "+376"
},
"ae": {
"flag": "🇦🇪",
"name": "United Arab Emirates",
"dialCode": "+971"
@glowinthedark
glowinthedark / multiple_ssh_setting.md
Created November 1, 2024 17:34 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@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