Skip to content

Instantly share code, notes, and snippets.

@alexdebril
alexdebril / lib-process.sh
Created October 13, 2015 11:40
bash library to handle multiple scripts
#!/bin/bash
function launch_script()
{
echo "launching ${@:1}"
nohup run-process.sh ${@:1} 1>> /tmp/scripts.log 2>>/tmp/crashes.log &
}
function wait_process()
{
@alexdebril
alexdebril / run-process.sh
Created October 13, 2015 11:42
script to launch a command wrapped in a lock system
#!/bin/bash
VAR_DIR=/tmp/processes
LOCK_DIR=$VAR_DIR/lock
LOG_DIR=$VAR_DIR/log
mkdir -p $LOCK_DIR
mkdir -p $LOG_DIR
LOCK_FILE=$LOCK_DIR/$2-$$.lock
<?php
namespace App\Controller;
use Slim\Http\Request;
use Slim\Http\Response;
class Home
{
/**
* @param Request $request
@alexdebril
alexdebril / .aliases.zsh
Created March 20, 2019 09:36
My ZSH aliases
alias fuck='sudo $(fc -ln -1)'
alias _=sudo
alias upgrade='sudo apt-get update && sudo apt-get upgrade'
alias indian-date='TZ=Asia/Calcutta date'
alias clean='git st > file-to-remove && xargs rm -Rf < file-to-remove'
#!/usr/bin/env python3
import argparse
import json
import os
import sys
from shutil import which
if which('rclone') is None: