Bash scripts to get stuff done..
Misc. bash scripts that i write mostly for fun. These are written for good practice, for tasks i occassionally need to do that involve multiple steps.
Scripts are sorted into folders according to their general purpose.
.
├── backups
│ └── copy_mysql_databases.sh
├── install
│ ├── amp_debian.sh
│ ├── amp_macos.sh
│ ├── dotnet_core_3_debian.sh
│ ├── flask.sh
│ ├── froxlor_debian.sh
│ ├── imgcat.sh
│ ├── ioncube.sh
│ ├── nodejs_arm.sh
│ ├── nvm.sh
│ ├── opencart.sh
│ ├── smlnj_unix.sh
│ ├── sublime.sh
│ ├── todotxt_debian.sh
│ ├── todotxt.sh
│ ├── tor_browser_ubuntu.sh
│ ├── tor_project_ubuntu.sh
│ ├── webmin_debian.sh
│ ├── yarn.sh
│ └── youtube-dl_debian.sh
├── misc
│ └── batch_rename_snake_case.sh
├── README.md
└── setup
├── dev_macos.sh
├── dev_ubuntu.sh
└── virtualhost.sh
4 directories, 25 files
Copies /var/lib/mysql
from remote server to local /var/lib/mysql
directory, essentially copying all MySQL Databases with Users and Permissions, and logs the progress in a text file.
Install Apache, MySQL, PHP and phpMyAdmin
curl https://raw.githubusercontent.com/aamnah/bash-scripts/master/install/amp_debian.sh | bash
A rough script that takes care of all the steps in installing and setting up a Flask project. There are variables you can edit before running the script. At present, the script does the following:
apache2
libapache2-mod-wsgi
pip
virtualenv
VirtualHost
file__init__.py
To run, simply do bash flask.sh
. To run remotely:
curl -s https://raw.githubusercontent.com/aamnah/bash-scripts/master/install/flask.sh | bash
Installs Froxlor Server Management Panel.
What it does:
Execute remotely:
curl -s https://raw.githubusercontent.com/aamnah/bash-scripts/master/install/froxlor_debian.sh | bash
Note: LAMP needs to be installed already
imgcat is a script that previews images and GIFs right in the Terminal. You can see a gif in the Terminal with img foo.gif
or a jpeg with img bar.jpg
..
img
$PATH
To run, simply do bash imgcat.sh
. To run remotely:
curl -s https://raw.githubusercontent.com/aamnah/bash-scripts/master/install/imgcat.sh | bash
Installs ionCube loader on a Debain Ubuntu system. May require some testing, don't remember if it worked flawlessly.
Removes the pre-installed Node.js on Raspbery Pi (Raspbian Jessy) and installs the latest release. The script:
nodejs
, nodejs-legacy
, nodered
and npm
autoremove
To run, simply do bash nodejs.sh
. To run remotely:
curl -s https://raw.githubusercontent.com/aamnah/bash-scripts/master/install/nodejs.sh | bash
Installs Node Version Manager and Node LTS version.
NOTE: I stopped working with OpenCart years ago and haven't looked at this scrip in a very long time. May not work as expected anymore..
Installs any opencart version between 1.5.6 and 3.0.2.0 The script:
.htaccess
fileTo finish the installation, go to /install
in your browser (http://yourdomain.com/install)
To run, simply do bash opencart.sh
. To run remotely:
curl -s https://raw.githubusercontent.com/aamnah/bash-scripts/master/install/opencart.sh | bash
Installs Standard ML of New Jersey compiler and updates the PATH
curl -s https://raw.githubusercontent.com/aamnah/bash-scripts/master/install/sublime.sh | bash
Same as install/todotxt.sh
, just different install directory. Uses a folder_name
variable that can be customized by editing the script.
run:
curl -s https://raw.githubusercontent.com/aamnah/bash-scripts/master/install/todotxt_debian.sh | bash -s
The default install location is: ~/todo
Installs todo.txt - a minimal command line based todo application - in the default Dropbox folder on a Mac. Also configures the recommended tweaks.
The tweaks are:
t
$PATH
TODOTXT_DEFAULT_ACTION
TODOTXT_SORT_COMMAND
The install location is: ~/Dropbox/todo
Requires: wget
Execute script remotely:
curl -s https://raw.githubusercontent.com/aamnah/bash-scripts/master/install/todotxt.sh | bash -s
Installs the Tor browser (which has better network speed than Brave's Tor mode)
Installs the Tor project which let's you do nifty things like masking your IP. For example: check IP with curl ifconfig.me
and then change IP with torify curl ifconfig.me 2>/dev/null
Installs Webmin on Debian. Adds Webmin to sources.list
, adds GPG key, updates apt and installs Webmin. Also adds a rule for Webmin in UFW.
curl -s https://raw.githubusercontent.com/aamnah/bash-scripts/master/install/webmin_debian.sh | bash
The file extensions (jpeg/jpg/png) can easily be updated or removed.
curl -s https://raw.githubusercontent.com/aamnah/bash-scripts/master/misc/batch_rename_snake_case.sh | bash
Installs common dev tools for macOS using Homebrew and Casks. Needs to be updated to add more tools but a good functional starting point.
Creates a virtual host file. The script can take one or more argument in the form of domain name, like mydomain.com
.
e.g:
bash virtualhost.sh domain1.com domain2.com domain3.com
For every domain, the script:
index.html
for virtual hostThe script also restarts Apache after all domains are set up.
Execute remotely:
curl -s https://raw.githubusercontent.com/aamnah/bash-scripts/master/setup/virtualhost.sh | bash -s mydomain.com
with sudo
curl -s https://raw.githubusercontent.com/aamnah/bash-scripts/master/setup/virtualhost.sh | sudo bash -s mydomain.com
Notes:
PHPINIDir
directive in the virtual host conf file will give an Apache config test failed error if PHP is not installed on the system. Either install PHP (why not?) or remove the directive.