<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8445360611672796425</id><updated>2024-09-11T22:00:28.770-07:00</updated><category term="Linux"/><category term="command"/><category term="operation"/><category term="software"/><category term="programming language"/><category term="MacOS"/><category term="open source software"/><category term="Groovy"/><category term="Cygwin"/><category term="Java"/><category term="iOS"/><category term="vi"/><category term="yum"/><category term="GIMP"/><category term="Maven"/><category term="Mule"/><category term="Trackball"/><category term="Windows"/><category term="Windows 7"/><category term="Windows7"/><category term="Xcode"/><category term="chown"/><category term="cocos2d"/><category term="dpkg"/><category term="email"/><category term="iPad"/><category term="retina"/><category term="su"/><category term="symlink"/><title type='text'>Shared Knowlege, Keep It Handy</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-5405132437425097490</id><published>2014-06-02T14:26:00.003-07:00</published><updated>2014-06-02T14:33:26.012-07:00</updated><title type='text'>Suppress some Spotlight activities on Mac</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
I use git for work and most of the time, with a lot of branches. Every time I switch from branch to branch, and do a clean build, Spotlight gets so busy in the background (mds, mdworker). All those indexing work takes a lot CPU time and disk IO. But those efforts are pretty wasted. I use IDE for text search, and in another hour or two, I switch to another branch.&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
It is possible to suppress some Spotlight activities. From System Preferences, Spotlight, in the privacy tab, put the directory of git repository in the not-to-index list. Save CPU usage, battery, and generate less heat.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/5405132437425097490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2014/06/suppress-some-spotlight-activities-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/5405132437425097490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/5405132437425097490'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2014/06/suppress-some-spotlight-activities-on.html' title='Suppress some Spotlight activities on Mac'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-4210252889520803975</id><published>2013-02-02T13:16:00.003-08:00</published><updated>2013-02-02T13:16:59.859-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Trackball"/><title type='text'>Disable trackpoint on ThinkPad running Ubuntu</title><content type='html'>I run Ubuntu 12.04.1 LTS on ThinkPad. Most of the time,&amp;nbsp;the track point gets in the way. I disable it with this command,&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;xinput -set-prop &quot;TPPS/2 IBM TrackPoint&quot; &quot;Device Enabled&quot; 0&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/4210252889520803975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2013/02/disable-trackpoint-on-thinkpad-running.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/4210252889520803975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/4210252889520803975'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2013/02/disable-trackpoint-on-thinkpad-running.html' title='Disable trackpoint on ThinkPad running Ubuntu'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-8098631309178642207</id><published>2012-07-10T11:01:00.002-07:00</published><updated>2012-07-10T11:02:23.088-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GIMP"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="MacOS"/><category scheme="http://www.blogger.com/atom/ns#" term="open source software"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>GIMP 2.8 has arrived</title><content type='html'>GIMP (GNU IMAGE) 2.8 is here.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
It just occurred to me the other day that GIMP was working on 2.8. I thought I would like to check it out. &amp;nbsp;When I got there (www.gimp.org), it is there.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I like the single view mode (under menu Windows, Single-Window-Mode). &amp;nbsp;It solved the only complaint I had with GIMP in the past. That is to click twice in order to re-focus on the other window when switching between tool/editor/layer windows.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I have not checked out what else is new in it. GIMP is one of a few open source projects I appreciated and used frequently. I would expect to continue creating a lot of digital assets from GIMP for my iPhone app projects.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/8098631309178642207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2012/07/gimp-28-has-arrived.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/8098631309178642207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/8098631309178642207'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2012/07/gimp-28-has-arrived.html' title='GIMP 2.8 has arrived'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-630780257104025747</id><published>2012-03-30T11:34:00.000-07:00</published><updated>2012-03-30T11:34:40.464-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="email"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="open source software"/><category scheme="http://www.blogger.com/atom/ns#" term="programming language"/><category scheme="http://www.blogger.com/atom/ns#" term="software"/><title type='text'>Combine gmail and Java mail library to create your email compaign</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
If you use gmail for your company, you can run your own email campaign without paying those email campaign companies. &amp;nbsp;Write a small script or Java program to pull user data from your database and create a pretty HTML based email template. If you want to track them, insert the tracking in the HTML content. &amp;nbsp;Use the following code to start sending emails to your users. &amp;nbsp;Just be sure not to abuse the gmail account.&lt;/div&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import java.io.File;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import java.util.Date;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import java.util.List;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import java.util.Properties;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import javax.activation.DataHandler;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import javax.activation.DataSource;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import javax.activation.FileDataSource;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import javax.mail.*;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import javax.mail.internet.InternetAddress;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import javax.mail.internet.MimeBodyPart;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import javax.mail.internet.MimeMessage;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;import javax.mail.internet.MimeMultipart;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;public class Mailman extends javax.mail.Authenticator&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; private String smtpServer;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; private String from;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; private String password;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; private boolean useAuth;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public Mailman(String sender)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from = sender;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; smtpServer = &quot;smtp.gmail.com&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public String getSmtpServer() { return smtpServer; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public void setSmtpServer(String svr) { smtpServer = svr; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public String getSender() { return from; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public void setSender(String fm) { from = fm; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public String getPassword() { return password; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public void setPassword(String passwd) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; password = passwd;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (passwd != null &amp;amp;&amp;amp; passwd.length() &amp;gt; 0) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; useAuth = true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; useAuth = false;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; /*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* This method sends plain text mail.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public void send(String subject, String body, String to, String cc)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Message msg = createMessage(subject, to, cc);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg.setText(body);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Transport.send(msg);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception ex) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw new RuntimeException(ex);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; /*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* this method sends mail with file attachments&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public void send(String subject, String body, List&amp;lt;String&amp;gt; attachPaths, String to, String cc)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Message msg = createMessage(subject, to, cc);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Multipart multipart = new MimeMultipart();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MimeBodyPart messageBodyPart = new MimeBodyPart();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; messageBodyPart.setText(body);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; multipart.addBodyPart(messageBodyPart);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (String fileAttachment : attachPaths) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MimeBodyPart attachment = new MimeBodyPart();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataSource source = new FileDataSource(fileAttachment);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; attachment.setDataHandler(new DataHandler(source));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; attachment.setFileName(new File(fileAttachment).getName());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; multipart.addBodyPart(attachment);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg.setContent(multipart);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Transport.send(msg);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception ex) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw new RuntimeException(ex);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; protected Message createMessage(String subject, String to, String cc) throws Exception&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Properties props = System.getProperties();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; props.put(&quot;mail.smtp.host&quot;, smtpServer);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Session session = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ( useAuth ) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; props.put(&quot;mail.smtp.starttls.enable&quot;,&quot;true&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; props.put(&quot;mail.smtp.auth&quot;, &quot;true&quot;);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // SSL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; props.put(&quot;mail.smtp.socketFactory.port&quot;, &quot;465&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; props.put(&quot;mail.smtp.socketFactory.class&quot;, &quot;javax.net.ssl.SSLSocketFactory&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; props.put(&quot;mail.smtp.socketFactory.fallback&quot;, &quot;false&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; session = Session.getInstance(props, this);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; session = Session.getInstance(props);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // create a new message&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Message msg = new MimeMessage(session);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (from == null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; from = System.getProperty(&quot;user.name&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg.setFrom(new InternetAddress(from));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (cc != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg.setRecipients(Message.RecipientType.CC, InternetAddress.parse(cc, false));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // set the subjecttext&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg.setSubject(subject);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // set some other header information&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg.setHeader(&quot;X-Mailer&quot;, &quot;s3ar-JavaMail&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg.setSentDate(new Date());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return msg;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; @Override&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public PasswordAuthentication getPasswordAuthentication()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // you can read the password from a file&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // which should set mode as 0400&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return new PasswordAuthentication(from, password);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/630780257104025747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2012/03/combine-gmail-and-java-mail-library-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/630780257104025747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/630780257104025747'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2012/03/combine-gmail-and-java-mail-library-to.html' title='Combine gmail and Java mail library to create your email compaign'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-5437131085829958239</id><published>2012-03-26T11:22:00.002-07:00</published><updated>2012-03-26T11:22:38.893-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="MacOS"/><category scheme="http://www.blogger.com/atom/ns#" term="Xcode"/><title type='text'>Update xcodebuild path</title><content type='html'>The installation directory of Apple&#39;s IDE, Xcode, moved from &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/Developer&lt;/span&gt; to &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/Applications&lt;/span&gt; starting version 4.3.1. It caused some glitches for tools, such as &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;xcodebuild&lt;/span&gt;, if invoked as a command-line utility.&lt;br /&gt;
&lt;br /&gt;
To point it to the new installation base, use&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Verify the change with&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/usr/bin/xcode-select -print-path&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/5437131085829958239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2012/03/update-xcodebuild-path.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/5437131085829958239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/5437131085829958239'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2012/03/update-xcodebuild-path.html' title='Update xcodebuild path'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-2272165221827952760</id><published>2012-03-19T10:29:00.000-07:00</published><updated>2012-03-19T10:29:07.216-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="operation"/><title type='text'>Examine multiple files in command less</title><content type='html'>To change to the next file after opening multiple files simultaneously in &#39;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;less&lt;/span&gt;&#39; command, use this command&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;:n&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
And to change to the previous file, use&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;:p&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;The instruction should also be available from the man page.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/2272165221827952760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2012/03/examine-multiple-files-in-command-less.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/2272165221827952760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/2272165221827952760'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2012/03/examine-multiple-files-in-command-less.html' title='Examine multiple files in command less'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-4564435060978637739</id><published>2012-03-11T17:18:00.000-07:00</published><updated>2012-03-12T10:49:20.210-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cygwin"/><category scheme="http://www.blogger.com/atom/ns#" term="symlink"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 7"/><title type='text'>Create symbolic links in Windows 7</title><content type='html'>I was running XAMPP on Windows 7 and tried to use symbolic link point to the folders with PHP code. The soft link created in Cygwin (ln -s &amp;lt;directory&amp;gt; &amp;lt;link-name&amp;gt;) did not seem to be recognized by Apache.&amp;nbsp;I found &amp;nbsp;I need to use native Windows command in the command prompt.&lt;br /&gt;
&lt;br /&gt;
Run Command Prompt as administrator&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;gt; MKLINK /D &amp;lt;link-name&amp;gt; &amp;lt;target directory&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;

Note&lt;/h4&gt;
I tried to use&amp;nbsp;secpol.msc&amp;nbsp;to grant myself with privilege for creating symbolic link.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;secpol.msc via Start or Start → Run.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Open Security Settings → Local Policies → User Rights Assignment&lt;/span&gt;&lt;br /&gt;
It did not give me the permission to create symbolic link even after I re-log in. I have to run the command as administrator.</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/4564435060978637739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2012/03/create-symbolic-link-in-windows-7.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/4564435060978637739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/4564435060978637739'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2012/03/create-symbolic-link-in-windows-7.html' title='Create symbolic links in Windows 7'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-5682579912343740516</id><published>2012-03-11T16:57:00.003-07:00</published><updated>2012-03-11T17:18:38.765-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="chown"/><category scheme="http://www.blogger.com/atom/ns#" term="Cygwin"/><category scheme="http://www.blogger.com/atom/ns#" term="su"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows7"/><title type='text'>The chown command equivalent in Windows 7</title><content type='html'>As &#39;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;su - chown&lt;/span&gt;&#39; does not work in Cygwin, there is a alternative in Windows 7.&lt;br /&gt;
Log in as the user the files should be changed TO and run Command Prompt as administrator.&lt;br /&gt;
Run the follow command (or similar one with different parameter combination)&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;gt; takeown /F &amp;lt;directory name&amp;gt; /R&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/5682579912343740516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2012/03/change-owner-command-equivalent-on.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/5682579912343740516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/5682579912343740516'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2012/03/change-owner-command-equivalent-on.html' title='The chown command equivalent in Windows 7'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-5652671253897398242</id><published>2012-03-09T17:41:00.001-08:00</published><updated>2012-03-20T12:03:16.259-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cocos2d"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="iPad"/><category scheme="http://www.blogger.com/atom/ns#" term="retina"/><title type='text'>Black screen on simulator for iPad retina using cocos2d</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
I am excited to see that iPad has a retina display. As I am developing my first iPhone/iPad game (universal application) using cocos2d 1.0.1, I updated my Xcode to 4.3.1 to see if my code still works on the new device display.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
It showed a black screen. &amp;nbsp;Nothing displayed. &amp;nbsp;But the code seems to be running and responding to touch events. &amp;nbsp;I did not know what happened so I started to search on the web. &amp;nbsp;I found one &lt;a href=&quot;http://www.cocos2d-iphone.org/forum/topic/30021&quot; target=&quot;_blank&quot;&gt;posting&lt;/a&gt;&amp;nbsp;on cocos2d-iphone forum started a day ago was discussing exactly the same problem. &amp;nbsp;I read every post and experimented all the proposed solutions. &amp;nbsp;I don&#39;t think it is anything to do with &#39;-hd&#39; image files, as the sample cocos2d HelloWorld did not work in iPad retina display either. But apparently lowering the resolution makes everything work again. &amp;nbsp;I noticed one member mentioned something particularly interesting, which was about the call to&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;gluPerspective()&lt;/span&gt; in &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;CCDirectorIOS -setProjection()&lt;/span&gt;.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The call stack is&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;enableRetinaDisplay =&amp;gt;&amp;nbsp;setContentScaleFactor =&amp;gt;&amp;nbsp;setProjection&lt;/span&gt;, as &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;enableRetinaDisplay&lt;/span&gt; is the center of the discussion.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I found that switching to the commented code one line before the now in-use code in CCDirectorIOS makes my code work again in all the simulators. &amp;nbsp;I posted it to the thread. But here is the complete posting. &amp;nbsp;Hope this helps you as well.&lt;/div&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I was following DonomaGames&#39;s post on gluPerspective() (CCDirectorIOS line 212-213). &amp;nbsp;Line 212 was commented out and replaced with line 213,&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;gluPerspective(60, (GLfloat)size.width/size.height, 0.5f, 1500);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
which has &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;zFar&lt;/span&gt; as 1500. &amp;nbsp;I did a calculation using the formula on 212, &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;zNear=zeye-height/2, zFar=zeye+height/2&lt;/span&gt;. On iPad retina, the &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;zFar&lt;/span&gt; value is 2794.707275. &amp;nbsp;It is larger than 1500. The rendering may be clipped off.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
For comparison I computed the whole four types.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Type&lt;/td&gt;&lt;td&gt;zNear &amp;nbsp;&lt;/td&gt;&lt;td&gt;zFar&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;iPhone SD &amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;175&lt;/td&gt;&lt;td&gt;655&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;iPhone HD &amp;nbsp;&lt;/td&gt;&lt;td&gt;350&lt;/td&gt;&lt;td&gt;1310&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;iPad SD&lt;/td&gt;&lt;td&gt;373&lt;/td&gt;&lt;td&gt;1397&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;iPad HD&lt;/td&gt;&lt;td&gt;746&lt;/td&gt;&lt;td&gt;2794&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
Given that, I changed line 212 in CCDirectorIOS.m to&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;gluPerspective(60, (GLfloat)size.width/size.height, 0.5f, 2800);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
It worked for iPad retina simulator.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I also tried the following code and worked also.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad &amp;amp;&amp;amp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; [[UIScreen mainScreen] scale] &amp;gt; 1.0 )&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; gluPerspective(60, (GLfloat)size.width/size.height, zeye-size.height/2, zeye+size.height/2 );&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;} else {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; gluPerspective(60, (GLfloat)size.width/size.height, 0.5f, 1500);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
This combines the original 212 and 213 code.&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/5652671253897398242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2012/03/black-screen-on-simulator-for-ipad.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/5652671253897398242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/5652671253897398242'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2012/03/black-screen-on-simulator-for-ipad.html' title='Black screen on simulator for iPad retina using cocos2d'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-8378550060356455634</id><published>2012-03-05T10:42:00.002-08:00</published><updated>2012-03-07T09:50:42.605-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MacOS"/><category scheme="http://www.blogger.com/atom/ns#" term="operation"/><title type='text'>Hostname on Mac OS X</title><content type='html'>If the dynamic hostname is provided by DHCP, and you prefer a fixed one, there are a few ways to do it.&lt;br /&gt;
&lt;br /&gt;
From System Preferences/Network&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Select the network adapter which interfaces the DHCP server.&lt;/li&gt;
&lt;li&gt;Click on the &quot;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Advanced&lt;/span&gt;&quot; button on the lower right.&lt;/li&gt;
&lt;li&gt;In the TCP/IP tab, specify the &quot;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;DHCP client ID&lt;/span&gt;&quot; text field.&lt;/li&gt;
&lt;/ul&gt;
Or depending on the version of Mac OS:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;i&gt;-- Mac OS X 10.5 and older&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
On Mac, the hostname shown on the terminal prompt is configured by the file,&lt;br /&gt;
/etc/hostconfig.&amp;nbsp;If it is specified as&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;HOSTNAME=-AUTOMATIC-&lt;/span&gt;,&lt;br /&gt;
the name shown in the prompt is provided by DHCP or BootP server.&lt;br /&gt;
&lt;br /&gt;
Change that line to&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;HOSTNAME=(preferred-name)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;-- Mac OS X 10.6 and newer&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;Use the command &lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;scutil&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt; (system configuration utility)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;scutil --set HostName&amp;nbsp;(preferred-name)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Remember to check the name set in&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;/Library/Preferences/SystemConfiguration/preferences.plist,&lt;/span&gt;&lt;br /&gt;
under &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;System/System/ComputerName&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/8378550060356455634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2012/03/hostname-on-mac-os-x.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/8378550060356455634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/8378550060356455634'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2012/03/hostname-on-mac-os-x.html' title='Hostname on Mac OS X'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-1902250885152360462</id><published>2012-02-23T14:57:00.000-08:00</published><updated>2012-02-23T14:58:14.731-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Groovy"/><category scheme="http://www.blogger.com/atom/ns#" term="programming language"/><category scheme="http://www.blogger.com/atom/ns#" term="software"/><title type='text'>Modify grapeConfig.xml to speed up groovy script with @Grab</title><content type='html'>I had a &lt;a href=&quot;http://swainya.blogspot.com/2011/09/skip-download-when-groovy-code.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt; on speed up groovy script startup time if Grape @Grab annotation is used in the script.&lt;br /&gt;
The cause is described in this post,&amp;nbsp;&lt;a href=&quot;http://swainya.blogspot.com/2011/09/skip-download-when-groovy-code.html&quot; target=&quot;_blank&quot;&gt;http://swainya.blogspot.com/2011/09/skip-download-when-groovy-code.html&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The solution described in that post is to add one line in the .groovy/grapeConfig.xml to decrease cache TTL. &amp;nbsp;Add&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;property name=&quot;ivy.cache.ttl.default&quot; value=&quot;15m&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
in the &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;ivysettings&amp;gt;&lt;/span&gt; section.&lt;br /&gt;
&lt;br /&gt;
Your grapeConfig.xml will look like this after adding that line&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;lt;ivysettings&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;property name=&quot;ivy.cache.ttl.default&quot; value=&quot;15m&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;lt;settings defaultResolver=&quot;downloadGrapes&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;......&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/1902250885152360462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2012/02/modify-grapeconfigxml-to-speed-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/1902250885152360462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/1902250885152360462'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2012/02/modify-grapeconfigxml-to-speed-up.html' title='Modify grapeConfig.xml to speed up groovy script with @Grab'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-1949728159976459189</id><published>2012-01-13T11:30:00.000-08:00</published><updated>2012-01-13T11:30:28.732-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="MacOS"/><title type='text'>Show user Library folder in Finder</title><content type='html'>Since moved to MacOS Lion (10.7.x), the folder Library disappeared from my Finder window. &amp;nbsp;It bothers me a lot. &amp;nbsp;Apparently Apple hides it in this OS release. &amp;nbsp; Here is the way to reveal it.&lt;br /&gt;
&lt;br /&gt;
From console terminal, use this command.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$ chflags nohidden ~/Library/&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/1949728159976459189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2012/01/show-user-library-folder-in-finder.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/1949728159976459189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/1949728159976459189'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2012/01/show-user-library-folder-in-finder.html' title='Show user Library folder in Finder'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-7880926058852584391</id><published>2011-12-30T11:24:00.000-08:00</published><updated>2011-12-30T11:25:56.902-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="vi"/><title type='text'>Comment out multiple lines in vi</title><content type='html'>Press &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Ctrl-v&lt;/span&gt; to start a &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;VISUAL BLOCK&lt;/span&gt;&lt;br /&gt;
Move the cursor (up/down arrow key) to expand the block&lt;br /&gt;
Press I (&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;Shift-i&lt;/span&gt;) to start insert.&lt;br /&gt;
Type in the character(s) that you want to insert, such as &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;#&lt;/span&gt;, or &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;//&lt;/span&gt;.&lt;br /&gt;
Press &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ESC&lt;/span&gt; to leave the visual block.</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/7880926058852584391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/12/comment-out-multiple-lines-in-vi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/7880926058852584391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/7880926058852584391'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/12/comment-out-multiple-lines-in-vi.html' title='Comment out multiple lines in vi'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-3659268043589527916</id><published>2011-12-06T12:08:00.001-08:00</published><updated>2011-12-06T12:15:18.080-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="operation"/><category scheme="http://www.blogger.com/atom/ns#" term="vi"/><title type='text'>Global search in vi and list results</title><content type='html'>We use the simple command&amp;nbsp;to search a pattern (or a fragment of text),&lt;div&gt;
&lt;br /&gt;&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;:/{pattern}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Sometimes, there would be a few dozens of matches that you want to list and browse quickly. &amp;nbsp;Use this command,&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;:g/{pattern}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
It lists the search results in one buffer. &amp;nbsp;If you want to search the pattern case insensitive, add \c in the command, like&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;:g/\c{pattern}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/3659268043589527916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/12/global-search-in-vi-and-list-results.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/3659268043589527916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/3659268043589527916'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/12/global-search-in-vi-and-list-results.html' title='Global search in vi and list results'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-7978984492372478711</id><published>2011-11-01T17:39:00.000-07:00</published><updated>2011-11-01T17:39:20.661-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="operation"/><title type='text'>Monitor disk IO activities on a Linux host</title><content type='html'>1. Use &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;df&lt;/span&gt; first to find all the devices&lt;br /&gt;
2. Use &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;iostat&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;iostat -dx &amp;lt;device&amp;gt; &amp;lt;time-interval&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
For example,&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;iostat -dx /dev/sdb 5&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
to display disk IO activities every 5 seconds.</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/7978984492372478711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/11/monitor-disk-io-activities-on-linux.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/7978984492372478711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/7978984492372478711'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/11/monitor-disk-io-activities-on-linux.html' title='Monitor disk IO activities on a Linux host'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-8970624378282549375</id><published>2011-10-27T13:30:00.000-07:00</published><updated>2011-10-27T13:30:03.255-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="operation"/><title type='text'>Find CPU information on a Linux</title><content type='html'>A good tip for finding out CPU and 32/64 bit kernel information on a Linux host, at&amp;nbsp;&lt;a href=&quot;http://www.cyberciti.biz/faq/linux-how-to-find-if-processor-is-64-bit-or-not/&quot;&gt;http://www.cyberciti.biz/faq/linux-how-to-find-if-processor-is-64-bit-or-not/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
In short, use&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;uname -a&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;cat /proc/cpuinfo&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/8970624378282549375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/10/find-cpu-information-on-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/8970624378282549375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/8970624378282549375'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/10/find-cpu-information-on-linux.html' title='Find CPU information on a Linux'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-7562532299184918726</id><published>2011-09-30T10:58:00.000-07:00</published><updated>2011-09-30T10:58:49.928-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Groovy"/><category scheme="http://www.blogger.com/atom/ns#" term="programming language"/><category scheme="http://www.blogger.com/atom/ns#" term="software"/><title type='text'>Find directory path of the current groovy script</title><content type='html'>Bash or PHP script has a function that returns the directory path of the current script file.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;$my_dir=dirname(__FILE__);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Groovy script lacks such a capability but an alternative is available by calling&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;def my_dir = new File(getClass().protectionDomain.codeSource.location.path).parent&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/7562532299184918726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/09/find-directory-path-of-current-groovy.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/7562532299184918726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/7562532299184918726'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/09/find-directory-path-of-current-groovy.html' title='Find directory path of the current groovy script'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-6915862657599890195</id><published>2011-09-27T11:37:00.000-07:00</published><updated>2011-09-27T11:37:22.154-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Groovy"/><category scheme="http://www.blogger.com/atom/ns#" term="programming language"/><category scheme="http://www.blogger.com/atom/ns#" term="software"/><title type='text'>Skip download when groovy code annotated with Grapes</title><content type='html'>Grapes is a great utility to manage class path automation when coding with groovy. &lt;br /&gt;
&lt;a href=&quot;http://groovy.codehaus.org/Grape&quot;&gt;http://groovy.codehaus.org/Grape&lt;/a&gt;&lt;br /&gt;
But it slows down the start-up if there are a lot of dependent jars to download. &amp;nbsp;Even all the dependent jar files have been downloaded to local m2 and grapes store previously, the download process still takes place, which slow things down unnecessarily. &lt;br /&gt;
&lt;br /&gt;
Use the following options to ask groovy look into local storage directly.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;groovy -Dgroovy.grape.autoDownload=false [groovy file path] [arguments ......]&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/6915862657599890195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/09/skip-download-when-groovy-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/6915862657599890195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/6915862657599890195'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/09/skip-download-when-groovy-code.html' title='Skip download when groovy code annotated with Grapes'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-8955801368264735559</id><published>2011-09-23T18:00:00.000-07:00</published><updated>2011-09-23T18:01:12.211-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="Maven"/><title type='text'>Suppress test stage during maven build</title><content type='html'>Use&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;-Dmaven.&lt;span class=&quot;bold highlight search-highlight&quot;&gt;test&lt;/span&gt;.skip.exec=true&lt;/span&gt;&lt;br /&gt;
to skip running test cases without skipping test jar build</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/8955801368264735559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/09/suppress-test-stage-during-maven-build.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/8955801368264735559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/8955801368264735559'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/09/suppress-test-stage-during-maven-build.html' title='Suppress test stage during maven build'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-3764151913885444847</id><published>2011-09-23T11:46:00.000-07:00</published><updated>2011-09-23T18:00:46.982-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="software"/><title type='text'>A class path with all jar files in a folder</title><content type='html'>Typing in all the jar files to form a class path is not a fun job. &amp;nbsp;This quick trick may&amp;nbsp;alleviate&amp;nbsp;some of the pain.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;export CLASSPATH=`echo $PWD/*.jar | sed &#39;s/ /:/g&#39;`&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Customize the &quot;echo&quot; part to get all the files needed.&lt;/div&gt;
&lt;div&gt;
Such as&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;export CLASSPATH=`echo $PWD/*.jar . $HOME/lib | sed &#39;s/ /:/g&#39;`&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/3764151913885444847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/09/class-path-with-all-jar-files-in-folder.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/3764151913885444847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/3764151913885444847'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/09/class-path-with-all-jar-files-in-folder.html' title='A class path with all jar files in a folder'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-3084690039539184633</id><published>2011-08-18T12:03:00.000-07:00</published><updated>2012-03-12T10:39:18.988-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="operation"/><title type='text'>Use wildcard in the command find</title><content type='html'>To use a wildcard &lt;q style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;*&lt;/q&gt; in the find command needs a little more care.&lt;br /&gt;
&lt;br /&gt;
Without quote or backslash &lt;q style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;\&lt;/q&gt;, such as&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;find . foo*bar -print&lt;/span&gt;&lt;br /&gt;
the shell will expand &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;*&lt;/span&gt; before passing it into find command.&amp;nbsp; This results is a different, and most likely a narrower, search.&lt;br /&gt;
&lt;br /&gt;
To avoid that, use&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;find . &#39;foo*bar&#39; -print&lt;/span&gt;&lt;br /&gt;
or&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;find . foo\*bar -print&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/3084690039539184633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/08/use-wildcard-in-command-find.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/3084690039539184633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/3084690039539184633'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/08/use-wildcard-in-command-find.html' title='Use wildcard in the command &lt;q&gt;find&lt;/q&gt;'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-4319938891618022362</id><published>2011-08-16T16:15:00.000-07:00</published><updated>2011-08-16T16:15:38.026-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="operation"/><category scheme="http://www.blogger.com/atom/ns#" term="yum"/><title type='text'>Add one more yum repository</title><content type='html'>Read &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;yum.conf&lt;/span&gt; first.&amp;nbsp; Usually the path is &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;/etc/yum.conf&lt;/span&gt;.&lt;br /&gt;
Understand where the cache and repository configuration file directory&lt;br /&gt;
&lt;br /&gt;
The following examples use default locations&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;## add epel to the repo list&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;## see what is there before change&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;ls /var/cache/yum/*/* &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;cd yum.repos.d/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;## copy contents from another configured host&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;sudo vi epel.repo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;sudo yum clean all&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;## make sure it is empty&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;ls /var/cache/yum/*/*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;sudo yum makecache&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;## see if the new repo epel is added&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;ls /var/cache/yum/*/*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;## add GPG key for the new repo, also do copy-paste&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;sudo vi /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If you are not sure about the name of RPM-GPG key, run rpm to install the package.&amp;nbsp; Towards the end, rpm will complain about missing the GPG key and prompt the file name for you.</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/4319938891618022362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/08/add-one-more-yum-repository.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/4319938891618022362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/4319938891618022362'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/08/add-one-more-yum-repository.html' title='Add one more yum repository'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-3349629210950074896</id><published>2011-08-16T15:20:00.001-07:00</published><updated>2011-08-16T15:20:59.285-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="operation"/><title type='text'>Find out it is a 32 or 64-bit Linux</title><content type='html'>Use the command&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;uname -m&lt;/span&gt;&lt;br /&gt;
If it shows &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;x86_64&lt;/span&gt;, it is a 64-bit host.&lt;br /&gt;
If it shows &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;i386&lt;/span&gt; (or sometimes &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;i686&lt;/span&gt;), it is a 32-bit machine&lt;br /&gt;
&lt;br /&gt;
Plus, run the command&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;file /bin/ls&lt;/span&gt;&lt;br /&gt;
For 64-bit kernel, it should show&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;/bin/ls: ELF 64-bit LSB executable ....&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/3349629210950074896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/08/find-out-it-is-32-or-64-bit-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/3349629210950074896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/3349629210950074896'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/08/find-out-it-is-32-or-64-bit-linux.html' title='Find out it is a 32 or 64-bit Linux'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-7267855109190607242</id><published>2011-08-16T14:30:00.000-07:00</published><updated>2011-08-16T16:23:49.090-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="dpkg"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="operation"/><category scheme="http://www.blogger.com/atom/ns#" term="yum"/><title type='text'>Find installed packages on Linux hosts</title><content type='html'>To find installed packages on a Redhat/CentOS Linux, use&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;rpm -qa | less&lt;/div&gt;&lt;br /&gt;
Once the package name is found, use this command to find more details&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;rpm -qil {package-name}&lt;/div&gt;&lt;br /&gt;
To find installed packages on a Debian (also Ubuntu) Linux, use&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;dpkg --list &lt;/div&gt;&lt;br /&gt;
Once the package name is found, use this command to find more details&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;dpkg -p {package-name}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/7267855109190607242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/08/find-installed-packages-on-linux-hosts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/7267855109190607242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/7267855109190607242'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/08/find-installed-packages-on-linux-hosts.html' title='Find installed packages on Linux hosts'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8445360611672796425.post-7230433999698888204</id><published>2011-08-09T13:28:00.000-07:00</published><updated>2011-08-09T13:28:45.518-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="command"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="operation"/><title type='text'>Find and delete into directories recursively</title><content type='html'>How to find a set of files or directories that are named the same?&amp;nbsp; For example, to delete all the &#39;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;.svn&lt;/span&gt;&#39; directories in the current working directory.&lt;br /&gt;
&lt;br /&gt;
One easy way is&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;rm -rvf `find . -type d -name .svn`&lt;/div&gt;&lt;br /&gt;
The option [-v] prints out the files/directories found.&amp;nbsp; and rm -rf is the typical force deletion of a directory.&lt;br /&gt;
&lt;br /&gt;
Another way to do it is&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;find . -name &quot;.svn&quot; -exec rm -rf {} \;&lt;/div&gt;&lt;br /&gt;
But this command prints out warning messages that sometimes confuse users.&lt;br /&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;find: ./.svn: No such file or directory&lt;br /&gt;
find: ./images/.svn: No such file or directory&lt;/div&gt;&lt;br /&gt;
The warning message means it found a &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;.svn&lt;/span&gt; directory in the current directory and deleted as instructed ( &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;-exec rm -rf&lt;/span&gt; ).&amp;nbsp; When the command &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;find&lt;/span&gt; wanted to descend into &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;.svn&lt;/span&gt; directory, it could not.&lt;br /&gt;
&lt;br /&gt;
The trailing &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;{} \;&lt;/span&gt; is required.&amp;nbsp; Pay attention to its format: there is a space between &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;}&lt;/span&gt; and &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;\&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://swainya.blogspot.com/feeds/7230433999698888204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swainya.blogspot.com/2011/08/find-and-delete-into-directories.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/7230433999698888204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8445360611672796425/posts/default/7230433999698888204'/><link rel='alternate' type='text/html' href='http://swainya.blogspot.com/2011/08/find-and-delete-into-directories.html' title='Find and delete into directories recursively'/><author><name>Spencer Ho</name><uri>http://www.blogger.com/profile/09369332488381065382</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>