Skip to content

Instantly share code, notes, and snippets.

View psgganesh's full-sized avatar
🤖
Currently exploring: DS and ML

Shankar Ganesh psgganesh

🤖
Currently exploring: DS and ML
View GitHub Profile
@psgganesh
psgganesh / assignment3.md
Created March 11, 2018 12:58 — forked from mGalarnyk/assignment3.md
R Programming Programming Assignment 3 (Week 4) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera
@psgganesh
psgganesh / README.md
Last active February 12, 2018 04:11
Use laravel / envoy for smoother deployments on forge servers

Adding envoy globally using

composer global require laravel/envoy

Update ~/.bashrc file to enable envoy on CLI

echo 'export PATH="$PATH:/home/forge/.config/composer/vendor/bin"' >> ~/.bashrc
@psgganesh
psgganesh / README.md
Last active October 16, 2017 12:35
Pass that .env to JS !

Cleaner way to pass over .env vars to javascript ( Laravel .env -> .js )

There are times when we wanted to pass .env vars over to javascript, regardless of what type of framework is being used.

We tried the following methods.

  • Passed to a js var wrapped inside a laravel blade file - which works but when viewed over the browser all the vars will be visible.We have stumbled over code where the js is embedded
  • One step ahead, we used jeffery way's re-usable package PHP-Vars-To-JS
  • One step further, we started passing the values over the meta attributes instead of cluttering the .blade.php files
  • One more step ahead, probably this is the cleaner way - as .env is just another hidden file, why not let webpack and node read it !
@psgganesh
psgganesh / 0_readme.md
Last active August 14, 2017 02:31
Hijack laravel exceptions

In-house incident handling

Just like how services like

Would do. Just one change, those would be added inside laravel project as a package where they would hijack the same from.

@psgganesh
psgganesh / reference.md
Last active July 12, 2017 03:38
Eloquent Accessors and Mutators

Laravel Eloquent Accessors and Mutators

Eloquent Accessors - All "get's" getFirstNameAttribute( $value ) ...

Eloquent Mutators - All " set's " setFirstNameAttribute( $value ) ....

How to use

Declare in your model files

Where to use

@psgganesh
psgganesh / Digital ocean Floating IPs
Last active March 7, 2017 03:38
Using digital ocean floating IPs
Complete tutorial
https://www.digitalocean.com/community/tutorials/how-to-create-a-high-availability-haproxy-setup-with-corosync-pacemaker-and-floating-ips-on-ubuntu-14-04
Below is the main trouble-shooting steps missed on the above post.
As per: Pathfinder - https://www.digitalocean.com/community/users/pathfinder - Run below also.
sudo apt-get install python-pip
sudo pip install requests
@psgganesh
psgganesh / Digital ocean publickey denied
Last active March 10, 2018 20:17
Unable to access digital ocean after rebuild droplet ?
Login to console using digital ocean's browser based shell, login using root and the new password generated,
and carry on with below steps
sudo nano /etc/ssh/sshd_config
Change
UsePAM yes
IgnoreUserKnownHosts no
@psgganesh
psgganesh / ubuntu 16 vagrant
Created December 22, 2016 11:12
Ubuntu 16 vagrant
#Fix locale issue
http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue
sudo locale-gen en_US.UTF-8
# UFW rules to be enabled and added
https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands
# Maria DB
http://idroot.net/linux/install-mariadb-ubuntu-16-04/
@psgganesh
psgganesh / mautic.conf
Created September 14, 2016 14:36
Simple mautic nginx config
server {
server_name <domain name>;
listen 80;
root /var/www/social/public_html;
access_log /home/mautic/site/logs/access.log;
error_log /home/mautic/site/logs/error.log;
index index.php;
@psgganesh
psgganesh / 12.04-ubuntu14.04.sh
Created July 23, 2016 15:29
12.04 to 14.04 upgrade sh
sudo apt-get update
sudo apt-get install update-manager-core
lsb_release -a
sudo do-release-upgrade --check-dist-upgrade-only --devel-release
sudo do-release-upgrade --devel-release