https://github.com/guardian
https://github.com/nprapps
| * LFCS Domains 2015.02 | |
| Note - the domains will change somewhat in March 2015. SW RAID | |
| with mdadm will be removed | |
| ** The Command Line | |
| *** Editing text files on the CLI | |
| Covers the use of the basic text editors nano and gedit as well | |
| as the advanced editors _vi_ and _emacs_ | |
| - nano | |
| simple CLI-based text editor |
| # Example | |
| git clone [email protected]:guardian/ge2015-results-interactive.git | |
| sudo npm install -g grunt-cli | |
| sudo npm install -g bower | |
| sudo npm install -g sass | |
| sudo npm install | |
| bower install | |
| grunt (--force) |
| #! /usr/bin/python | |
| ''' | |
| Python script to set up GA web tracking code, usually in static web files (in PHP files, you can use a simple 'include' or 'require_once'). | |
| add_ga_code.py <file> <track-id> | |
| Example: add_ga_code.py /var/www/index.html UA-557744-10 | |
| To add the tracking code in multiple files, use a oneliner. Example: |
| #! /bin/sh | |
| ## | |
| # update-wordpress.sh It will update your WordPress installation using the utility wp-cli http://wp-cli.org | |
| # To keep your WP updated, you can copy this script into your /etc/cron.daily directory | |
| # Don't forget to add execution right and remove ".sh" extension from the filename. | |
| ## | |
| WPDIR=/var/www/myblog |
| #! /usr/bin/php | |
| <?php | |
| ## | |
| # mantis-users-survey.php: Asebetetze inkestaren esteka bidaltzen zaio erabiltzaileari, bere matxura | |
| # itxi ostean. Horretarako, script hau egunero exekutatu behar da CRON bitartez. | |
| # Adibidez: | |
| # 55 23 * * * /root/scripts/mantis-users-survey.php >> /root/scripts/mantis-survey.log | |
| ## |
| #! /bin/sh | |
| ## | |
| # update-drupal.sh It will update your Drupal installation using the utility Drush http://www.drush.org | |
| # To keep your Drupal updated, you can copy this script into your /etc/cron.daily directory | |
| # Don't forget to add execution right and remove ".sh" extension from the filename. | |
| ## | |
| cd /var/www/mydrupalsite | |
| drush up -y |
| #! /bin/bash -e | |
| # | |
| # Usage: | |
| # ./eb-installer.sh [OPTIONS] | |
| # [-f customconfigfile] [-h dbhost] [-u dbuser] | |
| # [-U dbadminuser] [-p dbpass] [-P dbadminpass] | |
| # [-n dbname] [-v version] [-y] [-d] [-I] | |
| # Config |
| #! /bin/sh -e | |
| # | |
| # File: /etc/cron.daily/reboot-when-required | |
| # Description: reboots the machine if its required | |
| if [ -f /var/run/reboot-required ]; then | |
| shutdown -r +5 "Reboot required. System will be restarted in 5min." | |
| fi |
| REM Uninstall Bash on Windows | |
| lxrun /uninstall /full /y | |
| REM TODO: Disable WSL feature | |
| REM TODO: Disable Developer Mode | |
| REM debugging-pause | |
| pause |