How to make a service in Ubuntu Linux
Save the following at /lib/systemd/system/you_service_name.service
:
[Unit]
Description=My First Service
After=network-online.target
#!/bin/bash | |
# Check if a number was provided as an argument | |
if [ $# -eq 0 ] | |
then | |
echo "Please provide a number of times to run the script." | |
exit 1 | |
fi | |
# Directory where output files will be saved |
[ | |
{ | |
"key": "cmd+1", | |
"command": "workbench.action.openEditorAtIndex1" | |
}, | |
{ | |
"key": "ctrl+1", | |
"command": "-workbench.action.openEditorAtIndex1" | |
}, | |
{ |
function log(target, name, descriptor) { | |
const original = descriptor.value; | |
if (typeof original === 'function') { | |
descriptor.value = function(...args) { | |
console.log(`[${original.name}] Arguments: ${args}`); | |
try { | |
const result = original.apply(this, args); | |
console.log(`[${original.name}] Result: ${result}`); | |
return result; | |
} catch (e) { |
# Usage | |
# some task && notify "The task is over!" | |
notify() { | |
osascript -e "display notification \"$@\"" | |
} |
lazyYarnAddTypes() { | |
yarn add $@ | |
for module in $@ | |
do | |
echo "Trying to install types for $module" | |
yarn add @types/$module > /dev/null | |
done | |
} |