Friday, February 13, 2015

#AHK Swap ctrl with ALT and highlight to copy text

Here is a nice Autohotkey command to set up the  and swap ctrl with ALT and highlight to copy text.

Copy with highlight because I worked with terminal a lot and had to manually copy and paste into the terminal.
If I do not want the highlight to copy the items, just kill the ahk process from the taskbar, and life is normal again! Note that it is only effective to the highlights by the left click and drag. Not the shift and arrow highlights.

To activate the ahk script, save the script as alt-ctrl-mouse.ahk. Install AHK software, then drag the script file to startup folder inside the start menu. The script will be activated when you log in.

; Switches the left Control and Alt keys.

LCtrl::Alt

LAlt::Ctrl
; code below are used to copy the mouse-highlighted items.
 
~$LButton Up::
{
 Send ^c
    Sleep 2
}
return

Saturday, February 7, 2015

Match airs data granules in a folder

the reverb search came short. But I had the list of c05 data. That meant I could mimic the site/doy and have the wget -nc -i to the list.
asdf = importdata('\\taal\collectionsin\primary\airsc6\2003\c52003.txt')
 fid = fopen(['\\taal\dai\download2\missed3.txt'] , 'w') ;

for jj = 1:length(asdf)-4
gettxt = asdf{jj} ;

if length(gettxt)<57 & length(gettxt)>10
%get the day of the year for 2003 $$$$$
doy = datenum([str2num(gettxt(6:9)),str2num(gettxt(11:12)),str2num(gettxt(14:15))])  - datenum(2003,1,1) + 1;

ftploc = ['ftp://site/2003/', sprintf('%03d',doy), '/', gettxt(1:23),'*.hdf'];
% doy = datenum([2005,2,31]) - datenum(2005,1,1) + 1
fprintf(fid,'%s\n',ftploc);
end   
end
% newwget1 = newwget1';
fclose(fid) ;
 'done! now copy to the place and happy wget!'


Thursday, February 5, 2015

Get C06 from C05 convention

A quick way to find collection 6 files when you have the c05 download script files


asdf2 = importdata('wget-2004.txt');

want = round(linspace( 1,length(asdf2)+1,20));
 
for jj = 1:length(want)-1
    fprintf( '%d - %d\n',  [want(jj) want(jj+1)-1])
% end
  
 fid = fopen(['\\taal\dai\download2\',num2str(jj) ,'get.txt'] , 'w') ;

for kk= want(jj):want(jj+1)-1 %3001:7521%length(asdf)
    try
    newg{kk} = [asdf2{kk}(1:103),'*.hdf'];
         fprintf(fid,'%s\n', newg{kk});
    catch
        continue
    end
    end
% newwget1 = newwget1';
     fclose(fid) ;
end

clear all
asdf = importdata('\\taal\c\primary\airs\2005\wget-file-2005q3');
for jj = 2%:length(want)-1
 
 fid = fopen(['\\taal\dai\download2\',num2str(jj) ,'.txt'] , 'w') ;
for kk= 1:length(asdf) % want(jj):want(jj+1)-1 %
    try
    newg{kk} = [asdf{kk}(1:103),'*.hdf'];
         fprintf(fid,'%s\n', newg{kk});
    catch
        continue
    end
end
% newwget1 = newwget1';
     fclose(fid) ;
end
'done! now replace 2005 with 2006'