<?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-5332763671710458168</id><updated>2024-09-19T03:36:20.054-07:00</updated><category term="Ubuntu"/><category term="Linux"/><category term="LaTeX"/><category term="windows"/><category term="Firefox"/><category term="Programming"/><category term="fonts"/><category term="Emacs"/><category term="BibTeX"/><category term="Dropbox"/><category term="Git"/><category term="Gnome"/><category term="Teamviewer"/><category term="ftp"/><category term="matlab"/><category term="Academic"/><category term="Android"/><category term="CVS"/><category term="Daemon"/><category term="Encryption"/><category term="Gmail"/><category term="Google"/><category term="Hard Disk"/><category term="JabRef"/><category term="LXDE"/><category term="LyX"/><category term="MS Word"/><category term="Picasa"/><category term="Printer"/><category term="Proxy"/><category term="Rainmeter"/><category term="Thoughts"/><category term="Virus"/><category term="cron"/><category term="crontab"/><category term="ipv6"/><category term="pdf"/><category term="virtualbox"/><category term="vnc"/><category term="windows xp"/><title type='text'>Fluky Logs</title><subtitle type='html'>Just another random web-log, containing all types of information.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://flukylogs.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><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>53</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-2526761356266993581</id><published>2017-01-21T17:16:00.000-08:00</published><updated>2017-01-21T17:25:27.474-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Generate random password on Linux terminal</title><content type='html'>This just a log for me (&amp;amp; may be others) to remind me how to generate random passwords on Linux terminal. &lt;a href=&quot;https://sourceforge.net/projects/pwgen/&quot; target=&quot;_blank&quot;&gt;&lt;tt&gt;pwgen&lt;/tt&gt;&lt;/a&gt; is a useful command which can generate both pronounceable and secure passwords. There a &lt;a href=&quot;http://unix.stackexchange.com/q/230673&quot;&gt;few other&lt;/a&gt; &lt;a href=&quot;http://askubuntu.com/q/25090&quot;&gt;creative ways&lt;/a&gt; to generate random text/password on linux terminal, but pwgen is specially designed for the task and is the most handy.


 The usage is quite simple:&lt;br /&gt;
&lt;code&gt;pwgen [ OPTIONS ] [ pw_length ] [ num_pw ]&lt;/code&gt;

By default, pwgen generates pronounceable passwords. For secure password use &lt;tt&gt;-s&lt;/tt&gt; option. The &lt;a href=&quot;https://linux.die.net/man/1/pwgen&quot; target=&quot;_blank&quot;&gt;pwgen man page&lt;/a&gt; describes more options. Here are some example outputs:&lt;br /&gt;
&lt;br /&gt;

Generate 6 random (pronounceable) passwords of length 20.
&lt;code&gt;$ pwgen 20 6
fei7hohS9co6ahkua2ei chaiFoo2eaLedei9Oosi Ainuu5eehie5ae1eecae
co6quahbaiPahSh1good fah6Daer7geepae0teef queeLahl9us7sushawie
&lt;/code&gt;&lt;br /&gt;

Generate 6 random (secure) passwords of length 20.
&lt;code&gt;$ pwgen -s 20 6
PTbQ8Nc8gIJ5sHrKM0gS pMI8R8KK0MrnCd4UCEhe 25KcqpYiQTOFYf7PHwoN
ztClxu7CQiOOVPgNJFHa yKnc1obXyXLvmPmLAVWA L1fMNHRRHiC2MNWS6j2Z
&lt;/code&gt;&lt;br /&gt;

Generate 6 random passwords of length 20 with special characters.
&lt;code&gt;$ pwgen -y 20 6
EN5eb2eyuz2ohNgir}ei yah&amp;gt;l9ainohWah8afaiJ Jue-dah3quoo8wee9foh
ul)eoWie3Ees;aeh(ees pheehie+Zanahw~eiP5g dath5oozaht0fei&amp;amp;F4Xi
&lt;/code&gt;&lt;br /&gt;

Generate 6 random (secure) passwords of length 20 with special characters.
&lt;code&gt;$ pwgen -s -y 20 6
JSt]pL1UV)`u&amp;gt;Rz%;]Ei yx-sWF#pm_ci?(w|D0pd [#W%%E%oP7vQ~U%?#L&amp;lt;9
:~Y:Z?LH&#39;&#39;aHH&amp;amp;A$zJ4w zZ5vZH+ABm!k;S_b^#cb c&quot;zpT6l1HI_&quot;ENSuNAkw
&lt;/code&gt;&lt;br /&gt;

Lastly, here is the pwgen help text:
&lt;code&gt;$ pwgen --help
Usage: pwgen [ OPTIONS ] [ pw_length ] [ num_pw ]

Options supported by pwgen:
  -c or --capitalize
        Include at least one capital letter in the password
  -A or --no-capitalize
        Don&#39;t include capital letters in the password
  -n or --numerals
        Include at least one number in the password
  -0 or --no-numerals
        Don&#39;t include numbers in the password
  -y or --symbols
        Include at least one special symbol in the password
  -s or --secure
        Generate completely random passwords
  -B or --ambiguous
        Don&#39;t include ambiguous characters in the password
  -h or --help
        Print a help message
  -H or --sha1=path/to/file[#seed]
        Use sha1 hash of given file as a (not so) random generator
  -C
        Print the generated passwords in columns
  -1
        Don&#39;t print the generated passwords in columns
  -v or --no-vowels
        Do not use any vowels so as to avoid accidental nasty words
&lt;/code&gt;&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/2526761356266993581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/2526761356266993581'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2017/01/generate-random-password-on-linux.html' title='Generate random password on Linux terminal'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-1696730671928335457</id><published>2015-09-11T15:14:00.001-07:00</published><updated>2015-09-11T15:14:45.018-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Daemon"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Teamviewer"/><title type='text'>TeamViewer initctl start fail on Linux</title><content type='html'>Tested on: Linux Mint 17.1 Rebecca (Ubuntu 14.04.1 LTS) with TeamViewer 10.0.46203&lt;br/&gt;&lt;br/&gt;

&lt;a href=&quot;https://www.teamviewer.com/&quot;&gt;TeamViewer&lt;/a&gt; is great! But it keeps a daemon running in background, which may not be very desirable for occasional users. The daemon can be disabled by running: 
&lt;!-- adsense --&gt;
&lt;code&gt;$ teamviewer daemon disable

tee: /opt/teamviewer/logfiles/install_teamviewerd.log: Permission denied

Fri Sep 11 14:12:42 PDT 2015
Action: Removing ...
initctl stop teamviewerd
initctl: Unknown instance: 
fail

rm: cannot remove ‘/etc/init/teamviewerd.conf’: Permission denied
initctl: Rejected send message, 1 matched rules; type=&quot;method_call&quot;, sender=&quot;:1.113&quot; (uid=1000 pid=22111 comm=&quot;initctl reload-configuration &quot;) interface=&quot;com.ubuntu.Upstart0_6&quot; member=&quot;ReloadConfiguration&quot; error name=&quot;(unset)&quot; requested_reply=&quot;0&quot; destination=&quot;com.ubuntu.Upstart&quot; (uid=0 pid=1 comm=&quot;/sbin/init&quot;)&lt;/code&gt;


OK, using &lt;tt&gt;sudo&lt;/tt&gt; seems to do the trick:

&lt;code&gt;$ sudo teamviewer daemon disable

Fri Sep 11 14:14:55 PDT 2015
Action: Removing ...
initctl stop teamviewerd
initctl: Unknown instance: 
fail

wine: /home/username/.config/teamviewer10 is not owned by you&lt;/code&gt;

&lt;br/&gt;After disabling daemon, TeamViewer shows following error message when started, which is expected. However, the daemon fails to start when the command is executed: &lt;br/&gt; &lt;br/&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCoxhyAAZkmd8_uF6yoriVu-M2BeKdME4IjnCu_32WlOMPK-rSMtp_b2CKpV3zax3N_uVmsPScqCfExetTTWfGpCb3Olv9dUbN7JEQZmCK7OMCIRgvbSABrk0oYxmeDDwFlISVDTM1r1qO/s1600/teamviewer-error.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCoxhyAAZkmd8_uF6yoriVu-M2BeKdME4IjnCu_32WlOMPK-rSMtp_b2CKpV3zax3N_uVmsPScqCfExetTTWfGpCb3Olv9dUbN7JEQZmCK7OMCIRgvbSABrk0oYxmeDDwFlISVDTM1r1qO/s1600/teamviewer-error.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;

&lt;code&gt;$ sudo teamviewer daemon start

initctl start teamviewerd
initctl: Unknown job: teamviewerd
fail


$ sudo teamviewer --daemon start

initctl start teamviewerd
initctl: Unknown job: teamviewerd
fail&lt;/code&gt;

&lt;tt&gt;initctl&lt;/tt&gt; is not aware of &lt;tt&gt;teamviewerd&lt;/tt&gt;, probably because &lt;tt&gt;/etc/init/teamviewerd.conf&lt;/tt&gt; was deleted during the daemon disable command (see above). Reinstalling teamviewer makes it work, but that&#39;s not the best solution. 

&lt;br/&gt;&lt;br/&gt;After looking into some more details, following command can be used to start the daemon (open TeamViewer as usual after this and Ctrl-C to kill the daemon):

&lt;code&gt;$ sudo /opt/teamviewer/tv_bin/teamviewerd -f&lt;/code&gt;


&lt;br/&gt;For reference, initial content of &lt;tt&gt;/etc/init/teamviewerd.conf&lt;/tt&gt; can be found in &lt;tt&gt;/opt/teamviewer/tv_bin/script/teamviewerd.DEB.conf&lt;/tt&gt;, which can also be modified and copied to correct location. Also see &lt;a href=&quot;https://github.com/dnschneid/crouton/issues/99&quot;&gt;this Github discussion&lt;/a&gt; and &lt;a href=&quot;http://www.deepthought.ws/linux/fix-teamviewer-initctl-start-on-ubuntu/&quot;&gt;this blog post&lt;/a&gt; for more details.

</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/1696730671928335457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/1696730671928335457'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2015/09/teamviewer-initctl-start-fail-on-linux.html' title='TeamViewer initctl start fail on Linux'/><author><name>Unknown</name><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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCoxhyAAZkmd8_uF6yoriVu-M2BeKdME4IjnCu_32WlOMPK-rSMtp_b2CKpV3zax3N_uVmsPScqCfExetTTWfGpCb3Olv9dUbN7JEQZmCK7OMCIRgvbSABrk0oYxmeDDwFlISVDTM1r1qO/s72-c/teamviewer-error.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-2956048262002969614</id><published>2015-05-12T12:02:00.000-07:00</published><updated>2015-05-12T12:03:37.354-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="LaTeX"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>tikz.sty not found</title><content type='html'>Tested on: Linux Mint 17.1 Rebecca (Ubuntu 14.04 LTS - Trusty Tahr)&lt;br /&gt;
&lt;br /&gt;
This error with pdflatex has been mystery to me for a long time. Surprisingly, it is not easy to find a clear solution online.&lt;br /&gt;
&lt;code&gt;ERROR: LaTeX Error: File `tikz.sty&amp;#39; not found.

--- TeX said ---

Type X to quit or &amp;lt;RETURN&amp;gt; to proceed,
or enter new name. (Default extension: sty)&lt;/code&gt;
&lt;br /&gt;&lt;!-- adsense --&gt;
&lt;br /&gt;
&lt;h3&gt;Solution&lt;/h3&gt;

&lt;code&gt;sudo apt-get install texlive-pictures pgf&lt;/code&gt;
&lt;br /&gt;

