Skip to content

Instantly share code, notes, and snippets.

View awd-git's full-sized avatar

Adrian World awd-git

  • Adrian World Design
  • Austin, TX
View GitHub Profile
// 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
@awd-git
awd-git / nodejs-install.txt
Created November 17, 2015 14:39
Ubuntu base node.js (and npm) setup
// 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
@awd-git
awd-git / linux-process-mgmt.txt
Last active November 14, 2015 20:43
Manage processes in Linux (Ubuntu)
// 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
// a default to deny access to all robots
User-agent: *
Disallow: /
//
@awd-git
awd-git / add-newuser.sh
Last active September 8, 2015 11:54
HowTo add user on ubuntu with sudo and ssh key access
# 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
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
@awd-git
awd-git / .htaccess
Created January 21, 2013 19:57
Default .htaccess configuration for Zend Framework and probably most other frameworks or CMS that funnel everything through a single php file.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]