This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
at 16:45 <<END | |
pgrep wfica | xargs kill -s TERM | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
sudo shutdown 17:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
/bin/systemctl hybrid-sleep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!venv/bin/python3 | |
import datetime | |
import smtplib | |
import time | |
import requests | |
import sys | |
import random | |
from bs4 import BeautifulSoup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Example of constructing & appending to a JSON file | |
# Required JSON payload: | |
# | |
# [ | |
# { | |
# "id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", | |
# "type": "host" | |
# }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . type f -name '*.original_extension' -execdir /bin/zsh -c '/usr/bin/echo $0 ${0/original_extension/new_extension}' {} \; | |
###################################################################### | |
## Before: ./01-Part 1.original_extension ## | |
## After: ./01-Part 1.original_extension ./01-Part 1.new_extension ## | |
###################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
argocd app create controller \ | |
--project default \ | |
--sync-policy automatic \ | |
--repo https://github.com/codefresh-contrib/gitops-certification-examples \ | |
--path ./secret-app/manifests \ | |
--dest-server https://kubernetes.default.svc \ | |
--dest-namespace kube-system |