Skip to content

Instantly share code, notes, and snippets.

View dalibor-sojic's full-sized avatar

Dalibor Sojic dalibor-sojic

View GitHub Profile
@darth-veitcher
darth-veitcher / bash-pid.md
Created January 8, 2017 22:13
Bash Script PID file locking

Pattern below allows for a bash script to be called via, say, cron and check to see if it is already running.

Useful for things like rsync tasks.

PIDFILE=/var/run/myscriptname.pid

if [ -f $PIDFILE ]
then
 PID=$(cat $PIDFILE)
@jakebellacera
jakebellacera / ICS.php
Last active April 19, 2024 09:06
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*