Skip to content

Instantly share code, notes, and snippets.

View luckylittle's full-sized avatar
:octocat:
Working for @RedHatOfficial

Lucian Maly luckylittle

:octocat:
Working for @RedHatOfficial
View GitHub Profile
@luckylittle
luckylittle / doublecmd.xml
Last active June 20, 2024 00:45
Double Commander Configuration backup (/home/lmaly/.config/doublecmd/)
<?xml version="1.0" encoding="UTF-8"?>
<doublecmd DCVersion="1.0.11" ConfigVersion="13">
<Toolbars>
<MainToolbar>
<Row>
<Command>
<ID>{BD1601E1-1554-4B01-AEF1-849AA2845C52}</ID>
<Icon>cm_refresh</Icon>
<Command>cm_Refresh</Command>
</Command>
@luckylittle
luckylittle / audible-last-3-manning.sh
Last active April 28, 2025 02:46
Script returns last three Audible products from a specific publisher
#!/bin/zsh
source /home/lmaly/Projects/audible-cli/venv/bin/activate
read -r -d '' -A LAST_THREE_MANNING_ASIN <<< "$(audible api /1.0/catalog/products -p publisher="Manning Publications" -p products_sort_by=-ReleaseDate -p num_results=3 | jq -r '.products[].asin')"
for ASIN in "${LAST_THREE_MANNING_ASIN[@]:0:$((${#LAST_THREE_MANNING_ASIN[@]}-1))}"
do
audible api -p response_groups=product_desc /1.0/catalog/products/${ASIN} | jq -r '.product.title'
done
#######
@luckylittle
luckylittle / predb.sh
Last active May 26, 2022 23:40
Wrapper for @crackhub-dev script predb-ovh-cli
#!/bin/zsh
################
## Add alias predb='/home/lmaly/Projects/predb-ovh-cli/THIS_SCRIPT.sh'
## Usage: predb <SEARCH QUERY>
## Example: predb wild territory
################
C=''
source /home/lmaly/Projects/predb-ovh-cli/venv/bin/activate
@luckylittle
luckylittle / epub_maker.sh
Created May 24, 2022 02:20
Simple workflow to create an EPUB file from the folder and check for EPUB errors
#!/bin/zsh
export EPUB=Lyssa_Adkins_-_Coaching_Agile_Teams
# No compression zip file, with `mimetype` being the first file in the archive
zip -0 -X ${EPUB}.zip mimetype
zip -0 -X -r ${EPUB}.zip META-INF OEBPS
# Rename .zip to .epub
mv -v ${EPUB}.{zip,epub}
@luckylittle
luckylittle / at_1659_sleep.sh
Last active May 25, 2022 00:05
Make your computer go to sleep today at 16:59 (once)
#!/bin/zsh
# Old way of doing it:
# at -M 16:59 <<END
# /usr/bin/sudo /bin/systemctl hybrid-sleep
# END
# New way of doing it:
# systemd-analyze calendar --iterations=5 '16:59' <-- this would run every day
# systemd-analyze calendar "$(date +%Y-%m-%d) 16:59" <-- only today
@luckylittle
luckylittle / at_1645_close_wfica.sh
Created May 19, 2022 01:57
Gracefully shut down Citrix Workspace session today at 16:45
#!/bin/zsh
at 16:45 <<END
pgrep wfica | xargs kill -s TERM
END
@luckylittle
luckylittle / shutdown_at_5PM.sh
Last active May 19, 2022 01:55
Shutdown your computer at 5PM today
#!/bin/zsh
sudo shutdown 17:00
@luckylittle
luckylittle / sleep.sh
Last active May 19, 2022 01:56
Make your computer go to sleep immediately
#!/bin/zsh
/bin/systemctl hybrid-sleep
@luckylittle
luckylittle / informit.py
Created May 9, 2022 00:47
InformIT eBook Deal of the Day Mailinator
#!venv/bin/python3
import datetime
import smtplib
import time
import requests
import sys
import random
from bs4 import BeautifulSoup
@luckylittle
luckylittle / playbook.yaml
Last active April 7, 2022 05:34
Elegant way to append to a JSON file
---
# Example of constructing & appending to a JSON file
# Required JSON payload:
#
# [
# {
# "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
# "type": "host"
# },