- 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
#!/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.
adb
is the Android CLI tool with which you can interact with your android device, from your PC
You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.
To get the list of your installed applications: