Skip to content

Instantly share code, notes, and snippets.

View danielestevez's full-sized avatar
🍁
playing with something, probably

Daniel Estévez danielestevez

🍁
playing with something, probably
View GitHub Profile
@danielestevez
danielestevez / keep_alive.sh
Created August 10, 2023 19:25
Keep alive Bash script to check, log and restart a process
#!/bin/bash
process_name="xxxxx"
if ! pgrep -x "$process_name" > /dev/null; then
echo "The process $process_namen was not running at " $(date -u) >> ~/keep_alive.log
./xxxxxx &
echo "The process $process_namen was restarted at " $(date -u) >> ~/keep_alive.log
fi
@danielestevez
danielestevez / slackwebhooknotify.go
Created June 29, 2023 14:26
Send notification to slack webhook
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
@danielestevez
danielestevez / webhooklistener.go
Last active June 29, 2023 14:27
Golang Webhook listener to receive and parse an event via POST
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
)
@danielestevez
danielestevez / cron.md
Last active March 9, 2023 19:07
CRON related stufff
  • Redirect output to a log file
    01 14 * * * /home/joe/myscript >> /home/log/myscript.log 2>&1
@danielestevez
danielestevez / resume.json
Last active February 3, 2023 15:20
resume json
{"basics":{"name":"Daniel Estevez","label":"Software Developer at Ubisoft IT","image":"https://avatars.githubusercontent.com/u/495063?v=4","email":"","phone":"","url":"www.danielestevez.com","summary":"\n* Currently not looking for a job\n* Only 100% remote and 4-day week offers and will be considered or answered.","profiles":[{"network":"gitconnected","username":"danielestevez","url":"https://gitconnected.com/danielestevez"},{"network":"GitHub","username":"danielestevez","url":"https://github.com/danielestevez"},{"network":"LinkedIn","url":"https://www.linkedin.com/in/daniestevez/","username":"daniestevez"},{"network":"Stack Overflow","url":"https://stackoverflow.com/users/2369157/daniestevez","username":"daniestevez"}],"headline":"Software Engineer","blog":null,"yearsOfExperience":20,"username":"danielestevez","locationAsString":"Montreal","region":"Montreal","karma":14,"id":"6fa99d32-0bf7-4d53-a9d6-a8f437eba870","followers":20,"following":30,"picture":"https://avatars.githubusercontent.com/u/495063?v=4","
@danielestevez
danielestevez / regex.md
Last active June 14, 2021 18:07
Regular expressions for many things

Use https://regexr.com/

  • Extract IP/Domain from a URL (group[2])
^(http|https)://([^/]*)/?
  • Parse IP
@danielestevez
danielestevez / docker-commands.md
Last active August 6, 2021 14:47
Docker cheatsheet
  • Kill all containers for a given <image-name>
  docker rm $(docker stop $(docker ps -a -q --filter ancestor=<image-name> --format="{{.ID}}"))
  • Login to a docker container
  docker exec -it container_id /bin/bash
@danielestevez
danielestevez / linux_commands.md
Last active July 14, 2020 22:00
Linux cool commands
  • Kills all process by name

sudo kill -9 $(pidof middleman)

* Access JIRA with no SSO, just user/password
https://[JIRA_URL]/jira/secure/Dashboard.jspa?os_username=[USER_NAME]&os_password=[USER_PASSWORD]