- Verify is Supplied any argument
((!$#)) && echo No arguments supplied! && exit 1
- If you need to ensure a minimum ammount of args
if [ $# -ge 3 ]
then
const axios = require('axios'); | |
const apiKey = 'SUA_API_KEY'; // Substitua com sua chave de API RD Station Marketing | |
const endpoint = 'https://api.rd.services/platform/contacts'; | |
const leadData = { | |
name: 'Nome do Lead', | |
email: '[email protected]', | |
job_title: 'Cargo do Lead', | |
company_name: 'Nome da Empresa', |
#!/bin/bash | |
#### Definitions | |
db_username=user | |
container_filter=cimentao_db | |
backup_dir=/home/ubuntu/backup | |
### Variables | |
date=`date +%Y-%m-%d"_"%H_%M_%S` | |
filename=dump_$date.gz |
class Ability | |
include CanCan::Ability | |
def marshal_dump | |
#blocks cannot be cached | |
@rules.reject{|rule| rule.instance_variable_get :@block }.map{|rule| Marshal.dump(rule) } | |
end | |
def marshal_load array | |
#blocks cannot be cached, so blocks must be re-defined | |
can :read, Comment do |comment| |
#!/bin/bash | |
echo "Instalando VNC server" | |
sudo apt install tigervnc-standalone-server tigervnc-scraping-server tigervnc-common tigervnc-xorg-extension tigervnc-viewer | |
echo "Configure a senha padrão" | |
vncserver | |
echo "Realizando backup do arquivo de configuração" | |
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak |
#!/bin/bash | |
if [[ $# -eq 0 ]] ; then | |
echo 'Must pass an time for reboot in form hh:mm' | |
exit 1 | |
fi | |
if [ -f /var/run/reboot-required ]; then | |
echo 'Reboot required, scheduling based on parameter' | |
sudo shutdown -r $1 | |
fi |
#!/bin/bash | |
#### Script important variables | |
USR="user" | |
SERVER="0.0.0.0" | |
DEPLOY_PATH="/home/user/application_home" | |
LOCAL_PATH="<Current code path>" | |
# Color output | |
cecho() { |
--- | |
- hosts: all | |
become: true | |
tasks: | |
- name: Install aptitude | |
apt: | |
name: aptitude | |
state: latest | |
update_cache: true |
#!/bin/sh | |
#!/bin/sh | |
volumes=$(docker volume ls --format '{{.Name}}') | |
dangling=() | |
for volume in $volumes | |
do | |
if result=$(docker ps -a --filter volume="$volume" --format '{{.Names}}' | sed 's/^/ => Used in:/' ) | |
then |
This example will replace all JPG files removing IMG from name and Adding VACATION:
for f in *.jpg; do mv "$f" "$(echo "$f" | sed s/IMG/VACATION/)"; done
Obs: If you want justo to make a copy just replace MV commad with CP. This is very useful to make backup before file modification.