Skip to content

Instantly share code, notes, and snippets.

View ookiineko's full-sized avatar
😣
A noob who tries weird things sometimes

小さい猫 ookiineko

😣
A noob who tries weird things sometimes
  • Somewhere
View GitHub Profile
@ookiineko
ookiineko / README.md
Last active May 8, 2024 04:38
msys rust (unofficial) test (hacky)

first get cygwin rust (unofficial) from here (we will reconfigure it for linking against msys DLL instead of cygwin)

make sure you have gcc install for msys environment and run these in the MINGW64 terminal

Hello world:

export PATH=/path/to/cygwin-rust/bin:$PATH

cargo new --bin hellohi && cd hellohi
@ookiineko
ookiineko / msys_mingw_cygexec.c
Last active May 9, 2024 02:12
Invoke Cygwin programs for msys2-cygwin
/* SPDX-License-Identifier: MIT */
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@ookiineko
ookiineko / _vfork_longjmp.S
Last active May 3, 2024 16:58
trying to implement vfork(2) for MinGW
/*
* DISCLAIMER
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
*
* The mingw-w64 runtime package and its code is distributed in the hope that it
* will be useful but WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESSED OR
* IMPLIED ARE HEREBY DISCLAIMED. This includes but is not limited to
* warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
@ookiineko
ookiineko / pycase.py
Last active March 24, 2024 06:58
set directory case sensitive on Windows directly with ctypes
#!/usr/bin/env python3
"""
set directory case sensitive on Windows directly with ctypes
**requires WSL to be enabled**
thus for Windows 10 1903 and up
BASED ON CODE FROM https://github.com/microsoft/WSL/issues/2954 !!!
"""
From 8de93f96c35e34bd773aa1be1fa3742157e31b43 Mon Sep 17 00:00:00 2001
From: Ookiineko <chiisaineko@protonmail.com>
Date: Wed, 6 Mar 2024 22:57:03 +0800
Subject: [PATCH] upstream migrated to pyproject.toml
Signed-off-by: Ookiineko <chiisaineko@protonmail.com>
---
PKGBUILD | 8 +++--
scripts-and-data-files.patch | 55 +++++++++++++++++++++++++++---------
udev.patch | 4 +--
@ookiineko
ookiineko / README.md
Last active October 11, 2023 09:10
images2telegraph - A simple Telegraph gallery uploading tool with CLI

An example usage

images2telegraph.py -c path/to/config.json --author='Me' --homepage='https://example.com' \
                    Sample-Page-Path ThisIsATitle --manifest path/to/files.list.txt

note: -c path/to/config.json can be omitted if it's under the current directory

Using stdin

@ookiineko
ookiineko / mpv4ndm.py
Last active September 24, 2023 15:56
Play with MPV but using Neat Download Manager browser plugin (and load extra subtitle files
#!/usr/bin/env python3
# SPDX-License-Identifier: GLWTPL
import asyncio
import typing
import enum
import dataclasses
import argparse
import os.path
@ookiineko
ookiineko / downscale_all_to_1080p_amd_hw.sh
Created August 16, 2023 08:01
Batch downscale video to 1080p (using AMD hwaccel and hwenc)
#!/bin/sh
set -e
OIFS="$IFS"
IFS=$'\n'
for __vidfile in $(ls -1 *.mp4); do
if echo "$__vidfile" | grep _1080p; then
echo 'skip converted file: ' "$__vidfile"
@ookiineko
ookiineko / mingw-standalone-release.sh
Created August 1, 2023 11:18
Release standalone binary for MinGW in one click LOL
#!/bin/bash
set +e
set +o pipefail
release_files=$(ls -1 ./*.exe)
function add_deps_auto() {
echo "finding dep for '${1}'"
deps_list=$(ldd "${1}" | grep '=>' | grep -vi '/c/WINDOWS' | gawk '{ print $3 }' | sort | uniq)
@ookiineko
ookiineko / asm-no-fpic.patch
Created July 24, 2023 13:11
random cygwin fixes - cmake patch for llvm11+ libunwind build
--- origsrc/cmake-3.25.3/Modules/Platform/CYGWIN-Clang-ASM.cmake 1970-01-01 08:00:00.000000000 +0800
+++ src/cmake-3.25.3/Modules/Platform/CYGWIN-Clang-ASM.cmake 2023-07-24 20:50:00.899033700 +0800
@@ -0,0 +1 @@
+include(Platform/CYGWIN-GNU-ASM)
--- origsrc/cmake-3.25.3/Modules/Platform/CYGWIN-GNU-ASM.cmake 1970-01-01 08:00:00.000000000 +0800
+++ src/cmake-3.25.3/Modules/Platform/CYGWIN-GNU-ASM.cmake 2023-07-24 20:49:12.859578000 +0800
@@ -0,0 +1,2 @@
+include(Platform/CYGWIN-GNU)
+__cygwin_compiler_gnu(ASM)