Skip to content

Instantly share code, notes, and snippets.

View a7madgamal's full-sized avatar

Ahmed Hassanein a7madgamal

View GitHub Profile
@a7madgamal
a7madgamal / fstab
Created April 15, 2014 10:25
fstab permissions fix for mounting drives
uid=1000,gid=1000,umask=002 0 0
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@a7madgamal
a7madgamal / gist:38121322f411edf18a6a
Last active August 29, 2015 14:06
install composer globally
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
#in .bashrc
export PATH="$PATH:~/.composer/vendor/bin"
In Terminal, paste the following: defaults write com.apple.finder AppleShowAllFiles YES
Press return
Hold the ‘Option/alt’ key, then right click on the Finder icon in the dock and click Relaunch.
@a7madgamal
a7madgamal / apparix.sh
Last active January 1, 2016 07:29
path bookmarks for terminal,"sudo apt-get install apparix" then append the gist code to the ~/.bashrc file =========================================== syntax: cd /very/long/bath/to/very/deep/folder/ >bm notsolong now wherever you are,this command takes you to your bookmark >to notsolong
function to () {
if test "$2"; then
cd "$(apparix "$1" "$2" || echo .)";
else
cd "$(apparix "$1" || echo .)";
fi
pwd
}
function bm () {
if test "$2"; then
@a7madgamal
a7madgamal / passwordless_ssh
Last active January 1, 2016 07:29
passwordless ssh connection
# step 1: on local machine
# (for first time only!)
ssh-keygen -t rsa
#copy the result exactly
cat ~/.ssh/id_rsa.pub
# step 2:on remote machine
ssh-copy-id <remote>

Installing git on CentOS 5 using yum

Since you're using CentOS 5, the default package manager is yum, not apt-get. To install a program using it, you'd normally use the following command:

$ sudo yum install <packagename>

However, when trying to install git this way, you'll encounter the following error on CentOS 5:

cd /var/www/
sudo chown -R www-data:www-data html
javascript:(function(){var h,a,f;a=document.getElementsByTagName('link');for(h=0;h<a.length;h++){f=a[h];if(f.rel.toLowerCase().match(/stylesheet/)&&f.href){var g=f.href.replace(/(&|%5C?)forceReload=\d+/,'');f.href=g+(g.match(/\?/)?'&':'?')+'forceReload='+(new Date().valueOf())}}})()
@a7madgamal
a7madgamal / createBearerToken.js
Created April 14, 2016 17:02 — forked from elmariachi111/createBearerToken.js
A Javascript file that requests a Twitter bearer token for application only authentication (https://dev.twitter.com/docs/auth/application-only-auth). Depends on mikeals request library (https://github.com/mikeal/request) (npm install request)
var R = require("request");
var key = process.env.TWITTER_CONSUMER_KEY;
var secret = process.env.TWITTER_CONSUMER_SECRET;
var cat = key +":"+secret;
var credentials = new Buffer(cat).toString('base64');
var url = 'https://api.twitter.com/oauth2/token';
R({ url: url,