Skip to content

Instantly share code, notes, and snippets.

View blackjack75's full-sized avatar

Santiago Lema blackjack75

View GitHub Profile
@blackjack75
blackjack75 / windowfix.sh
Last active April 10, 2024 12:43
Resize and remove window decoration on PopOS and Linux desktops (from stack overflow) . Last commented lines show usage example.
#!/usr/bin/env zsh
wait_find_window_id() {
while true; do
window_id=$(wmctrl -l | grep "$1" | awk '{print $1}')
if [ -n "$window_id" ]; then
echo "$window_id"
return
fi
@blackjack75
blackjack75 / amishell.sh
Created April 10, 2024 12:39
Launched and removed border on Amiga shell on Pi4-T
#!/bin/bash
cd /home/pi/scripts/
/bin/lxterminal -e 'tmux' &
sleep 8
source ./windowfix.sh
window_name="tmux"
#resizing like this fails on cool retro term but we use geometry above
@blackjack75
blackjack75 / kiwix_start.sh
Created April 6, 2024 18:57
Kiwix start script On my minipc
#!/bin/bash
ZIMDIR=/hugedisk/kiwix/zims
LIBRARY_XML=/hugedisk/kiwix/library.xml
pkill kiwix-serve
touch $LIBRARY_XML
echo "Will scan zimdir: $ZIMDIR"
for f in "$ZIMDIR"/*.zim; do
if [[ -f "$f" ]]; then
10000000 - 10010000
c8c6a000 - c951b000
c951c000 - cb572000
cb57a000 - cb57b000
cb57e000 - cb581000
cb582000 - cb586000
cb592000 - 100000000
ffffffc002000000 - ffffffc0068d1000
fffffffe00080000 - 0
kernel args ranges:
@blackjack75
blackjack75 / .xbindkeysrc
Last active March 14, 2024 21:02
xbindkeys commands to make Command + C / V / X do Control + Shift + C / V / X
"xdotool keydown Control_L keydown Shift_L sleep 0.1 key c keyup Shift_L keyup Control_L"
release+m:0x40 + c
"xdotool keydown Control_L keydown Shift_L sleep 0.1 key x keyup Shift_L keyup Control_L"
release+m:0x40 + x
"xdotool keydown Control_L keydown Shift_L sleep 0.1 key v keyup Shift_L keyup Control_L"
release+m:0x40 + v
@blackjack75
blackjack75 / vv.sh
Created February 12, 2024 21:11
Bash command to edit file with nvim with my user or sudo if necessary to write the file. Use config for my user with root (will download modules again)
#!/bin/bash
vv() {
if [ $# -eq 0 ]; then
echo "Usage: vv <file>"
echo "Will edit with current user or sudo if needed b ut using nvim config of this user"
return 1
fi
vpath=$(which $EDITOR)
@blackjack75
blackjack75 / useful_bash_feature.sh
Created January 27, 2024 14:11
Useful script for bash
#!/usr/bin/env zsh
# Use fzf and open file in text editor
vd() {
# folder, default to current directory
# depth, default to 1
local dir=${1:-.}
local depth=${2:-1}
local selected_file
@blackjack75
blackjack75 / entregas-box.yaml
Last active May 6, 2023 19:21
ESPHome YAML for delivery box
globals:
- id: ready_to_open
type: bool
initial_value: 'false'
esphome:
name: entregas-lock
friendly_name: entregas-lock
on_boot:
@blackjack75
blackjack75 / gist:72267c967e6b47f564968b3fb85f6a83
Created April 13, 2023 12:45
My follows on mastodon April 2023
Account address,Show boosts,Notify on new posts,Languages
Seg@oldbytes.space,true,false,
ylegall@genart.social,true,false,
AutisticAdam@autistics.life,true,false,
johnmacintosh@swiss.social,true,false,
jcfischer@swiss.social,true,false,
chludens@hcommons.social,true,false,
shanselman@hachyderm.io,true,false,
spook@m68k.church,true,false,
Mecid@mastodon.social,true,false,
@blackjack75
blackjack75 / start_chromium_stats.sh
Last active November 21, 2021 17:51
Script to launch chromium with full screen browser with minimal SD-Card writes
#!/bin/sh
# RUN chromium in full screen with minimal SD-Card writes, runs OK on a Raspberry 3 with a webpage playing video
# ADD a ram disk in fstab with this line
# tmpfs /tmpcache tmpfs nodiratime,noatime,nosuid,nodev,size=256M 0 0
# and that this script is called on startup for a minimalistic (no desktop setup)
# /etc/xdg/openbox/autostart