Skip to content

Instantly share code, notes, and snippets.

View unique-EJ's full-sized avatar
😕
Status: I'm living, with psychological problems.

Edward Jho-nse unique-EJ

😕
Status: I'm living, with psychological problems.
View GitHub Profile
@unique-EJ
unique-EJ / bash-shell-init-snippets.sh
Last active March 10, 2025 17:44
Bash edit file, local file server commands (command interpreter shell initialization snippets).
#!/usr/bin/env bash
# Download: raw file is in https://gist.github.com/unique-EJ/64b2f43dfb5489a52a020114b374ffdc
# curl can download the URL.
# Usage: no options, puts command snippets into the Bash initialization file.
declare edit_file="$(cat <<"EOF"
# Edit a file. Line numbers - Meta key (Alt, Cmd, or Esc), N.
function edit_file () {
[[ ! -f "$1" || ! -w "$1" ]] && return 1;
@unique-EJ
unique-EJ / decimal-to-hexadecimal-command
Created December 27, 2024 20:27
Linux command-line to convert decimal values to hexadecimal.
# Linux command-line - AWK text processing language program.
awk $'BEGIN { print "Type decimal (input) values to have the converted hexadecimal value output. CTRL-d to end." }\n{ printf "%s%x\\n", "Hex: ", $0 }'
#!/bin/bash
# Send text to Android device using ADB, emulating keyboard input.
# Based on a script from https://android.stackexchange.com/a/105881/223695
# and extended to support special characters.
# CC BY-SA 3.0 - Share under same license, attribute the creator, indicate changes.
# From Matthijs Kooijman's answer, https://android.stackexchange.com/a/176590/359828
if [[ "$1" != "" ]]
then
TEXT="$1"
@unique-EJ
unique-EJ / Xserver.sh
Last active August 16, 2024 05:18
Start application, and X server, on a remote machine (SSH).
# Start application, and X server, on a remote machine (SSH).
# ". Xserver.sh [app name]", "pgrep [app name]"
if [ $# -ge 1 ]; then
app="$@" # The positional parameters (app).
session="startlxde-pi"
commands="\
cd /tmp/; mkfifo -m 607 .command;
env echo -e \"declare DISPLAY=:0; \$(which ${session}) &
${app}\" > .command &
@kairusds
kairusds / 1-termux-adb.md
Last active November 21, 2025 19:47
Instructions for connecting Termux's android-tools adb to the current device via Wireless debugging and fixing phantom process killing

Install android-tools if you haven't already:

pkg update ; pkg upgrade
pkg install android-tools

adb pair 127.0.0.1:port
@boublinux
boublinux / install_vino_ubuntu.md
Created November 26, 2020 08:25
Vino Installation (Vino is a GNOME Remote Desktop) Like vnc

source

Installation

GNOME

Install the vino package.

You need to restart GNOME so that vino-server is started automatically when enabling the remote desktop feature. The remote desktop feature can usually be enabled in Settings > Sharing, however this only seems to be functional when NetworkManager is installed and functional. Alternative Desktop Environments

@ArtBIT
ArtBIT / GRUB_INIT_TUNE.md
Last active October 5, 2025 06:37
A collection of GRUB init tunes
@tsohr
tsohr / gist:5711945
Created June 5, 2013 06:15
Android activity manager "am" command help
adb shell am
usage: am [subcommand] [options]
usage: am start [-D] [-W] [-P <FILE>] [--start-profiler <FILE>]
[--R COUNT] [-S] [--opengl-trace] <INTENT>
am startservice <INTENT>
am force-stop <PACKAGE>
am kill <PACKAGE>
am kill-all
am broadcast <INTENT>
am instrument [-r] [-e <NAME> <VALUE>] [-p <FILE>] [-w]