Tag: Bash

  • Authentication – Subversion on command line will not remember credentials

    I ran into this issue today on my command line SVN client.
    Every time I ran the SVN command against my repository, it asks for my password. It does remember the username but doesn’t store the password.
    There are a couple of settings to check in two different files:

    • .subversion/config
    • .subversion/servers

    .subversion/config

    The config file contains a setting which sets the password store you will be using. We need to disable all password stores and use an empty list, which is done by uncommenting (or adding) the next line

    password-stores =

    .subversion/servers

    The servers file contains settings which allow you to save your passwords in general and to save the passwords in plaintext (please be careful when choosing this option!)
    This file is divided in sections which are set with the [] brackets. In the [global] group you should uncomment (or add) the following lines:

    store-passwords = yes
    store-plaintext-passwords = yes
  • See which SVN user editted which line

    This is one quite cool trick where you can see which edit’s were done to a file by which user:
    Issue the following command on a file which is checked in to SVN:

    svn blame filename

    Which will output the following syntax:

    revision <tab> username <tab> line in filecontents

    Please look at this example :

    21672 jvisscher   declare namespace urn = "namespace:customer:v01";
    21672 jvisscher   declare namespace urn1 ="namespace:customer:v01";
    21673 mycolleague declare namespace urn2 = "namespace:v01";
    21673 mycolleague declare namespace urn3 = "namespace:v01";
    21674 mycolleague declare namespace urn4 = "namespace:v01";

    Awesome! Now I can quickly see that my colleague was the cause of my failing namespace!
    As a sidenote: I really like the function’s name, because most of the time, you’re looking to blame someone 😉

  • Supercharge your CLI bash history search

    This is a repost from https://coderwall.com/p/oqtj8w but it’s so handy, I want to share anyway 🙂
     
    Create ~/.inputrc and fill it with this:

    "\e[A": history-search-backward
    "\e[B": history-search-forward
    set show-all-if-ambiguous on
    set completion-ignore-case on

     

    This allows you to search through your history using the up and down arrows … i.e. type “cd /” and press the up arrow and you’ll search through everything in your history that starts with “cd /”.
  • Pretty print XML on Linux Command Line BASH

    It’s quite handy to indent XML when you need to read it with the human eye, but on a terminal it’s often not as easily readible.
    Fortunatly there’s a command which’ll indent it so you can actually read it;
    xmllint –format file.xml
    This will show you how ugly it could be:
     

    Screenshot Unformatted XML on terminal
    Screenshot Unformatted XML on terminal

     
    And behold the indented beauty of this little gem:
    Screenshot indented XML on terminal
    Screenshot indented XML on terminal

  • Listen to streaming internet radio via terminal on Ubuntu

    Okay, so this might be a tad geeky, but I dislike overhead when I’m working on my work laptop.. And since I couldn’t find a streaming music player with a low memory footprint I loved this mplayer solution which can play your internet streams via a bash terminal.
    Apt-get install mplayer or mplayer2 and then just execute this command in any terminal

    mplayer http://pr320.pinguinradio.nl:80/

    Which will result in the following:

    Screenshot Mplayer in Terminal on Ubuntu
    Screenshot Mplayer in Terminal on Ubuntu

    And it will update the stream title through the console so you can still see which artist and song are playing! A thing of beauty, isn’t it!?