Monday, October 28, 2013

Tuesday, October 22, 2013

Install wget in Mac using terminal

This is my history from the terminal installing wget in mac

210  which wget
  211  curl -O
  212  tar -xzf wget-1.13.4.tar.gz
  213  cd wget-1.13.4
  214  ./configure --with-ssl=openssl
  215  make
  216  sudo make install
  217  wget --help
  218  cd .. && rm -rf wget*
  219  ls
  220  history

Monday, October 21, 2013

Check and curl the file list.

So, I had downloaded a bunch of files using curl.
However, the number of files seem to be less than what I had in the list.

Simple program to check if the file exists, else download using curl.

My trouble was that the list had repeated items. Had not checked before running around... Sigh!


fid = fopen('urls.txt');
flist = textscan(fid, '%s');

for jj = 1:length(flist{1})
    fn = flist{1}{jj}
    fnlocal = fn(28:length(fn));
    if exist(fnlocal,'file')>0
        % do nothing
        command = ['curl -L -O ' fn];

Install using software-center in Ubuntu

So I had trouble getting Meld diff viewer software using the software center.
Whenever I tried to install it, it asked the password for the first user.

This can be solved by sudoing the software center from terminal
$ sudo software-center

Then Install the Meld diff viewer.

Friday, October 18, 2013

Download from list using curl in shell/terminal

So, I had to get data from a text file with the list of url.
I saved the url (one per line) in a txt file. Then executed the command
-O saves teh given name in the server. -L gracefully handles redirects if any.

xargs -n 1 curl -O -L < urls.txt

Remove "Subscribe to: posts (atom) " from Blogger

Search for "blog feed links" Change "!=" tp "==" so that subscribe to posts will be visible only in the posts page.
  <b:if cond='data:blog.pageType == "item"'> <!-- Blog feed links -->
If you want to remove the subscribe to comments feature, then remove the following:
  <b:include data='post.feedLinks' name='feedLinksBody'/>

In the following block:

  <b:includable id='feedLinks'>
  <b:if cond='data:blog.pageType == "item"'> <!-- Blog feed links -->
    <b:if cond='data:feedLinks'>
      <div class='blog-feeds'>
        <b:include data='feedLinks' name='feedLinksBody'/>

    <b:else/> <!--Post feed links -->
    <div class='post-feeds'>
      <b:loop values='data:posts' var='post'>
        <b:if cond='data:post.allowComments'>
          <b:if cond='data:post.feedLinks'>
   <b:include data='post.feedLinks' name='feedLinksBody'/>         

Saturday, October 12, 2013

Creating CDF plot.

Generate a CDF plot

close all
y = randn(1,40000);
% xlimit([-3,3])

  saveas(gcf, ['SAVE/''Histogram-Gaussian', num2str(mm)], 'png')

  saveas(gcf, ['SAVE/''CDF-Gaussian', num2str(mm)], 'png')

Monday, October 7, 2013

Load saved figure and save in fullscreen size

% Load figure
filename =dir;
for jj = 3:length(filename)
    this = filename(jj).name;
    hfig=  openfig(this,'reuse');
    set(hfig,'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);

 %     saveas(gcf,[this,'.png'])
% pause