https://bigbluebutton.org
https://www.canvaslms.com
https://moodle.org
Category: General
-
PrestaShop 1.6 regenerate htaccess
To regenerate PrestaShop .htaccess file
1) Login to admin area.
2) Go to Preferences > SEO and URLs
3) Enable Friendly URL and click Save. -
Reset Prestashop 1.6 admin password
To reset admin password for prestashop 1.6 or below, find value of _COOKIE_KEY from file
config/settings.inc.php
The line look like
define('_COOKIE_KEY_', 'AySbNFrmveDOXDnEwiAEGxWAOYbckI1Vx2hDpu1JwgNFj19bPUyi6HBc');
Now you need to update ps_employee table using following SQL command.
update ps_employee set passwd=md5("AySbNFrmveDOXDnEwiAEGxWAOYbckI1Vx2hDpu1JwgNFj19bPUyi6HBcYOUR_NEW_PASSOWRD_HERE") where id_employee=1;
Replace “YOUR_NEW_PASSOWRD_HERE” with your new password.
ps_employee maybe differnt depending on what table prefix you selected during prestashop installation.
id_employee=1, change this with id_employee of the user you need to change password. 1 is id for first user.
Once password reset, you will be able to login to admin area. Normally prestashop rename admin folder to random name, this you can find it in FTP as it is just a normal folder.
-
Preview Website Before Name Server Change
When migrating web site to new server, it is good to test the site from new server before you actually change the name servers. Doing this will avoid unexpected errors after you make site live from new server.
To do this, you need to edit file with name hosts on your computer. Add following content to it.
NEW_IP_ADDRESS www.yourdomain.com yourdomain.com
Example
127.0.0.1 www.serverok.in serverok.in
At this point, if you take command promt on you computer and type folloing command, you will see the new server IP.
ping www.yourdomain.com
Now you may need to restart the browser for browser DNS cache to clear. Now you will be able to see the site from new server.
Location of hosts file
Location of hosts file depends on Operating System you use.
Windows
You need to edit the file c:\Windows\System32\Drivers\etc\hosts
To open, you need Administrator privilage, so run notepad as user “Administrator”, then open above file to edit it.
Linux and Mac
The file is located in /etc/hosts, to edit use
sudo vi /etc/hosts
-
Visual Code Studio
I was using Sublime Text as my text editor. Recently switched to Visual Code Studio, it is an open source editor from Microsoft, it works on Windows, Linux, and Mac. You can download it from
https://code.visualstudio.com/
Here are some shortcuts I use
ALT+Z = Wordwrap CTRL+SHIFT+I = insert date (for this, you need "Insert Date String" extension installed) CTRL + / = comment selected block of text CTRL + SHIFT + A = comment select block of text
Visual Code Studio Tab key not working
How to Install Visual Studio Code Server -
PHP Script to pull changes from GIT Repository
Here is a PHP script, that pulls the latest code from Git Repository to your website.
&1", $r2); echo "
"; foreach ($r2 as $line) { echo $line . "\n"; } unset($r2); echo "\n\n"; echo "------------------------------------------------------"; echo "\ngit status\n"; echo "------------------------------------------------------"; echo "\n\n"; $result = exec("git status 2>&1", $r2); echo "
"; foreach ($r2 as $line) { echo $line . "\n"; }
https://gist.github.com/serverok/7efc12fcd75aac21309dbe234d9030f6
Upload the file to your web server as git-pull.php, access it with URL
https://yourdomain/git-pull.php?pw=YOUR_PASSWORD_HERE
For this script to work, your web server should work as the user that owns the files. If your webserver runs as www-data, you need to chown the files as www-data.
Example
chown -R www-data:www-data /path/to/doc/root/
See git