tag:blogger.com,1999:blog-88247493394936997242024-03-19T09:21:47.488+05:30The Induction MachineAbhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.comBlogger47125tag:blogger.com,1999:blog-8824749339493699724.post-63295824412033297222019-09-05T20:02:00.004+05:302019-09-05T20:02:53.417+05:30Darktable for Sony A6400<div dir="ltr" style="text-align: left;" trbidi="on">
The latest APSC camera from Sony, the A6400 (ILCE-6400) has a new raw file format which is not supported by Darktable versions currently* in the Ubuntu repos or in the stable PPAs.<br />
<br />
The only way to get darktable to open the RAW files from the A6400is to build the latest (unstable) darktable from source. Steps to do this on a vanilla install of Ubuntu are given in a text file below, also available through <a href="https://gist.github.com/abhijit86k/b48fa0207fb5bd40530b907d02f9be5c">a Github Gist</a>.<br />
<br />
<u><span style="font-size: x-small;"><i>* as of this writing, Sep 5. 2019</i></span></u><br />
<br />
<br />
<script src="https://gist.github.com/abhijit86k/b48fa0207fb5bd40530b907d02f9be5c.js"></script>
<br />
<br /></div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-70308206849051500402017-05-02T00:50:00.002+05:302017-05-02T00:50:28.323+05:30Notes on Communication and Knowledge<div dir="ltr" style="text-align: left;" trbidi="on">
For centuries we have attempted communication "downward." This, however,<br />
cannot work, no matter how hard and how intelligently we try. It cannot<br />
work, first, because it focuses on what we want to say. It assumes, in<br />
other words, that the emitter communicates.<br />
<br />
...unless the recipient "hears," communication has not taken place.<br />
Information and communication are different. Communication has not taken<br />
place unless the emitter is sure that the receiver understands what action<br />
is to be taken as a result of, say, a conversation or a memo.<br />
<br />
- Peter Drucker<br />
<br />
Sadly, there is a villain in our story. The villain is a natural<br />
psychological tendency that consistently confounds our ability to create<br />
ideas using these principles. It's called the Curse of Knowledge. (We will<br />
capitalize the phrase throughout the book to give it the drama we think it<br />
deserves.)<br />
<br />
Tappers and Listeners<br />
<br />
In 1990, Elizabeth Newton earned a Ph.D. in psychology at Stanford by<br />
studying a simple game in which she assigned people to one of two roles:<br />
"tappers" or "listeners." Tappers received a list of twenty-five<br />
well-known songs, such as "Happy Birthday to You" and "The Star-Spangled<br />
Banner." Each tapper was asked to pick a song and tap out the rhythm to a<br />
listener (by knocking on a table). The listener's job was to guess the<br />
song, based on the rhythm being tapped. (By the way, this experiment is<br />
fun to try at home if there's a good "listener" candidate nearby.)<br />
<br />
The listener's job in this game is quite difficult. Over the course of<br />
Newton's experiment, 120 songs were tapped out. Listeners guessed only 2.5<br />
percent of the songs: 3 out of 120.<br />
<br />
But here's what made the result worthy of a dissertation in psychology.<br />
Before the listeners guessed the name of the song, Newton asked the<br />
tappers to predict the odds that the listeners would guess correctly. They<br />
predicted that the odds were 50 percent.<br />
<br />
The tappers got their message across 1 time in 40, but they thought they<br />
were getting their message across 1 time in 2. Why?<br />
<br />
When a tapper taps, she is hearing the song in her head. Go ahead and try<br />
it for yourself - tap out "The Star-Spangled Banner." It's impossible to<br />
avoid hearing the tune in your head. Meanwhile, the listeners can't hear<br />
that tune - all they can hear is a bunch of disconnected taps, like a kind<br />
of bizarre Morse Code.<br />
<br />
In the experiment, tappers are flabbergasted at how hard the listeners<br />
seem to be working to pick up the tune. Isn't the song obvious? The<br />
tappers' expressions, when a listener guesses "Happy Birthday to You" for<br />
"The Star-Spangled Banner," are priceless: How could you be so stupid?<br />
<br />
It's hard to be a tapper. The problem is that tappers have been given<br />
knowledge (the song title) that makes it impossible for them to imagine<br />
what it's like to lack that knowledge. When they're tapping, they can't<br />
imagine what it's like for the listeners to hear isolated taps rather than<br />
a song. This is the Curse of Knowledge. Once we know something, we find it<br />
hard to imagine what it was like not to know it. Our knowledge has<br />
"cursed" us. And it becomes difficult for us to share our knowledge with<br />
others, because we can't readily re-create our listeners' state of mind.<br />
<br />
The tapper/listener experiment is reenacted every day across the world.<br />
The tappers and listeners are CEOs and frontline employees, teachers and<br />
students, politicians and voters, marketers and customers, writers and<br />
readers. All of these groups rely on ongoing communication, but, like the<br />
tappers and listeners, they suffer from enormous information imbalances.<br />
When a CEO discusses "unlocking shareholder value," there is a tune<br />
playing in her head that the employees can't hear.<br />
<br />
It's a hard problem to avoid - a CEO might have thirty years of daily<br />
immersion in the logic and conventions of business. Reversing the process<br />
is as impossible as un-ringing a bell. You can't unlearn what you already<br />
know. There are, in fact, only two ways to beat the Curse of Knowledge<br />
reliably. The first is not to learn anything. The second is to take your<br />
ideas and transform them.<br />
<br />
This book will teach you how to transform your ideas to beat the Curse of<br />
Knowledge. The six principles presented earlier are your best weapons.<br />
They can be used as a kind of checklist. Let's take the CEO who announces<br />
to her staff that they must strive to "maximize shareholder value."<br />
<br />
Is this idea simple? Yes, in the sense that it's short, but it lacks the<br />
useful simplicity of a proverb. Is it unexpected? No. Concrete? Not at<br />
all. Credible? Only in the sense that it's coming from the mouth of the<br />
CEO. Emotional? Urn, no. A story? No.<br />
<br />
Contrast the "maximize shareholder value" idea with John F. Kennedy's<br />
famous 1961 call to "put a man on the moon and return him safely by the<br />
end of the decade." Simple? Yes. Unexpected? Yes. Concrete? Amazingly so.<br />
Credible? The goal seemed like science fiction, but the source was<br />
credible. Emotional? Yes. Story? In miniature.<br />
<br />
Had John F. Kennedy been a CEO, he would have said, "Our mission is to<br />
become the international leader in the space industry through maximum<br />
team-centered innovation and strategically targeted aerospace<br />
initiatives." Fortunately, JFK was more intuitive than a modern-day CEO;<br />
he knew that opaque, abstract missions don't captivate and inspire people.<br />
The moon mission was a classic case of a communicator's dodging the Curse<br />
of Knowledge. It was a brilliant and beautiful idea - a single idea that<br />
motivated the actions of millions of people for a decade.<br />
<br />
- Chip & Dan Heath, Made to Stick</div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-80390162761306503882017-05-02T00:48:00.001+05:302017-05-02T00:48:45.590+05:30Working with Windows<div dir="ltr" style="text-align: left;" trbidi="on">
Over the last few months I have been "forced" (?) to work on(?) with (?) (perhaps despite?) windows. Overall Windows 10 isn't the clunky nightmare that Vista was, and is way better than Windows 7 too. Heck it even has workspaces finally!<br />
<br />
Here are a few hacks I had to use to work out some common issues.<br />
<br />
1. Machine does not respond to ping<br />Firewall rule is too strict. To change, go to:<br />
<blockquote class="tr_bq">
Control Panel> Firewall<br />Advanced Setting<br />Inbound Rules:<br />Enable File and Printer Sharing Rules</blockquote>
2. Remote file access is not possible:<br />
You need to be admin or otherwise have access to C:\ of the machine; then use smb://192.168.X.Y/C$ to access from Nautilus on another machine.<br />
<br />
More hacks later. </div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0Minneapolis, MN, USA44.977753 -93.26501080000002744.7980145 -93.587734300000022 45.1574915 -92.942287300000032tag:blogger.com,1999:blog-8824749339493699724.post-11724258878784155792016-02-05T10:48:00.001+05:302016-02-05T10:48:35.025+05:30HPLIP Binary Plugin Installation<div dir="ltr" style="text-align: left;" trbidi="on">
Recently ran into this exact bug with my junk laserjet printer P1108.<br />
<br />
<br />
From: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605589#40 <br />
<br />
<pre class="message">Package: hplip
Version: 3.13.4-1
Followup-For: Bug #605589
since the update to 3.13.4 I cannot seem to print with my P1005.
When sending a job to the printer, a window pops up asking to install the
plugin. When following the dialogs, they end saying that the plugin is
installed, followed by another window saying it failes.
Manually launching hp-plugin completes the plugin installation successfully,
the printer comes alive, but sending a print job goes back to requesting the
plugin.
</pre>
<br />The solution is here:<br />
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=605589#50<br />
<br />
Briefly:<br />
Create the directory /var/lib/hp<br />
Update hplip-gui<br />
Install/update cups-pk-helper if required<br />
Unplug, then re-plug in printer<br />
HPLip will ask to download and install the plugin, which is a run file.<br />
<br />
If you are behind a firewall or your internet connection is dodgy, this automatic download will fail, and you will need to manually download and install the plugin.<br />
<br />
In a terminal run hp-plugin<br />
Watch the terminal for URL of the plugin file.<br />
<br />
Download *.run file from hplip website. </div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-73846441516471348732016-02-05T10:43:00.003+05:302016-02-05T10:43:39.413+05:30Tex Studio Keyboard Shortcuts<div dir="ltr" style="text-align: left;" trbidi="on">
TexStudio had an annoying habit of jumping to the the previous brace when I wanted to go one word (CTRL + left / right). This is because this key combination is assigned by default to "Next (or prev) word / placeholder".<br />
<br />
Fix:<br />
Assign nothing to "Next word / placeholder".<br />
Assign CTRL+Right to "Move cursor right (1 word)" <br />
Assign a different combination, e.g. Meta+Shift+Right to "Next placeholder".<br />
Repeat for left.<br />
<br />
PS<br />
Meta = Usu key with the windows logo.<br />
On GNOME the "windows" / meta key is used in lots of shortcuts, so assign carefully.</div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-45872772191929117782015-12-09T19:29:00.000+05:302015-12-09T19:29:01.448+05:30Colored output from Bash<div dir="ltr" style="text-align: left;" trbidi="on">
Problem:<br />
I've got colored output from bash (mostly git diffs) which I need to save *with* the coloring intact.<br />
<br />
Solution:<br />
- Pipe the output (*with coloring enabled - use --color switch or equivalent*) to a file.<br />
- Get <a href="http://www.andre-simon.de/doku/ansifilter/en/ansifilter.php" rel="nofollow" target="_blank">ansifilter</a><br />
Download <a href="http://www.andre-simon.de/zip/ansifilter-1.14.tar.bz2" target="_blank">source</a> , compile and install.<br />
- Convert input to latex, compile the tex, save the PDF</div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-21264441240309238762015-08-21T14:17:00.001+05:302015-08-21T14:17:22.218+05:30Inkscape Latex render improvement<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://www.inkscapeforum.com/viewtopic.php?f=28&t=9138" target="_blank">This</a> little fix by <strong>KaKiLa </strong>allows passing of packahe options to the latex renderer (TexText) in inkscape.<br />
To use, back up and then patch your source file eqtexsvg.py (usu. located in /usr/share/inkscape/extensions). Backup and delete the compiled bytecode (eqtexsvg.pyc), then restart Inkscape!<br />
<br />
Tip: Remember that python is "indentation space" sensitive. So when you patch the script pay attention to the leading whitespaces. </div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-15418067004468702922015-02-14T10:45:00.000+05:302015-02-14T10:45:31.124+05:30Nexus Un-Lollipop-ping<div dir="ltr" style="text-align: left;" trbidi="on">
So Android Lollipop 5.0 was a fairly disappointing experience, as reported by many other Nexus 7 users. 5.0.1 and 5.0.2 were better, but significantly worse than KK 4.4.4, so I'm back to on KitKat using the instructions provided on the <a href="https://developers.google.com/android/nexus/images" target="_blank">Android Developers' site</a>. In brief the steps are:<br />
<br />
<ol style="text-align: left;">
<li>Download image for your device from the link above and extract the . Enable developer options on your device</li>
<li>Go to Settings > Developer options > Enable USB debugging</li>
<li>Connect USB Cable to a computer where adb is installed (On Ubuntu 14.04 you can install android-tools-adb package from synaptic)</li>
<li>Click "allow" on device to always allow connections from that computer (useful incase you ever get locked out of the device)</li>
<li>Reboot the device into bootloader. Use the device specific instructions or, in a terminal, run: <span style="color: #38761d;"><span style="font-family: "Courier New",Courier,monospace;">adb reboot bootloader</span></span></li>
<li>Unlock the bootloader (CAUTION:this wipes the device)<br /><span style="color: #38761d;"><span style="font-family: "Courier New",Courier,monospace;">fastboot oem unlock</span></span></li>
<li>Flash the new image by executing flash-al script in the image directory</li>
<li>Reboot into Bootloader as in step 5, then lock the bootloader using <span style="color: #38761d;"><span style="font-family: "Courier New",Courier,monospace;">fastboot oem lock </span></span></li>
</ol>
</div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-42769612122199055802014-10-22T14:29:00.000+05:302014-10-22T14:29:11.207+05:30Guest Login<div dir="ltr" style="text-align: left;" trbidi="on">
Recently there was a need to have a "volatile" guest account on my debian box. The solution it to create a user account with the $HOME in /tmp so it will get wiped out. (This is on Debian Wheezy / stable)<br />
<br />
The relevant command is in this answer on <a href="http://superuser.com/a/529988/372633" rel="nofollow" target="_blank">SuperUser</a><br />
<br />
<span class="comment-copy"><code>> # Create account called guest with $HOME in /tmp</code></span><br />
<span class="comment-copy"><code>> # and default shell as 'none' so ssh access is not possible</code></span><br />
<span class="comment-copy"><code>> sudo useradd -mb /tmp -s /bin/false -c "Welcome Guest" guest;</code></span><br />
<span class="comment-copy"><code>> #Disable the password - Click on "Guest" in login screen</code></span><br />
<span class="comment-copy"><code>> #Make sure you have users displayed on the login screen!</code></span><br />
<span class="comment-copy"><code>> sudo passwd -d guest</code></span><br />
<br />
Now I need to figure out how to display a nice welcome message for the Guest user *after* login (Ubuntu 14.04 does this out of the box)<span class="comment-copy"><code><br /></code></span></div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-49472600282268420212014-10-19T18:28:00.001+05:302014-10-19T18:28:57.826+05:30Recording Stereo Mix using avconv<div dir="ltr" style="text-align: left;" trbidi="on">
Based on instructions here:<br />
<a href="http://askubuntu.com/questions/233060/recording-speaker-audio-using-avconv">http://askubuntu.com/questions/233060/recording-speaker-audio-using-avconv</a><br />
<br />
Identify your device first:<br />
<br />
<code>$ pactl list sources | grep output</code><br />
<code><br /></code>
<br />
<br />
Get the string under "Name:", it will be something like: <span style="font-family: "Courier New",Courier,monospace;">alsa_output.pci-[some number].analog-stereo.monitor
</span><br />
<br />
Record audio and Video:<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;">avconv -f pulse -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -f x11grab -r 30 -s 1920*1080 -i :0.0 -vcodec libx264 -preset ultrafast -ab 320k -t 10 -threads 8 screen.mkv</span></blockquote>
<br />
Record only audio:<br />
avconv -f pulse -i alsa_output.pci-0000_00_1b.0.analog-stereo.monitor -t 1620 -threads 8 screen.mp3</div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com2tag:blogger.com,1999:blog-8824749339493699724.post-54688521058936003962013-09-12T19:41:00.001+05:302013-09-12T19:50:32.491+05:30QGit Segfaults on opening the settings dialog<div dir="ltr" style="text-align: left;" trbidi="on">
Seem to be running into a few corner cases today. Qgit is a really nice viewer for git repositories, but it would crash each time I attempted to open the settings dialog. After some hours of debugging I traced the problem to the presence of newlines in the branch description. Full details can be seen in the bug report on <a href="https://bugs.launchpad.net/ubuntu/+source/qgit/+bug/1221748">launchpad.net</a></div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-81222219532100838452013-09-12T14:14:00.001+05:302013-09-12T14:30:00.615+05:30Octave PDF print error<div dir="ltr" style="text-align: left;" trbidi="on">
Spent a while debugging a mysterious error with exporting PDF plots from Octave. To test if you have the same bug run the following commands on an octave prompt:<br />
<br />
<blockquote class="tr_bq">
<span style="font-family: "Courier New",Courier,monospace;">
<span style="color: #38761d; font-size: x-small;">clear <br />
close all <br />
sombrero <br />
print -deps temp.eps <br />
print -dpdf temp.pdf</span> <br />
</span> </blockquote>
Now check for the following errors/warnings:<br />
<br />
1. Did you get an error saying epstool binary not found?<br />
<b>Solution:</b><br />
Install epstool from your package manager (synaptic or equivalent) <br />
<br />
2. Did you get an error from Ghostscript?<br />
e.g. <span style="color: #990000;"><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">GPL Ghostscript X.XX: Unrecoverable error, exit code 1</span></span></span><br />
<br />
and/or<br />
<br />
Is the EPS file unreadable?<br />
Try to convert the EPS to pdf using <span style="color: #38761d;"><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">ps2pdf temp.eps</span></span></span>. If you get an error like <span style="color: #990000;"><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">"Error: /limitcheck in /fontfont"</span></span></span> then there is a problem with the installed fonts. Try the diagnostic test described here [3]:<br />
<span style="color: #38761d;"><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">octave:1> set (0, "defaultaxesfontname", "Helvetica")</span></span></span><br />
<b>Solution</b>: remove the package <b>font-pagul. [1,2] </b><br />
<br />
<b>Links:</b><br />
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662892<br />
[2] http://octave.1599824.n4.nabble.com/3-6-1-produces-eps-files-that-are-unusable-on-Debian-wheezy-td4438420.html<br />
[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=710272#17<br />
<br />
<br /></div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-79097712660785628072013-01-11T19:42:00.001+05:302013-01-11T20:18:10.841+05:30Syntax highlighting for SPICE in gedit<div dir="ltr" style="text-align: left;" trbidi="on">
Ever viewed a SPICE netlist in gedit, and struggled to make sense of it? One thing that makes life easier is Syntax highlighting.<br />
<br />
We first need the .lang file for spice, which has been which can be <a href="https://raw.github.com/abhijit86k/Gedit-SPICE-syntax-highlighting/master/spice.lang" rel="nofollow" target="_blank">downloaded here.</a> Then copy this file (as root) to the relevant directory, which is : /usr/share/gtksourceview-3.0/language-specs/<br />
(You may have 1.0 or 2.0 etc. instead of 3.0)<br />
Restart gedit,open a netlist file, and click on highlighting scheme (probably "plain text" by default, and select SPICE)<br />
<br />
<br />
Ref: <a href="http://ubuntuforums.org/showthread.php?t=1150569" target="_blank">Ubuntu Forums</a></div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-90520229194279962792012-11-04T12:18:00.001+05:302012-11-04T12:20:54.681+05:30Mobile posting<div xmlns="http://www.w3.org/1999/xhtml"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtlz2rifAd8MqZHNXSKIg8fJ-L8znFMoysCrBdR9ZHPPRgIDYqxXtIBkwg6OzdAYvWKjMgjrIZ0aplMXGA8uMmvqlLrUuQ9oXHNHhcqIsCN1SY6Sbm3RFoStCvdPDpIqO5Pkkx79e0IV4/s1600/image-upload-33-705104.jpg"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0RCXnid7gueyYZbH5UhX4v8im0hmylg0fswnObsf87KnP4QVtDEzPDWYl751Oiz6XgZXAgtKKjtCxDlzposL_1gkh9SkoXmf3XLW2Ggi2NGgi4F4DdBgzaCr0QbG5MeJkIzf0OQ8SLUc/s320/image-upload-33-705104.jpg"/></a> <span>Setting up mobile posting for the phone!</span><br /> </div>Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-66744896798708321152012-09-17T16:32:00.000+05:302012-09-17T16:32:12.854+05:30Custom Launchers in GNOME 3<div dir="ltr" style="text-align: left;" trbidi="on">
Install 'alacarte', and then use!<br />
Self explanatory.</div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-62896002196839037922012-09-11T12:36:00.000+05:302012-09-11T12:36:03.605+05:30Dual boot clock problems<div dir="ltr" style="text-align: left;" trbidi="on">
Symptom:<br />
<br />
You have a dual boot machine with Windows and Linux. The Linux OS thinks the BIOS time is UTC, whereas windows thinks it is local time. So depending on what your BIOS clock is set to, one of the OSes will show a wrong clock.<br />
<br />
Solution:<br />
<ol style="text-align: left;">
<li>Decide what you want your BIOS clock to be. There are arguments for both sides.</li>
<li>If you want you BIOS to be set to UTC, then:</li>
<ol>
<li>Linux will be fine, because this is what is expects. </li>
<li>For Windows add a registry entry as follows.</li>
<li>Create a file called time.reg with the following content</li>
<span style="color: #38761d; font-family: "Courier New",Courier,monospace; font-size: x-small;">Windows Registry Editor Version 5.00
<br />[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
</span><span style="color: #38761d; font-family: "Courier New",Courier,monospace; font-size: x-small;">"RealTimeIsUniversal"=dword:00000001
</span>
<li>Then double click it - and accept the warnings that follow.</li>
<li>Done!</li>
</ol>
<li>If you want the BIOS to be set to Local time, then</li>
<ol>
<li>Leave Windows as it is</li>
<li>In Linux, add a line in the file <span style="color: #990000; font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">/etc/default/rcS</span></span> with the content <span style="color: #38761d; font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">UTC=no</span></span></li>
</ol>
</ol>
</div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-72618853300730799472012-07-16T17:26:00.000+05:302012-07-16T17:26:19.697+05:30Automounting Network partitions<div dir="ltr" style="text-align: left;" trbidi="on">
If you have network drives that you would like to be auto-mounted on startup on your Linux box, then the obvious way to do this seems to be to put the appropriate line in <span style="color: blue; font-family: "Courier New",Courier,monospace;">/etc/fstab</span>. (Note that for Windows shares, the appropriate packages have to be installed - samba and smbfs).<br />
<br />
However, if the fstab is executed before the network comes up, you have a problem - the mount will fail. The workaround is to either<br />
<ol style="text-align: left;">
<li>not do auto-mount, OR </li>
<li>delay the mount till the network is up OR</li>
<li>to use a program written specifically for this situation - <a href="https://help.ubuntu.com/community/Autofs" target="_blank">Autofs.</a> </li>
</ol>
<br />
<a name='more'></a>Despite a lot of struggling, autofs did not work, so went to option #2. The scheme is simple, after the system boots I run a small script to check if the network is up (by pinging a known server). I keep trying at fixed intervals till the network is found to be up, then I mount the remote drives. Note that corresponding entries have been made in <span style="color: blue; font-family: "Courier New",Courier,monospace;">/etc/fstab</span>.<h4 style="text-align: left;">
1. Create entries in fstab:</h4>
The <span style="color: blue;">fstab</span> entries look like this:<br />
<blockquote class="tr_bq">
<span style="color: #38761d; font-size: x-small;"><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">#Bhaskara</span><br style="font-family: "Courier New",Courier,monospace;" />
<span style="font-family: "Courier New",Courier,monospace;">//server/folder
/mount-pointhome cifs
defaults,noauto,locale=en_IN,uid=networkusername,password=networkpasswd,gid=localgroup,user=localuser
0 0</span></span></span><br />
</blockquote>
The "noauto" option ensures that these will not get mounted along with the local drives at bootup.<br />
<br />
<h4 style="text-align: left;">
2. Create the script </h4>
Now to create a script which, when called, will check if the network is up, and if it is, will mount the drive. This script is saved as (in this example):<br />
<b><span style="color: blue; font-family: "Courier New",Courier,monospace;">/home/myuser/bin/mount_drives</span> </b><br />
Ensure that you make this file executable.<br />
<blockquote class="tr_bq">
<span style="color: #38761d; font-size: x-small;"><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"><span style="color: purple;">#!/bin/bash</span><br />MAX_TRIES=60; <span style="color: purple;"># Defines the number of times to atempt</span><br />DELAY=5; <span style="color: purple;">#Delay between successive attempt</span><br /><br /><span style="color: purple;">#A Variable to keep track of network status:</span><br style="color: purple;" /><span style="color: purple;"># 0: Working</span><br style="color: purple;" /><span style="color: purple;"># non-zero: not working</span><br style="color: purple;" />NETSTAT=1;<br /><br /><span style="color: purple;">#Number of tries made:</span><br />COUNT=0;<br /><br /><span style="color: purple;">#Keep trying to reach the network:</span><br style="color: purple;" />while [ $NETSTAT != 0 ]; do<br />ping -A -c 5 server<br /><br /><span style="color: purple;">#Get return value for ping</span><br />NETSTAT=$?<br /><br /><span style="color: purple;">#Increment count value</span><br /><br />COUNT=$[$COUNT+1]<br /><br /><span style="color: purple;"> #If max no. of tries exceeded then quit</span><br /> if [ $COUNT = $MAX_TRIES ]; then<br /> exit 1<br /> fi<br /><br /> </span></span></span><span style="color: #38761d; font-size: x-small;"><span style="font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"><span style="color: purple;"></span>if [ $NETSTAT != 0 ]; then<br /> sleep $DELAY<br /> fi<br />done<br /><br />sudo mount //server/folder</span><span style="font-family: "Courier New",Courier,monospace;"></span></span></span></blockquote>
<blockquote class="tr_bq">
</blockquote>
This script will attempt to reach the server (by ping) every DELAY seconds, and will try a maximum of MAX_TRIES number of times. <br />
Now the only thing left to do is to:<br />
<h4 style="text-align: left;">
3. Run this script at every bootup.</h4>
To do this, simply add a line to the end of /etc/init.d/rc.local:<br />
<br />
<span style="color: #38761d; font-family: "Courier New",Courier,monospace; font-size: x-small;">/bin/bash /home/myuser/bin/mount_drives </span><br />
<br />
<br />
<br />
<br /></div>Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-4931424049971674272012-07-13T07:26:00.000+05:302012-07-13T07:26:36.758+05:30From J. N. Tata to Swami Vivekananda<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Dear Swami Vivekanand,<br />
<br />
I trust you remember me as a fellow-traveller in your voyage from Japan to Chicago [in 1893].
I very much recall at this moment your views on the growth of the ascetic spirit in India and the
duty, not of destroying, but of diverting it into useful channels.
I recall these ideas in connection with my scheme of a Research Institute for India, of which
you have doubtless heard or read.<br />
<br />
<a name='more'></a><br />
It seems to me that no better use can be made of the ascetic
spirit than the establishment of monasteries or residential halls for men dominated by this
spirit, where they should live with ordinary decency and devote their lives to the cultivation of
sciences — natural and humanistic. I am of opinion that if such a crusade in favour of an
asceticism of this kind were undertaken by a competent leader, it would greatly help asceticism
in science, and the good name of our common country, and I know not who would make a more
fitting general of such a campaign [than] Vivekanand.<br />
<br />
So you think you would care to apply
yourself to the Mission of galvanizing into life our ancient traditions in this respect? Perhaps,
you had better begin with a fiery pamphlet rousing our people in this matter? I should
cheerfully repay all the expenses of publication.<br />
<br />
<div style="text-align: left;">
With kind regards,</div>
<div style="text-align: center;">
I am dear Swami </div>
<div style="text-align: right;">
Yours faithfully
Jamsetji N. Tata </div>
<div style="text-align: right;">
<br /></div>
<div style="text-align: right;">
<br /></div>
<div style="color: #351c75; text-align: left;">
<span style="font-size: x-small;"><br /></span></div>
<div style="text-align: left;">
<span style="color: #351c75; font-size: x-small;">This letter was written sometime before 1900, and I chanced upon it in an old archive. The Research Institute of India that J. N. Tata talks about, which he subsequently founded, is today the <a href="http://www.blogger.com/">Indian Institute of Science</a> situated at Bangalore.</span></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
</div>Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-14867584837850004372012-07-13T06:41:00.001+05:302012-07-13T06:44:06.718+05:30Compiling ngSPICE on Ubuntu 12.04<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Wanting to install the latest version of <a href="http://ngspice.sourceforge.net/" target="_blank">ngSPICE</a> on the new Ubuntu 12.04 box, i ran into a little trouble. The first is that ngSPICE is a very powerful interactive software, but the plain vanilla command line is really painful to use because it does not support backspace and arrow keys. The fix for this is to use the GNU readline library. Unfortunately, without the correct X packages installed, you will end up with a functioning installation of ngSPICE that cannot plot data, <a href="http://archives.seul.org/geda/user/Aug-2007/msg00036.html" target="_blank">complaining that it "Cannot open viewport"</a>. The fix for this is to install the following packages:<br />
<br />
Install <span style="color: #274e13; font-family: "Courier New",Courier,monospace;"><span style="color: #38761d;">autoconf and libtool</span> </span> if you are running autogen.sh<br />
<br />
<br />
Install <span style="color: #38761d; font-family: "Courier New",Courier,monospace;">bison</span>, else configure will not run.<br />
<br />
For GNU Readline support, install <span style="color: #38761d; font-family: "Courier New",Courier,monospace;">libreadline6, libreadline6-dev </span><br />
For Plotting, install: <span style="color: #38761d; font-family: "Courier New",Courier,monospace;">libxaw7, libxaw7-dev, libx11-6, libx11-dev</span></div>
<br />
Then run <span style="color: #38761d;">./configure --with-readline</span><br />
<br />
Then make and then [sudo] make install...
</div>Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-11801671340353802272012-07-12T14:39:00.002+05:302012-07-17T12:02:15.501+05:30Backing Up with Rsync<div dir="ltr" style="text-align: left;" trbidi="on">
There's always a moment of butterflies when your machine hangs, or doesn't boot up, or shows some cryptic message and dies. In the few minutes following my last such catastrophe, I berated myself for not taking regular backups on an external drive. Then I started to look at trying to recover the data using a <a href="http://en.wikipedia.org/wiki/Live_CD" target="_blank">live CD</a>. When I finally got the new OS going I decided the first thing to do was to set up a system to silently backup the system every once in a while, either to a USB hard drive or to a network drive. So I wrote a script to do this using rsync. The script is as follows, with explanations for each line...<br />
<br />
<a name='more'></a><br />
<br />
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
</div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
</div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">#!/bin/bash</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#This tells the shell that this is a bash script</span></span><br />
<span style="font-size: x-small;">#Script to backup the contents of my desktop machine to an external device<br />#identified by the following UUID:<br /><br />TARGET_UUID=84f15456-ce64-52be-c488-e88125e623a30;</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#This line defines which device is to be used as the backup device. For example, #backups must be made ONLY to a specific hard disk, not just any device that may #be plugged in</span></span><span style="color: #38761d; font-size: x-small;">. </span><span style="color: #38761d; font-size: x-small;">If a new backup device is to be used, change the UUID!</span><span style="font-size: x-small;"><span style="color: #38761d;"> If a new #backup device is to be used, change the UUID!</span></span><br />
<span style="font-size: x-small;"><span style="color: #38761d;"># </span><br /><br />MAINLOG=/home/someuser/serverbackup.log</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#Set a variable with the name of a main log file. This will contain broad info, #like date of last backup and success or failure stats.</span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">VERBOSELOG=/home/</span><span style="font-size: x-small;">someuser</span><span style="font-size: x-small;">/backupdetails.log</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#This file contains the details of what files were backed up, how much time it #took, etc etc.</span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<br /></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">BACKUPTARGET=/home/</span><span style="font-size: x-small;">someuser</span><span style="font-size: x-small;">/BACKUP/</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#This is the location where the backup drive will be mounted. If the drive is #mounted in the same location.</span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#NOTE: USB devices usually get automounted on insertion in Ubuntu. If this is the #case, you may want to either </span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;"># 1. disable automount for that particular device,</span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;"># 2. Mount to a fixed location always</span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;"># 3. allow automount and then figure out at run time if the device is mounted,</span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;"># and where. Naturally this is the most robust approach but my script assumes automount has been disabled for my drive.</span></span><br />
<span style="font-size: x-small;"><br />#Status Variable, used for logging also<br />ERROR=0; #0:Success , Non-Zero:Failure(s)</span><span style="font-size: x-small;"><span style="color: #38761d;">#This is a status variable which will keep accumulating the error values</span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<br />
<span style="font-size: x-small;">#Alias for RSync:<br />alias rsync='rsync -az --delete-after'<br />shopt -s expand_aliases</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#I don't want to be typing out the full rsync command, so I make an alias for it. #Note that when a bash script is executed, NONE of the environment variables or #aliases from the original shell are available to it. It runs in a 'fresh and #clean' shell, so to speak. </span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#Moreover, even if an alias is defined, it DOES not get expanded unless explicitly #told to do so using the "shopt" command</span></span><br />
<br />
<span style="font-size: x-small;"><span style="color: #38761d;">#Rsync Options: </span></span><br />
<span style="font-size: x-small;"><span style="color: #38761d;">#-az archive mode: preserve directory structure, permissions, etc</span></span><br />
<span style="font-size: x-small;"><span style="color: #38761d;">#--delete-after: delete files from the target that are no longer on the source</span></span><br />
<span style="font-size: x-small;"><span style="color: #38761d;">#IF your target is an NTFS formatted disk, or a drive on a windows machine,</span></span><br />
<span style="font-size: x-small;"><span style="color: #38761d;"># then links cannot be copied. So use the --no-l (no links) option also. </span></span><br />
<span style="font-size: x-small;"><br /># The date of the lastbackup is stored in a file called <br /># lastdiskbackup</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#A file with the date of the last backup is kept. This prevents us from making a #backup when a very recent backup has already been made. This is VERY useful when #the backups are to be made automatically via a cron job.</span></span><br />
<span style="font-size: x-small;"><br />if [ -e lastdiskbackup ]; then<br /><span style="color: #38761d;">#If it does not exist then create it</span><br />echo "";</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#Just a dummy statement</span></span><br />
<span style="font-size: x-small;">else<br />date --date="10 years ago" > lastdiskbackup;<br />fi</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><br /></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;"><br /></span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#Calculate when the last backup was made</span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<br />
<span style="font-size: x-small;">DAYS_SINCE_LAST_BACKUP=$(echo $"(( $(date +%s) - $(date --date="`cat lastdiskbackup`" +%s) ))/(60*60*24)"|bc)</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><br /></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#If the last backup to disk was done today, then don't backup again.</span><br />if [ $DAYS_SINCE_LAST_BACKUP = 0 ]; then<br />echo "Last backup was just $DAYS_SINCE_LAST_BACKUP ago. Quitting"<br /><span style="color: #38761d;">#Exit from the script</span> </span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">exit 0;<br />fi</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><br /></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">echo "*********************************************************************" >> $MAINLOG<br />echo "`date`" >> $MAINLOG<br />echo "Backing up to Disk" >> $MAINLOG<br />echo "" >> $MAINLOG</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<br /></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#Pretty print to the main log</span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><br /></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><br />echo "*********************************************************************" >> $VERBOSELOG<br />echo `date` >> $VERBOSELOG<br />echo "" >> $VERBOSELOG</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;">#Pretty print to the verbose log</span></span><br />
<span style="font-size: x-small;"><br />#********************************************************************<br /><span style="color: #38761d;">#Mount Local Drive for backup </span><br />if [ -e /dev/disk/by-uuid/$TARGET_UUID ] ; then<br />echo "Backup Drive Found...">> $VERBOSELOG<br />else<br />echo "Fatal: Disk Not found" >> $MAINLOG<br />exit 0<br />fi<br /><br />echo "Mounting Backup Drive...">> $VERBOSELOG<br />mount /dev/disk/by-uuid/$TARGET_UUID /some/folder/ &>> $VERBOSELOG<br />echo "" >> $VERBOSELOG<br />echo "" >> $VERBOSELOG</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"></span></div>
<div style="color: #38761d; font-family: "Courier New",Courier,monospace;">
<br /></div>
<div style="color: #38761d; font-family: "Courier New",Courier,monospace;">
<br /></div>
<div style="color: #38761d; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">#I put this to check for the existence of a certain file. In case there is </span></div>
<div style="color: #38761d; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">#a problem with the mount, or the wrong drive gets mounted this is </span></div>
<div style="color: #38761d; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">#still a fall-back check to make sure that the expected drive has been </span></div>
<div style="color: #38761d; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">#mounted in the right place.</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
</div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<br />
<span style="font-size: x-small;">if [ -e /some/folder/testfile ] ; thenecho "" > /dev/null;<br />else<br />echo "Fatal: Backup Location not found" >> $MAINLOG<br />exit 0<br />fi</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><br /></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;">#--------------------------------------------------------------------<br />#BACKUPS<br />#--------------------------------------------------------------------</span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="font-size: x-small;"><span style="color: #38761d;"># The actual backups...</span></span><br />
<span style="font-size: x-small;"><span style="color: #38761d;"># make as many copies of this snippet, changing the arguments to rsync to suit</span></span><br />
<span style="font-size: x-small;"><span style="color: #38761d;"># your requirements. You should be backing up only really important stuff - </span></span><br />
<span style="font-size: x-small;"><span style="color: #38761d;"># if you back up your entire /home you may end up backing up just a lot </span></span><br />
<span style="font-size: x-small;"><span style="color: #38761d;"># of garbage that you cannot or will never use.</span></span></div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
</div>
<div style="color: purple; font-family: "Courier New",Courier,monospace;">
<span style="color: purple; font-size: x-small;">echo "Backing Up HOME" >> $VERBOSELOG<br />echo "--------------" >> $VERBOSELOG<br />rsync /home/myuser/ $DEST >> $VERBOSELOG<br />ERROR=$[$ERROR+$?];<br />echo "" >> $VERBOSELOG<br /><br /><span style="font-family: "Courier New",Courier,monospace;">#--------------------------------------------------------------------</span></span><br />
<span style="color: purple; font-size: x-small;"></span><br />
<span style="color: purple; font-size: x-small;"><br style="font-family: "Courier New",Courier,monospace;" /><span style="color: #38761d; font-family: "Courier New",Courier,monospace;"># Now we are done with the backing up; remove (unmount)</span></span><br />
<span style="color: purple; font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"><span style="color: #38761d;"># the backup disk</span></span></span><br />
<br />
<span style="color: purple; font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;">echo "Unmounting backup drive:" >> $VERBOSELOG</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">umount $BACKUPTARGET >> $VERBOSELOG</span><br style="font-family: "Courier New",Courier,monospace;" /><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">if [ $ERROR = 0 ]; then</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">echo "Successfully Completed backup" >> $MAINLOG</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">else</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">echo "Backup Unsuccessful. There were errors. [Code: $ERROR]" >> $MAINLOG</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">fi</span><br style="font-family: "Courier New",Courier,monospace;" /><br style="color: #38761d; font-family: "Courier New",Courier,monospace;" /><span style="color: #38761d; font-family: "Courier New",Courier,monospace;">#Change date in the file to reflect this backup</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">date > lastdiskbackup</span></span><br />
<br />
<div style="text-align: left;">
<span style="color: purple; font-size: x-small;"><span style="font-family: "Courier New",Courier,monospace;"><span style="font-family: Times,"Times New Roman",serif; font-size: small;"></span><span style="font-family: Times,"Times New Roman",serif;"> </span></span></span></div>
</div>
<div dir="ltr" style="text-align: left;" trbidi="on">
Now for the last part of the exercise: creating a launcher. Until Unity and GNOME came along, things were fine - a right click on the desktop bar would let you add a launcher. Now in unity you need to do something extra - create a file in <span style="color: purple; font-family: "Courier New",Courier,monospace;">/usr/share/applications</span> as explained <a href="http://askubuntu.com/a/137228" target="_blank">here</a>. Not happy with the icon? Select one from <span style="color: purple;"></span><span style="color: purple; font-family: "Courier New",Courier,monospace;">/usr/share/icons</span> and type in the file name in the field for icon.<br />
<br />
<br /></div>
</div>Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-77261839493817372542012-05-08T15:49:00.001+05:302013-04-25T17:40:19.444+05:30Custom Bash Prompts<div dir="ltr" style="text-align: left;" trbidi="on">
When working on some tasks the bash prompt can become irritating. Moreover, switching back and forth can get pretty irritating with the export commands. So here is a small script to do the job conveniently. Just <a href="https://github.com/abhijit86k/colash/archive/ae05db845a67d802d2d84e86b7bd5f5c13d71dcb.zip" target="_blank">download </a>the package and read the README file for detailed information on installation and usage.</div>
Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com1tag:blogger.com,1999:blog-8824749339493699724.post-71680456479528330402012-03-26T15:27:00.001+05:302012-03-26T15:27:36.095+05:30Divine Music Springs from the Soul<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: center;">
Divine Music Springs from the Soul</h2>
<h4 style="text-align: center;">
By Pandit Amarnath</h4>
<div style="text-align: left;">
<br style="font-family: Georgia,"Times New Roman",serif;" /><span style="font-family: Georgia,"Times New Roman",serif;">The word </span><i style="font-family: Georgia,"Times New Roman",serif;">riyaz</i><span style="font-family: Georgia,"Times New Roman",serif;"> has its origins in </span><i style="font-family: Georgia,"Times New Roman",serif;">riyazi</i><span style="font-family: Georgia,"Times New Roman",serif;">, which implies </span><i style="font-family: Georgia,"Times New Roman",serif;">ibadat</i><span style="font-family: Georgia,"Times New Roman",serif;">, </span><i style="font-family: Georgia,"Times New Roman",serif;">bandagi</i><span style="font-family: Georgia,"Times New Roman",serif;">, </span><i style="font-family: Georgia,"Times New Roman",serif;">bhakti</i><span style="font-family: Georgia,"Times New Roman",serif;"> or devotion. If riyaz is performed with a spirit of devotion, the exercise becomes ibadat. But while riyaz is equated with practice or exercise, the all-important difference is one of spirit. Riyaz is to achieve that which has not been achieved so far. For that, the student has to struggle with faith. </span><br style="font-family: Georgia,"Times New Roman",serif;" /><br style="font-family: Georgia,"Times New Roman",serif;" /><span style="font-family: Georgia,"Times New Roman",serif;">In the initial one might be less than sure whether one is correct in what one is doing. But that is the struggle! In the absence of faith, one's riyaz will be filled with doubt. Faith is of great importance in riyaz. Practice with a doubt-riden mind will achieve little. </span><br style="font-family: Georgia,"Times New Roman",serif;" /><span style="font-family: Georgia,"Times New Roman",serif;"> </span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;">The first step in riyaz is to concentrate on the supremely soothing notes of the tanpura that connotes <i>sruti</i>. This is followed by <i>kharaj sadhana</i> or practice of <i>Sa</i> with a deep breath. Gradually, one moves to the exercises or scales suggested by the guru - <i>sargam</i> (each note named and sung), <i>aakar</i>, <i>eekar</i> and <i>ookar</i> (aa-wise, ee-wise, oo-wise). From here one moves to intricacies such as <i>gamak</i>, or swara applications producing the heavy effect. All this should be done with <i>laya</i> or tempo, in mind and, if possible, with tabla accompaniment. </span><br style="font-family: Georgia,"Times New Roman",serif;" /><span style="font-family: Georgia,"Times New Roman",serif;"> </span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;">Riyaz is an everyday activity, a daily prayer to the God of Music. When one arrives at the stage of raga and <i>gayaki</i>, one becomes aware of what is weak in one's music and attends to it. At times, a raga might not seem satisfactory, or the <i>bandish</i> may not lend itself to easy rendition in laya. At times, one's riyaz could focus on one aspect and neglect another. Nut a stage should arrive when one cam judge what should be practiced at a particular time.</span><br style="font-family: Georgia,"Times New Roman",serif;" /><br style="font-family: Georgia,"Times New Roman",serif;" /><span style="font-family: Georgia,"Times New Roman",serif;">The Guru, the beacon, provides direction. It is important to be able to feel a sense of improvement during practice. That means one's riyaz and its method is basically correct. Or else, one should seek the help of the Guru, our music doctor!</span><br style="font-family: Georgia,"Times New Roman",serif;" /><br style="font-family: Georgia,"Times New Roman",serif;" /><span style="font-family: Georgia,"Times New Roman",serif;">I have often observed students 'performing' like strutting peacocks during riyaz. In his excitement, the student is prone not to listen to his Guru. Before his guru completes his sentence, the over-eager student interrupts with his own views, without giving his Guru a chance, Is this not a sign of restlessness or overambitiousness? Every second student exhibits such signs. </span><br style="font-family: Georgia,"Times New Roman",serif;" /><br style="font-family: Georgia,"Times New Roman",serif;" /><span style="font-family: Georgia,"Times New Roman",serif;">Another commonly experienced problem in the initial stage is that of feeling dull with one's music. Here one has to practice for mood. One should not sit down mechanically for riyaz. In such times, one should listen to good music to recharge oneself. </span><br style="font-family: Georgia,"Times New Roman",serif;" /><br style="font-family: Georgia,"Times New Roman",serif;" /><span style="font-family: Georgia,"Times New Roman",serif;">Mental Riyaz is extremely important. Music is deeply understood when one thinks about it and reflects about it. The music that then emerges is close to the soul. Once one immerses oneself in Sadhana for a very long time, one's swaras will begin to leave a deep impression. </span><br style="font-family: Georgia,"Times New Roman",serif;" /><span style="font-family: Georgia,"Times New Roman",serif;"> </span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;">One should always be regular in riyaz - whether vigorous or not. If one discontinues riyaz in old age, the muscles become dull, hard and inactive. The mood for riyaz should never go away. Even a wrinkled face can produce music of great emotion! In fact every action in one's music becomes more meaningful. The vigour of youth might be less in evidence, but to make up for its lack there is maturity and richness of texture. Whether a small or big phrase, each is charged with the power of the whole music, because the grammar of phrases and sentences is not its sole element anymore. </span><br style="font-family: Georgia,"Times New Roman",serif;" /><span style="font-family: Georgia,"Times New Roman",serif;"> </span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;">It is now all a matter of soul. One's music is now the true picture of one's soul.</span></div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
<br style="font-family: Georgia,"Times New Roman",serif;" /><span style="font-family: Georgia,"Times New Roman",serif;">(Excerpted from the book "Conversations with Pandit Amarnath" by Bindu Chawla ISBN:8185503079. This extract appeared in 'The Times of India' sometime in 1994, sometime before the book was published)</span>. </div>
</div>Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-90751692310125005882012-03-12T12:11:00.002+05:302012-03-12T12:36:42.808+05:30Opening external Links in Thunderbird (now Earlybird)<div dir="ltr" style="text-align: left;" trbidi="on">
After deciding to switch to Mozilla Thunderbird (which, incidentally is called 'Earlybird') I ran into some rough weather. First off, the latest version, 10.0.2 is not available from the official Ubuntu repositories for Maverick (10.10). So I downloaded the source from the Mozilla FTP archive, which is a whopping 92MB. Fixing dependencies and compiling took extraordinarily long, or so it seemed. <br />
Then began the trouble of migrating all my data from Evolution to Thunderbird.<br />
<br />
<a name='more'></a><br /><br />
Filters and Tags:<br />
<br />
Migrating filters turned out to be an extremely tricky part. In Evolution the filter philosophy is slightly different. You can have the filters apply colors to messages - e.g. red to important ones, green to interesting ones and gray to unimportant ones. If multiple colors are assigned, the last assigned color stays - so filter order is all that needs to be checked.<br />
<br />
In Thunderbird there are tags, and tags have colors. A message can be tagged by one or more filter, and a message can have many tags. The question now is - if a message has two tags, "Priority" (colored red) and "Bulk" (colored gray), what will the message color be? The color will be gray, because tags are 'stacked' in alphabetical order. This happens irrespective of the order in which the filters are applied. The only workaround is to name your tags like this:<br />
"1- Important"<br />
"2- Slightly Important"<br />
"3- Marginally important"<br />
"4- Not important"<br />
etc. This way the color for "1- Important" will dominate over all those below it.<br />
<br />
In addition tags are stored internally somewhere, and the name and color are only 'external' properties. Some HTML web clients like Zimbra will show the actual internal tag names.<br />
<br />
External Links:<br />
<br />
The second part of the problem lies in the inability of Thunderbird to open links. The fix was simple, with clear and step-wise instructions given in this <a href="http://kb.mozillazine.org/Default_browser" target="_blank">Mozilla Knowledge Base Article</a>.</div>Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-55753554136839403022012-01-31T23:54:00.033+05:302012-03-12T12:38:06.276+05:30Project Initialisation Script<div dir="ltr" style="text-align: left;" trbidi="on">
I was finding it more and more difficult, not to mention irritating, to have to change working directories and open up the appropriate folders when working on oft repeated tasks on my Ubuntu machine. So I patched together a small script - complete with autocomplete...<br />
<br />
<a name='more'></a><br /><br />
For example, when i am working on assignments for my course work, I need<br />
<ul style="text-align: left;">
<li>A terminal with the correct working directory (something like ~/Coursework/Assignments/)</li>
<li>Nautilus showing the contents of this folder</li>
<li>PDF documents in this folder opened</li>
<li>Octave open</li>
</ul>
Similarly when working on a separate project i want:<br />
<ul style="text-align: left;">
<li>A terminal with a different working directory</li>
<li>Source files opened in an editor</li>
<li>Firefox showing certain webpages.</li>
</ul>
It is very irritating to keep doing this every time I reboot my machine and resume what I was doing. So I wrote a small scipt to do all these things in one shot, when I start a project. The script first checks if the argument is one of a number of pre-set keywords. If there is a match then all the commands for that keyword are executed. Last, the command 'bash' ensures that I get a terminal with the desired path (working directory).<br />
<br />
So if i'm working on a project that is called "spicetools", i simply open a terminal and enter "init spicetools" and all my required windows are open. (I even do git fetch and git merge)<br />
<br />
Nesting:<br />
One unexpected feature is that nested 'init' commands are possible. So if i'm working on project X, I start by doing "init X". Then someone comes and interrupts me to ask about project Y. All i do is "init Y" and i'm now in Y. After i'm done all I do is key in "exit" and I'm back where I was in Project X!<br />
<br />
The script itself can be downloaded from <a href="http://www.cedt.iisc.ernet.in/people/students/kabhijit/utilities/Init_scripts/init" target="_blank">here.</a> Remember to add execute permissions when it is saved on your machine. Copy it into your ~/bin/ directory so that you do not have to specify the full path each time.<br />
<br />
Try the script with "Init X". Open it in a text editor, read it and make modifications as you require.<br />
<br />
Afterword:<br />
I realised, after having created the script, that I was forgetting the keywords I had assigned for the various projects. As a result I created a script to do <a href="http://www.debian-administration.org/article/317/An_introduction_to_bash_completion_part_1" target="_blank">autocompletes on the bash terminal</a>. <br />
You can download my autocomplete file (init.autocomplete) from <a href="http://www.cedt.iisc.ernet.in/people/students/kabhijit/utilities/Init_scripts/init.autocomplete" target="_blank">here</a>. This file must be placed in /etc/bash_completion.d/, and then start a new terminal. To add more options to the autocomplete, simply edit the autocomplete script.<br />
<br />
TODO:<br />
The init.autocomplete, when placed in /etc/bash_completion.d/ gets executed when a new terminal is started. So it can be made to read the init script itself and figure out what are the available keywords.</div>Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0tag:blogger.com,1999:blog-8824749339493699724.post-11021926171405229812012-01-08T05:38:00.001+05:302012-11-04T12:20:54.685+05:30A test post..<div xmlns="http://www.w3.org/1999/xhtml"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizYFi35cui6TZ0jl4YXmzzet-R6uf3t-ftPbxki82mfCF8ciksa1TwICjE21mWFt4xpRkytkjhIaKeFDX1R9qaWQMAOJ9a3R8NZnGzeU6pA-I9lIwvTbdO1ouXnRmVXvTiPSlQbVI4G5I/s1600/image-upload-70-720324.jpg"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY9-xKOyOjcyBZgO9mygVse39osKHPx3vOVKPk889qhtmHsYQa3J83AU5_cRlZNbaz_aTFPdacdFmPkqRos56SHPg_vz1xa9gEq28_YSIok-kPceCTCuoNQwlQMHOA2pFYn47hH6Ixh98/s320/image-upload-70-720324.jpg"/></a> <span>Starting mobile blogging from the j108i...</span><br /> </div>Abhijit Kshirsagarhttp://www.blogger.com/profile/18187607680172083538noreply@blogger.com0