Skip to content

Instantly share code, notes, and snippets.

View nuhil's full-sized avatar
🎯
Focusing

Nuhil Mehdy nuhil

🎯
Focusing
View GitHub Profile

#Unix Tips & Tricks
Install imagemagick package
sudo apt-get install imagemagick php5-imagick

Exporting Path (Mac OSX)
a. In your ~/.bash_profile add the path ~/.composer/vendor/bin like following
export PATH=blahblahblah:~/.composer/vendor/bin:$PATH
b. Then reload
source ~/.bash_profile
c. Check if its added correctly

@nuhil
nuhil / Virtual-Machine-Troubles.md
Last active May 11, 2016 10:21
Virtual Box, Vagrant, Homestead, PuPHPet, Sequel Pro - Trouble Shooting!

VM Troubleshoots

Connect Homestead's mySQL through Sequel Pro


Host: 127.0.0.1
Username: homestead
Pass: secret
Port: 33060

Sequel Pro can't connect to Vagrant (Puphpet) Ubuntu's mySQL


@nuhil
nuhil / mysite.com
Last active September 19, 2019 05:35
Nginx Configuration for Slim
# Assume that inside the 'Slim' directory,
# there is another directory named 'api' inside which there is the index.php file
# '/home/vagrant/Code/' is simply a synched folder from host machine to this directory
server {
listen 80;
server_name www.mysite.com mysite.com;
root /home/vagrant/Code/Slim;
try_files $uri /api/index.php;
@nuhil
nuhil / nginx-header-by-php
Created March 6, 2015 15:12
Nginx - Get header data by PHP
<?php
foreach (getallheaders() as $name => $value) {
echo $name.':'.$value;
}
@nuhil
nuhil / nginx-vhosts.md
Last active August 29, 2015 14:16
Nginx Create Virtual Host

Create Virtual Hosts in Nginx @Ubuntu

1. Setup


sudo apt-get install nginx

2. Create new directory


sudo mkdir -p /var/www/example.com/public_html

3. Give permissions

@nuhil
nuhil / supervisord.md
Last active August 29, 2015 14:17
supervisord troubleshoot

1. Check which supervisor process is running with which configuration


ps -ef | grep supervisord

2. Should get following output in terminal


root      2204     1  0 22:57 ?        00:00:00 /usr/bin/python /usr/bin/supervisord -c supervisor.conf
ubuntu    2791  1394  0 23:10 pts/0    00:00:00 grep --color=auto supervisord
@nuhil
nuhil / bongabdo-usage.js
Last active June 4, 2017 09:00
gist for bongabdo jQuery plugin
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="jquery.bongabdo.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.bongabdo').bongabdo();
});
</script>
@nuhil
nuhil / vagrant-vm.md
Last active November 2, 2017 19:30
Creating Virtual Machine with Vagrant Box

#Creating Virtual Machine with Vagrant Box
Step 1. Install VirtualBox and Vagrant in your main computer.

Step 2. Download a vagrant box from here and save anywhere in your main computer. To have a Ubuntu 14.04 64 bit Download.

Step 3. Add the newly downloaded box to your vagrant
vagrant box add NEWNAME PATH/SAVEDNAME
Here, NEWNAME is anything of your choice. Like, Ubuntu-14-04-64. PATH/SAVEDNAME is where you downloaded the vagrant box (path along with file name).

Step 4. Go to the location where you want to create a Vagrant Virtual Machine

@nuhil
nuhil / HTTP-STATUS-CODES.md
Last active May 11, 2016 10:22
HTTP Status Code Definitions - Can be Used While Developing REST API

HTTP Status Code Definitions

Informational 1xx

This class of status code indicates a provisional response.

Code Text Description
100 Continue The client SHOULD continue with its request.
101 Switching Protocols The server understands and is willing to comply with the client's request.
@nuhil
nuhil / osx-tips.md
Created June 17, 2015 07:47
OSX Tips & Tricks

#OSX Tips & Tricks
Disable the Internal Laptop Display
sudo nvram boot-args="niog=1"
After executing the terminal command, reboot and close the lid immediately. Keep the lid closed during boot up, and once logged in to a user account in OS X, open the lid. If in sleep mode, just close the lid before waking the MacBook Pro and open the lid once again after logging back in.

To undo and return to normal display behavior:
sudo nvram -d boot-args
Similar to prior versions of OS X, resetting the PRAM can also disable the setting.