Skip to content

Instantly share code, notes, and snippets.

View megamen32's full-sized avatar

Demiurge The Single megamen32

View GitHub Profile
@megamen32
megamen32 / chromeconsole.js
Last active June 22, 2026 22:13
bypass permisions on code-server(vscode) for codex
(() => {
const NEEDLE = "Yes, and don't ask again for commands that start with";
const clickButton = () => {
const buttons = [...document.querySelectorAll('button[role="radio"], button')];
const btn = buttons.find(b => {
const label = b.getAttribute("aria-label") || "";
const text = b.innerText || "";
return (
@megamen32
megamen32 / chatgpt-plugin-autoaprove.js
Created May 14, 2026 09:47
extension for chrome to click aprrove in custom chatgpts
// make-extension.js — запустите через: node make-extension.js
const fs = require('fs');
const path = require('path');
const zlib = require('zlib');
const EXT_DIR = 'auto-confirm-extension';
if (!fs.existsSync(EXT_DIR)) fs.mkdirSync(EXT_DIR);
const files = {
'manifest.json': `{
@megamen32
megamen32 / notify
Last active May 9, 2026 22:51
mini app for notify to telegram when app ends
#!/usr/bin/env bash
#put to /usr/local/bin/notify
set -u
SECRETS_FILE="$HOME/.config/secrets/notifier.env"
STATE_DIR="$HOME/.local/state/notify"
mkdir -p "$STATE_DIR"
if [ -f "$SECRETS_FILE" ]; then
set -a
@megamen32
megamen32 / codex-auth
Last active June 24, 2026 13:36
Change profiles of codex (vscode extension or app) easily
#!/usr/bin/env bash
set -euo pipefail
# инстукция https://habr.com/ru/articles/1020450/
CODEX_DIR="${CODEX_HOME:-$HOME/.codex}"
AUTH_FILE="$CODEX_DIR/auth.json"
OPENCODE_AUTH_FILE="${OPENCODE_AUTH_FILE:-$HOME/.local/share/opencode/auth.json}"
PROFILES_DIR="${CODEX_AUTH_PROFILES_DIR:-$HOME/.codex-auth-profiles}"
CURRENT_FILE="$PROFILES_DIR/.current_profile"
PROXY_FILE="$PROFILES_DIR/.default_proxy"
CACHE_TIME_FILE="$PROFILES_DIR/.cache_time"
# --- all: run command or script on local + many hosts (bash-only) ------------
all() {
# ---- defaults / env ----
local parallel=${ALL_PARALLEL:-1} # 1=parallel remotes
local run_local=${ALL_LOCAL:-1} # 1=run local too
local local_parallel=${ALL_LOCAL_PARALLEL:-1} # 1=local concurrent with remotes
local timeout=${ALL_TIMEOUT:-8}
local pty=${ALL_PTY:-0}
local sudo_n=${ALL_SUDO_N:-1}
local prefix=${ALL_PREFIX:-1} # kept for backward compatibility
@megamen32
megamen32 / .bashrc
Last active February 27, 2026 16:36
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
#!/bin/bash
# Проверка прав root
if [ "$EUID" -ne 0 ]; then
echo "Пожалуйста, запустите скрипт с правами root"
exit 1
fi
# Установка пакетов pptpd
if ! command -v pptpd &> /dev/null; then
@megamen32
megamen32 / install_vpnl2tp.sh
Created September 15, 2024 01:18
install vpn on ubuntu (L2TP)
#!/bin/bash
# Проверка прав root
if [ "$EUID" -ne 0 ]; then
echo "Пожалуйста, запустите скрипт с правами root"
exit 1
fi
# Установка необходимых пакетов
echo "Устанавливаем необходимые пакеты..."
@megamen32
megamen32 / install_vpn.sh
Created September 15, 2024 01:11
install vpn to ubuntu server (wiregruard)
#!/bin/bash
# Проверка прав root
if [ "$EUID" -ne 0 ]; then
echo "Пожалуйста, запустите скрипт с правами root"
exit 1
fi
# Установка WireGuard, если не установлен
if ! command -v wg &> /dev/null; then
@megamen32
megamen32 / run.sh
Created December 20, 2023 19:01
run a service with current name directory
#!/bin/bash
# Check for root privileges
if [ "$(id -u)" != "0" ]; then
echo "Warning: Some operations (like checking service status) require root privileges."
echo "You are not running as root. Continuing without those operations."
fi
# Use the current directory as default if no argument is provided
DIR=${1:-.}