Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Work in progress

Denis Sedchenko x1unix

:shipit:
Work in progress
View GitHub Profile
@x1unix
x1unix / gfcommit.py
Created Jun 21, 2022
Git flow commit message generator
View gfcommit.py
#!/usr/bin/env python3
# brew install pygit2
# pip3 install pygit2
from pygit2 import Repository
import sys
import re
regex = r"^([a-z]{1,5})/([A-Z]{1,5}-[0-9]{1,4})"
@x1unix
x1unix / aptx.md
Created Apr 6, 2022
macOS | Enable AptX
View aptx.md
  1. Launch Terminal on Mac.

  2. To enable aptX, type in the following command:

sudo defaults write bluetoothaudiod "Enable AptX codec" -bool true
  1. To enable AAC, type the following:
@x1unix
x1unix / ip.sh
Created Apr 3, 2022
Get public IP from terminal
View ip.sh
curl -i https://cloudflare.com/cdn-cgi/trace | grep ip | awk -F'=' '{print $2}'
@x1unix
x1unix / state.ts
Created Dec 25, 2021
React - Partial state update
View state.ts
import React from "react";
/**
* Performs partial object update
* @param obj
* @param value
* @param path
*/
export function partialUpdateObject<T=any>(obj: T, value: any, path: string[]): T {
const key = path.pop();
@x1unix
x1unix / nvidia-remove.sh
Last active Dec 15, 2021
Linux - disable NVIDIA GPU
View nvidia-remove.sh
#!/bin/env bash
# nvidia-remove - Disables NVIDIA GPU
#
# See: http://us.download.nvidia.com/XFree86/Linux-x86_64/455.45.01/README/dynamicpowermanagement.html
# Root user ID
ROOT_UID=0
# NVIDIA PCI Vendor ID
NV_PCI_VENDOR_ID='0x10de'
@x1unix
x1unix / README.md
Last active Dec 2, 2021
Better console log formatter for Winston
View README.md

About

This is a logrus-like improved CLI formatter for Winston.

Formatter supports labels and errors prerry print (from error field).

Output example

image

@x1unix
x1unix / install.md
Created Oct 6, 2021
Hub on Android
View install.md

Подготовка

  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 Oct 1, 2021
BxActions - EasyRemap
View start_easy_remap.sh
#!/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 Jul 25, 2021
[Prometheus] Counter with reset interval
View interval.go
package main
import (
"context"
"time"
"github.com/prometheus/client_golang/prometheus"
)
type IntervalFunc = func(now time.Time) time.Duration