This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Doesn't matter how good programmer, system administrator or technologist you are. You always have to refer to online documentation or I say ask GOOGLE to recall | |
those commands. It pisses me a lot. I created this GIST to refer too, whenever I am stuck. | |
---------------------------------------------------------------------------------------------- | |
Privileges Management | |
---------------------------------------------------------------------------------------------- | |
$sudo :– run command as root | |
$sudo -s :– open a root shell | |
$sudo -i :-similar to sudo su - , gives you roots environment configuration | |
$sudo -s -u user name : – open a shell as user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you have migrated recently from Windows to Unix like operating system, you will be bit surprised, when you put any CD Rom or Pen Drive in your system, why doesn’t it get detected. So, why doesn’t it get detected? Because it is not mounted. | |
As you all know, Linux is working with Files. Device, Drive, Partition everything is File in here. I have told this earlier, working with device is as easy as you write into File and read from it. | |
Ubuntu and other latest release are capable to auto mount your drive/device/CD/DVD-ROM when you connect. | |
There are dedicated drives in Linux File System hierarchy to mount external devices/drives/CD-ROMs. They are /media/ and /mnt/ drives. So to mount into any of these two drives, just do, | |
#mount <what_to_mount> <where_to_mount> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------- | |
Install PHP 5.4.x | |
-------------------------------------------- | |
yum install \ | |
php54.x86_64 \ | |
php54-bcmath.x86_64 \ | |
php54-cli.x86_64 \ | |
php54-common.x86_64 \ | |
php54-dba.x86_64 \ | |
php54-devel.x86_64 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Node.js is a Javascript platform for server-side programming that allows users to build network applications quickly. | |
Building nodejs server in ubuntu is fairly simple and easy. With few commands you can make a nodejs server up and running in not time. | |
Nodejs generally runs of port 3000 but that is not mandatory, you can use any other port you want to make your server more customised. | |
There are few path, you can follow to get your Nodejs up and running on Ubuntu 14.04 | |
====================== | |
Distro-Stable Version | |
====================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.serializeObject = function(){ | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function(){ | |
if(o[this.name] !== undefined) { | |
if(!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} | |
o[this.name].push(this.value || ''); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# checks to see if running | |
launchctl list | grep mongo | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist | |
launchctl remove homebrew.mxcl.mongodb | |
pkill -f mongod | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You've a lot unused kernels. Remove all but the last kernels with: | |
sudo apt-get purge linux-image-{3.0.0-12,2.6.3{1-21,2-25,8-{1[012],8}}} | |
This is shorthand for: | |
sudo apt-get purge linux-image-3.0.0-12 linux-image-2.6.31-21 linux-image-2.6.32-25 linux-image-2.6.38-10 linux-image-2.6.38-11 linux-image-2.6.38-12 linux-image-2.6.38-8 | |
Removing the linux-image-x.x.x-x package will also remove linux-image-x.x.x-x-generic. | |
The headers are installed into /usr/src and are used when building out-tree kernel modules (like the proprietary nvidia driver and virtualbox). Most users should remove these header packages if the matching kernel package (linux-image-*) is not installed. | |
To list all installed kernels, run: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd my-project | |
heroku login | |
heroku create appname | |
git init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo sync && sudo echo 3 | sudo tee /proc/sys/vm/drop_caches |
OlderNewer