Skip to content

Instantly share code, notes, and snippets.

View BanHammerYKT's full-sized avatar
🏠
Working from home

Fedot Borisov BanHammerYKT

🏠
Working from home
  • JSB "Almazergienbank"
View GitHub Profile

This gist provides a more flexible version of adb that exposes the functionality to select a device and then use that device's serial number in one or more adb commands. It expands on the initial implementation of the deeplinks.sh gist.

Companion blog post for usage is 🔗 here.

Companion posts for earlier versions of the script: Extending an Interactive ADB

@alaershov
alaershov / SharedEventFlow.kt
Created September 15, 2023 09:11
SharedEventFlow
/**
* Позволет эммитить сразу нескольким подписчикам все отправленные события.
* Ждёт, когда появится хотябы один подписчик, а затем отправляем ему все ивенты.
* credit: @aasitnikov
*/
class SharedEventFlow<T> : FlowCollector<T>, Flow<T> {
private val sharedFlow = MutableSharedFlow<T>()
override suspend fun emit(value: T) {
@theapache64
theapache64 / adb.sh
Last active July 4, 2023 10:30
adb with device selection
function adb() {
# Execute the actual command
local totalLines=$(command adb devices | wc -l | xargs)
local totalDeviceConnected=$(expr $totalLines - 2)
if [[ "$@" != *"-s "* && $totalDeviceConnected -gt 1 ]]; then
# Get the list of connected devices
devices=(`command adb devices | awk '$2 == "device" {print $1}'`)
devicesText=""
@mjtiempo
mjtiempo / x0vncserver.service
Created November 24, 2022 02:42
TigerVNC systemd service using sddm on kde plasma
[Unit]
Description=Remote desktop service (VNC) for :0 display
Requires=display-manager.service
After=network-online.target
After=display-manager.service
[Service]
Type=simple
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment XAUTHORITY=$(find /var/run/sddm/ -type f)"
Environment=HOME=/root

Здравствуйте!

Для эмиграции в наше нелегкое время вам потребуются все документы, в том числе:

  • Загранпаспорт
  • Внутренний паспорт
  • ИНН (ХЗ зачем, "ну надо"©)
  • СНИЛС, Полис и прочие документы
  • Запасной работающий телефон (рекомендуется)

🇷🇺 Перед вылетом местным вылетом в другой город РФ:

@PlugFox
PlugFox / dart.code-snippets
Last active February 5, 2024 17:24
@dart-lang & @flutter Visual Studio Code snippets by @PlugFox
{
"Changelog unreleased": {
"scope": "md, markdown",
"prefix": "changelog_unreleased",
"description": "Changelog unreleased",
"body": [
"# Unreleased",
"+ added: ${0}",
"+ changed: ",
"+ deprecated: ",
@idleberg
idleberg / vscode-macos-context-menu.md
Last active May 18, 2024 11:18
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@FreddieOliveira
FreddieOliveira / docker.md
Last active May 19, 2024 07:24
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@Th3Whit3Wolf
Th3Whit3Wolf / arch_sec_install.sh
Last active April 26, 2024 22:49
Install arch on btrfs(w/ swapfile) on luks with rEFInd bootloader
#!/bin/bash
# 0 - SSH
# This isn't necessary but if you ssh into the computer all the other steps are copy and paste
# Set a password for root
passwd
# Get network access
iwctl
"""