Skip to content

Instantly share code, notes, and snippets.

View x1unix's full-sized avatar
:shipit:
Work in progress

Denys Sedchenko x1unix

:shipit:
Work in progress
View GitHub Profile
@x1unix
x1unix / install.md
Created October 6, 2021 13:50
Hub on Android

Подготовка

  1. Установи termux
  2. Зайди в termux и установи контейнер с убунтой
  • pkg update && pkg install resolv-conf proot proot-distro -y
  • proot-distro install ubuntu
  • proot-distro login ubuntu

Установка

@x1unix
x1unix / start_easy_remap.sh
Created October 1, 2021 02:40
BxActions - EasyRemap
#!/usr/bin/sh
# Source: /data/data/com.jamworks.bxactions/files/start_easy_remap.sh
pm enable com.samsung.android.bixby.agent
pm grant com.jamworks.bxactions android.permission.READ_LOGS
pm grant com.jamworks.bxactions android.permission.WRITE_SECURE_SETTINGS
logcat -c
am force-stop com.jamworks.bxactions
@x1unix
x1unix / interval.go
Last active July 25, 2021 22:39
[Prometheus] Counter with reset interval
package main
import (
"context"
"time"
"github.com/prometheus/client_golang/prometheus"
)
type IntervalFunc = func(now time.Time) time.Duration
@x1unix
x1unix / makefont.ps1
Last active July 24, 2021 04:01
Rockbox font converter
<#
.SYNOPSIS
RockBox font converter.
.DESCRIPTION
Converts a list of TTF or OTF font files to RockBox file format (FNT).
For convertion, script uses 'otf2bdf' and 'convbdf' tools.
Please ensure that mentioned tools present before using the script.
'-ToolsDir' parameter can be used to specify a custom tools directory location.
@x1unix
x1unix / XzFileInfo.cs
Created July 13, 2021 02:50
[C#] SharpCompress - get XZ uncompressed size
namespace MyProgram {
public class XzFileInfo
{
private const int XzHeaderSize = 12;
public static ulong GetUncompressedSize(string filePath)
{
using var file = File.Open(filePath, FileMode.Open);
// Read the footer from the end. Footer size is 12 bytes according to the spec.
file.Seek(-XzHeaderSize, SeekOrigin.End);
@x1unix
x1unix / remove_node.sh
Created June 16, 2021 14:11
Recursive remove node_modules
#!/usr/bin/env bash
set -e
dir_name=$1
node_dir="node_modules"
echo "Removing each node_modules in $dir_name..."
rm_node_modules() {
dir=$1
echo ":: Inspecting '$dir'..."
@x1unix
x1unix / README.md
Last active May 8, 2021 21:42
[PWSH] Find XInput-compatible devices

Get-XInput

Queries all XInput devices using WMI

Based on MSDN article

@x1unix
x1unix / NET-framework-standalone-exe.md
Last active February 18, 2024 17:31
[C#] Embed DLL assemblies onto executable

Summary

This guide tells how to embed CLR assemblies (.dll) onto a single executable. This works for WPF, WinForms and console .NET applications.

Source - original article

Project settings

First, we need to add special section to .csproj file to make MSBuild embed referenced assemblies

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
@x1unix
x1unix / aplay -L
Last active March 3, 2021 02:00
Fiio M3k - Issue debug Info
null
Discard all samples (playback) or generate zero samples (capture)
samplerate
Rate Converter Plugin Using Samplerate Library
speexrate
Rate Converter Plugin Using Speex Resampler
jack
JACK Audio Connection Kit
oss
Open Sound System