The example situation:
- Wish to execute a bash script at
/var/foobah/myscript.sh
- But
/var/
has been mounted usingnoexec
via/etc/fstab
. - How to solve? Using bind mounts.
Firstly, create a directory to hold script(s), located somewhere that has exec rights, then create the target directory on noexec
partition:
$ mkdir --parents /opt/magnetik/foobah
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# query MySQL for slave replication status | |
# note: requires [~/.my.cnf] to be present a populated with valid MySQL password | |
mysql \ | |
--batch \ | |
--user root \ | |
--execute "SHOW GLOBAL STATUS LIKE 'Slave_running';" | \ | |
tail --lines 1 | grep --extended-regexp --quiet "^Slave_running\tON$" |
Have tested these instructions successfully under Ubuntu 16.04LTS and 14.04LTS.
- Create Ubuntu server instance under Parallels (obviously).
- Start VM, goto Actions - Install Parallels Tools... to mount the ISO image.
- Note: if this fails, or updating tools for an existing guest you can do the following:
- Goto
Devices
>CD/DVD 1
>Connect Image...
. - Select the following ISO image:
/Applications/Parallels Desktop/Contents/Resources/Tools/prl-tools-lin.iso
. - This will mount the tools CD image.
- Two AWS RDS MySQL databases - moving databases from source to destination.
- Both databases are not publicly accessible, only via an EC2 instance(s) - e.g. you have setup your security groups.
- Can SSH to a target EC2 instance (but of course).
- Sets up two SSH port forwards on local machine - one to source database, another to target.
- Via calls to
transferDatabase()
:
Reference: http://rtyley.github.io/bfg-repo-cleaner/
$ wget http://repo1.maven.org/maven2/com/madgag/bfg/1.11.8/bfg-1.11.8.jar
$ git clone [email protected]:org-name/repo-name.git repo-name.cleanup
$ java -jar bfg-1.11.8.jar --delete-files '*.{gif,jpg,png}' repo-name.cleanup
$ cd repo-name.cleanup
$ git gc --prune=now --aggressive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git clone --depth 1 \ | |
-qb $BRANCH_NAME \ | |
$REPOSITORY_URL $TARGET_CLONE_DIR | |
cd $TARGET_CLONE_DIR | |
git submodule update -q --init --depth 1 |