Skip to content

Instantly share code, notes, and snippets.

View iamhsa's full-sized avatar

Hugo Salesses iamhsa

View GitHub Profile
@iamhsa
iamhsa / modimg
Created January 27, 2024 16:10
Rename Images
#!/usr/bin/env bash
#
# modimg : change images name
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
## Font config
## use ctrl+alt+j to open javascript
## ----------------------------------------------
# DroidSansMonoNerdFont
term_.prefs_.set('user-css', 'https://cdn.jsdelivr.net/gh/JayXon/powerline-web-fonts/DroidSansMonoNerdFont.css');
term_.prefs_.set('font-family', '"Droid Sans Mono Nerd Font", monospace');
# MesloLGSNF
term_.prefs_.set('user-css', 'https://www.uncon.net/MesloLGSNF-web-fonts/stylesheet.css');
@iamhsa
iamhsa / color.sh
Created November 29, 2021 14:58
Test color terminal
#!/bin/bash
#
# This file echoes a bunch of 24-bit color codes
# to the terminal to demonstrate its functionality.
# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
# The background escape sequence is ^[48;2;<r>;<g>;<b>m
# <r> <g> <b> range from 0 to 255 inclusive.
# The escape sequence ^[0m returns output to default
setBackgroundColor()
/**
* From
* https://devops.stackexchange.com/questions/2191/how-to-decrypt-jenkins-passwords-from-credentials-xml
*/
import com.cloudbees.plugins.credentials.CredentialsProvider
import com.cloudbees.plugins.credentials.Credentials
import com.cloudbees.plugins.credentials.domains.Domain
import jenkins.model.Jenkins
def indent = { String text, int indentationCount ->
@iamhsa
iamhsa / p10k_lpass_functions
Created December 9, 2020 14:33
p10k lastpass segment functions
####################################[ lpass: lastpass status ]#################################
#POWERLEVEL9K_LPASS_BACKGROUND=red
function prompt_lpass() {
_p9k_cached_cmd 0 lpass --version || return
local lpass_status=$(lpass status --color=never | cut -d ' ' -f4)
if [ $(lpass status --color=never | cut -d ' ' -f4) ]; then
p10k segment -i '聾' -f 160
else
p10k segment -i '聾' -f 250
fi
@iamhsa
iamhsa / starwars-imperial-beep.sh
Created February 15, 2019 15:27
StarWars beep
beep -l 350 -f 392 -D 100 -n -l 350 -f 392 -D 100 -n -l 350 -f 392 -D 100 -n -l 250 -f 311.1 -D 100 -n -l 25 -f 466.2 -D 100 -n -l 350 -f 392 -D 100 -n -l 250 -f 311.1 -D 100 -n -l 25 -f 466.2 -D 100 -n -l 700 -f 392 -D 100 -n -l 350 -f 587.32 -D 100 -n -l 350 -f 587.32 -D 100 -n -l 350 -f 587.32 -D 100 -n -l 250 -f 622.26 -D 100 -n -l 25 -f 466.2 -D 100 -n -l 350 -f 369.99 -D 100 -n -l 250 -f 311.1 -D 100 -n -l 25 -f 466.2 -D 100 -n -l 700 -f 392 -D 100 -n -l 350 -f 784 -D 100 -n -l 250 -f 392 -D 100 -n -l 25 -f 392 -D 100 -n -l 350 -f 784 -D 100 -n -l 250 -f 739.98 -D 100 -n -l 25 -f 698.46 -D 100 -n -l 25 -f 659.26 -D 100 -n -l 25 -f 622.26 -D 100 -n -l 50 -f 659.26 -D 400 -n -l 25 -f 415.3 -D 200 -n -l 350 -f 554.36 -D 100 -n -l 250 -f 523.25 -D 100 -n -l 25 -f 493.88 -D 100 -n -l 25 -f 466.16 -D 100 -n -l 25 -f 440 -D 100 -n -l 50 -f 466.16 -D 400 -n -l 25 -f 311.13 -D 200 -n -l 350 -f 369.99 -D 100 -n -l 250 -f 311.13 -D 100 -n -l 25 -f 392 -D 100 -n -l 350 -f 466.16 -D 100 -n -l 250 -f 392 -D 100 -n -l
@iamhsa
iamhsa / chk-services
Last active March 10, 2021 15:03
Simple script to check service status and restart them after update
#!/usr/bin/env bash
#title : chk-services
#description : Check & Restart systemd services after packages updates or points to necessary reboot
#author : iamhsa
#date : 20170531
#version : 0.3.3
#usage : ./chk-services <opts>
#notes : This script is ment to be used with systemd and archlinux
#licence : GPL-2.0
#==============================================================================
@iamhsa
iamhsa / keybase.md
Last active April 22, 2017 21:22
Keybase proof : iamhsa

Keybase proof

I hereby claim:

  • I am iamhsa on github.
  • I am iamhsa (https://keybase.io/iamhsa) on keybase.
  • I have a public key ASDOWW5djhFGTTYgq3Kt1_iJCkILjSnkqWgIgBXGP4NI6Ao

To claim this, I am signing this object:

@iamhsa
iamhsa / checkMusic.sh
Created March 21, 2017 09:23
Simple script to check music directory
#!/bin/sh
# Simple script to check music directory flaws
# Ajout de la variable TERM si elle n'est pas
# définie dans l'environnement
export TERM=xterm
ERR=""
# Repertoire de base à scanner