Skip to content

Instantly share code, notes, and snippets.

View pabloab's full-sized avatar

Pablo pabloab

View GitHub Profile
@pabloab
pabloab / koha-auth_txt2mrc.pl
Last active January 24, 2018 04:56
[Tamil to MRC format] Convert Koha::Contrib::Tamil koha-auth TXT to MRC format #Koha
#!/usr/bin/perl
use Modern::Perl;
use MARC::Record;
@ARGV == 2 or die "usage: $0 auths.txt auths.mrc\n";
my $inf = shift();
my $ouf = shift();
@pabloab
pabloab / xcliptester.sh
Last active January 24, 2018 04:55
[xclip bug 37 tester] Little tool created to test xclip issue #37 #xclip
#!/bin/bash
# Before used xmacrorec2 > test.macro, capturing from 0,0 to different points on screen.
# $ cat test-1000-1000.macro
# KeyStrPress Control_L
# KeyStrPress Shift_L
# KeyStrPress Print
# KeyStrRelease Print
# KeyStrRelease Shift_L
# KeyStrRelease Control_L
@pabloab
pabloab / byobuCommands.md
Last active March 14, 2019 02:09
Some useful tmux / Byobu shortcuts

Cheatsheet: byobu and tmux commands

Of course Ctrl+s should be replaced with your preffix shortcut.

Window-related

Shortcut Description
@pabloab
pabloab / CLI-Cheatsheets.md
Last active January 26, 2018 16:51
[CLI Cheatsheet] Mysc command line related cheatsheets #CLI #cheatsheet

Cheatsheets

Bash keyboard shortcuts

  • Ctrl+P Up / Previous (!!)
  • Ctrl+N Down / Next

  • Ctrl+B Left / Back
  • Ctrl+F Right / Forward

  • Ctrl+A Home. Sometimes used by tmux/byobu.
  • Ctrl+E End
@pabloab
pabloab / testInternet.sh
Last active January 24, 2018 05:03
[Online tester] Test if online. A nice guitar pluck sound loud when comes back
#!/bin/bash
set -euo pipefail # unofficial bash strict mode: http://redsymbol.net/articles/unofficial-bash-strict-mode/
IFS=$'\n\t'
# By Pablo Bianchi (pablo.bianchi@gmail.com)
# Infinit loop testing if we are onliene. When we are start beeping.
# (based on http://www.linuxscrew.com/2009/04/02/tiny-bash-scripts-check-internet-connection-availability/ )
#~ USAGE: Just: ./testInternet.sh
#~ NOTES
@pabloab
pabloab / landscape-sysinfo-alternative.sh
Last active October 21, 2023 18:36
[landscape-sysinfo alternative ], more cross-linux
#!/bin/bash
# Simple motd script for any systemd Linux (tested on Debian)
# Inspiration: https://superuser.com/questions/919962/landscape-sysinfo-for-centos
# Inspiration 2: https://github.com/thusoy/headsup/blob/master/headsup.py
os-name=$()
os-kernel=$()
date-today=$()
system-load=$()
processes=$(cat /proc/loadavg | cut -d"/" -f2| cut -d" " -f1)
@pabloab
pabloab / koha-export-patron-images.sh
Created September 30, 2018 02:06
Bash script to export patron images from a Koha instance and generate DATALINK.TXT to import into another instance.
#!/bin/bash
# set -euo pipefail # unofficial bash strict mode
# IFS=$'\n\t'
echo "This script bulk export patron images from a Koha instance and generate DATALINK.TXT to import into another instance."
# @TODO
# -
# [PARAMS]
@pabloab
pabloab / pomodoro
Last active February 2, 2023 18:55
Simple pomodoro bash script that switch between sound outputs
#!/usr/bin/env bash
# Little script to play a music/sound on pomodoros through headphones and call to come back to work through HDMI speakers.
# set -euo pipefail # Unofficial bash strict mode
# Prerequsitres: gtts (`pip install --user --upgrade gtts`, mpv (`flatpak install io.mpv.Mpv`), vlc, libsox-fmt-mp3 and retry.
# Also use yt-dlp instead of yt-dl https://hund.tty1.se/2021/10/12/how-to-use-yt-dlp-instead-of-yt-dl-with-mpv.html
# TODO/Known bugs:
# - Fix issue with PipeWire: pacmd stat No PulseAudio daemon running, or not running as session daemon. https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/357
@pabloab
pabloab / CLI-not-so-known_handy_utils.md
Last active September 8, 2020 23:05
List of not-so-known handy CLI utils

List of not-so-known handy CLI utils

Inspired from this Twitter post.

  • tig # text-mode interface for Git
  • diff-so-fancy # 11.5k
  • ncdu # Disk usage analyzer
  • bat # cat alternative
  • fzf # 20.4k A command-line fuzzy finder. Probably there is a oh-my-zsh plugin
  • httpie # 40.3k CLI, cURL-like tool for humans. See https://httpie.org/
@pabloab
pabloab / line-mode-MARC.sublime-syntax
Last active July 20, 2023 02:18
Sublime syntax for MARC line mode files (yaz-marcdump), used by syntect and therefore by bat
%YAML 1.2
---
# By Pablo Bianchi
name: MARC line mode (yaz-marcdump)
file_extensions:
- line
scope: string
uuid: 222f19a4-f491-4e71-a391-00b138add2a0
contexts: