Skip to content

Instantly share code, notes, and snippets.

@RodolVelasco
Last active September 21, 2018 13:51
Show Gist options
  • Save RodolVelasco/50658e3df15cf53aae2b178718248338 to your computer and use it in GitHub Desktop.
Save RodolVelasco/50658e3df15cf53aae2b178718248338 to your computer and use it in GitHub Desktop.
Debian 9
sudo apt-get install
sudo apt-get update
@RodolVelasco
Copy link
Author

RodolVelasco commented Sep 6, 2018

Downgrade from PHP 7.0 to PHP 5.6

Removing php7
sudo apt-get remove -y --purge php7.0*

Installing php5.6
sudo apt-get update
sudo apt-get install -y apt-transport-https curl
curl https://packages.sury.org/php/apt.gpg | sudo apt-key add -
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php5.list

Then
sudo apt-get update
sudo apt-get install -y php5.6
php -v

Output

PHP 5.6.33-1+0~20180105151408.9+stretch~1.gbp0deeda (cli) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

For more
sudo apt-get install php5.6-cli php5.6-common php5.6-curl php5.6-mbstring php5.6-mysql php5.6-xml php5.6-ldap mysql-client

sudo service apache2 restart

@RodolVelasco
Copy link
Author

Installing Cloud 9 IDE

sudo git clone https://github.com/c9/core.git c9sdk
cd c9sdk
sudo apt-get install build-essential
sudo scripts/install-sdk.sh
sudo apt-get install -y nodejs

In order to startup the server run:
sudo node server.js -w /var/www/html -p 8181 -l 0.0.0.0 --auth test:test

@RodolVelasco
Copy link
Author

RodolVelasco commented Sep 21, 2018

Crontab

Edit
sudo crontab -e
View
sudo crontab -l

Start/stop service
sudo service cron restart
tail -f /var/log/syslog

Examples
15 6 * * * /usr/bin/php /var/www/html/tag-server/test.php > /var/log/TI/`date +\%Y-\%m-\%d_\%H:\%M:\%S`_suf_ad_user-.log 2>&1

0 0 * * * sudo indexer --rotate --all --config /etc/sphinxsearch/sphinx.conf > /var/log/TI/`date +\%Y-\%m-\%d_\%H:\%M:\%S`_sphinx_indexer.log 2>&1

 ┌───────────── minute (0 - 59)
 │ ┌───────────── hour (0 - 23)
 │ │ ┌───────────── day of the month (1 - 31)
 │ │ │ ┌───────────── month (1 - 12)
 │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
 │ │ │ │ │                                   7 is also Sunday on some systems)
 │ │ │ │ │
 │ │ │ │ │
 * * * * * command to execute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment