Skip to content

Instantly share code, notes, and snippets.

@ouyi
ouyi / ansible_settings_for_vault_diff.txt
Last active December 27, 2017 15:53
ansible vault diff
# [your_project]$ cat .gitattributes
prod/group_vars/vaulted* diff=ansible-vault-prod merge=binary
# [your_project]$ cat ~/.gitconfig
[diff "ansible-vault-prod"]
textconv = ansible-vault view --vault-password-file ~/vault_prod.txt
...
@ouyi
ouyi / android_data_backup.sh
Last active December 3, 2017 08:57
Backup and restore android data from a Fedora Linux host
#!/usr/bin/env bash
dnf install -y android-tools
# backup apps
adb backup -all -f adb-backup-2017-12-03-v9.adb
# backup photos
adb pull /sdcard/DCIM/Camera/ v9_sdcard_DCIM_Camera/
@ouyi
ouyi / glassfish_commands.sh
Last active December 18, 2017 23:18
Glassfish commands
#!/usr/bin/env bash
# docker run -p 14848:4848 -p 18080:8080 -p 18181:8181 --name glassfish oracle/glassfish:5.0
##########GENERATED ADMIN PASSWORD: f621b788 ##########
# docker exec -u 0 -it glassfish bash
ADMIN_PASSWORD=123456
echo "AS_ADMIN_PASSWORD=${ADMIN_PASSWORD}" > /tmp/glassfishpwd
@ouyi
ouyi / multiplication_formulas.sh
Created October 22, 2017 19:38
Bash script to print out the Table of Multiplication Formulas for school kids
#!/usr/bin/env bash
for i in {1..9}; do
for j in $(seq 1 $i); do
echo -n "$j x $i = $( printf '% 2s' $(( $i * $j ))) "
done
echo
done
#/usr/bin/env bash
# Install some pacakages we'll need to compile the driver below.
dnf install gcc kernel-devel -y
# Create working dir for Broadcom driver files and patches.
mkdir hybrid_wl_f23
# Change to working dir.
cd hybrid_wl_f23