I added a function to my .bashrc to parse the git branch I'm currently working in and display it in my bash-prompt according to several tutorials on this topic. My code snippet looks like this:  parse_git_branch() {     BRANCH=$(git branch 2&gt; /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')    if [ "$BRANCH" != "" ]; then       echo -e "[\e[1;31m⎇ $BRANCH\e[1;37m]"    else       echo "╼"    fi } if [ "$color_prompt" = yes ]; then     PS1='${debian_chroot:+($debian_chroot)}\[\033[1;37m\]┌[\[\033[1;32m\]\u\[\033[1;37m\]@\[\033[1;32m\]\H\[\033[1;37m\]] [\w]\n└$(parse_git_branch) \[\033[00m\]'  else     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi unset color_prompt force_color_prompt   This does as expected print the current git branch in red if there is one:   However, if the command is really long, the line doesn't break anymore:    The problem goes away if I don't use the -e flag for echo in parse_git_branch, but I need it to color the branch red.  Any ideas on how to fix this?   All the other solutions I found while googling this just print either the colored git branch or nothing, so they don't quite work for me since i want it to print the git branch if there is one and if not print that ╼-character in white.
See my edit below, this is not totally a duplicate of   My reverse-search function in the CLI is broken and I don't know how to fix it back...  When I hit ctrl+r and search a command I did earlier, find it then press the right arrow key to use it, the output is broken. Here is an example:  # I reverse-searched the word "test" then pressed right arrow yoshiji@x1carbon:~/path/to/git/folder (master) $ch)`test': rake test #                                              ^^^^^^^^^^ weird output #                                                     ^ cursor right there   It also "shifts" my cursor to a different position. If I press enter, the right command is executed (rake test in this case) so it means the text displayed is not the same as what is actually executed.  I know this is most-likely related to my PS1 export in my ~/.bashrc, so here are the last lines of this file:  # Git branch in prompt. git_branch() {   branch=$(__git_ps1 2&gt; /dev/null)   if [ "$branch" = " (master)" ]; then      echo -e "\033[33m${branch}\033[00m" # yellow   elif [ "$branch" = "" ]; then      echo -e "\033[90m (no git)\033[00m" # red   else      echo -e "\033[32m${branch}\033[00m" # green   fi } PS1='\u@\h:\w$(git_branch) \$ '   This is something I wrote to displays the git branch in orange (if master branch) or else in green (or no git in gray).  Do you guys have any idea on what is causing this weird behavior?    Edit: This is a different problem from the  in the way that I am using echo -e "some string" to return a string having color+name of the git branch from the function git_branch(). Using echo -e does not escape the characters \[ and \] (try it yourself in your CLI: echo -e "\[\033[33m\]test").  Ideally, I would like to keep those conditional colors based on the branch's presence &amp; name (gray if no branch, orange if master, else green).
The tilde operator in Python Proxying fake domain to a localhost port I'd like to do much the same thing described at  for web app development purposes, but with the twist that I'd like requests to fakedomain.com:80 to be routed to localhost:8080, say, so that I don't have to actually use my development machine's port 80.  I'd welcome answers that take the form of:   Small changes to configuration files like /etc/hosts, and/or An easy-to-configure proxy server I could run   Note:  takes the approach of setting a firewall rule to forward all incoming traffic on port 80 to port 20559. That may be an acceptable solution, but ideally, I'd like to forward only a specific domain + port combination. My question is, how would I make the visible HDRI/Enviroment Map be image 1 and then have reflections as Image 2? If someone can post a node setup, or a .py file that would be great &lt;3 I was thinking maybe using the Is Camera Ray node but I'm not confident it would work, and have no idea where to start. Which one is correct: "Do you wake at seven?" or "Do you wake up at seven?" Someone said to me that the first one is the correct answer, because you use "wake up" to ask someone to stop sleeping. But I think the first one does not sound natural. Recently I created a website with hundreds of thousands of unique pages. A week ago, Google had indexed about 250,000 pages. It has now decreased to 90k URLs (using a site:domain.com query).   What should I do to have Google index all the pages again? Why did all these pages get de-indexed from Google?. Clear item with custom name? How do you clear 1 item from the inventory that has a custom name? What I'm trying to do is make a torch that when you hold it, it gives you Night Vision effect but after like 400 ticks or so I want the torch to run out of fuel and clear 1 torch away from the inventory, I have the potion effects (giving and taking away) working and the testfor command but how do I clear the item? this is my code I'm trying to use /clear @a torch 1 1 {display:{Name:"Special Torch"}} I'm very new to GIS concepts. Is there a way or procedure of finding out whether the co-ordinate system is in UTM, latitude/longitude or in stateplane using .prj file?   My .prj file contains the following text:      GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS   84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]] Public-key cryptographic systems are often implemented on top of an existing problem. For example, RSA is built on top of integers and the difficulty of factoring. ECDSA/ECIES are built on top of elliptic curves and the difficulty of the discrete logarithm.  My question is, what are, mathematically speaking, the exact primitives needed to implement public-key based signature and encryption cryptography in a generic way? I'm using Drupal 7.  Is it possible to add a CC to a webform email?  I was using   function theme_webform_mail_headers($variables) {   $headers = array(     'X-Mailer' =&gt; 'Drupal Webform (PHP/' . phpversion() . ')',   );   return $headers; }   changing it with      function MYTHEME_webform_mail_headers($variables) {       $headers = array( 'CC' =&gt; 'ccmeail@domain.com', 'X-Mailer' =&gt; 'Drupal Webform (PHP/'. phpversion() .')',  );       return $headers;     }   It does not work, I've cleared all the chaches and it does not add the CC. How could I add the CC?  Thanks in advance. How to redirect a URL to a custom IP address? I have an Ubuntu machine that I'm using as my home Internet router.  It uses a USB mobile broadband modem as its Internet connection, and shares this with another router (via the router's "Internet" port) which I use as my LAN.  How do I redirect requests from within my LAN for a given URL to a custom IP address (ex have google.com redirect to x.x.x.x)? POSTFIX main.cf permission denied I am trying to set up a postfix server for smtp relay. Centos 5.5  I have followed  but am getting a FAILED error when trying to restart or reload postfix.  When I do:  cat maillog   I get:  fatal: open /etc/postfix/main.cf: Permission denied   Here is what I have tried:  chown postfix /etc/postfix/main.cf chmod u+rwx /etc/postfix/main.cf   After that, I do:  ls -l /etc/postfix/main.cf   Which gives me:  -rwx------. 1 postfix anotheruser 27531 Apf 29 12:19 /etc/postfix/main.cf   No dice. Same error. I even tried temporarily doing chmod 777 but got same error.  Any ideas on the permissions problem? I am assuming it is running the service as the postfix user.  Thanks Ok, after seeing , I have decided to skip to the end and go with .  So what I need is a beginner's practical guide to Git.  "Beginner" being defined as someone who knows how to handle their compiler, understands to some level what a  is, and has touched source control without understanding it very well.  "Practical" being defined as this person doesn't want to get into great detail regarding what Git is doing in the background, and doesn't even care (or know) that it's distributed.  Your answers might hint at the possibilities, but try to aim for the beginner that wants to keep a 'main' repository on a 'server' which is backed up and secure, and treat their local repository as merely a 'client' resource.  So:  Installation/Setup    How do you set up Git?  Try to cover Linux, Windows, Mac, think 'client/server' mindset.         Working with the code          How do you handle binary files (visio docs, for instance, or compiler environments)? How do you merge files changed at the "same time"?    Tagging, branching, releases, baselines    How do you pull a particular 'release'?   How do you resolve conflicts and complete the merge? How do you merge parts of one branch into another branch?        Other   Describe and link to a good GUI, IDE plugin, etc. that makes Git a non-command line resource, but please list its limitations as well as its good.    - Cross platform, included with Git  - Cross platform history viewer, included with Git  - Mac OS X  - Mac OS X history viewer  - Cross platform, commercial, beta  - console GUI for Linux  - GUI for Windows, Linux  - package for Windows, includes friendly GUI  Any other common tasks a beginner should know?     How do I work effectively with a subversion repository set as my source control source?   Other Git beginner's references                 Delving into Git     (and )    I will go through the entries from time to time and 'tidy' them up so they have a consistent look/feel and it's easy to scan the list - feel free to follow a simple "header - brief explanation - list of instructions - gotchas and extra info" template.  I'll also link to the entries from the bullet list above so it's easy to find them later. Difference between "been to" and "been in" Stack Exchange OpenID credentials not removed on logout, allowing insecure re-login Algebraic closure of $\mathbb F_p$ Remap a key combination to another combination, e. g. Super+Ctrl+Shift+J -> Ctrl+Shift+Left When is the move constructor called in the `std::move()` function? I read the following dev email  and when i read this part:  Note that this does not completely remove the ability for extensions (e.g. Dropbox) to add emblems programmatically by using the libnautilus-extension library, just the user-added emblems from the properties dialog/emblems sidebar.   There is ability to bring emblems programmatically. So, How can i use libnautilus-extension library to add some emblems like Dropbox does? Or is there any tweak tool for this? In the book Limit Theorems of Probability Theory by Valentin V. Petrov, I saw a distinction between the definitions of a distribution being &quot;continuous&quot; and &quot;absolutely continuous&quot;, which is stated as follows:  &quot;...The distribution of the random variable $X$ is said to be continuous if $P\left(X \in B\right)=0$ for any finite or countable set $B$ of points of the real line. It is said to be absolutely continuous if $P\left(X \in B\right)=0$ for all Borel sets $B$ of Lebesgue measure zero...&quot;  The concept I am familiar with is:  &quot;If a random variable has a continuous Cumulative Distribution Function, then it is absolutely continuous.&quot;  My questions are: are the two descriptions about &quot;absolute continuity&quot; in (1) and (2) talking about the same thing? If yes, how can I translate one explanation into the other one? How to convert mediawiki syntax to latex?