Skip to content

Instantly share code, notes, and snippets.

View HR's full-sized avatar

Habib Rehman HR

View GitHub Profile
@HR
HR / download.js
Created March 12, 2021 15:16
Deno CLI to download JSON links to directory
import { download, Destination } from 'https://deno.land/x/download/mod.ts'
function error(msg) {
console.error(msg)
Deno.exit(1)
}
/**
* @param file The JSON file path
* @param path The JSON object path
* @param dest The download destination dir (optional, defaults to current)
@HR
HR / screen.sh
Created May 21, 2021 18:21
Restore screen session if exist or start new one ssh
# Connect to screen session
case "/$(ps -p $PPID -o comm=)" in
*/sshd) screen -RR;;
esac