The sudo is needed as you can’t bind to a port number lower than 1024 as a normal user.
Session animated by Harry Percival based on the book http://www.obeythetestinggoat.com/
For having the handout:
- Django 1.7 beta
Nice display of the current tree
git log --graph --all --format=format:"%x09%C(yellow)%h%C(reset) %C(green)%ai%x08%x08%x08%x08%x08%x08%C(reset) %C(bold white)%cn%C(reset)%C(green)%d%C(reset)%n%x09%C(white)%s%C(reset)" --abbrev-commit "[email protected]"
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
You can also make an alias. Copy and paste the line below on your terminal:
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
And every time you need to see your log, just type in
Or, if you want to see the lines that changed
NB: If you want to see a list of aliases set up on your linux box, just type alias at the prompt.
Simply add color to your git environment:
Learn git from your browser: https://try.github.io/levels/1/challenges/1
To avoid doing all the time:
You can do:
You next, you will just have to do:
Find which commit is breaking the test with 'git bisect'
You may be in situation where you come back from holidays and find the tests that were passing before broken.
Git can help to find which commit produced the failure.
To start bisect, run:
You know that the tests are failing so you indicate it with:
You checkout an earlier revision when you know that the tests were passing (git log can help):
Then run the tests, and if they are passing, indicate it:
Once you have indicated that once it was bad and once it was good. You can leave git bisect do the job automatically:
You can now grab a coffee and come back few minutes later to see what commit made the tests failed.
Finally, you also need to come back to the original revision:
What is the original commit of a git repository?
You know git log to see the history of he commits.
Once you get the results of git log, you can do 'G' (capital G) to inverse the order of commits and see the first one in time.
Reduce the size of a git repository with the garbage collector
Something interesting when combined with svc:
It will monitor every 2 seconds the state of your service.
Monitor the queries being run in real time:
ssh -D 8888 [email protected]
Install foxyproxy addons.
Install Foxy Proxy standard: https://chrome.google.com/webstore/detail/foxyproxy-standard/gcknhkkoolaabfmlnjonogaaifnjlfnp
Then in Tools | Extensions | Options of FoxyProxy, change the settings.
Writing 'r' will move the cursor back to the beginning of the line.
This displays a percentage counter:
The built in tutorial of Vim is very useful to know the basics. To launch it simply type the following in your terminal:
It will launch some lessons with an approach 'learning by doing'.
The ~/.vimrc file provides Vim's default configuration
set textwidth=79 " lines longer than 79 columns will be broken set shiftwidth=4 " operation >> indents 4 columns; << unindents 4 columns set tabstop=4 " a hard TAB displays as 4 columns set expandtab " insert spaces when hitting TABs set softtabstop=4 " insert/delete 4 spaces when hitting a TAB/BACKSPACE set shiftround " round indent to multiple of 'shiftwidth' set autoindent " align the new line indent with the previous line
Highlight variable under cursor:
Move cursor to its last position:
The quickest way is to hit either:
(two apostrophes) or:
(two backticks). Note that the difference is that the backtick goes to the same location on the line, whereas the apostrophe goes to the start of the line. On a UK keyboard, the apostrophe is more accessible, so I tend to use that one. There are loads of useful marks like this, see :help mark-motions. For some other motions (not 2j I think), there's also the jump-list that lets you navigate back and forth among a number of motions. Ctrl-O and Ctrl-I do this navigation, but see :help jump-motions for more information.
To display line numbers along the left side of a window, type any one of the following command while using text editor:
Website hosted from my Github Repository
It is using Github Pages. Create a repository called username.github.io, where username is your username (or organization name) on GitHub and put your website files in there.
Website generation using a Python framework: Nikola
This website is using Nikola which is a Python static website generator. Assuming that you have created a github repository called username.github.io, clone it with:
git clone [email protected]:username/username.github.io.git
Then initialize your website with this command:
where username.github.io is the repository you have just cloned.
cd in this directory and execute this command:
The website will open at the url http://127.0.0.1:8000.
To deploy to Github, change the file conf.py such as:
Once you are happy with it, you can deploy to Github with the command:
Posts written using reStructuredText
Useful cheatsheet for the basics: http://github.com/ralsina/rst-cheatsheet/raw/master/rst-cheatsheet.pdf
This is also a way to learn how to use Vim. Since Nikola 7.0.1, you can use the -e option when creating a new post. But before, you need to set up a default editor. If you want to use vim, you can first locate it:
Then you can use it in the export variable:
Download a pre-built template from bootswatch
If you have the following error while installing nikola:
You can fix it with:
Since Nikola can be installed with Pip, you can use the following command:
To install pip, see http://pip.readthedocs.org/en/latest/installing.html
If you have the following error:
You can fix it with:
To upgrade pip:
To downgrade pip to a previous version:
Add your own domain
Log in to your domain provider website and change the forwarding value to the website url provided by Github-pages e.g. username.github.io