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
// HEAD~2 squashes the last two commits | |
// HEAD~3 the last three | |
// ... and so on | |
// this is the example for last three | |
git reset --soft HEAD~3 && git commit | |
// to push everything to origin, i.e. remote on github.com | |
git push origin [branch-name] --force |
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
// first add node.js to the APT package catalog | |
// node.js Version 5.x | |
$ curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash - | |
// node.js Version 4.x | |
$ curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - | |
// always a good idea to re-synchronize the whole package index | |
$ sudo apt-get update |
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
// Easiest way to find out what processes are running | |
$ top | |
// Improved version of top. Install on ubuntu as: | |
$ sudo apt-get install htop | |
// run htop same as top | |
$ htop | |
// Listing running process with ps | |
// ps itself won't show much |
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
// a default to deny access to all robots | |
User-agent: * | |
Disallow: / | |
// |
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
# Add user to a ubuntu system with sudo rights | |
if [ "$1" == '' ]; then | |
echo "Please add a username to the command" | |
exit 1; | |
fi | |
newuser=$1 | |
# NOTE: adduser has option --ingropup and --add_extra_group | |
# but they cannot be used to add user at the same time to a |
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
Basics first | |
------------ | |
Starting screen | |
--------------- | |
Start screen by typing screen and hit enter | |
Confirm welcome message with space bar | |
C-a means nothing more than Ctrl-a | |
This basically makes screen listen to commands, i.e. any following key stroke is your requested action |
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
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} -s [OR] | |
RewriteCond %{REQUEST_FILENAME} -l [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^.*$ - [NC,L] | |
RewriteRule ^.*$ index.php [NC,L] |