Installation of the package &lt;tt&gt;pgf&lt;/tt&gt; is the most important bit! Without &lt;tt&gt;pgf&lt;/tt&gt; LaTeX will keep complaining that tikz.sty is missing. This solution was also proposed in a comment on &lt;a href=&quot;http://tex.stackexchange.com/questions/140555/how-to-fix-tikz-sty-problem&quot;&gt;stackexchange&lt;/a&gt;:
&lt;br /&gt;&lt;br /&gt;
&lt;blockquote&gt;
... The pgf package, as I keep forgetting and remembering every year, is independently installed from the pictures (which includes tikz but it&#39;s not loaded unless pgf is present) extras, the common, and the main tex on &#39;ix systems.
&lt;/blockquote&gt;

&lt;br /&gt;
&lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/2956048262002969614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/2956048262002969614'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2015/05/tikzsty-not-found.html' title='tikz.sty not found'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-717337491093581746</id><published>2014-12-23T12:20:00.000-08:00</published><updated>2015-09-11T15:46:48.129-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Connecting to USC Secure Wireless on Linux</title><content type='html'>
Tested on: Ubuntu 14.04, Linux Mint 17, Linux Mint 17.1&lt;br /&gt;
&lt;br /&gt;
USC (Univ. of Southern California) updated its wireless service to have an &lt;a href=&quot;http://itservices.usc.edu/wireless/&quot; target=&quot;_blank&quot;&gt;encrypted and faster connection available to USC faculty, staff, and students&lt;/a&gt; with name &#39;&lt;b&gt;USC Secure Wireless&lt;/b&gt;&#39;. Unfortunately for students like me, USC did not document how to use Linux computers with this service.&lt;br /&gt;
&lt;br /&gt;
Following configuration has worked for me to connect to USC Secure Wireless during past couple of months. The basic idea is to use &#39;WAP2&#39; or &#39;WAP Enterprise&#39; security and use Protected EAP (PEAP) authentication along with GTC as secondary authentication. Same idea works on Android phones as well.&lt;br /&gt;
&lt;br /&gt;
Create a new connection by right-clicking on &#39;Network connection&#39; icon in notification area and choosing &#39;Edit Connections...&#39; It will pop a &#39;Network connection&#39; window. Click on the &#39;Add&#39; button on the right side and choose &#39;Wi-Fi&#39; as connection type. Then follow the settings described in the images below (click on the images to enlarge them). Note that the USC-id must be entered &lt;b&gt;without @usc.edu&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNDxSK4c0d9ijCcKzclOR1RsBxfHp8Y-_9vvjOeB3eyd52fvfSjdXivpzCSEris60Anm1GCBXbk96pmR29r0L8On4NrH9X7myXpkaKirSFqdU4sYa0XtepXwhBGMxZ-TEUzsApw4DvRsEV/s1600/nc.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNDxSK4c0d9ijCcKzclOR1RsBxfHp8Y-_9vvjOeB3eyd52fvfSjdXivpzCSEris60Anm1GCBXbk96pmR29r0L8On4NrH9X7myXpkaKirSFqdU4sYa0XtepXwhBGMxZ-TEUzsApw4DvRsEV/s1600/nc.png&quot; height=&quot;148&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0Lh2hdy_vwStylVJh4Wn1A3T40KuNZfvqJrcEbt8eJxbv7MvL-zkKDT5ZoWY-bIdj8Qa6PuMg3Odr6Pw5DO9ZVxOYvCNhR6LFD1bwur5HbVk6l_PwpicSWZGOyBylDvyPNri1DVpUEHI_/s1600/c2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0Lh2hdy_vwStylVJh4Wn1A3T40KuNZfvqJrcEbt8eJxbv7MvL-zkKDT5ZoWY-bIdj8Qa6PuMg3Odr6Pw5DO9ZVxOYvCNhR6LFD1bwur5HbVk6l_PwpicSWZGOyBylDvyPNri1DVpUEHI_/s1600/c2.png&quot; height=&quot;83&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;!-- adsense --&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibsgBCntIfnGJAzmG2byqywqwULRCuauKL4x9baeG-8qdX7UFRWTKAQfJdayHK7acxRtZ66xjbMfGj6NhxLBhCpaIA3r13_G-c3_jLb6jCs4BAF7YrDeHXTSaWpDFB_HjcBJhkquRLTVvr/s1600/a3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibsgBCntIfnGJAzmG2byqywqwULRCuauKL4x9baeG-8qdX7UFRWTKAQfJdayHK7acxRtZ66xjbMfGj6NhxLBhCpaIA3r13_G-c3_jLb6jCs4BAF7YrDeHXTSaWpDFB_HjcBJhkquRLTVvr/s1600/a3.png&quot; height=&quot;200&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3R5_UG1bl8MmZT6QfOCpNZuAYEa5C80y8YORZFvKV4SBrsgk_uFeD6NRE72NS44aoh6DPILWUL9mn8lZvzkAO576e5VuNrv7sIxXByRQa1Oth7cwCmBMCxOQcvtU0H8p74RMe8AuYCP3f/s1600/a2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3R5_UG1bl8MmZT6QfOCpNZuAYEa5C80y8YORZFvKV4SBrsgk_uFeD6NRE72NS44aoh6DPILWUL9mn8lZvzkAO576e5VuNrv7sIxXByRQa1Oth7cwCmBMCxOQcvtU0H8p74RMe8AuYCP3f/s1600/a2.png&quot; height=&quot;200&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIzrx0qFPt4VR43be6IFdHDdi_cIKZsJ1m3lJERrw6puk-51E2kYxwIQfKbx2cRtmP6lFgvZmDQzVCl1sveL9iIBpPv_jyHBBiGgc7vMthi4Cv28V57AKVskNEnmEOJzhfpd5KwcynoNmH/s1600/a4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIzrx0qFPt4VR43be6IFdHDdi_cIKZsJ1m3lJERrw6puk-51E2kYxwIQfKbx2cRtmP6lFgvZmDQzVCl1sveL9iIBpPv_jyHBBiGgc7vMthi4Cv28V57AKVskNEnmEOJzhfpd5KwcynoNmH/s1600/a4.png&quot; height=&quot;200&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;


And here is how the connection information looks like after being connected to USC Secure wireless. 
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavO0i3OQGGKu1Tuhr8fnaT36a0KHFvSc2rler_uBMX2cchR1hvzt2t9dnRopomaY5slSJKbAIu16YhnMUSc-qIxnSxM_Zmif-pMzDiZfNheld7JP7ldemYmhyphenhyphenVMz2S68foOJEf73vvaUa/s1600/a.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgavO0i3OQGGKu1Tuhr8fnaT36a0KHFvSc2rler_uBMX2cchR1hvzt2t9dnRopomaY5slSJKbAIu16YhnMUSc-qIxnSxM_Zmif-pMzDiZfNheld7JP7ldemYmhyphenhyphenVMz2S68foOJEf73vvaUa/s1600/a.png&quot; height=&quot;200&quot; width=&quot;160&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/717337491093581746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/717337491093581746'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2014/12/connecting-to-usc-secure-wireless-on.html' title='Connecting to USC Secure Wireless on Linux'/><author><name>Unknown</name><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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNDxSK4c0d9ijCcKzclOR1RsBxfHp8Y-_9vvjOeB3eyd52fvfSjdXivpzCSEris60Anm1GCBXbk96pmR29r0L8On4NrH9X7myXpkaKirSFqdU4sYa0XtepXwhBGMxZ-TEUzsApw4DvRsEV/s72-c/nc.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-7550203446841501402</id><published>2014-09-05T18:39:00.003-07:00</published><updated>2014-09-30T22:14:55.534-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Academic"/><category scheme="http://www.blogger.com/atom/ns#" term="BibTeX"/><category scheme="http://www.blogger.com/atom/ns#" term="JabRef"/><category scheme="http://www.blogger.com/atom/ns#" term="LaTeX"/><title type='text'>A simple approach to reference and PDF management</title><content type='html'>&lt;p&gt;Managing references and citations is essential for &lt;a href=&quot;http://en.wikipedia.org/wiki/Academic_publishing&quot;&gt;academic publishing&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Reproducibility#Reproducible_research&quot;&gt;reproducible research&lt;/a&gt;. However, managing large volume of references and citations over years is no easy task! &lt;a href=&quot;http://en.wikipedia.org/wiki/Comparison_of_reference_management_software&quot;&gt;A number of softwares&lt;/a&gt; have been developed specially for the task and &lt;a href=&quot;http://www.literaturereviewhq.com/6-tips-on-how-to-choose-reference-management-software/&quot;&gt;been&lt;/a&gt; &lt;a href=&quot;http://www.researchgate.net/post/How_to_manage_my_references_pdfs11&quot;&gt;discussed&lt;/a&gt; &lt;a href=&quot;http://www.docear.org/2013/08/27/off-topic-which-one-is-the-best-reference-management-software-tool/&quot;&gt;many&lt;/a&gt; &lt;a href=&quot;http://www.phdontrack.net/review-and-discover/reference-managers/&quot;&gt;times&lt;/a&gt;. In this post I will briefly describe my own approach, which I have been using over 4-5 years now, to manage references, notes and corresponding files including PDFs. In particular, my approach aims to be: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Scalable&lt;/b&gt; - Manage hundreds of references and related files; It should be easy to add new reference/notes and should require no/little maintenance.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Easy formatting&lt;/b&gt; - References should be accurate and should be able to handle different character encoding, accents and should adapt to any reference-style based on the publisher specification.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Portable&lt;/b&gt; - Easy synchronization of whole setup (files, notes etc.) to a new computer/laptop/device.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Searchable&lt;/b&gt; - Search through titles, authors, previous notes etc.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Cross Platform&lt;/b&gt; - Same method should work across different operating systems (Linux, Windows, Mac) with no/minimal changes.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Work offline&lt;/b&gt; - Because &lt;a href=&quot;http://theoatmeal.com/comics/no_internet&quot;&gt;Internet access is never as reliable&lt;/a&gt; as one wants it to be (also see &#39;Portable&#39; above).&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Free and Open&lt;/b&gt; - &quot;&lt;a href=&quot;http://en.wikipedia.org/wiki/Gratis_versus_libre#.22Free_beer.22_vs_.22free_speech.22_distinction&quot;&gt;Free as in beer&lt;/a&gt;&quot; and, preferably, as &quot;free speech&quot; as well (no proprietary format). Being &quot;open&quot; also make it possible to &lt;a href=&quot;http://www.docear.org/2013/10/14/what-makes-a-bad-reference-manager/&quot;&gt;port the data to some-other format/method&lt;/a&gt;, if required.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note that the described method relies on &lt;a href=&quot;http://en.wikipedia.org/wiki/BibTeX&quot;&gt;&lt;strong&gt;BibTeX&lt;/strong&gt;&lt;/a&gt;, mainly because it can achieve all the above goals and because BibTeX (&amp;amp; LaTeX) is &lt;i&gt;de facto&lt;/i&gt; standard for writing in my discipline (Engineering). Use of BibTeX also makes bibliography dead simple in LaTeX - absolutely no &lt;i&gt;export/import&lt;/i&gt; required! If BibTeX is not acceptable, skip to last section below for some alternatives.
&lt;br /&gt;&lt;!-- adsense --&gt;&lt;/p&gt;
&lt;h2&gt;Approach&lt;/h2&gt;
&lt;p&gt;The approach itself is fairly simple and is motivate by &lt;a href=&quot;http://luv.asn.au/overheads/prog/philosophy.html&quot;&gt;The Unix philosophy of small tools&lt;/a&gt;. The approach has three components: 
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd79RH0DGQHhNX_QiZdCtXpoBt9QrSz0njD6OuinMBohe0_37S7PcSa918PxlPOaBiz4P5zVSyd8Yswnhz9qiihfZBb_LAWvsrbzwfFiWI8RPX6U2vFE9zAofPpYFJ42G6LHgi5aZOj6u8/s1600/a.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd79RH0DGQHhNX_QiZdCtXpoBt9QrSz0njD6OuinMBohe0_37S7PcSa918PxlPOaBiz4P5zVSyd8Yswnhz9qiihfZBb_LAWvsrbzwfFiWI8RPX6U2vFE9zAofPpYFJ42G6LHgi5aZOj6u8/s1600/a.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A directory on our computer/device, say with name &quot;&lt;tt&gt;papers&lt;/tt&gt;&quot;, which will contain &lt;strong&gt;all the files&lt;/strong&gt; related to the references. Basically, this directory is the &lt;i&gt;self-contained repository&lt;/i&gt; of all our information.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jabref.sourceforge.net/&quot;&gt;JabRef&lt;/a&gt; for managing the BibTeX (&lt;tt&gt;.bib&lt;/tt&gt;) file which manages all information, and&lt;/li&gt;
&lt;li&gt;A &lt;a href=&quot;http://en.wikipedia.org/wiki/Comparison_of_file_synchronization_software&quot;&gt;file synchronization tool&lt;/a&gt;, like &lt;a href=&quot;https://www.dropbox.com/&quot;&gt;Dropbox&lt;/a&gt; or &lt;a href=&quot;http://www.cis.upenn.edu/~bcpierce/unison/&quot;&gt;Unison&lt;/a&gt;, to synchronize the &lt;tt&gt;papers&lt;/tt&gt; directory to other devices, if required. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So, basically we save our files (PDFs etc.) in a directory, open/read/edit the files using our favorite software, add/edit the reference information via JabRef, and sync to other devices using our favorite sync-software. (In theory one could also use any other BibTeX manager, but JabRef is absolutely the best BibTeX manager I know.) For ease of file management, we can create 2-3 sub-directories to organize files, but it is completely optional as JabRef allows more advanced categorization. The image on right shows a sample directory structure. &lt;tt&gt;reference.bib&lt;/tt&gt; is the &lt;a href=&quot;http://www.bibtex.org/&quot;&gt;BibTeX&lt;/a&gt; file which contains all the information related to references and lies at the heart of this approach. The sub-directories contain PDF and other files related to references. In my approach, I use one single &lt;tt&gt;.bib&lt;/tt&gt; file for managing all reference, which in my experience works in a  much better unified-way than multiple &lt;tt&gt;.bib&lt;/tt&gt; files.&lt;/p&gt;
&lt;p&gt;Next, I will outline some bare-minimum steps to get started with this approach. However, feel free to explore &lt;a href=&quot;http://jabref.sourceforge.net/documentation.php&quot;&gt;JabRef options&lt;/a&gt; and make your own customizations. &lt;/p&gt;
&lt;h3&gt;Setup&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Create a &lt;tt&gt;papers&lt;/tt&gt; directory with 1-2 relevant sub-directories. Optionally, throw in few PDF files of your references in sub-directories. Avoid spaces in file and directory names; use &lt;a href=&quot;http://en.wikipedia.org/wiki/Underscore&quot;&gt;underscore&lt;/a&gt; instead. &lt;/li&gt;
&lt;li&gt;Download and install latest version of &lt;a href=&quot;http://jabref.sourceforge.net/&quot;&gt;JabRef&lt;/a&gt; for your platform. &lt;/li&gt;
&lt;li&gt;Open JabRef and create new database (File-&amp;gt;New database). Save database as a &lt;tt&gt;reference.bib&lt;/tt&gt; in 
&lt;tt&gt;papers&lt;/tt&gt; directory. &lt;/li&gt;
&lt;li&gt;In JabRef, go to the menu Options-&amp;gt;Preferences and set following: &lt;/li&gt;
&lt;ul&gt;&lt;li&gt;In &lt;em&gt;Files&lt;/em&gt; tab, check &quot;Open last edited databases at startup&quot; and &quot;Backup old file when saving&quot;.&lt;/li&gt;
&lt;li&gt;In &lt;em&gt;External programs&lt;/em&gt; tab, check &quot;Allow file links relative to each bib file&#39;s location&quot; and &quot;Use the bib file location as primary file directory&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Optionally, setup your synchronization/backup for the &lt;tt&gt;papers&lt;/tt&gt; directory. &lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Adding references&lt;/h3&gt;
&lt;p&gt;This step is &lt;strong&gt;the most&lt;/strong&gt; important step, as we want our reference to be accurate. Let us assume that we have read &lt;a href=&quot;http://scholar.google.com/scholar?q=Concerning+an+Heuristic+Point+of+View+Toward+the+Emission+and+Transformation+of+Light&quot;&gt;this paper from Einstein&lt;/a&gt; and have saved a copy of the PDF file in appropriate sub-directory. Next, we would want to add it to our refernce list and add some notes from our reading. The idea here is that we will be &lt;strong&gt;very careful&lt;/strong&gt; with all the details while adding the references the first time and then we can use it confidently life-long (almost) without any changes. If you are entirely new with JabRef then go through &lt;a href=&quot;http://www.cs.rpi.edu/~tayloj/JABREF.TUTORIAL/&quot;&gt;this short tutorial&lt;/a&gt; to familiarize yourself. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open &lt;tt&gt;reference.bib&lt;/tt&gt; using JabRef. Go to BibTeX-&amp;gt;New entry and then select &lt;em&gt;Article&lt;/em&gt; from entry type dialog. &lt;/li&gt;
&lt;li&gt;Fill in the details of the paper starting from &quot;Required fields&quot; tab. You need not fill in all the fields in other tabs. You can find more about fields in &lt;a href=&quot;http://jabref.sourceforge.net/help/BibtexHelp.php&quot;&gt;BibTeX Help&lt;/a&gt; and &lt;a href=&quot;http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management#BibTeX&quot;&gt;wikibooks&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;You can also copy-paste the details of field from the paper, publisher website, or &lt;a href=&quot;http://texblog.org/2014/04/22/using-google-scholar-to-download-bibtex-citations/&quot;&gt;listing on Google Scholar&lt;/a&gt;. But make sure that the details are correct. For example, the author details &lt;a href=&quot;http://scholar.google.com/scholar?q=Concerning+an+Heuristic+Point+of+View+Toward+the+Emission+and+Transformation+of+Light&quot;&gt;of the Einstein paper&lt;/a&gt; is wrong on Google Scholar! &lt;/li&gt;
&lt;li&gt;While selecting &lt;strong&gt;Bibtexkey&lt;/strong&gt; be sure that it is unique as you would &lt;em&gt;never&lt;/em&gt; want to change it in future (Bibtexkey is the &lt;em&gt;key&lt;/em&gt; which would &lt;a href=&quot;http://www.bibtex.org/Using/&quot;&gt;refer from LaTeX&lt;/a&gt;). I typically follow the format: &lt;tt&gt;firstAuthorLastName_year_four_word_paper_summary&lt;/tt&gt; for my Bibtexkey (&amp;amp; PDF filenames). &lt;/li&gt;
&lt;li&gt;To link the PDF (or any other file), go to &quot;General&quot; tab and add the link to file. You can add as many files as you want to an entry. This allows easy access to the files from JabRef. &lt;a href=&quot;http://jabref.sourceforge.net/help/FileLinks.php&quot;&gt;See help section&lt;/a&gt; for more details and options. &lt;/li&gt;
&lt;li&gt;You can also add your review of the paper in &quot;Review&quot; tab. I prefer adding some &quot;Keywords&quot; and write my notes in &quot;Comment&quot; in &quot;General&quot; tab. Also, I prefer to use my favorite 3rd party tools to annotate/highlight the PDF itself. &lt;/li&gt;
&lt;li&gt;JabRef also supports &lt;a href=&quot;http://jabref.sourceforge.net/help/GroupsHelp.php&quot;&gt;groups&lt;/a&gt; (which are somewhat similar to labels in Gmail) and &lt;a href=&quot;http://jabref.sourceforge.net/help/MarkingHelp.php&quot;&gt;marking&lt;/a&gt; for more advanced categorization. However, I never felt any need of such categorization because the &lt;a href=&quot;http://jabref.sourceforge.net/help/SearchHelp.php&quot;&gt;search in JabRef&lt;/a&gt; works well and use of &lt;em&gt;keywords&lt;/em&gt; pretty much categorizes all the references.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While adding new entries, JabRef will &lt;a href=&quot;http://jabref.sourceforge.net/help/EntryEditorHelp.php&quot;&gt;autocomplete author names and words and can also autogenerate Bibtexkey&lt;/a&gt;. Once you have added enough references, you can directly &lt;a href=&quot;http://www.bibtex.org/Using/&quot;&gt;link to the &lt;tt&gt;reference.bib&lt;/tt&gt; from LaTeX file&lt;/a&gt; for bibiliography. You can also put the &lt;tt&gt;.bib&lt;/tt&gt; file in some sort of &lt;a href=&quot;http://en.wikipedia.org/wiki/Revision_control&quot;&gt;version control&lt;/a&gt; for enhanced security and control. I prefer to create weekly backup of the entire &lt;tt&gt;papers&lt;/tt&gt; directory to external hard-drive for peace of mind. &lt;/p&gt;
&lt;h3&gt;Cross-platform&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://jabref.sourceforge.net&quot;&gt;JabRef&lt;/a&gt; is written in &lt;a href=&quot;http://en.wikipedia.org/wiki/Java_%28programming_language%29&quot;&gt;Java&lt;/a&gt; which makes it cross-platform by design. I frequently use it on desktops (Linux, Windows and Mac). The method also works well with portable android devices with &lt;a href=&quot;https://play.google.com/store/apps/details?id=me.bares.refmaster&amp;amp;hl=en&quot;&gt;RefMaster&lt;/a&gt;. Basically, RefMaster replaces JabRef on andriod and it supports Dropbox integration. There should be similar apps for managing BibTeX on iOS platform.&lt;/p&gt;
&lt;h2&gt;Drawbacks&lt;/h2&gt;
&lt;p&gt;The only feature which I miss in this approach is the ability to search inside the linked files when searching in JabRef. However, it is not a show stopper, especially in presence of &lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_search_engines#Desktop_search_engines&quot;&gt;various desktop search tools&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Also, this approach will &lt;strong&gt;not&lt;/strong&gt; parse your computer for PDF files and auto-magically generate &quot;correct&quot; references. This method is geared towards accuracy and, in my experience, the auto-magical metadata extraction from PDF &lt;a href=&quot;http://support.mendeley.com/customer/portal/articles/197284-the-metadata-for-one-of-my-pdfs-has-been-extracted-wrongly&quot;&gt;do not&lt;/a&gt; &lt;a href=&quot;http://support.mendeley.com/customer/portal/questions/339476--pdf-or-doc-files-created-with-metadata&quot;&gt;work&lt;/a&gt; &lt;a href=&quot;http://support.mendeley.com/customer/portal/questions/206705-mendeley-not-reading-metadata-attached-to-pdf-s-which-we-created-from-word-documents&quot;&gt;well&lt;/a&gt; &lt;a href=&quot;http://support.mendeley.com/customer/portal/questions/654809-incorrect-metadata-when-importing-pdfs&quot;&gt;frequently&lt;/a&gt; and have rather large error rate. Careful verification of reference data while entering data is important and fruitful in long run. &lt;/p&gt;
&lt;p&gt;Another drawback could be the steep learning curve required for getting comfortable with LaTeX (&amp;amp; BibTeX). It is assumed that people from my discipline (Engineering) are already using or will be using LaTeX. See next section for alternatives. &lt;/p&gt;
&lt;h2&gt;Alternatives&lt;/h2&gt;
&lt;p&gt;If &lt;a href=&quot;http://en.wikipedia.org/wiki/LaTeX&quot;&gt;LaTeX&lt;/a&gt; (&amp;amp; BibTeX) is not your cup of tea then following are some alternatives (but one should consider &lt;a href=&quot;http://tex.stackexchange.com/a/1760&quot;&gt;why should they not use LaTeX&lt;/a&gt; and &lt;a href=&quot;http://tex.stackexchange.com/questions/940/what-professions-use-tex-latex-besides-cs&quot;&gt;who else uses LaTeX&lt;/a&gt;). I ended up with JabRef because most of the following did not had upto-the-mark BibTeX management, atleast by my taste, when I was trying them. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.mendeley.com/&quot;&gt;Mendeley&lt;/a&gt; is a good alternative and specially works well with office documents and can search inside linked PDFs. &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.citeulike.org/&quot;&gt;citeulike&lt;/a&gt; is an online service and works well for collecting references while browsing over internet. &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.zotero.org/&quot;&gt;Zotero&lt;/a&gt; used to be a browser-plugin which offers good features, but I never tried it seriously. The standalone version came much later but looks good.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are &lt;a href=&quot;http://en.wikipedia.org/wiki/Comparison_of_reference_management_software&quot;&gt;several other softwares&lt;/a&gt; which can be used for refernce management. &lt;a href=&quot;http://www.docear.org/2013/11/11/on-the-popularity-of-reference-managers-and-their-rise-and-fall/&quot;&gt;Here is a popularity context&lt;/a&gt; of different softwares and &lt;a href=&quot;https://www.docear.org/2013/08/27/off-topic-which-one-is-the-best-reference-management-software-tool/&quot;&gt;here is an irony post comparing them&lt;/a&gt;. Everyone has their own preferences and a solution may not be the &#39;best&#39; solution for everyone. The described approach works for me and could be helpful to others. &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/7550203446841501402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/7550203446841501402'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2014/09/a-simple-approach-to-reference-and-pdf.html' title='A simple approach to reference and PDF management'/><author><name>Unknown</name><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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd79RH0DGQHhNX_QiZdCtXpoBt9QrSz0njD6OuinMBohe0_37S7PcSa918PxlPOaBiz4P5zVSyd8Yswnhz9qiihfZBb_LAWvsrbzwfFiWI8RPX6U2vFE9zAofPpYFJ42G6LHgi5aZOj6u8/s72-c/a.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-3283100415810671342</id><published>2014-07-11T12:45:00.000-07:00</published><updated>2014-07-11T12:48:43.564-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Git"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Moving remote Git repository </title><content type='html'>It is surprising that most of the &lt;a href=&quot;http://www.smashingmagazine.com/2014/05/19/moving-git-repository-new-server/&quot;&gt;search&lt;/a&gt; &lt;a href=&quot;https://coderwall.com/p/istvca&quot;&gt;results&lt;/a&gt; &lt;a href=&quot;http://blog.riamaria.com/45/migrate-a-git-repo-to-a-new-server/&quot;&gt;related&lt;/a&gt; &lt;a href=&quot;https://help.github.com/articles/duplicating-a-repository#mirroring-a-repository&quot;&gt;to moving&lt;/a&gt; Git repository is targeted towards moving repositories to github.com and alike. I was trying to move my git repository from, say, &lt;tt&gt;server1.edu&lt;/tt&gt; to &lt;tt&gt;server2.edu&lt;/tt&gt;. These servers are Linux servers and are accessible via  SSH. However, using the common set of instructions &lt;i&gt;i.e.&lt;/i&gt; &lt;tt&gt;git clone --bare&lt;/tt&gt; followed by &lt;tt&gt;git push --mirror&lt;/tt&gt; kept throwing me following error: 
&lt;code&gt;$ git push -v --mirror ssh://server2.edu:/home/user/Repo.git
Pushing to ssh://server2.edu:/home/user/Repo.git
fatal: &#39;/home/user/Repo.git&#39; does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.&lt;/code&gt;
Some posts suggested to &lt;a href=&quot;http://stackoverflow.com/questions/3894719/git-move-existing-repository-from-pc-to-server-clone-from-server&quot;&gt;first&lt;/a&gt; &lt;a href=&quot;http://stackoverflow.com/questions/8978650/how-do-i-move-my-local-git-repository-to-a-remote-git-repository&quot;&gt;initialize&lt;/a&gt; a git repository on server. This sounded odd to me as per my understanding, all we need is SSH access to the server in order to setup as a remote Git repository.&lt;br /&gt;&lt;br /&gt;

And it turns out that the answer is very simple and is actually explained on &lt;a href=&quot;http://git-scm.com/book/en/Git-on-the-Server-Getting-Git-on-a-Server&quot;&gt;Git documentation&lt;/a&gt;. Just perform a local &lt;tt&gt;--bare&lt;/tt&gt; clone of the repository then &lt;tt&gt;scp&lt;/tt&gt; or &lt;tt&gt;rsync&lt;/tt&gt; it to server and update &lt;tt&gt;origin&lt;/tt&gt; of the repository. Thats it! All push/pull would work as expected after that with new server. Here are steps I followed (notice &lt;b&gt;&lt;tt&gt;server1&lt;/tt&gt;&lt;/b&gt; and &lt;b&gt;&lt;tt&gt;server2&lt;/tt&gt;&lt;/b&gt; in the commands):
&lt;!-- adsense --&gt; 
&lt;code&gt;&lt;span class=&quot;codecmnt&quot;&gt;# Check current remotes&lt;/span&gt;
$ cd /home/user/Repo
$ git remote -v
origin user@&lt;b&gt;server1&lt;/b&gt;.edu:/home/user/Repo.git (fetch)
origin user@&lt;b&gt;server1&lt;/b&gt;.edu:/home/user/Repo.git (push)

&lt;span class=&quot;codecmnt&quot;&gt;# Temporary --bare clone in /tmp&lt;/span&gt;
$ cd /tmp 
$ git clone --bare file:///home/user/Repo
Cloning into bare repository &#39;Repo.git&#39;...
remote: Counting objects: 4389, done.
remote: Compressing objects: 100% (4349/4349), done.
remote: Total 4389 (delta 3138), reused 3 (delta 0)
Receiving objects: 100% (4389/4389), 45.46 MiB | 15.28 MiB/s, done.
Resolving deltas: 100% (3138/3138), done.
Checking connectivity... done.

&lt;span class=&quot;codecmnt&quot;&gt;# Transfer the new bare repository to new server using scp or rsync&lt;/span&gt;
$ scp -r Repo.git user@&lt;b&gt;server2&lt;/b&gt;.edu:/home/user

&lt;span class=&quot;codecmnt&quot;&gt;# Update origin url in local repository&lt;/span&gt;
$ cd /home/user/Repo
$ git remote set-url origin user@&lt;b&gt;server2&lt;/b&gt;.edu:/home/user/Repo.git

&lt;span class=&quot;codecmnt&quot;&gt;# Check the updated remotes&lt;/span&gt;
$ git remote -v
origin user@&lt;b&gt;server2&lt;/b&gt;.edu:/home/user/Repo.git (fetch)
origin user@&lt;b&gt;server2&lt;/b&gt;.edu:/home/user/Repo.git (push)

&lt;span class=&quot;codecmnt&quot;&gt;# Delete the temporary clone in /tmp&lt;/span&gt;
$ rm -rf /tmp/Repo.git
&lt;/code&gt;
&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/3283100415810671342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/3283100415810671342'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2014/07/moving-remote-git-repository.html' title='Moving remote Git repository '/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-4224593597157314574</id><published>2014-05-17T19:04:00.000-07:00</published><updated>2014-05-17T19:04:38.004-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="matlab"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Matlab&#39;s cryptic error messages</title><content type='html'>Sometimes MATLAB&#39;s error messages can be very cryptic and misleading. Following are examples of error messages which I encountered while trying to solve \(\mathbf{A}x=b\) in least square sense using &lt;a href=&quot;http://www.mathworks.com/help/matlab/ref/lsqr.html&quot;&gt;MATLAB&#39;s lsqr function&lt;/a&gt;. 
&lt;code&gt;&lt;span class=&quot;codecmnt&quot;&gt;%% Error 1&lt;/span&gt;
Error using iterapp (line 60)
user supplied function ==&gt;
@(x,transp_flag)transform_X(x,transp_flag, ...)
 failed with the following error:

 Not enough input arguments.

Error in lsqr (line 180)
    u = u - iterapp(&#39;mtimes&#39;,afun,atype,afcnstr,x,varargin{:},&#39;notransp&#39;);&lt;/code&gt;
&lt;code&gt;&lt;span class=&quot;codecmnt&quot;&gt;%% Error 2&lt;/span&gt;
Error using  * 
MTIMES is not supported for one sparse input and one single input.

Error in iterapp (line 29)
                y = afun * x;

Error in lsqr (line 180)
    u = u - iterapp(&#39;mtimes&#39;,afun,atype,afcnstr,x,varargin{:},&#39;notransp&#39;);
&lt;/code&gt;
For an experienced MATLAB user, error 2 may be easier to locate because of the message: &quot;&lt;tt&gt;Error using  *&lt;/tt&gt;&quot;. However, when I was actually working, I got error 1 which said &quot;&lt;tt&gt;Not enough input arguments&lt;/tt&gt;&quot;. It took me sometime to figure out that both the errors were related to mismatching datatypes in input parameters. Both the situations were actually identical, except that in first case I was using function handle &lt;tt&gt;Afun&lt;/tt&gt; in place of matrix representation of \(\mathbf{A}\). Here are the actual statements which raised errors:
&lt;code&gt;x = lsqr(Afun, b, 1e-9, 100, [], [], x0);      &lt;span class=&quot;codecmnt&quot;&gt;% Raises Error 1&lt;/span&gt;
x = lsqr(A, b, 1e-9, 100, [], [], x0);         &lt;span class=&quot;codecmnt&quot;&gt;% Raises Error 2&lt;/span&gt;&lt;/code&gt;
&lt;!-- adsense --&gt;
&lt;br /&gt;And here is the code snippet for Error 2 above. The code can be modified easily to create function handle &lt;tt&gt;Afun&lt;/tt&gt; (see  &lt;a href=&quot;http://www.mathworks.com/help/matlab/ref/lsqr.html&quot;&gt;Example 2 here&lt;/a&gt;). Notice the statement &lt;tt&gt;x0 = single(rand(size(b))*5);&lt;/tt&gt; in the code snippet which changes the datatype and causes error. 
&lt;code&gt;n = 50;
on = ones(n,1);
A = spdiags([-2*on 4*on -on],-1:1,n,n);
b = sum(A,2);
x0 = single(rand(size(b))*5);
x = lsqr(A,b,1e-9,100,[],[],x0);&lt;/code&gt;
&lt;br /&gt;
&lt;b&gt;The take-away message:&lt;/b&gt; Always check datatypes when MATLAB&#39;s error messages don&#39;t make sense! &lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/4224593597157314574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/4224593597157314574'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2014/05/matlabs-cryptic-error-messages.html' title='Matlab&#39;s cryptic error messages'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-5466414017363057121</id><published>2014-01-24T13:00:00.001-08:00</published><updated>2014-05-17T15:55:20.485-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="LaTeX"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="MS Word"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>LaTeX to word document</title><content type='html'>Tested on: Linux Mint 13 (Ubuntu 12.04), Microsoft Office 2010, LibreOffice 3&lt;br /&gt;
&lt;br /&gt;
It is common to typeset scientific documents in &amp;nbsp;\(\LaTeX\). However, few people may like to still read and edit the document in word processors like Microsoft word (&lt;tt&gt;.doc&lt;/tt&gt; or &lt;tt&gt;.docx&lt;/tt&gt;)or LibreOffice (&lt;tt&gt;.odt&lt;/tt&gt;). Here are quick (&amp;amp; dirty) steps to produce reasonably looking &quot;office&quot; documents from &lt;tt&gt;.tex&lt;/tt&gt; files. The idea is to exploit HTML output as intermediate format which is &lt;i&gt;readable&lt;/i&gt; by word processors. This ideas is shown below and has been &lt;a href=&quot;http://tex.stackexchange.com/questions/8836/producing-doc-docx-from-latex&quot; target=&quot;_blank&quot;&gt;explored&lt;/a&gt; &lt;a href=&quot;http://tex.stackexchange.com/questions/91040/from-tex-to-doc-format-is-it-possible&quot; target=&quot;_blank&quot;&gt;and&lt;/a&gt; &lt;a href=&quot;http://tex.stackexchange.com/questions/4145/workflow-for-converting-latex-into-open-office-ms-word-format&quot; target=&quot;_blank&quot;&gt;reported&lt;/a&gt; &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=1033441&quot; target=&quot;_blank&quot;&gt;widely&lt;/a&gt;.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;tt&gt;.tex&lt;/tt&gt;→&lt;tt&gt;.html&lt;/tt&gt;→&lt;tt&gt;.docx&lt;/tt&gt;&lt;/span&gt;&lt;/div&gt;
&lt;!-- adsense --&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;b&gt;Convert&amp;nbsp;\(\LaTeX\) to .html:&lt;/b&gt; There are &lt;a href=&quot;http://en.wikibooks.org/wiki/LaTeX/Export_To_Other_Formats#Convert_to_HTML&quot; target=&quot;_blank&quot;&gt;various&lt;/a&gt; &lt;a href=&quot;http://tex.stackexchange.com/questions/39309/convert-latex-to-html&quot; target=&quot;_blank&quot;&gt;ways&lt;/a&gt; to achieve this, but &lt;tt&gt;htlatex&lt;/tt&gt; from &lt;a href=&quot;http://www.tug.org/applications/tex4ht/mn.html&quot; target=&quot;_blank&quot;&gt;TeX4ht&lt;/a&gt;&amp;nbsp;worked best for me. First install TeX4ht and then then run following on the&amp;nbsp;\(\LaTeX\) document. Note that &lt;tt&gt;htlatex&lt;/tt&gt;&amp;nbsp;runs&amp;nbsp;&lt;tt&gt;latex&lt;/tt&gt; three times before calling TeX4ht programs and it would write out all the outputs in the same directory as the &lt;tt&gt;.tex&lt;/tt&gt; file (see below for handling PDF images). The generated files would include one &lt;tt&gt;.html&lt;/tt&gt; file (&lt;tt&gt;paper.html&lt;/tt&gt; for command shown below).  &lt;code&gt;$ sudo apt-get install tex4ht
$ htlatex paper.tex&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;PDF images:&lt;/b&gt; If the &lt;tt&gt;.tex&lt;/tt&gt; file uses PDF files as images, then &lt;tt&gt;htlatex&lt;/tt&gt; (or &lt;tt&gt;latex&lt;/tt&gt;) may not be able to go along with correct conversion. Some &lt;a href=&quot;http://tex.stackexchange.com/questions/46156/pdf-image-files-and-htlatex&quot; target=&quot;_blank&quot;&gt;discussions&lt;/a&gt; on &lt;a href=&quot;http://tex.stackexchange.com/questions/43391/tex4ht-reuse-png-images-instead-of-creating-new-ones&quot; target=&quot;_blank&quot;&gt;Stack Exchange&lt;/a&gt; were very help for this issue and provided the solution. First create a configuration file, say &lt;tt&gt;myxhtml.cfg&lt;/tt&gt;, with following content: &lt;code&gt;\Preamble{xhtml}
  \Configure{graphics*}  
         {pdf}  
         {\Needs{&quot;convert \csname Gin@base\endcsname.pdf  
                               \csname Gin@base\endcsname.png&quot;}%  
          \Picture[pict]{\csname Gin@base\endcsname.png}%  
          \special{t4ht+@File: \csname Gin@base\endcsname.png}
         }  
\begin{document}
\EndPreamble&lt;/code&gt;
Then run &lt;tt&gt;htlatex&lt;/tt&gt; as shown below. Note that the &lt;tt&gt;.tex&lt;/tt&gt; file should use correct extension for every included image (or else use &lt;tt&gt;\DeclareGraphicsExtensions{.pdf}&lt;/tt&gt;). &lt;code&gt;$ htlatex paper.tex myxhtml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Fix HTML:&lt;/b&gt; Sometimes TeX4ht will not write out clean html files i.e. the html tags may not be aligned properly. This may prevent html to import into word processors. Online editors like &lt;a href=&quot;http://fixmyhtml.com/&quot; target=&quot;_blank&quot;&gt;Fix My Html&lt;/a&gt; and &lt;a href=&quot;http://infohound.net/tidy/&quot;&gt;HTML Tidy Online&lt;/a&gt; did the trick for me. Use the &lt;tt&gt;.html&lt;/tt&gt; file generated by &lt;tt&gt;htlatex&lt;/tt&gt; as input to these online editors and save the &lt;i&gt;fixed&lt;/i&gt; &lt;tt&gt;html&lt;/tt&gt; file for next step.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Import HTML in word processor:&lt;/b&gt;&amp;nbsp;Usually most word processors would support importing HTML files. If that does not work (like in my case), you can just open the HTML file in a browser then copy-paste the whole page into the word processor (check if your word processor also supports &lt;i&gt;Paste Special&lt;/i&gt; for formatted text. It everything works out then you should be able to just save the pasted document in &lt;tt&gt;.doc&lt;/tt&gt;, &lt;tt&gt;.docx&lt;/tt&gt; or &lt;tt&gt;.odt&lt;/tt&gt; format.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;

The above set of steps produced good looking single column document for me with correct bibiliography references. The math equations are embedded as images in the documents, which may not be optimal but the process works for reviewing and editing the text by someone who prefers word processors. </content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/5466414017363057121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/5466414017363057121'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2014/01/latex-to-word-document.html' title='LaTeX to word document'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-1307612150491654031</id><published>2014-01-03T15:16:00.000-08:00</published><updated>2014-05-17T16:22:21.895-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Parent directories in tar archives</title><content type='html'>Tested on: Linux Mint 13 Maya (based on Ubuntu 12.04 LTS)&lt;br /&gt;
&lt;br /&gt;
It is common to see full directory tree or &lt;tt&gt;.&lt;/tt&gt; (dot) in tar archives. Sometimes, it may be unnecessary hassle to remove all parent directories after extracting or to look for the extracted file which merged with other files in extracted directory. In some situations, it may be desirable to create a tar archive with top directory (with informative name). There has been &lt;a href=&quot;http://frankkoehl.com/2011/04/remove-parent-directories-from-tar-archives/&quot; target=&quot;_blank&quot;&gt;many&lt;/a&gt; &lt;a href=&quot;http://stackoverflow.com/questions/4031416/prevent-parent-directories-from-being-tarred&quot; target=&quot;_blank&quot;&gt;discussion&lt;/a&gt; &lt;a href=&quot;http://stackoverflow.com/questions/5695881/how-do-i-tar-a-directory-without-retaining-the-directory-structure&quot; target=&quot;_blank&quot;&gt;about the&lt;/a&gt; &lt;a href=&quot;http://stackoverflow.com/questions/10227892/tar-create-archive-exclude-directories-except-one&quot; target=&quot;_blank&quot;&gt;same&lt;/a&gt;. Here is quick summary with an example for future reference.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Test setup&lt;/h3&gt;
We will create a test directory with some files in it with following commands (outputs are also shown):
&lt;code&gt;$ mkdir -p /tmp/path/to/test/dir_archive

$ touch /tmp/path/to/test/dir_archive/file{1..10}

$ ls /tmp/path/to/test/dir_archive/
file1  file10  file2  file3  file4  file5  file6  file7  file8  file9

$ tar --version
tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http: gnu.org=&quot;&quot; gpl.html=&quot;&quot; licenses=&quot;&quot;&gt;.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.&lt;/http:&gt;&lt;/code&gt;
&lt;!-- adsense --&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Full parent directory&lt;/h3&gt;
Following command creates tar archive with full parent directory structure as shown by &lt;tt&gt;--list&lt;/tt&gt; command. 
&lt;code&gt;$ tar -caf /tmp/test.tar.gz /tmp/path/to/test/dir_archive

$ tar --list -af /tmp/test.tar.gz 
tmp/path/to/test/dir_archive/
tmp/path/to/test/dir_archive/file3
tmp/path/to/test/dir_archive/file10
tmp/path/to/test/dir_archive/file1
tmp/path/to/test/dir_archive/file8
tmp/path/to/test/dir_archive/file4
tmp/path/to/test/dir_archive/file2
tmp/path/to/test/dir_archive/file7
tmp/path/to/test/dir_archive/file5
tmp/path/to/test/dir_archive/file6
tmp/path/to/test/dir_archive/file9&lt;/code&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Dot (&lt;tt&gt;.&lt;/tt&gt;) as parent directory&lt;/h3&gt;
Following command creates tar archive with dot (&lt;tt&gt;.&lt;/tt&gt;) as parent directory. Note that the &lt;tt&gt;tar&lt;/tt&gt; command ends in a dot (&lt;tt&gt;.&lt;/tt&gt;).
&lt;code&gt;$ tar --directory /tmp/path/to/test/dir_archive -caf /tmp/test.tar.gz .

$ tar --list -af /tmp/test.tar.gz 
./
./file3
./file10
./file1
./file8
./file4
./file2
./file7
./file5
./file6
./file9&lt;/code&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Directory name as parent directory&lt;/h3&gt;
The trick to get &lt;tt&gt;dir_archive&lt;/tt&gt; as parent directory in tar archive is to use &lt;tt&gt;--directory&lt;/tt&gt; to change directory to one level up as shown below. Note location of &lt;tt&gt;dir_archive&lt;/tt&gt; in the command. 
&lt;code&gt;$ tar --directory /tmp/path/to/test -caf /tmp/test.tar.gz dir_archive

$ tar --list -af /tmp/test.tar.gz 
dir_archive/
dir_archive/file3
dir_archive/file10
dir_archive/file1
dir_archive/file8
dir_archive/file4
dir_archive/file2
dir_archive/file7
dir_archive/file5
dir_archive/file6
dir_archive/file9&lt;/code&gt;
&lt;br /&gt;
Some more notes about &lt;tt&gt;tar&lt;/tt&gt; command:
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Above commands can be combined with used along with exclude directive to by using &lt;tt&gt;--exclude=&#39;dir_archive/dir_exclude&#39;&lt;/tt&gt; after the &lt;tt&gt;--directory&lt;/tt&gt; option.&lt;/li&gt;
&lt;li&gt;Do not mix absolute and relative path in tar command for &lt;i&gt;pathname&lt;/i&gt; and &lt;i&gt;exclude&lt;/i&gt; option. &lt;tt&gt;--directory&lt;/tt&gt; is an exception and can be absolute path while others paths can be defined relative to it.&lt;/li&gt;
&lt;/ul&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/1307612150491654031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/1307612150491654031'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2014/01/parent-directories-in-tar-archives.html' title='Parent directories in tar archives'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-7348923424083703865</id><published>2013-12-27T01:53:00.000-08:00</published><updated>2014-05-18T14:08:35.000-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="BibTeX"/><category scheme="http://www.blogger.com/atom/ns#" term="LaTeX"/><title type='text'>BibTeX hacks</title><content type='html'>Sometimes \(\LaTeX\) compilation can give fairly unhelpful error messages like these:
&lt;code&gt;! Missing $ inserted.
&lt;inserted text=&quot;&quot;&gt; 
                $
l.190 ... pp. 225--236, 10.1007/978-3-642-31340-0_19
                                                  18. [Online].
?&lt;/inserted&gt;&lt;/code&gt;
If these error message are in &lt;tt&gt;.bbl&lt;/tt&gt; file, when you are using &lt;a href=&quot;http://www.bibtex.org/&quot;&gt;BibTeX&lt;/a&gt; (&lt;tt&gt;.bib&lt;/tt&gt; file) for bibliography then it is possible that these error messages are result of some special characters in your &lt;tt&gt;.bib&lt;/tt&gt; file. I have seen it frequently that some &lt;a href=&quot;http://en.wikipedia.org/wiki/Digital_object_identifier&quot;&gt;DOI links&lt;/a&gt; contain some special characters. Following are some ways to get around these issues so that resulting document is rendered correctly.

&lt;!-- adsense --&gt;

&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Escape underscore (&lt;tt&gt;_&lt;/tt&gt;) with a backslash (&lt;tt&gt;\&lt;/tt&gt;). In the above example, the original DOI url was &lt;tt&gt;10.1007/978-3-642-31340-0_19&lt;/tt&gt; which was resulting into errors. Escaping the underscore with backslash fixed the issue for me: &lt;tt&gt;10.1007/978-3-642-31340-0\_19&lt;/tt&gt; (notice a backslash before &lt;tt&gt;_19&lt;/tt&gt; near the end).&lt;/li&gt;
&lt;li&gt;Sometimes DOI urls would contain less-than (&lt;tt&gt;&lt;&lt;/tt&gt;) and greater-than (&lt;tt&gt;&gt;&lt;/tt&gt;) character. These characters do not result into errors during compilation but would be rendered incorrectly. Escaping these characters with backslash generally does not work and often result into errors similar to that shown near the top of the post. An example (fake) DOI url is &lt;tt&gt;2/3&lt;80::AID-HBM2&gt;3.0&lt;/tt&gt; which was rendering upside down question mark and exclamation marks (probably because of issues with font encoding). I found that putting &lt;tt&gt;&lt;&lt;/tt&gt; in math mode helps to resolve this issue, i.e. replace with &lt;tt&gt;$&lt;$&lt;/tt&gt; and &lt;tt&gt;$&gt;$&lt;/tt&gt; so that new DOI url looks like &lt;tt&gt;2/3$&lt;$80::AID-HBM2$&gt;$3.0&lt;/tt&gt;.&lt;/li&gt;
&lt;li&gt;Changing font encoding by adding following lines in \(\LaTeX\) preamble can also help to resolve above issue with &lt;tt&gt;&lt;&lt;/tt&gt; and &lt;tt&gt;&gt;&lt;/tt&gt;, as discussed &lt;a href=&quot;http://tex.stackexchange.com/questions/2369/why-do-the-less-than-symbol-and-the-greater-than-symbol-appear-wrong-as&quot;&gt;here&lt;/a&gt;. 
&lt;code&gt;\usepackage[T1]{fontenc}
\usepackage{lmodern}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;\(\LaTeX\) provides means to describe special characters like accents or umlauts using a special notation as described in following table hot-linked from &lt;a href=&quot;http://www.bibtex.org/SpecialSymbols/&quot;&gt;official homepage&lt;/a&gt;. In addition, also check out &lt;a href=&quot;http://tex.stackexchange.com/a/57745&quot;&gt;this really great answer&lt;/a&gt; on stackexchange about accented letters. &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.bibtex.org/SpecialSymbols/specialsymbols.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.bibtex.org/SpecialSymbols/specialsymbols.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/7348923424083703865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/7348923424083703865'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2013/12/bibtex-hacks.html' title='BibTeX hacks'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-416268433649812780</id><published>2013-08-03T14:32:00.000-07:00</published><updated>2014-05-17T15:53:30.137-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="LaTeX"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Useful LaTeX tricks</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;
\(\LaTeX\) word count&lt;/h3&gt;
It can get difficult to keep track of accurate number of words in a \(\LaTeX\) document. &lt;a href=&quot;http://app.uio.no/ifi/texcount/index.html&quot;&gt;TeXcount&lt;/a&gt; is a script for counting words in text and math equations in LaTeX documents. It can also generate very &lt;a href=&quot;http://app.uio.no/ifi/texcount/screenshot.html&quot;&gt;detailed html output&lt;/a&gt; with color-coded words types. TeXcount is part of &lt;a href=&quot;http://www.tug.org/texlive//devsrc/Master/texmf-dist/doc/support/texcount/&quot;&gt;Tex live&lt;/a&gt; and can be installed by installing &lt;tt&gt;texlive-extra-utils&lt;/tt&gt; from Ubuntu repository. TeXcount also has a &lt;a href=&quot;http://app.uio.no/ifi/texcount/online.php&quot;&gt;web interface&lt;/a&gt;.
&lt;code&gt;$ texcount document.tex
FILE: document.tex
Words in text: 6462
Words in headers: 48
Words in float captions: 274
Number of headers: 19
Number of floats: 4
Number of math inlines: 204
Number of math displayed: 8
&lt;/code&gt;
&lt;code&gt;texcount -v -html document.tex &amp;gt; word_count.html&lt;/code&gt;
&lt;!-- adsense --&gt;
&lt;h3&gt;
\(\LaTeX\) diff&lt;/h3&gt;
Usual diff programs &lt;a href=&quot;https://mail.gnome.org/archives/meld-list/2006-October/msg00001.html&quot;&gt;may not do a great job&lt;/a&gt; of diffing two \(\LaTeX\) documents. Following are some of the alternative ways: 
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;tt&gt;wdiff&lt;/tt&gt; with &lt;tt&gt;colordiff&lt;/tt&gt;, similar to this stackexchange question:
&lt;code&gt;wdiff -n old.tex new.tex | colordiff | less -R&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Use &lt;a href=&quot;http://www.ctan.org/tex-archive/support/latexdiff&quot;&gt;latexdiff&lt;/a&gt; to determine differences and create a new LaTeX document with markup differences between two latex files. &lt;tt&gt;latexdiff&lt;/tt&gt; can be found in Ubuntu repository and detailed description of usage can be found &lt;a href=&quot;https://www.sharelatex.com/blog/2013/02/16/using-latexdiff-for-marking-changes-to-tex-documents.html&quot;&gt;here&lt;/a&gt;. An example with beautifully typeset document is given below.
&lt;code&gt;latexdiff draft.tex revision.tex &amp;gt; diff.tex&lt;/code&gt;&lt;img src=&quot;http://3142.nl/latex-diff/screenshot.png&quot; /&gt;&lt;/li&gt;
&lt;li&gt;Another alternative could be to follow a simple guideline: &lt;i&gt;Always start a new sentence in a new line and do not put any line-breaks in till the sentence ends&lt;/i&gt;. This allows traditional diff/merge programs like &lt;a href=&quot;http://meldmerge.org/&quot;&gt;meld&lt;/a&gt; etc to work in a much better way. &lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h3&gt;
\(\LaTeX\) and git&lt;/h3&gt;
It is useful to use a version control system, like &lt;a href=&quot;http://git-scm.com/book/en/Getting-Started-Git-Basics&quot;&gt;git&lt;/a&gt;, with \(\LaTeX\) documents. Here are some useful tips while working with git: 
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Check &lt;a href=&quot;http://stackoverflow.com/questions/6188780/git-latex-workflow&quot;&gt;git + LaTeX workflow&lt;/a&gt; for some great tips.&lt;/li&gt;
&lt;li&gt;Use &lt;a href=&quot;http://www.ctan.org/tex-archive/support/latexdiff&quot;&gt;latexdiff&lt;/a&gt; (also see above) in smarter way:
&lt;ul&gt;&lt;li&gt;&lt;code&gt;latexdiff &lt;(git show checksumHash:file.tex) file.tex &gt; diff.tex&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://gitorious.org/git-latexdiff&quot;&gt;Git-latexdiff&lt;/a&gt; can also be used for more advanced operations, like documents involving multiple &lt;tt&gt;.tex&lt;/tt&gt;files.&lt;/li&gt;
&lt;li&gt;Check &lt;a href=&quot;http://tex.stackexchange.com/questions/1325/using-latexdiff-with-git&quot;&gt;stackexchange&lt;/a&gt; discussion for more solutions.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;br /&gt;
&lt;h3&gt;
\(\LaTeX\) on blogspot.com&lt;/h3&gt;
&lt;a href=&quot;http://www.mathjax.org/&quot;&gt;MathJax&lt;/a&gt; is awesome. It is very easy to &lt;a href=&quot;http://docs.mathjax.org/en/latest/start.html#mathjax-cdn&quot;&gt;install&lt;/a&gt; and get \(\LaTeX\) equations working.
      \[
        J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha}
      \]
&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/416268433649812780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/416268433649812780'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2013/08/useful-latex-tricks.html' title='Useful LaTeX tricks'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-6362671402950829781</id><published>2013-07-10T11:12:00.000-07:00</published><updated>2014-09-17T23:00:49.652-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Git"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Git cheat sheet</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;
Git overview: Operation and File lifecycle&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://git-scm.com/book/en/Getting-Started-Git-Basics&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;294&quot; src=&quot;http://git-scm.com/figures/18333fig0106-tn.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;http://git-scm.com/book/en/Git-Basics-Recording-Changes-to-the-Repository&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://git-scm.com/figures/18333fig0201-tn.png&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
Image are &lt;a href=&quot;https://en.wikipedia.org/wiki/Inline_linking&quot;&gt;hotlinked&lt;/a&gt; from &lt;a href=&quot;http://git-scm.com/book/&quot;&gt;Pro Git book, written by Scott Chacon&lt;/a&gt;.
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some of the commands listed here may use alias and/or configuration defined in &lt;tt&gt;~/.gitconfig&lt;/tt&gt; (see near the end of the post).
&lt;br /&gt;
&lt;!-- adsense --&gt;
&lt;h3&gt;
General operations&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Help with git:&lt;/b&gt;
&lt;code&gt;git --help             &lt;span class=&quot;codecmnt&quot;&gt;# List available git commands&lt;/span&gt;
git help &amp;lt;command&amp;gt;     &lt;span class=&quot;codecmnt&quot;&gt;# More details about a specific command&lt;/span&gt;
git &amp;lt;command&amp;gt; --help   &lt;span class=&quot;codecmnt&quot;&gt;# More details about a specific command&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;b&gt;Display status of (local) repository:&lt;/b&gt;
&lt;code&gt;git status
git st            &lt;span class=&quot;codecmnt&quot;&gt;# Abbreviated using ~/.gitconfig&lt;/span&gt;
git status -sb    &lt;span class=&quot;codecmnt&quot;&gt;# Shorter output&lt;/span&gt;
git status -uno   &lt;span class=&quot;codecmnt&quot;&gt;# Hide details of untracked files&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;b&gt;Adding files to staging area:&lt;/b&gt;
&lt;code&gt;git add --dry-run &amp;lt;file1&amp;gt; &amp;lt;file2...fileN&amp;gt;  &lt;span class=&quot;codecmnt&quot;&gt;# Dry run. No change in repository&lt;/span&gt;
git add -n &amp;lt;file1&amp;gt; &amp;lt;file2...fileN&amp;gt;         &lt;span class=&quot;codecmnt&quot;&gt;# Abbreviated flag for dry run&lt;/span&gt;
git add &amp;lt;file1&amp;gt; &amp;lt;file2...fileN&amp;gt;            &lt;span class=&quot;codecmnt&quot;&gt;# Add files to staging area&lt;/span&gt;
git add *.m *.txt                          &lt;span class=&quot;codecmnt&quot;&gt;# Also supports wildcards&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;b&gt;Commit changes with message:&lt;/b&gt;
&lt;code&gt;git commit -m &#39;message&#39;     &lt;span class=&quot;codecmnt&quot;&gt;# Commit ONLY staged files&lt;/span&gt;
git commit -a -m &#39;message&#39;  &lt;span class=&quot;codecmnt&quot;&gt;# Commit ALL changes, including unstaged files&lt;/span&gt;
git ci &#39;message&#39;            &lt;span class=&quot;codecmnt&quot;&gt;# Abbreviated using ~/.gitconfig&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Compare and inspect&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Changes in working directory:&lt;/b&gt;
&lt;code&gt;git diff --color                   &lt;span class=&quot;codecmnt&quot;&gt;# Colored diff&lt;/span&gt;
git diff --stat                    &lt;span class=&quot;codecmnt&quot;&gt;# Show diffstat&lt;/span&gt;
git diff --ignore-all-space        &lt;span class=&quot;codecmnt&quot;&gt;# Ignore all whitespace&lt;/span&gt;
git diff -w                        &lt;span class=&quot;codecmnt&quot;&gt;# Abbreviated --ignore-all-space&lt;/span&gt;
git diff --ignore-space-changes    &lt;span class=&quot;codecmnt&quot;&gt;# Ignore change in amount of whitespace&lt;/span&gt;
git diff -b                        &lt;span class=&quot;codecmnt&quot;&gt;# Abbreviated --ignore-space-changes&lt;/span&gt;
git diff -w --color-words          &lt;span class=&quot;codecmnt&quot;&gt;# Colored word diff (rather than line diff) ignoring whitespace&lt;/span&gt;
git diff --cached                  &lt;span class=&quot;codecmnt&quot;&gt;# Show changes in staged files&lt;/span&gt;
git diff --staged                  &lt;span class=&quot;codecmnt&quot;&gt;# Same as --cached&lt;/span&gt;
&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Inspect changes:&lt;/b&gt; &lt;br/&gt;
(&lt;a href=&quot;http://git-scm.com/docs/gitk&quot;&gt;gitk&lt;/a&gt; is a tcl/tk based gui; &lt;a href=&quot;http://lostechies.com/joshuaflanagan/2010/09/03/use-gitk-to-understand-git/&quot;&gt;Beginner tutorial&lt;/a&gt;)
&lt;code&gt;gitk --all                          &lt;span class=&quot;codecmnt&quot;&gt;# Browse all branches in local repository&lt;/span&gt;
git log --oneline --graph           &lt;span class=&quot;codecmnt&quot;&gt;# Inspect repository with summary of changes&lt;/span&gt;
git log --oneline --graph --stat    &lt;span class=&quot;codecmnt&quot;&gt;# Inspect repository with diffstats&lt;/span&gt;
git whatchanged --oneline --graph   &lt;span class=&quot;codecmnt&quot;&gt;# Similar to git log &lt;/span&gt;
git lg                              &lt;span class=&quot;codecmnt&quot;&gt;# Abbreviated using ~/.gitconfig&lt;/span&gt;
git show &amp;lt;commit&amp;gt;                   &lt;span class=&quot;codecmnt&quot;&gt;# Shows details of changes in commit&lt;/span&gt;
&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Inspect changes beyond file renames:&lt;/b&gt; &lt;br/&gt;
(&lt;a href=&quot;http://blog.bauermann.eng.br/2008/01/03/take-care-when-renaming-files-in-git/&quot;&gt;Take care with renames&lt;/a&gt;: NEVER commit renames and modifications in the same commit. &lt;a href=&quot;http://stackoverflow.com/a/1890293&quot;&gt;Check&lt;/a&gt; &lt;a href=&quot;http://stackoverflow.com/questions/10828267/can-git-restructure-my-folders-without-losing-history&quot;&gt;these&lt;/a&gt; &lt;a href=&quot;http://stackoverflow.com/questions/4176784/lost-git-history-after-reorganizing-project-folder&quot;&gt;as well&lt;/a&gt;.)
&lt;code&gt;git log --oneline --follow &amp;lt;filename&amp;gt;   &lt;span class=&quot;codecmnt&quot;&gt;# Summary of changes&lt;/span&gt;
git log --follow -p &amp;lt;filename&amp;gt;          &lt;span class=&quot;codecmnt&quot;&gt;# Detailed changes&lt;/span&gt;
gitk &amp;lt;filename&amp;gt;                         &lt;span class=&quot;codecmnt&quot;&gt;# Detailed changes using gitk&lt;/span&gt;
&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
Branching&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Pro Git book has &lt;a href=&quot;http://git-scm.com/book/en/Git-Branching-What-a-Branch-Is&quot;&gt;an excellent chapter on Branching and Merging&lt;/a&gt;.
&lt;/li&gt;
&lt;li&gt;When typing in the name of a branch in following commands, try using TAB for auto-completion. It works most of the times.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git branch                     &lt;span class=&quot;codecmnt&quot;&gt;# List local branches&lt;/span&gt;
git branch -a                  &lt;span class=&quot;codecmnt&quot;&gt;# List all local and remote branches&lt;/span&gt;
git checkout &amp;lt;branch_name&amp;gt;     &lt;span class=&quot;codecmnt&quot;&gt;# Switch to other existing branch&lt;/span&gt;
git checkout -b &amp;lt;branch_name&amp;gt;  &lt;span class=&quot;codecmnt&quot;&gt;# Create a branch and switch to it&lt;/span&gt;
git branch -d &amp;lt;branch name&amp;gt;    &lt;span class=&quot;codecmnt&quot;&gt;# Delete a branch&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;b&gt;Compare branches:&lt;/b&gt; (order of branches matter)
&lt;code&gt;git diff &amp;lt;branch1&amp;gt;..&amp;lt;branch2&amp;gt;
git diff --stat &amp;lt;branch1&amp;gt;..&amp;lt;branch2&amp;gt;         &lt;span class=&quot;codecmnt&quot;&gt;# Generate diffstat&lt;/span&gt;
git diff --name-status &amp;lt;branch1&amp;gt;..&amp;lt;branch2&amp;gt;  &lt;span class=&quot;codecmnt&quot;&gt;# Short diff with only name and status&lt;/span&gt;
git diff &amp;lt;branch1&amp;gt; &amp;lt;branch2&amp;gt; &amp;lt;filename&amp;gt;      &lt;span class=&quot;codecmnt&quot;&gt;# Show differences only for a file&lt;/span&gt;
git difftool &amp;lt;branch1&amp;gt; &amp;lt;branch2&amp;gt; &amp;lt;filename&amp;gt;  &lt;span class=&quot;codecmnt&quot;&gt;# Use (external) diff tool&lt;/span&gt;
&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;b&gt;Compare directories (branches/commits):&lt;/b&gt; (requires git version &gt;=1.7.10)
&lt;code&gt;git difftool --dir-diff &amp;lt;commit1&amp;gt;..&amp;lt;commit2&amp;gt;
git difftool --dir-diff &amp;lt;commit1&amp;gt;
git difftool --dir-diff &amp;lt;branch1&amp;gt;
git difftool --dir-diff &amp;lt;branch1&amp;gt;..&amp;lt;branch2&amp;gt;&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;b&gt;Remote branches &amp; its management&lt;/b&gt; &lt;br/&gt;
A very good and detailed description of remote branch management can be found in &lt;a href=&quot;http://git-scm.com/book/en/Git-Branching-Remote-Branches&quot;&gt;Pro Git book&lt;/a&gt;.
&lt;code&gt;&lt;span class=&quot;codecmnt&quot;&gt;# Pushing to remote&lt;/span&gt;
git push origin localBranch                          &lt;span class=&quot;codecmnt&quot;&gt;# Pushes localBranch to origin&lt;/span&gt;
git push -u origin localBranch                       &lt;span class=&quot;codecmnt&quot;&gt;# Pushes/sets association of localBranch to origin&lt;/span&gt;
git push origin localBranch:remoteBranchName         &lt;span class=&quot;codecmnt&quot;&gt;# Pushes localBranch to origin/remoteBranchName&lt;/span&gt;
git push -u origin localBranch:remoteBranchName      &lt;span class=&quot;codecmnt&quot;&gt;# Similar effect to -u above&lt;/span&gt;

&lt;span class=&quot;codecmnt&quot;&gt;# Tracking or defining association. Also &lt;a href=&quot;http://git-scm.com/book/en/Git-Branching-Remote-Branches#Tracking-Branches&quot;&gt;see this&lt;/a&gt;.&lt;/span&gt;
git branch -u origin/remoteBranchName                &lt;span class=&quot;codecmnt&quot;&gt;# Associates current branch to origin/remoteBranchName&lt;/span&gt;
git branch -u origin/remoteBranchName localBranch    &lt;span class=&quot;codecmnt&quot;&gt;# Associates localBranch to origin/remoteBranchName&lt;/span&gt;

&lt;span class=&quot;codecmnt&quot;&gt;# Checking out from remote&lt;/span&gt;
git fetch origin &amp;&amp; git checkout remoteBranchName    &lt;span class=&quot;codecmnt&quot;&gt;# Checkout origin/remoteBranchName&lt;/span&gt;
git checkout -b localBranch origin/remoteBranchName  &lt;span class=&quot;codecmnt&quot;&gt;# Checkout origin/remoteBranchName to localBranch&lt;/span&gt;
git pull                                             &lt;span class=&quot;codecmnt&quot;&gt;# Works after checking out or associating.&lt;/span&gt;

&lt;span class=&quot;codecmnt&quot;&gt;# Deleting remote branch&lt;/span&gt;
git push origin :remoteBranchName                    &lt;span class=&quot;codecmnt&quot;&gt;# Deletes origin/remoteBranchName&lt;/span&gt;
git push origin --delete remoteBranchName            &lt;span class=&quot;codecmnt&quot;&gt;# Deletes origin/remoteBranchName&lt;/span&gt;

&lt;span class=&quot;codecmnt&quot;&gt;# Prune stale branch. See &lt;a href=&quot;http://stackoverflow.com/questions/5094293/git-remote-branch-deleted-but-still-appears-in-branch-a&quot;&gt;git remote branch deleted but still appears in &#39;branch -a&#39;&lt;/a&gt;&lt;/span&gt;
git remote prune origin                              &lt;span class=&quot;codecmnt&quot;&gt;# Removes all stale branches&lt;/span&gt;
git fetch -p                                         &lt;span class=&quot;codecmnt&quot;&gt;# Fetches from origin and prunes all stale branches&lt;/span&gt;

&lt;span class=&quot;codecmnt&quot;&gt;# Show details of branch tracking information&lt;/span&gt;
git remote -v show origin
git branch -vv -a
&lt;/code&gt;&lt;/li&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Merge conflicts&lt;/h3&gt;
Good read about three-way merge in git: &lt;a href=&quot;http://blog.wuwon.id.au/2010/09/painless-merge-conflict-resolution-in.html&quot;&gt;Painless Merge...&lt;/a&gt; and &lt;a href=&quot;http://lukas.zapletalovi.com/2012/09/three-way-git-merging-with-meld.html&quot;&gt;Three way git...&lt;/a&gt; Here is a summary:
&lt;ul&gt;
&lt;li&gt;Use &lt;tt&gt;git mergetool&lt;/tt&gt; with &lt;a href=&quot;http://meldmerge.org/&quot;&gt;meld&lt;/a&gt;. See &lt;tt&gt;~/.gitconfig&lt;/tt&gt; below. Mergetool would go through the conflicting files and create various new files with different file extensions so that it can use following command with meld (see &lt;a href=&quot;https://github.com/git/git/blob/master/mergetools/meld&quot;&gt;git source code&lt;/a&gt; for more details).
&lt;code&gt;meld --output $MERGED $LOCAL $BASE $REMOTE&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;tt&gt;$LOCAL&lt;/tt&gt;: Contents of the file on the current branch. This is presented in &lt;b&gt;Left-most&lt;/b&gt; column in meld.&lt;/li&gt;
&lt;li&gt;&lt;tt&gt;$REMOTE&lt;/tt&gt;: Contents of the file to be merged. &lt;b&gt;Right-most&lt;/b&gt; column in meld.&lt;/li&gt;
&lt;li&gt;&lt;tt&gt;$BASE&lt;/tt&gt;: Common base of the merge OR half-finished merge where things started to fail. It is shown in &lt;b&gt;middle&lt;/b&gt; column in meld. This is column which you would want to edit.&lt;/li&gt;
&lt;li&gt;&lt;tt&gt;$MERGED&lt;/tt&gt;: File to which meld would write the merge resolution. It is &lt;b&gt;not&lt;/b&gt; shown in meld. However, when &lt;tt&gt;$BASE&lt;/tt&gt; is saved after editing, the output is written to &lt;tt&gt;$MERGED&lt;/tt&gt;. Usually, &lt;tt&gt;$MERGED&lt;/tt&gt; does not have any special extension like above files.&lt;/li&gt;
&lt;li&gt;Mergetool creates &lt;tt&gt;*.orig&lt;/tt&gt; backup files while resolving merges. These are safe to remove once a file has been merged. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
Tagging&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Create/Delete tags&lt;/b&gt; (Also see &lt;a href=&quot;http://git-scm.com/book/en/Git-Basics-Tagging&quot;&gt;Pro Git book&lt;/a&gt;)
&lt;code&gt;git tag -a v1.4 -m &#39;my version 1.4&#39;                   &lt;span class=&quot;codecmnt&quot;&gt;# Creates annotated tag to current commit&lt;/span&gt;
git tag -a v1.4 -m &#39;my version 1.4 &amp;lt;checksum&amp;gt;         &lt;span class=&quot;codecmnt&quot;&gt;# Adds tag to an older commit&lt;/span&gt;
git tag -d &amp;lt;tag_name&amp;gt;                                 &lt;span class=&quot;codecmnt&quot;&gt;# Deletes a tag&lt;/span&gt;
&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;List tags&lt;/b&gt;
&lt;code&gt;git tag -l                                             &lt;span class=&quot;codecmnt&quot;&gt;# Lists tags in alphabetical order&lt;/span&gt;
git tag                                                &lt;span class=&quot;codecmnt&quot;&gt;# Lists tags in alphabetical order&lt;/span&gt;
git tag -l -n1                                         &lt;span class=&quot;codecmnt&quot;&gt;# Lists tags along with annotation&lt;/span&gt;
git tag -l &amp;lt;pattern&amp;gt;                                   &lt;span class=&quot;codecmnt&quot;&gt;# Lists tags in matching a pattern&lt;/span&gt;
git tag -l v13*                                        &lt;span class=&quot;codecmnt&quot;&gt;# Lists tags starting with v13&lt;/span&gt;
git log --tags --simplify-by-decoration --pretty=&quot;%d&quot;  &lt;span class=&quot;codecmnt&quot;&gt;# Lists tags in chronological order&lt;/span&gt;
git tl                                                 &lt;span class=&quot;codecmnt&quot;&gt;# Abbreviated by ~/.gitconfig&lt;/span&gt;
git show &amp;lt;tag_name&amp;gt;                                    &lt;span class=&quot;codecmnt&quot;&gt;# Show details of a tags&lt;/span&gt;
&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;&lt;b&gt;Remote tags&lt;/b&gt;
&lt;code&gt;git ls-remote --tags origin                            &lt;span class=&quot;codecmnt&quot;&gt;# List all tags on origin&lt;/span&gt;
git push origin &amp;lt;tag_name&amp;gt;                             &lt;span class=&quot;codecmnt&quot;&gt;# Push a tag to origin&lt;/span&gt;
git push origin --tags                                 &lt;span class=&quot;codecmnt&quot;&gt;# Push all tags to origin&lt;/span&gt;
git push origin :refs/tags/&amp;lt;tag_name&amp;gt;                  &lt;span class=&quot;codecmnt&quot;&gt;# Delete a tag on origin&lt;/span&gt;
&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Others:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Revert changes&lt;/b&gt; (excellent examples in &lt;a href=&quot;http://git-scm.com/docs/git-reset&quot;&gt;git-reset documentation&lt;/a&gt;)
&lt;code&gt;git reset                     &lt;span class=&quot;codecmnt&quot;&gt;# Undo all add. Retains all changes in working tree&lt;/span&gt;
git reset --hard              &lt;span class=&quot;codecmnt&quot;&gt;# Undo add all. Discards all changes in working tree&lt;/span&gt;
git reset HEAD &amp;lt;file_name&amp;gt;    &lt;span class=&quot;codecmnt&quot;&gt;# Undo add one file. Retains all changes in working tree&lt;/span&gt;
git reset --soft HEAD^        &lt;span class=&quot;codecmnt&quot;&gt;# Undo last commit. Retains all changes in working tree&lt;/span&gt;
&lt;/code&gt;
uncommitted (un-stage) all changes including files and folders:&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;

&lt;!-- adsense --&gt;

&lt;br /&gt;
&lt;h3&gt;
&lt;tt&gt;~/.gitconfig&lt;/tt&gt;&lt;/h3&gt;
&lt;tt&gt;git difftool&lt;/tt&gt; falls back to &lt;tt&gt;git mergetool&lt;/tt&gt; config variables when the difftool equivalents have not been defined. If a merge resolution program is not specified, &lt;tt&gt;git mergetool&lt;/tt&gt; will use the configuration variable &lt;tt&gt;merge.tool&lt;/tt&gt;.
&lt;code&gt;[core]
 editor = emacs
 autocrlf = input
[merge]
 tool = meld
[alias]
 ci = commit -a -m
 st = status -sb
 rb = rebase
 lg = log --graph --all --format=format:&#39;%C(auto)%h (%cd)%C(reset)%C(bold red)%d%C(reset) %C(bold green)%s%C(reset) %C(bold white)- %cn%C(reset)&#39; --abbrev-commit --date=short
 df = diff -w --color-words
 dft = difftool -y
 tl = log --tags --simplify-by-decoration --format=format:&#39;%C(auto)%h (%cd) -%C(reset)%C(bold red)%d%C(reset) %C(bold white)- %cn%C(reset)&#39; --date=short --author-date-order
[color]
 ui = true
[color &quot;status&quot;] 
       added = yellow
       changed = red
       untracked = cyan
[push]
       default = current
&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
Other great Git references: 
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://git-scm.com/book&quot;&gt;Pro Git book&lt;/a&gt; is a great reference to learn Git. Many of above commands are derived it.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gitready.com/&quot;&gt;git ready&lt;/a&gt; provides tonnes of great git tips for all level of users.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://marklodato.github.io/visual-git-guide/index-en.html&quot;&gt;Visual Git Reference&lt;/a&gt; is another (short) reference to get idea and basics of Git.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gitimmersion.com/index.html&quot;&gt;Git immersion&lt;/a&gt; is a full length Git tutorial starting from very basic.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gitref.org/index.html&quot;&gt;GitRef&lt;/a&gt; provides a quick reference to Git&#39;s syntax.&lt;/li&gt;
&lt;li&gt;Andrew Peterson&#39;s &lt;a href=&quot;http://ndpsoftware.com/git-cheatsheet.html&quot;&gt;interactive Git cheat sheet&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Another &lt;a href=&quot;http://cheat.errtheblog.com/s/git&quot;&gt;very extensive&lt;/a&gt; cheat sheet.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/6362671402950829781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/6362671402950829781'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2013/07/git-cheat-sheet.html' title='Git cheat sheet'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-7159772634458926931</id><published>2013-03-10T17:48:00.004-07:00</published><updated>2014-05-17T16:01:31.820-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Dropbox"/><title type='text'>Dropbox Bug? </title><content type='html'>UPDATE: This is an expected behavior of dropbox. See relevant &lt;a href=&quot;https://forums.dropbox.com/topic.php?id=97810&quot;&gt;discussion at Dropbox Forums&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
It seems that there is a dropbox bug which may affect the recovery of deleted files and folders in this specific situation. I will try to document and elaborate my observations in this post. In short, dropbox seems to be not able to recover a deleted folder if a new file with exact same name is replaced at the exact same location as the deleted folder. I am a free user of dropbox and I am not sure&amp;nbsp;whether this is one of the &lt;i&gt;free features&lt;/i&gt;. I found this particular problem 7-8 months back &amp;amp; I could recover the files from my personal backup, which is&amp;nbsp;separate&amp;nbsp;and independent from dropbox.&lt;br /&gt;
&lt;br /&gt;
Here are the steps to reproduce the results. (I did backup all the data, so nothing was lost in reality. This is just a demonstration.) Here, I am going to delete a folder named &#39;&lt;i&gt;Image Fun&lt;/i&gt;&#39; from my dropbox which has some more files and folders in it. The goal is to check, if I can recover those files and folders inside the folder &lt;i&gt;Image Fun.&lt;/i&gt;&lt;br /&gt;

&lt;!-- adsense --&gt;

&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Make sure Dropbox is running. (I am using Linux Mint 13)&lt;/li&gt;
&lt;li&gt;Delete the folder &lt;i&gt;Image Fun&lt;/i&gt;, with some files and folders.&lt;/li&gt;
&lt;li&gt;Create a file with name &lt;i&gt;Image Fun&lt;/i&gt; (no extensions) somewhere outside the Dropbox folder and then copy the file to the location of original &lt;i&gt;Image Fun&lt;/i&gt; folder.&lt;/li&gt;
&lt;li&gt;Log on to dropbox.com website and hit &quot;Show deleted files&quot;. I can not see any folder which has been deleted &amp;amp; has name &lt;i&gt;Image Fun.&lt;/i&gt;&amp;nbsp;Though, I can see the file I created with the exact same name (among normal files, not deleted files).&lt;/li&gt;
&lt;li&gt;Navigate to &quot;Events&quot; link on the left on dropbox website. This is the part where it gets interesting. I could see the notification which says that I deleted Image Fun and other 45 files in that folder. See the screenshot below. Now when I click on Image Fun, I am taken to home page where it highlighted the new &lt;i&gt;Image Fun&lt;/i&gt; file.&lt;/li&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivBwueqRUFcz1V0lQNPdAgN53sNDcrm2ErfG86A9YmZQAYCgNspa1hH6WtHhkznpT4IB4aNVaZxhIr1BF5JqS-SXNAtTzqqSFnENPgy_HOGqVqpAHXZsJGTdaDtCv5gE95qdHj2HCFJjIm/s1600/events-page.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;193&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivBwueqRUFcz1V0lQNPdAgN53sNDcrm2ErfG86A9YmZQAYCgNspa1hH6WtHhkznpT4IB4aNVaZxhIr1BF5JqS-SXNAtTzqqSFnENPgy_HOGqVqpAHXZsJGTdaDtCv5gE95qdHj2HCFJjIm/s640/events-page.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;
&lt;li&gt;Clicking on &quot;output&quot; link in events page (output was a folder inside the delete folder) showed a message in red saying &quot;The folder /Image Fun/output is deleted&quot; (screenshot below).&lt;/li&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvuhY5AmqK7vLMmhv2XeikcBUh-CxpZD5jNW6MXQ20um_g1QAj-A8ggLlfnIFvml9l_VWBEjaLaS8P2vl35S8LDsLNadJYfCJIyXGnAXsW_OGCLXS_29AdqMIEpMHfDpFKfhflIixZagx0/s1600/output.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;464&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvuhY5AmqK7vLMmhv2XeikcBUh-CxpZD5jNW6MXQ20um_g1QAj-A8ggLlfnIFvml9l_VWBEjaLaS8P2vl35S8LDsLNadJYfCJIyXGnAXsW_OGCLXS_29AdqMIEpMHfDpFKfhflIixZagx0/s640/output.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;
&lt;li&gt;When I clicked on &quot;45 more files&quot; in the events page, it showed me a page where all the files were listed, but I could not click on any of them in order to recover.&amp;nbsp;&lt;/li&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOpHAoUKIdWgeahmw0k51i_sgB0FaPiD3gr-yl_FkT838Jc4DE_zreI9Lwb6LNp9eB_0dnaDUTByJirvRJWoRcV-abk8ymk7_I_6yhPEBpvn_EZzYK2ZiPB0uKje6K67lu6mY3mBaP-2b5/s1600/45_more_files.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;603&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOpHAoUKIdWgeahmw0k51i_sgB0FaPiD3gr-yl_FkT838Jc4DE_zreI9Lwb6LNp9eB_0dnaDUTByJirvRJWoRcV-abk8ymk7_I_6yhPEBpvn_EZzYK2ZiPB0uKje6K67lu6mY3mBaP-2b5/s640/45_more_files.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;
&lt;li&gt;But, when I clicked on link &quot;a1.jpg&quot; in events page (where it said &quot;You deleted a1.jpg and 45 more files&quot;), I was taken to a page where I can actually see the older version of that particular file - a1.jpg. Clicking on version 0 shows the correct original file.&amp;nbsp;&lt;/li&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKW9pcjKSh4JYD3kRazi2mVHsKMkjko2FtMnhlLOLA-MdrTuCQ-V8FUCeFAIjUCyA8LD-F5mUhC_XcEOAKOm8r62SCU_vARAVHZmgETL2w8Wllp_IG3NxlOlxw_CPjx2w6Z0o1p-uwTxQZ/s1600/a1-jpg.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;248&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKW9pcjKSh4JYD3kRazi2mVHsKMkjko2FtMnhlLOLA-MdrTuCQ-V8FUCeFAIjUCyA8LD-F5mUhC_XcEOAKOm8r62SCU_vARAVHZmgETL2w8Wllp_IG3NxlOlxw_CPjx2w6Z0o1p-uwTxQZ/s640/a1-jpg.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;li&gt;You must have noticed the &quot;Restore&quot; button on a1.jpg link (above screenshot). When I clicked on it, something unexpected happened. The file which I created, with name&amp;nbsp;&lt;i&gt;Image Fun&lt;/i&gt;, was actually removed with the folder &lt;i&gt;Image Fun&lt;/i&gt; and a1.jpg was restored in the folder. Now I could navigate to the folder and even see deleted files. This could be one way to recover the file. But I would count it as very unreliable method. It relies on finding and clicking on one particular file&#39;s deleted link and then recovering it. That particular link may actually get lost if many other files in other locations were also deleted. Events page after the recovery looks like this:&lt;/li&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWXKzNEMBSQmONDYaOfxZf_F68Bssm05XBCP0t5XCBLnKjnpeN5kc82CpjLAe_XixLapF6dvFv66MeUjObjHV-ionSybK0iIZ2x3mZmHp-ncLYEsd7lgB0VgPXxzkpvAucEmtvY2Jf7vUD/s1600/new-events.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;214&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWXKzNEMBSQmONDYaOfxZf_F68Bssm05XBCP0t5XCBLnKjnpeN5kc82CpjLAe_XixLapF6dvFv66MeUjObjHV-ionSybK0iIZ2x3mZmHp-ncLYEsd7lgB0VgPXxzkpvAucEmtvY2Jf7vUD/s640/new-events.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;strike&gt;Hopefully, this will help to fix or address the issue I mentioned.&lt;/strike&gt; It is probably an expected behavior. See relevant &lt;a href=&quot;https://forums.dropbox.com/topic.php?id=97810&quot;&gt;discussion at Dropbox Forums&lt;/a&gt;.  </content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/7159772634458926931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/7159772634458926931'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2013/03/dropbox-bug.html' title='Dropbox Bug? '/><author><name>Unknown</name><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><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivBwueqRUFcz1V0lQNPdAgN53sNDcrm2ErfG86A9YmZQAYCgNspa1hH6WtHhkznpT4IB4aNVaZxhIr1BF5JqS-SXNAtTzqqSFnENPgy_HOGqVqpAHXZsJGTdaDtCv5gE95qdHj2HCFJjIm/s72-c/events-page.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-4648378010697192927</id><published>2012-08-28T15:34:00.000-07:00</published><updated>2014-05-17T16:02:42.850-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="fonts"/><category scheme="http://www.blogger.com/atom/ns#" term="LaTeX"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="pdf"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>gs (GhostScript) cheat sheet</title><content type='html'>Cheat-sheet for versatile interpreter &lt;a href=&quot;http://www.ghostscript.com/&quot;&gt;GhostScript&lt;/a&gt;. It can be used to tweak, convert, produce high quality Postscript and PDF files.
&lt;br/&gt;&lt;br/&gt;
&lt;h4&gt;Convert postscript (ps) to pdf:&lt;/h4&gt; &lt;code&gt;gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=fileout.pdf filein.ps &lt;/code&gt;
&lt;h4&gt;Merge ps and/or pdf:&lt;/h4&gt; &lt;code&gt;gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=fileout.pdf filein1.ps filein2.pdf filein3.pdf&lt;/code&gt;
&lt;h4&gt;Extract page(s) from a ps or a pdf document:&lt;/h4&gt;&lt;code&gt;gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=3 -dLastPage=3 -sOutputFile=fileout.pdf filein.ps&lt;/code&gt;
&lt;h4&gt;Embed fonts in a pdf:&lt;/h4&gt;&lt;code&gt;gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=fileout.pdf  -dPDFSETTINGS=/prepress -dEmbedAllFonts=true -dSubsetFonts=true -dCompatibilityLevel=1.6 filein.pdf&lt;/code&gt;
&lt;h4&gt;Convert images to pdf:&lt;/h4&gt; Check &lt;a href=&quot;http://stackoverflow.com/questions/4283245/using-ghostscript-to-convert-jpeg-to-pdf&quot;&gt;this post&lt;/a&gt;. Or else use ImageMagic&#39;s &lt;a href=&quot;http://www.imagemagick.org/script/convert.php&quot;&gt;convert&lt;/a&gt;.
&lt;br/&gt;

&lt;!-- adsense --&gt;

&lt;h4 style=&quot;text-align: left;&quot;&gt;PDF optimization options&lt;/h4&gt;
&lt;code&gt;-dPDFSETTINGS=/screen (screen-view-only quality, 72 dpi images)
-dPDFSETTINGS=/ebook (low quality, 150 dpi images)
-dPDFSETTINGS=/printer (high quality, 300 dpi images)
-dPDFSETTINGS=/prepress (high quality, color preserving, 300 dpi imgs)
-dPDFSETTINGS=/default (almost identical to /screen)&lt;/code&gt;
&lt;br/&gt;

&lt;h4 style=&quot;text-align: left;&quot;&gt;Paper size options&lt;/h4&gt;
&lt;code&gt;-sPAPERSIZE=letter
-sPAPERSIZE=a4
-dDEVICEWIDTHPOINTS=w -dDEVICEHEIGHTPOINTS=h (point=1/72 of an inch)
-dFIXEDMEDIA (force paper size over the PostScript defined size)
-gWIDTHxHEIGHT  (page size in pixels)&lt;/code&gt;
&lt;br/&gt;

&lt;h4&gt;Output devices:&lt;/h4&gt;
&lt;code&gt;-sDEVICE=pdfwrite
-sDEVICE=ps2write
-sDEVICE=png16m  (24-bit RGB color)
-sDEVICE=pnggray  (grayscale)
-sDEVICE=pngmono  (black-and-white)
-sDEVICE=pngalpha (32-bit RGBA color)
-sDEVICE=jpeg   (color JPEG)
-sDEVICE=jpeggray  (grayscale JPEG)
-sDEVICE=epswrite  (encapsulated postscript)
-sDEVICE=txtwrite  (text output, UTF-8)
&lt;/code&gt;
Check &lt;tt&gt;-sOutputFile&lt;/tt&gt; below, for separate images for each page of a multi-page document. Tiff, PNM and many more formats are supported. Check details in &lt;a href=&quot;http://ghostscript.com/doc/current/Devices.htm&quot;&gt;Ghostscript output devices&lt;/a&gt;.
&lt;br/&gt;&lt;br/&gt;
&lt;h4&gt;Help &amp; list of available devices:&lt;/h4&gt;&lt;code&gt;gs -h&lt;/code&gt;
&lt;br/&gt;

&lt;h4 style=&quot;text-align: left;&quot;&gt;Other options&lt;/h4&gt;
&lt;code&gt;-dNOPAUSE    (no pause after page)
-dBATCH  (exit after last file)
-sOutputFile=ABC-%03d.pgm (produces &#39;ABC-001.pgm&#39;..&#39;ABC-010.pgm&#39;..)
-dEmbedAllFonts=true
-dSubsetFonts=true  (Embeds only the characters used in document)
-dCompatibilityLevel=1.4  (Adobe&#39;s PDF specifications,
                           &gt;=1.4 for font embedding, 
                           =1.6 for OpenType font embedding)
-dCompressPages=true  (compress page content)
-dFirstPage=pagenumber
-dLastPage=pagenumber
-dAutoRotatePages=/PageByPage  (or /All or /None)
-rXRESxYRES (XRES &amp; YRES in pixels/inch)
-rRES (same XRES &amp; YRES, affects images and fonts converted to bitmaps)
-sPDFPassword=password&lt;/code&gt;
More details &amp; defaults on &lt;a href=&quot;http://ghostscript.com/doc/current/Ps2pdf.htm#Options&quot;&gt; ps2pdf documentation&lt;/a&gt;.&lt;br/&gt;
&lt;a href=&quot;http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/pdf_creation_apis_and_specs/PDFCreationSettings.pdf&quot;&gt;Adobe® PDF Creation Settings&lt;/a&gt; - Used by GhostScript.&lt;br/&gt;
&lt;a href=&quot;http://ghostscript.com/doc/current/Readme.htm&quot;&gt;GhostScript Documentation&lt;/a&gt;.
&lt;br/&gt;&lt;br/&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/4648378010697192927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/4648378010697192927'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2012/08/gs-ghostscript-cheat-sheet.html' title='gs (GhostScript) cheat sheet'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-6285837711714228547</id><published>2012-07-21T12:52:00.000-07:00</published><updated>2013-12-27T01:56:06.646-08:00</updated><title type='text'>Cheat Sheets</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Cheat_sheet&quot; target=&quot;_blank&quot;&gt;Cheat sheets&lt;/a&gt; in this blog are not static posts and they keep getting updates from time to time. Here is the list of cheat sheet (from this blog) for different applications:&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://flukylogs.blogspot.com/2013/08/useful-latex-tricks.html&quot;&gt;Useful \(\LaTeX\) tricks&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;http://flukylogs.blogspot.com/2013/12/bibtex-hacks.html&quot;&gt;BibTex hacks&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;http://flukylogs.blogspot.com/2013/07/git-cheat-sheet.html&quot;&gt;Git - distributed version control system&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://flukylogs.blogspot.com/2012/08/gs-ghostscript-cheat-sheet.html&quot;&gt;GhostScript - an interpreter for the PostScript language and PDF&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://flukylogs.blogspot.com/2011/07/infrequent-linux-commands.html&quot;&gt;Infrequent Linux commands&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://flukylogs.blogspot.com/2009/09/emacs-cheat-sheet.html&quot;&gt;Emacs - A highly customizable and advanced text editor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=5332763671710458168&quot;&gt;CVS - version control&lt;/a&gt; (Not updated anymore)&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Some other useful &lt;a href=&quot;http://en.wikipedia.org/wiki/Cheat_sheet&quot; target=&quot;_blank&quot;&gt;cheat sheet&lt;/a&gt; resources:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.cheat-sheets.org/&quot;&gt;http://www.cheat-sheets.org/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.quicklycode.com/&quot;&gt;http://www.quicklycode.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://devcheatsheet.com/&quot;&gt;http://devcheatsheet.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.sosmath.com/&quot;&gt;http://www.sosmath.com/&lt;/a&gt;&amp;nbsp;- A somewhat detailed &amp;amp; categorized math cheat sheet&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://tutorial.math.lamar.edu/cheat_table.aspx&quot;&gt;http://tutorial.math.lamar.edu/cheat_table.aspx&lt;/a&gt;&amp;nbsp;- Another math cheat sheet&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/6285837711714228547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/6285837711714228547'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2013/07/cheat-sheets.html' title='Cheat Sheets'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-3772790659843276894</id><published>2012-05-11T20:02:00.001-07:00</published><updated>2014-05-17T16:04:30.614-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hard Disk"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Where did my disk space go?</title><content type='html'>Have you ever noticed missing disk space on newly bought hard disks? Here are some possible reasons:&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Unit confusion: The most common confusion in between GB/GiB or MB/MiB.&lt;/li&gt;
&lt;li&gt;Reserved space in linux partitions.&lt;/li&gt;
&lt;li&gt;Filesystem overheads.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Unit Confusion&lt;/span&gt;&lt;/h2&gt;
Many people have &lt;a href=&quot;http://www.shoppingsquare.com.au/help_article.php?id=58&quot; target=&quot;_blank&quot;&gt;questions&lt;/a&gt; &lt;a href=&quot;http://www.tomshardware.com/forum/254118-32-external-harddrive-930gb&quot; target=&quot;_blank&quot;&gt;like&lt;/a&gt;: &lt;a href=&quot;http://community.wdc.com/t5/My-Book-for-PC/New-1TB-MyBook-with-only-930-GB-Storage-Free/td-p/14455&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;Why my 1 TB hard disk shows only 930 GB?&lt;/i&gt;&lt;/a&gt; This is purely a confusion of units and bases used when words like &#39;kilo&#39;, &#39;mega&#39; etc. are used. Following table, from &lt;a href=&quot;http://askubuntu.com/questions/22102/meaning-of-i-in-mib/&quot; target=&quot;_blank&quot;&gt;AskUbuntu&lt;/a&gt;, explains the situation.
&lt;code&gt;Prefix            Bytes                      Prefix            Bytes
1 Byte          = (2^10)^0 = 1               1 Byte         = (10^3)^0 = 1
1 Kibibyte(KiB) = (2^10)^1 = 1024            1 Kilobyte(KB) = (10^3)^1 = 1000
1 Mebibyte(MiB) = (2^10)^2 = 1048576         1 Megabyte(MB) = (10^3)^2 = 1000000
1 Gibibyte(GiB) = (2^10)^3 = 1073741824      1 Gigabyte(GB) = (10^3)^3 = 1000000000
1 Tebibyte(TiB) = (2^10)^4 = 1099511627776   1 Terabyte(TB) = (10^3)^4 = 1000000000000&lt;/code&gt;
Many softwares and operating systems often calculate size in &lt;tt&gt;GiB&lt;/tt&gt; and put &lt;tt&gt;GB&lt;/tt&gt; when they are displaying it. This becomes even worse because most of the harddisks are labelled with actual GBs and hence when numbers are reported in GiB, it creates the confusion. Online &lt;a href=&quot;http://www.cactus2000.de/uk/unit/massbyt.shtml&quot; target=&quot;_blank&quot;&gt;calculators&lt;/a&gt; &lt;a href=&quot;http://wintelguy.com/gb2gib.html&quot; target=&quot;_blank&quot;&gt;like&lt;/a&gt; &lt;a href=&quot;http://www.dr-lex.be/info-stuff/bytecalc.html&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt; can help to remove the confusion. &lt;a href=&quot;http://physics.nist.gov/cuu/Units/binary.html&quot; target=&quot;_blank&quot;&gt;NIST&lt;/a&gt; states very interesting historical reason of this confusing prefix:&lt;br /&gt;&lt;br /&gt;
&lt;div&gt;
&lt;i&gt;Once
upon a time, computer professionals noticed that 2&lt;sup&gt;10&lt;/sup&gt; was very
nearly equal to 1000 and started using the SI prefix &quot;kilo&quot; to mean 1024.
That worked well enough for a decade or two because everybody who talked
kilobytes knew that the term implied 1024 bytes. But, almost overnight
a much more numerous &quot;everybody&quot; bought computers, and the trade computer
professionals needed to talk to physicists and engineers and even to ordinary
people, most of whom know that a kilometer is 1000 meters and a kilogram
is 1000 grams.&lt;br /&gt;
Then
data storage for gigabytes, and even terabytes, became practical, and the
storage devices were not constructed on binary trees, which meant that,
for many practical purposes, binary arithmetic was less convenient than
decimal arithmetic. The result is that today &quot;everybody&quot; does not &quot;know&quot;
what a megabyte is. When discussing computer memory, most manufacturers
use megabyte to mean 
&lt;nobr&gt;2&lt;sup&gt;20&lt;/sup&gt;&amp;nbsp;= 1&amp;nbsp;048&amp;nbsp;576&lt;/nobr&gt;&amp;nbsp;bytes, but the 
manufacturers of computer storage devices usually use the term to mean 
&lt;nobr&gt;1&amp;nbsp;000&amp;nbsp;000&lt;/nobr&gt; bytes. Some designers of local area networks 
have used megabit per second to mean &lt;nobr&gt;1 048 576 bit/s,&lt;/nobr&gt; but all 
telecommunications engineers use it to mean 10&lt;sup&gt;6&lt;/sup&gt; bit/s. And if two 
definitions of the megabyte are not enough, a third megabyte of 
&lt;nobr&gt;1 024 000 bytes&lt;/nobr&gt; is the megabyte used to format the familiar 
90&amp;nbsp;mm (3&amp;nbsp;1/2&amp;nbsp;inch), &quot;1.44&amp;nbsp;MB&quot; diskette. The confusion is 
real, as is the potential for incompatibility in standards and in implemented 
systems.&lt;/i&gt;&lt;/div&gt;

&lt;!-- adsense --&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Reserved space&lt;/span&gt;&lt;/h2&gt;
While formatting Linux partitions like ext2/ext3/ext4, 5% of the drive&#39;s total space is reserved for the super-user (root) so that the &lt;a href=&quot;http://unix.stackexchange.com/questions/7950/reserved-space-for-root-on-a-filesystem-why&quot;&gt;operating system can still write&lt;/a&gt; to the disk even if it is full. This space is wasted if the drive is being used solely for data storage especially on large partitions. The details of the reserved space can be seen by running following command (replace &lt;tt&gt;sda1&lt;/tt&gt; by your drive name)&lt;code&gt;sudo tune2fs -l /dev/sda1&lt;/code&gt; The reserved space can be decreased to 1% of the drive&#39;s total space by running following command. To completely remove this reserved space replace 1 by 0. &lt;code&gt;sudo tune2fs -m 1 /dev/sda1&lt;/code&gt; As explained in &lt;a href=&quot;https://help.ubuntu.com/community/InstallingANewHardDrive#Modify_Reserved_Space_.28Optional.29&quot;&gt;Ubuntu Documentation&lt;/a&gt;, using this command does not change any existing data on the drive. You can use it on a drive which already contains data. This should be left to 5% on drives containing filesystem &lt;tt&gt;/&lt;/tt&gt;, &lt;tt&gt;/var&lt;/tt&gt;, &lt;tt&gt;/tmp&lt;/tt&gt; in order to avoid any problems. &lt;br /&gt;&lt;br /&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Filesystem overheads&lt;/span&gt;&lt;/h2&gt;
Journaling file systems like  ext2/ext3/ext4/NTFS used file tables for managing the filesystem. These tables take up lots of space (2-3% of drive size). Different file system allocates space to these tables differently. For example ext4 allocates all its space during the format itself, which shows up as used disk space. Where as NTFS allocates it when more files are written to disk. &lt;br /&gt;&lt;br /&gt; The exact details are more complicated than this handy wavy explanation. &lt;a href=&quot;http://askubuntu.com/questions/48488/ext4-partition-size-free-space-discrepancies&quot;&gt;Many&lt;/a&gt; &lt;a href=&quot;http://askubuntu.com/questions/131516/new-ext4-partition-and-used-space&quot;&gt;forum&lt;/a&gt; &lt;a href=&quot;http://unix.stackexchange.com/questions/13547/ext4-how-to-account-for-the-filesystem-space&quot;&gt;posts&lt;/a&gt; has discussed this issue. 
&lt;br /&gt;&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/3772790659843276894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/3772790659843276894'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2012/05/where-did-my-disk-space-go.html' title='Where did my disk space go?'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-4521688029454468876</id><published>2012-02-15T18:51:00.000-08:00</published><updated>2015-01-16T11:14:02.061-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Wireless power management in Ubuntu</title><content type='html'>Tested on: Ubuntu 11.04 (natty)&lt;br /&gt;
&lt;br /&gt;
I have been experiencing extremely slow network connection whenever my laptop has been on battery. &lt;a href=&quot;http://www.speedtest.net/&quot;&gt;Speedtest&lt;/a&gt; results showed a 50 fold speed reduction when my laptop was on battery. I speculated that lower speed has to do with power-management, which reduces network speed in order to save battery. Ubuntu, like other operating systems, also has &lt;a href=&quot;https://help.ubuntu.com/community/PowerManagement/&quot;&gt;power management&lt;/a&gt; options installed by default. There is a frontend/GUI for Power Management preferences. But I could not find any thing related to wireless or Wi-Fi in the GUI. Looking around on internet, I &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=1772267&quot;&gt;found&lt;/a&gt; &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=1624956&quot;&gt;many&lt;/a&gt; &lt;a href=&quot;http://uselessuseofcat.com/?p=67&quot;&gt;pages&lt;/a&gt;. Here is a log of the things I found.&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;b&gt;Confirming the behaviour:&lt;/b&gt; In order to make sure that power-management is the culprit of the slow network access run following command both when on power and when on battery.&lt;code&gt;iwconfig&lt;/code&gt; The output should look like following: &lt;code&gt;wlan0     IEEE 802.11bgn  ESSID:&quot;USC Wireless&quot;  
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:00:00:00:00:00  
          Bit Rate=65 Mb/s   Tx-Power=15 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          &lt;b&gt;Power Management:on&lt;/b&gt;
          Link Quality=68/70  Signal level=-42 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:27329  Invalid misc:204   Missed beacon:0&lt;/code&gt; Notice line five of the output. If it says anything other than &lt;i&gt;Power Management:off&lt;/i&gt; while on battery, then it could be power management which is slowing down then network. Check &lt;i&gt;power&lt;/i&gt; argument in &lt;a href=&quot;http://linux.die.net/man/8/iwconfig&quot;&gt;iwconfig man&lt;/a&gt; page for other possible options.&lt;br /&gt; &lt;br /&gt;&lt;/li&gt;
&lt;!-- adsense --&gt;
&lt;li&gt;&lt;b&gt;Temporarily disable the power-management:&lt;/b&gt; While on battery, run following command (replace &lt;tt&gt;wlan0&lt;/tt&gt; with your Ethernet name) &lt;code&gt;sudo iwconfig wlan0 power off &lt;/code&gt; This will only affect the wireless settings of power management. and should change the output of previous command to &lt;i&gt;Power Management:off &lt;/i&gt;and most-likely revert the network speed to usual speed. However, on restarting the system the power management will be enabled. &lt;br /&gt; &lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Permanently disable power-management&lt;/b&gt; for wireless: If you do not want to keep running the above command each time you restart you laptop, create a file &lt;tt&gt;/etc/pm/power.d/wireless&lt;/tt&gt; with following content: &lt;code&gt;#!/bin/sh
/sbin/iwconfig wlan0 power off&lt;/code&gt; Make the file executable by running following command:&lt;code&gt;sudo chmod +x /etc/pm/power.d/wireless&lt;/code&gt;
This new file will override the default wireless script run by power management and will also make sure that wireless power management is turned off. The above trick is taken from &lt;a href=&quot;https://help.ubuntu.com/community/PowerManagement/ReducedPower&quot;&gt;Ubuntu Documentation&lt;/a&gt; (Check few lines before the example). It says: &lt;br /&gt; &lt;br /&gt; &lt;i&gt;When you run pm-powersave it combines the scripts in these two directories and executes them in sorted order. If both directories contain a script with the same name, the one in &lt;tt&gt;/etc/pm/power.d/&lt;/tt&gt; has a higher precedence and only this one will be executed. Therefore to disable a script from &lt;tt&gt;/usr/lib/pm-utils/power.d/&lt;/tt&gt; simply create an empty file in &lt;tt&gt;/etc/pm/power.d/&lt;/tt&gt; with the same name and without the execute bit set. &lt;/i&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/4521688029454468876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/4521688029454468876'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2012/02/wireless-power-management-in-ubuntu.html' title='Wireless power management in Ubuntu'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-5306563985311974074</id><published>2012-01-28T20:55:00.000-08:00</published><updated>2014-05-17T16:06:29.936-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ftp"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>vsftpd behind router/firewall</title><content type='html'>Tested on: Ubuntu 11.04 (natty)&lt;br /&gt;
&lt;br /&gt;
This is how I got vsftpd server work behind a router. If you are getting errors like &lt;i&gt;&quot;Server sent passive reply with unroutable address. Using server address instead.&quot;&lt;/i&gt; or &lt;i&gt;&quot;500 illegal port command&quot;&lt;/i&gt; on list (ls) command, this post might help. Setting passive mode configuration correctly is the trick.&lt;br /&gt;
&lt;br /&gt;
Please note that this may not be the perfect solution or even worse - not very secure. Read vsftpd.conf &lt;a href=&quot;http://vsftpd.beasts.org/vsftpd_conf.html&quot;&gt;manual&lt;/a&gt; before applying any changes.&lt;br /&gt;
&lt;br /&gt;
Make sure port 20, 21 and few more ports, for example 4242-4252, are being forwarded to the server. We will need these extra ports for passive mode - set &lt;tt&gt;pasv_min_port&lt;/tt&gt; and &lt;tt&gt;pasv_max_port&lt;/tt&gt; accordingly in the configuration file. Add following to &lt;tt&gt;/etc/vsftpd.conf&lt;/tt&gt; .
&lt;code&gt;connect_from_port_20=YES
pasv_enable=YES
pasv_addr_resolve=YES
pasv_address=myaddress.dyndns.com
pasv_min_port=4242
pasv_max_port=4252&lt;/code&gt;
Set &lt;tt&gt;pasv_address&lt;/tt&gt; to your domain name. You can use &lt;a href=&quot;http://dyn.com/dns/&quot;&gt;dyndns&lt;/a&gt; for dynamic ip-address. vsftpd will convert your domain name to ip address when vsftpd server starts. Note that if your ip address changes after vsftpd has started it will not update the ip-address. There has been &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=964328&quot;&gt;some&lt;/a&gt; attempt to the solve it.&lt;br /&gt;
&lt;!-- adsense --&gt;

Here are some more configurations with comments:
&lt;code&gt;# Only allow FTP access to users listed in file /etc/vsftpd.userlist
# Other users will not have ftp access
userlist_enable=YES
userlist_deny=NO
userlist_file=/etc/vsftpd.userlist

# Disable delete commands
cmds_denied=DELE,RMD

# Verbose logging
log_ftp_protocol=YES

# You may restrict local users to their home directories. See FAQ for
# the possible risks in this before using chroot_local_user
chroot_local_user=YES&lt;/code&gt;&lt;br /&gt;
For more security, you can also modify the login-shell of a dummy ftp user to something like &lt;tt&gt;/bin/false&lt;/tt&gt; - which does not exist. Use following command
&lt;code&gt;sudo usermod -s /bin/false &amp;lt;username&amp;gt;&lt;/code&gt;
In order to make this work you have to add  &lt;tt&gt;/bin/false&lt;/tt&gt; to the file &lt;tt&gt;/etc/shells&lt;/tt&gt;. Or else vsftpd will generate login error when the user logs in using ftp.
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/5306563985311974074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/5306563985311974074'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2012/01/vsftpd-behind-routerfirewall.html' title='vsftpd behind router/firewall'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-8463909474434478406</id><published>2011-12-24T16:40:00.000-08:00</published><updated>2014-05-17T16:08:19.447-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Dropbox"/><category scheme="http://www.blogger.com/atom/ns#" term="Encryption"/><title type='text'>Encryption + Dropbox + Android</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.dropbox.com/&quot;&gt;Dropbox&lt;/a&gt; is a great application which syncs data across different computers and devices. This makes Dropbox ideal for syncing important, &amp;amp; often sensitive, information across devices. Saving sensitive information on cloud makes me feel uncomfortable and cranky. This is log of softwares/apps required for encrypting data. Explicit goals are:&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Data should never be saved to disk unencrypted.&lt;/li&gt;
&lt;li&gt;Encrypted data should be readable, even without internet access, on Windows, Linux, &amp;amp; Android devices.&lt;/li&gt;
&lt;li&gt;Encryption algorithm should be well known standard algorithm. Open source programs are preferable.&lt;/li&gt;
&lt;/ol&gt;
&lt;!-- adsense --&gt;

Following are some of the possible solutions with some notes. Not all of them achieve all the goals mentioned above.&lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.arg0.net/encfs&quot; target=&quot;_blank&quot;&gt;EncFS&lt;/a&gt; provides encrypted filesystem in user space. It allows mounting an encrypted folder to a user defined location. &lt;a href=&quot;https://play.google.com/store/apps/details?id=csh.cryptonite&quot; target=&quot;_blank&quot;&gt;Cryptonite&lt;/a&gt;&amp;nbsp;is an android app which supports mounting of encrypted EncFS. Unfortunately, I found Cryponite to be buggy and the android app did not work out well for me. EncFS is definitely among perfect solutions for &quot;desktop-only&quot; systems.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.boxcryptor.com/&quot;&gt;BoxCryptor&lt;/a&gt; comes very close (and probably is heavily inspired by EncFS). It has been developed with tight integration with dropbox. It uses very popular AES-256 standard. Unfortunately its Android app requires internet connection to read the encrypted folder. Another drawback is the tight integration with dropbox. The Android app requires dropbox credentials to access data. I feel uncomfortable to give the dropbox credentials to any place other than dropbox itself.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://sourceforge.net/apps/trac/enotes/&quot;&gt;enotes&lt;/a&gt; is the perfect solution for individual text files. So, each encrypted file is an independent text file and hence each individual file has to be encrypted/decrypted seperately. This can be advantage or disadvantage depending on the purpose. It also has an Android app: &lt;a href=&quot;https://market.android.com/details?id=net.ivoras.enotes&quot;&gt;Encrypted Notepad&lt;/a&gt;. It uses AES-128 encryption and is good enough for me. The software is written in Java and hence is cross platform. Similar apps: &lt;a href=&quot;https://market.android.com/details?id=com.giraone.secretsafelite&quot;&gt;Secret safe Lite&lt;/a&gt;, &lt;a href=&quot;https://market.android.com/details?id=info.guardianproject.notepadbot&quot;&gt;NoteCipher&lt;/a&gt;, &lt;a href=&quot;https://market.android.com/details?id=com.jaredhatfield.opennotesecure&quot;&gt;OpenNoteSecure&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://market.android.com/details?id=org.thialfihar.android.apg&quot;&gt;APG&lt;/a&gt; is an Android app which aims to provide a OpenPGP implementation. It uses public-private key or pass-phrase for encryption. But it saves unencrypted data to disk. Another app &lt;a href=&quot;https://market.android.com/details?id=com.giraone.encmanlite&quot;&gt;Encryption Manager Lite&lt;/a&gt; works in very similar fashion but with AES encryption. Similar apps: &lt;a href=&quot;https://market.android.com/details?id=com.hamishmedlin.fileencryptor.free&quot;&gt;File Encrypter&lt;/a&gt;, &lt;a href=&quot;https://market.android.com/details?id=PatternEncryptDecryptUpgrade.free&quot;&gt;Pattern Encrypt&lt;/a&gt; (Cool idea to use patterns for passwords).
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;PS:&lt;/b&gt; There are numerous desktop applications which can be used to encrypt/decrypt data using standard algorithms like AES. When accessing files on android device is not an issue, then any of these can be a solution. &lt;a href=&quot;http://www.truecrypt.org/&quot;&gt;TrueCrypt&lt;/a&gt; is worth a mention in this category for its simple interface and powerful features.&amp;nbsp;EncFS, as mentioned above, may also be suitable for some systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/8463909474434478406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/8463909474434478406'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2011/12/encryption-dropbox-android.html' title='Encryption + Dropbox + Android'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-655358107954351105</id><published>2011-08-07T23:45:00.001-07:00</published><updated>2011-08-07T23:47:24.347-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>xpdf &amp; X resource</title><content type='html'>Tested on: Ubuntu 11.04&lt;br /&gt;
&lt;br /&gt;
xpdf &lt;a href=&quot;http://linux.die.net/man/1/xpdf&quot;&gt;man page&lt;/a&gt; is not very detailed in terms of possible values for X resource file. Following are the places where xpdf settings can be specified:
&lt;ul&gt;
&lt;li&gt;Ubuntu X resource file: &lt;tt&gt;~/.Xresources&lt;/tt&gt; The exact files being read can be found by looking into &lt;tt&gt;/etc/gdm/Xsession&lt;/tt&gt;. My settings in &lt;tt&gt;~/.Xresources&lt;/tt&gt;
&lt;code&gt;# xpdf settings
xpdf.geometry: 1280x1024
xpdf.initialZoom: width&lt;/code&gt;
Run following for immediate effect:
&lt;code&gt;xrdb -nocpp -merge ~/.Xresources&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
xpdfrc can be found at &lt;tt&gt;~/.xpdfrc&lt;/tt&gt; and at &lt;tt&gt;/etc/xpdf/xpdfrc&lt;/tt&gt;. My &lt;tt&gt;~/.xpdfrc&lt;/tt&gt; file:
&lt;code&gt;include /etc/xpdf/xpdfrc
initialZoom width
&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/655358107954351105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/655358107954351105'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2011/08/xpdf-x-resource.html' title='xpdf &amp; X resource'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-5745205536432812770</id><published>2011-08-04T01:38:00.010-07:00</published><updated>2014-05-17T15:48:54.035-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Gnome"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Teamviewer"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>TeamViewer: Unattended auto-start in Ubuntu</title><content type='html'>Tested on: Ubuntu 11.04 (Natty Narwhal)&lt;br /&gt;
&lt;br /&gt;
This is log of the steps to setup TeamViewer on Ubuntu on my laptop, so that I can access my laptop from any other computer, without any user interaction on my laptop&#39;s end. More importantly, TeamViewer should be started on each reboot automatically &amp;amp; should not interfere with user normal task(s).&lt;br /&gt;
&lt;br /&gt;
Precisely its an effort to mimic TeamViewer on windows, where it can be used to remotely access the computer even before login to windows (Though this workaround is cheating as we use auto-login feature of Ubuntu. Read step 3 for details). Following are the main steps:&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Install &amp;amp; setup TeamViewer for auto-start - Detailed steps are &lt;a href=&quot;http://www.liberiangeek.net/2010/04/how-to-install-teamviewer-on-ubuntu-and-connect-to-windows-systems/&quot;&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;ul style=&quot;margin-left: 0; padding-left: 30px;&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.teamviewer.com/en/download/index.aspx#downloadAreaLinux&quot;&gt;Download&lt;/a&gt; &amp;amp; install appropriate .deb file.&lt;/li&gt;
&lt;li&gt;Add a new application in Menu -&amp;gt; System -&amp;gt; Preferences -&amp;gt; Startup Applications.&lt;/li&gt;
&lt;/ul&gt;&lt;li&gt;(Optional) Some configuration to make sure that TeamViewer does not pop-up on user logins.&lt;/li&gt;
&lt;li&gt;Configure Ubuntu to automatically login &amp;amp; then lock the screen&lt;/li&gt;
&lt;/ol&gt;Details of last two steps are given below.&lt;br /&gt;
&lt;!-- adsense --&gt;
&lt;u&gt;&lt;b&gt;Step 2:&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
This is optional step. Its safe to skip this step. If TeamViewer is added to auto-start on each login, the user gets the TeamViewer window on each login. This might be annoying after some time. So, the idea here is to use another application, &lt;a href=&quot;http://burtonini.com/blog/computers/devilspie/&quot;&gt;devilspie&lt;/a&gt;, to hide TeamViewer window: put the TeamViewer window on another workspace and/or minimize it. &lt;a href=&quot;http://ubuntu-tutorials.com/2007/07/25/how-to-set-default-workspace-size-and-window-effects-in-gnome/&quot;&gt;Here&lt;/a&gt; is a very good devilspie tutorial.&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Install devilspie (&amp;amp; maybe gDevilspie, a nice front-end)&lt;/li&gt;
&lt;li&gt;Create devilspie directory &lt;code&gt;mkdir ~/.devilspie&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Create a file with name &#39;teamviwer.ds&#39; &amp;amp; put following in it. 
&lt;code&gt;; generated_rule teamviewer
( if 
( begin 
( is ( application_name ) &quot;TeamViewer&quot; )
( is ( window_name ) &quot;TeamViewer&quot; )
) 
( begin 
( set_workspace 2 )
( minimize )
( println &quot;match&quot; )
)
)&lt;/code&gt;
It will put the windows with name &quot;TeamViewer&quot; on workspace 2 &amp;amp; minimize it. Make sure devilspie demon is running. Check gDevilspie GUI.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
This is &lt;i&gt;not&lt;/i&gt; a very elegant solution. There were some &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqQoY9dbB0T24UU-5AJd2DQKBlGUP2N_cm2zGOPfnNLriTosNPfnUzjev1Og78ZWiYOwlzgnDcaonmhxXf2lKcNvUQKYc1VknxDBObZhYGp6-_j0UPhqa4sd5ySzV5wdjgo5IY-wq2Wb0x/s800/Screenshot-TeamViewer.png&quot;&gt;minor issues&lt;/a&gt; with the rendering of the TeamViewer window (Though it works without any flaw). There can be some other ways to put it in system tray using some application like alltray. But this workaround is good enough for me.&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Step 3: Configure Ubuntu to automatically login &amp;amp; then lock the screen&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
TeamViewer will auto-start only when user is logged in. So in order to make sure that TeamViewer is started even in case of remote reboot, auto-login has to be enabled. But this is also a security/privacy threat. One of the easiest way to maintain security is to somehow lock the screen immediately after login in. We can create a custom xsession for the same. See note 2 below, if you are using some secured wireless network on Ubuntu.&lt;br /&gt;
&lt;br /&gt;
Create a file &lt;tt&gt;/usr/share/xsessions/autolock.desktop&lt;/tt&gt; with following content. Change username to the correct user name.  &lt;code&gt;[Desktop Entry]
Name=Auto Lock Gnome
Comment=Custom ~/.xsession script
Exec=/home/&amp;lt;username&amp;gt;/.xsession
X-Ubuntu-Gettext-Domain=gdm&lt;/code&gt; &lt;br /&gt;
Create another file &lt;tt&gt;~/.xsession&lt;/tt&gt; with following content:
&lt;code&gt;#! /bin/bash

gnome-screensaver
gnome-screensaver-command --lock
gnome-session --session=2d-gnome&lt;/code&gt;
Note the last line. I am loading the Ubuntu (Wihout any effects). You may want to change it to appropriate session. Check other &lt;tt&gt;.desktop&lt;/tt&gt; files in &lt;tt&gt;/usr/share/xsessions/&lt;/tt&gt; for the correct command.&lt;br /&gt;
&lt;br /&gt;
Now enable auto-login. Menu-&amp;gt; System -&amp;gt; Administration -&amp;gt;  Login Screen. Select &quot;Auto Lock Gnome&quot; in the default session. Reboot &amp;amp; you should see the change. Check note 1 &amp;amp; 3 as well. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Notes:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;You may opt to allow only selected computers to connect to the TeamViewer for better security. See 10.2 &quot;Security Category&quot; in &lt;a href=&quot;http://www.teamviewer.com/download/teamviewer_manual.pdf&quot;&gt;TeamViewer manual&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;If auto-login is enabled, &lt;a href=&quot;http://live.gnome.org/GnomeKeyring&quot;&gt;Gnome-Keyring&lt;/a&gt; kicks in each time after auto-login &amp;amp; usually affects all application related to saved passwords including network-manager. This is especially important if you are using a secured network, like WEP etc, as the internet connection won&#39;t be active till user enters the password in Gnome-Keyring manually. &lt;a href=&quot;http://askubuntu.com/a/10699&quot;&gt;Here&lt;/a&gt; is a very easy work-around to get internet connection without Keyring kicking in. You should apply this changes for only the trusted network(s).&lt;/li&gt;
&lt;li&gt;Please note that enabling Auto-login &amp;amp; configuring it to connect to wireless network automatically is a potential security threat. Try it at your own risk.&lt;/li&gt;
&lt;/ol&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/5745205536432812770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/5745205536432812770'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2011/08/teamviewer-unattended-auto-start-in.html' title='TeamViewer: Unattended auto-start in Ubuntu'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-6146644184404356400</id><published>2011-07-19T11:46:00.007-07:00</published><updated>2012-08-18T20:46:26.598-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Thoughts"/><title type='text'>Quotes</title><content type='html'>Quotes I liked. Source: Internet &amp;amp; people in and around planet earth.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;If you expect the world to be fair with you because you are fair with them, it is like expecting a lion not to eat you because you don&#39;t eat lion. - Internet&lt;/li&gt;
&lt;li&gt;PhD: Permanent head Damage - Anonymous graduate student&lt;/li&gt;
&lt;li&gt;If you succeed in cheating someone, don&#39;t think he/she is a fool. Rather realise that he/she trusted you more than you deserved - Anonymous&lt;/li&gt;
&lt;li&gt;The whole problem with the world is that fools and fanatics are always so 
certain of themselves, and wiser people so full of doubts. - Bertrand Russell&lt;/li&gt;
&lt;li&gt;A relationship that falls beyond the domain of definition is &#39;Friendship&#39;. - Anonymous Girl&lt;/li&gt;
&lt;li&gt;The financial markets have turned so bad that women are now actually marrying for Love !! - Anonymous&lt;/li&gt;
&lt;li&gt;A Good Girlfriend is one who forgives her Boyfriend when SHE is wrong. - Anonymous Girl&lt;/li&gt;
&lt;/ul&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/6146644184404356400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/6146644184404356400'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2011/07/quotes.html' title='Quotes'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-6786998444426732862</id><published>2011-07-15T17:40:00.002-07:00</published><updated>2011-08-02T19:29:31.482-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CVS"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>CVS cheatsheet</title><content type='html'>Tested on: CentOS release 5.6 (Final)&lt;br /&gt;
&lt;br /&gt;
There are &lt;a href=&quot;http://mrsrl.stanford.edu/%7Ebrian/cvstutorial/&quot;&gt;many&lt;/a&gt; &lt;a href=&quot;http://vasc.ri.cmu.edu/old_help/Archiving/Cvs/cvs_tutorial.texinfo_toc.html&quot;&gt;other&lt;/a&gt; &lt;a href=&quot;http://www.nongnu.org/cvs/&quot;&gt;CVS&lt;/a&gt; &lt;a href=&quot;http://www.cs.umb.edu/%7Esrevilak/cvs.html&quot;&gt;cheatsheets&lt;/a&gt; &amp;amp; &lt;a href=&quot;http://www.network-theory.co.uk/docs/cvsmanual/index.html&quot;&gt;books&lt;/a&gt; on the web. This is my version, which is intended to grow with time but will be less verbose (might not be good for beginners).
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Update current working directory with prune &amp;amp; build directories
&lt;code&gt;cvs update -P -d&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Difference between current version &amp;amp; latest repository version:
&lt;code&gt;cvs diff -cw &amp;lt;fileName&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Rename a file:
&lt;code&gt;mv &amp;lt;OldFileName&amp;gt; &amp;lt;NewFileName&amp;gt;
cvs remove &amp;lt;OldFileName&amp;gt;
cvs add &amp;lt;NewFileName&amp;gt;
cvs commit -m &quot;Renamed &amp;lt;OldFileName&amp;gt; to &amp;lt;NewFileName&amp;gt;&quot; &amp;lt;OldFileName&amp;gt; &amp;lt;NewFileName&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/6786998444426732862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/6786998444426732862'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2011/07/cvs-cheatsheet.html' title='CVS cheatsheet'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-4150039825617006650</id><published>2011-07-15T10:09:00.007-07:00</published><updated>2014-06-11T17:16:38.300-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Infrequent Linux commands</title><content type='html'>Tested with mainly Ubuntu-based distributions. List of Linux commands which are useful but not frequently used. See &lt;a href=&quot;http://unixhelp.ed.ac.uk/alphabetical/index.html&quot;&gt;online&lt;/a&gt; or local man pages for details. &lt;br/&gt;&lt;br/&gt;
&lt;h3&gt;System Information&lt;/h3&gt;
&lt;code&gt;uname -a                          &lt;span class=&quot;codecmnt&quot;&gt;# Details of kernel, processor, machine, OS&lt;/span&gt; 
cat /proc/version                 &lt;span class=&quot;codecmnt&quot;&gt;# Detailed kernel version.&lt;/span&gt; &lt;a href=&quot;http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/proc.html&quot;&gt;More details about /proc.&lt;/a&gt; 
cat /etc/*-release                &lt;span class=&quot;codecmnt&quot;&gt;# See details of distribution&lt;/span&gt; 
lsb_release -a                    &lt;span class=&quot;codecmnt&quot;&gt;# See details of distribution&lt;/span&gt;

service --status-all              &lt;span class=&quot;codecmnt&quot;&gt;# status of init services; [+] Running, [-] Not running, [?] Unknown&lt;/span&gt;
sudo initctl list                 &lt;span class=&quot;codecmnt&quot;&gt;# List &amp; status of &lt;a href=&quot;https://help.ubuntu.com/community/UpstartHowto&quot;&gt;upstart jobs&lt;/a&gt;. More at &lt;a href=&quot;https://help.ubuntu.com/community/UbuntuBootupHowto&quot;&gt;UbuntuBootupHowto&lt;/a&gt;.&lt;/span&gt;
&lt;/code&gt;

&lt;h3&gt;Hardware Information&lt;/h3&gt;
&lt;code&gt;cat /proc/cpuinfo                     &lt;span class=&quot;codecmnt&quot;&gt;# Shows CPU details&lt;/span&gt; 
free -mt                              &lt;span class=&quot;codecmnt&quot;&gt;# Shows details of memory usage&lt;/span&gt;
sudo dmidecode -t memory              &lt;span class=&quot;codecmnt&quot;&gt;# Shows details of RAM slots&lt;/span&gt;
df -hT                                &lt;span class=&quot;codecmnt&quot;&gt;# Report disk type, space usage, mount points&lt;/span&gt;
sudo fdisk -l                         &lt;span class=&quot;codecmnt&quot;&gt;# Lists partition table of all disks&lt;/span&gt;
blkid                                 &lt;span class=&quot;codecmnt&quot;&gt;# Lists UUID and type of all disks&lt;/span&gt;
ls -l /dev/disk/by-uuid               &lt;span class=&quot;codecmnt&quot;&gt;# Lists drives by UUID&lt;/span&gt;
&lt;/code&gt;
&lt;!-- adsense --&gt;

&lt;h3&gt;Users and Groups&lt;/h3&gt;
&lt;code&gt;groups &amp;lt;username&amp;gt;                          &lt;span class=&quot;codecmnt&quot;&gt;# Lists group memberships of the user&lt;/span&gt;
id -u &amp;lt;username&amp;gt;                           &lt;span class=&quot;codecmnt&quot;&gt;# Prints user-id of user&lt;/span&gt;
id -g &amp;lt;username&amp;gt;                           &lt;span class=&quot;codecmnt&quot;&gt;# Prints group-id of user&lt;/span&gt;
id &amp;lt;username&amp;gt;                              &lt;span class=&quot;codecmnt&quot;&gt;# Print user and group information of user&lt;/span&gt;
sudo passwd &amp;lt;username&amp;gt;                     &lt;span class=&quot;codecmnt&quot;&gt;# Change user password&lt;/span&gt;
sudo usermod -d /new/home/dir &amp;lt;username&amp;gt;   &lt;span class=&quot;codecmnt&quot;&gt;# Change user home directory&lt;/span&gt;
&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Disk usage&lt;/b&gt; (size) of directories: &lt;code&gt;du -ach&lt;/code&gt; &lt;code&gt;du -sch&lt;/code&gt; &lt;code&gt;du -ch /home/user&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;List USB Devices&lt;/b&gt; &lt;code&gt;lsusb -t&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;apt installed packages:&lt;/b&gt;&lt;code&gt;less /var/log/apt/history.log&lt;/code&gt; &lt;code&gt;zless /var/log/apt/history.log.1.gz&lt;/code&gt; &lt;code&gt;dpkg --get-selections | sed -n &#39;s/\t\+install$//p&#39;&lt;/code&gt; 
Automatically installed packages
&lt;code&gt;&amp;lt;/var/lib/apt/extended_states awk -v RS= &#39;/\nAuto-Installed: *1/{print$2}&#39;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Image to pdf:&lt;/b&gt;&lt;code&gt;convert *.png out.pdf&lt;/code&gt; &lt;code&gt;convert -compress jpeg *.png out.pdf&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
Last edited: June 11, 2014
&lt;br/&gt;&lt;br/&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/4150039825617006650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/4150039825617006650'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2011/07/infrequent-linux-commands.html' title='Infrequent Linux commands'/><author><name>Unknown</name><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></entry><entry><id>tag:blogger.com,1999:blog-5332763671710458168.post-257739328912410988</id><published>2011-07-11T11:07:00.002-07:00</published><updated>2011-07-11T11:11:12.441-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Emacs"/><category scheme="http://www.blogger.com/atom/ns#" term="fonts"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><title type='text'>Font &amp; old emacs</title><content type='html'>Tested on: CentOS release 5.6 (Final)&lt;/br&gt;&lt;/br&gt;
The newer version of emacs (23.x) has a nice option in menu to change the default font. But the older emacs (21.4.1) does not have these options. The older (&amp;amp; stable) versions of emacs are generally shipped with centos. Here are steps for changing the default fonts in emacs 21.4.1&lt;br /&gt;&lt;br /&gt;

&lt;b&gt;&lt;u&gt;Option 1&lt;/u&gt;&lt;/b&gt; (for current sessions only)
&lt;ol&gt;
&lt;li&gt;Open emacs.&lt;/li&gt;
&lt;li&gt;Left-click on mouse while holding &#39;Shift&#39; key on keyboard. A Font-menu will pop-up.&lt;/li&gt;
&lt;li&gt;Play around with the menu &amp;amp; set required font.&lt;/li&gt;
&lt;/ol&gt;

&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Option 2&lt;/u&gt;&lt;/b&gt; (for all future sessions)&lt;/br&gt;
We have to find the available system fonts and apply them to ~/.emacs file.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Open terminal &amp;amp; execute following command:
&lt;code&gt;xfontsel&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Left-click on &#39;fmly&#39; &amp;amp; others to select a value. You will be able to see how the font looks like in the same window. When you are satisfied with the font selected press &#39;Select&#39; button. It will copy the font name with details to clipboard. Following are some of the examples of the fonts:
&lt;code&gt;-*-courier-medium-r-*-*-17-*-*-*-*-*-iso8859-*&lt;/code&gt;
&lt;code&gt;-*-lucidatypewriter-medium-*-*-*-14-*-*-*-*-90-iso8859-*&lt;/code&gt;
&lt;code&gt;-*-luxi mono-medium-r-*-*-17-*-*-*-*-*-ascii-*&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Open ~/.emacs file in any text editor and add following at the end of the file:
&lt;code&gt;(set-default-font &quot;-*-*-*-*-*-*-*-*-*-*-*-*-*-*&quot;)&lt;/code&gt;
Replace &lt;b&gt;&lt;i&gt;-*-*-*-*-*-*-*-*-*-*-*-*-*-*&lt;/i&gt;&lt;/b&gt; by your selected font name (like one of the examples shown above) Save ~/.emacs &amp;amp; re-launch emacs. You should be able to see the difference.&lt;/li&gt;
&lt;li&gt;There might be some delay before text is displayed in emacs. Add following to &lt;b&gt;&lt;i&gt;top&lt;/i&gt;&lt;/b&gt; of the ~/.emacs file for a workaround:
&lt;code&gt;(modify-frame-parameters nil &#39;((wait-for-wm . nil)))&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/257739328912410988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5332763671710458168/posts/default/257739328912410988'/><link rel='alternate' type='text/html' href='http://flukylogs.blogspot.com/2011/07/font-old-emacs.html' title='Font &amp; old emacs'/><author><name>Unknown</name><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></entry></feed>