Skip to content

Instantly share code, notes, and snippets.

View kannangce's full-sized avatar

Kannan Ramamoorthy kannangce

View GitHub Profile
[
{
"id": "f1",
"name": "Restel Site Contact form",
"description": "Contact us form in restel site.",
"integrations": [
"Mail",
"Telegram"
]
},
@kannangce
kannangce / utils.sh
Last active August 25, 2022 07:36
Handy utility scripts
## Handy utility scripts.
retry_with_timeout () {
# Retries the given command until it returns the given value for the given number of times.
# Usage retry_with_timeout 'Command to be executed with quotes' <expected value> <number of times to retry>
local command_to_try="$1"
local expected_value="$2"
local expected_timeout="$3"
local total_time=0
{
"token": "adsfsadfssfdsdfs"
}
@kannangce
kannangce / gist:0a121cff1c6b40cd72dbd6ab0511e23b
Created November 11, 2023 15:01
Bash script to get the created time of a file.
get_crtime() {
for target in "${@}"; do
inode=$(stat -c '%i' "${target}")
fs=$(df --output=source "${target}" | tail -1)
crtime=$(sudo debugfs -R 'stat <'"${inode}"'>' "${fs}" 2>/dev/null |
grep -oP 'crtime.*--\s*\K.*')
printf "%s\t%s\n" "${target}" "${crtime}"
done