tag:blogger.com,1999:blog-28883472764065335172024-02-20T04:47:16.162-08:00Science of GeeksAshhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-2888347276406533517.post-49006254249678535002017-03-06T19:34:00.000-08:002017-03-06T19:34:06.245-08:00Not able to login on Fedora 25<div dir="ltr" style="text-align: left;" trbidi="on">
I got a new laptop at work place and it came with some other linux OS (other than Fedora). I installed Fedora 25 and when I tried to login, it started throwing me out each and every time. Still the problem is there, but here is a work around:<br />
<br />
Reason: Something is crashing with X server<br />
<br />
Solution Tried:<br />
1. Ctrl + Alt + Fx (Fx F2 F3 F4 etc.)<br />
2. Login as user from command line<br />
3. type and enter:<br />
startx<br />
<br />
It is a temporary solution, will update here as soon as I fill find one.<br />
<br /></div>
Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0tag:blogger.com,1999:blog-2888347276406533517.post-59341493670840952842017-02-24T17:19:00.000-08:002017-02-24T17:22:43.079-08:00Convert Code to HTML<div dir="ltr" style="text-align: left;" trbidi="on">
Recently, I was looking for some tool to covert Code to HTML so that when I include the code snippet in the blog or website it should look pretty and readable. I was seeking an open source solution and I came across HILITE.ME Here is the url:<br />
<a href="https://github.com/alexkay/hilite.me">https://github.com/alexkay/hilite.me</a><br />
<br />
And the web:<br />
http://hitlite.me<br />
<br />
<br />
Example:<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #000000; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3
4
5
6
7</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #cd00cd;">package</span> <span style="color: #cccccc;">main</span>
<span style="color: #cd00cd;">import</span> <span style="color: #cd0000;">"fmt"</span>
<span style="color: #00cd00;">func</span> <span style="color: #cccccc;">main()</span> <span style="color: #cccccc;">{</span>
<span style="color: #cccccc;">fmt.Println(</span><span style="color: #cd0000;">"Hello World"</span><span style="color: #cccccc;">)</span>
<span style="color: #cccccc;">}</span>
</pre>
</td></tr>
</tbody></table>
</div>
<br /></div>
Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0tag:blogger.com,1999:blog-2888347276406533517.post-62231521509618010072017-01-12T08:07:00.002-08:002017-01-12T08:07:43.890-08:00Programming: A lookup table example in C<div dir="ltr" style="text-align: left;" trbidi="on">
Sometimes it is better to replace a code snippet performing calculations by a lookup table. The use cases are:<br />
1. When the result of calculation is always a member of predefined set of numbers<br />
2. When input is a set of predefined integers<br />
<br />
For such cases it is easy and convenient to define an array and use it. one such example is (the code can be found <a href="https://github.com/ashwinipatankar/HandyCodeSnippetsInC/blob/master/doublelookuptable.c">here</a>):<br />
<table class="highlight tab-size js-file-line-container" data-tab-size="8" style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #333333; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px; tab-size: 8;"><tbody style="box-sizing: border-box;">
<tr style="box-sizing: border-box;"><td class="blob-code blob-code-inner js-file-line" id="LC1" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;">#<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;">include</span> <span class="pl-s" style="box-sizing: border-box; color: #183691;"><span class="pl-pds" style="box-sizing: border-box;"><</span>stdio.h<span class="pl-pds" style="box-sizing: border-box;">></span></span></td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="2" id="L2" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC2" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;">
</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="3" id="L3" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC3" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"><span class="pl-k" style="box-sizing: border-box; color: #a71d5d;">int</span> <span class="pl-en" style="box-sizing: border-box; color: #795da3;">main</span>(<span class="pl-k" style="box-sizing: border-box; color: #a71d5d;">void</span>) {</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="4" id="L4" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC4" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> </td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="5" id="L5" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC5" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;">int</span> lookupTable[<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">4</span>][<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">5</span>] = {</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="6" id="L6" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC6" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> { -<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">9</span>, <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">4</span>, -<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">0</span> },</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="7" id="L7" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC7" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> {-<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, -<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">9</span>, -<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">4</span>},</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="8" id="L8" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC8" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> {-<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, -<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, -<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, -<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">5</span>},</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="9" id="L9" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC9" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> {-<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, -<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, -<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, -<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">1</span>, <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">9</span>}</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="10" id="L10" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC10" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> };</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="11" id="L11" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC11" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;">int</span> row, columns;</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="12" id="L12" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC12" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;">for</span>(row=<span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">0</span>; row < <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">4</span>; row++) {</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="13" id="L13" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC13" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;">for</span>(columns = <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">0</span>; columns < <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">5</span>; columns++){</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="14" id="L14" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC14" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">printf</span>(<span class="pl-s" style="box-sizing: border-box; color: #183691;"><span class="pl-pds" style="box-sizing: border-box;">"</span>Row <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">%d</span> Columns <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">%d</span> Value <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">%d</span><span class="pl-cce" style="box-sizing: border-box;">\n</span><span class="pl-pds" style="box-sizing: border-box;">"</span></span>, row, columns, lookupTable[row][columns]);</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="15" id="L15" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC15" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> }</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="16" id="L16" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC16" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> }</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="17" id="L17" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC17" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;"> <span class="pl-k" style="box-sizing: border-box; color: #a71d5d;">return</span> <span class="pl-c1" style="box-sizing: border-box; color: #0086b3;">0</span>;</td></tr>
<tr style="box-sizing: border-box;"><td class="blob-num js-line-number" data-line-number="18" id="L18" style="-webkit-user-select: none; box-sizing: border-box; color: rgba(0, 0, 0, 0.298039); cursor: pointer; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; vertical-align: top; white-space: nowrap; width: 50px;"></td><td class="blob-code blob-code-inner js-file-line" id="LC18" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; line-height: 20px; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre; word-wrap: normal;">}
</td></tr>
</tbody></table>
</div>
Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0tag:blogger.com,1999:blog-2888347276406533517.post-15192866105602999972012-11-26T23:54:00.001-08:002012-11-26T23:54:26.041-08:00HOW TO add color to root vi ?<div dir="ltr" style="text-align: left;" trbidi="on">
I usually prefer vi over gedit or others, but whenever I use vi as root , it doesnt show any color. Here is a way to set color right in vi as root.<br />
<br />
Open your bashrc file:<br />
#vi /root/.bashrc<br />
and add this line<br />
alias vi='vim'<br />
<br />
then run #source /root/.bashrc<br />
<br />
<br />
You can also test which vi you are using by running "which vi" both as root and normal user.<br />
<br />
remember $ is for normal mode and # is for super user mode.<br />
All done !!<br />
<br /></div>
Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0tag:blogger.com,1999:blog-2888347276406533517.post-2401072019217853912012-07-22T07:43:00.004-07:002012-07-22T07:43:44.199-07:00New To Linux ?<div dir="ltr" style="text-align: left;" trbidi="on">
I have seen many who tried their hands on linux and end up back to windows. Many students who got stuck up with the question How will I do this in Linux? which is best distro ? where to get help ? So I decided this will help those who want to try their hands on linux and who are looking for doing everything with linux.
First thing first, you can use any distribution that you want Ubuntu, Sabayon, Centos, Mint, OpenSuse, Fedora etc. these are just few out of a big list, you can check and get information about all this at <a href="http://distrowatch.com/">Distrowatch</a>.
But my personal advice, if you are a programmer or engineering student then try with fedora else for everyone else try ubuntu.
Now, you can get the installation instructions through web or through the home pages of distribution.
Here are some places where you can get all the information and answers to your 'how to ' questions.
<a href="http://linuxscience.files.wordpress.com/2010/08/linuxorg.gif"><img alt="" class="alignnone size-full wp-image-28" height="113" src="http://linuxscience.files.wordpress.com/2010/08/linuxorg.gif" title="linuxorg" width="262" /></a><a href="http://linuxscience.files.wordpress.com/2010/08/icon_linuxcom.jpg"><img alt="" class="alignnone size-full wp-image-31" height="256" src="http://linuxscience.files.wordpress.com/2010/08/icon_linuxcom.jpg" title="icon_Linuxcom" width="256" /></a>
There are some forums also where you can browse the solutions to common porblems and also ask some new
<a href="http://fedoraforum.org/">Fedora Forum </a>
<a href="http://ubuntuforums.org/">Ubuntu Forum</a>
<a href="http://www.linuxforums.org/">Linux Forum</a>
<a href="http://www.linuxquestions.org/">Linux Questions</a>
And if you are looking to find the alternatives for your windows softwares then try this
<a href="http://alternativeto.net/"> Alternative to </a>
<a href="http://www.opensitesolutions.com/">Open Site Solutions</a>
<a href="http://www.osalt.com/">Open Source As Alternatives</a>
If you are looking for reasons why you should switch to linux then try this
<a href="http://www.whylinuxisbetter.net/">Why Linux is Better ?</a>
you can also google out for videos,
Usually, every linux distros has their own repositories from where you can install the packages but there is one more great place to look for some great softwares like <a href="http://sourceforge.net/">SourceForge</a>
For now thats all ! Please comment with more links and description so that many others get benefit ;)
Knowledge belongs to all, Follow opensource !</div>Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0tag:blogger.com,1999:blog-2888347276406533517.post-69701500323797180512012-04-28T00:53:00.001-07:002012-04-28T00:54:20.021-07:00How To stop and enable firewall ?<div dir="ltr" style="text-align: left;" trbidi="on">
Sometimes, when we are running some socket program, by connecting our machine to other machine, we face the problem of firewall. If the port is blocked, then we will not be able to transmit and receive, on the other hand both the codes will work fine with localhost (127.0.0.1)<br />
In such cases, you can disable the firewall on temporary basis and permanent basis both. There are other options also like allowing tcp/udp connection on specific port, but I prefer this one:<br />
<br />
<blockquote>
$service iptables stop</blockquote>
<br />
<br />
to renable:<br />
<br />
<blockquote>
$service iptables start</blockquote>
<br />
<br />
<br />
To make it permanent:<br />
<br />
<blockquote>
$chkconfig iptables off<br />
$service iptables stop</blockquote>
</div>Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0tag:blogger.com,1999:blog-2888347276406533517.post-92012944369596984982012-04-25T23:57:00.001-07:002012-04-26T03:01:31.253-07:00How to add Colors to GIT<div dir="ltr" style="text-align: left;" trbidi="on">
The easiest way:<br />
<br />
$git config color.ui true<br />
<br />
<br />
All set and done<br />
<br />
<br /></div>Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0tag:blogger.com,1999:blog-2888347276406533517.post-73619972738410836462012-04-25T05:38:00.001-07:002012-04-26T02:55:28.167-07:00How to install Chromium browser on fedora<div dir="ltr" style="text-align: left;" trbidi="on">
Step 1: Download the<a href="http://repos.fedorapeople.org/repos/spot/chromium-stable/fedora-chromium-stable.repo"> .repo file </a><br />
<br />
Step 2: copy the repo file in /etc/yum.repos.d/<br />
<blockquote>
$cp fedora-chromium-stable.repo /etc/yum.repos.d/</blockquote>
<br />
<br />
Step 3: run the following command with root access or sudo<br />
<blockquote>
$yum install chromium</blockquote>
<br />
<br />
All done.</div>Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0tag:blogger.com,1999:blog-2888347276406533517.post-75054170828635945262012-04-24T07:15:00.001-07:002012-04-26T03:01:12.734-07:00How to restore / reinstall grub<div dir="ltr" style="text-align: left;" trbidi="on">
If you install another operating system and by mistake you messed up, and you now feel that restoring the grub is a good option OR you install some thing, and found some operating system missing on system boot, then here are the steps to restore the grub:<br />
<br />
Step 1: open a terminal, and gain root access, you can also use "sudo"<br />
<br />
Step 2: run $os-probe<br />
this will give you all the operating system present on your machine.<br />
<br />
Step 3: $grub2-mkconfig -o /boot/grubX/grub.cfg<br />
replace X with the version of grub you are having , in some cases it is grub and grub2 depending upon the different operating system you installed<br />
<br />
Step 4: $grub2-install /dev/sda<br />
this will install grub in MBR (Master Boot Record)<br />
<br />
Use the above commands at your own risk, they always works for me. (triple boot: fedora 17B, Debby Sqeeze, and Windows 7)</div>Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0tag:blogger.com,1999:blog-2888347276406533517.post-66142828413209891042012-04-23T06:29:00.000-07:002012-04-23T06:29:17.243-07:00How to Switch from GDM to KDM ?<div dir="ltr" style="text-align: left;" trbidi="on">
<blockquote>
<span class="Apple-style-span" style="font-size: large;"><b>Step 1:</b> create a file "<span class="Apple-style-span" style="color: #2b14ff;">desktop</span>"</span></blockquote>
<blockquote>
<span class="Apple-style-span" style="font-size: large;"><b>Step 2:</b> In "desktop" put this:</span></blockquote>
<blockquote>
<span class="Apple-style-span" style="font-size: large;"> <span class="Apple-style-span" style="color: #3052ff;"> DISPLAYMANGER="KDE"</span></span></blockquote>
<blockquote>
<span class="Apple-style-span" style="font-size: large;">save the file.</span><br />
<span class="Apple-style-span" style="font-size: x-large;"><b>Step 3:</b> copy the file in "<span class="Apple-style-span" style="color: #4917ff;">\etc\sysconfig</span>"</span></blockquote>
<blockquote>
<span class="Apple-style-span" style="font-size: large;">For this, open the terminal and run "<span class="Apple-style-span" style="color: #3d43ff;">sudo cp desktop /etc/sysconfig</span>"</span></blockquote>
<blockquote>
<span class="Apple-style-span" style="font-size: large;">or su and then copy.</span></blockquote>
<blockquote>
<span class="Apple-style-span" style="font-size: large;"><b>Step 4:</b> reboot</span></blockquote>
<div>
<br /></div>
<br />
<br />
Posted from <a href="http://sourceforge.net/projects/gscribble/">GScribble</a>.</div>Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0tag:blogger.com,1999:blog-2888347276406533517.post-67699112057636096682011-10-10T20:51:00.000-07:002011-10-10T20:51:16.871-07:00How to Change Posix message Queue Size<div dir="ltr" style="text-align: left;" trbidi="on">
The easiest way is<br />
<br />
#sysctl -w fs.mqueue.msgsize_max=xxxx<br />
<br />
This will change the size temporarily for permanent we need to make some changes in the sysctl config file. </div>
Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0Bengaluru, Karnataka, India12.9715987 77.594562712.724026199999999 77.2787057 13.2191712 77.910419699999991tag:blogger.com,1999:blog-2888347276406533517.post-9392905316280485002011-01-15T02:07:00.000-08:002011-01-15T02:09:15.192-08:00How to Auto mount partitions on boot in Fedora ?Normally in windows when we login in we see all the partitions or drives e.g. c: d: etc. This was when I was a windows user, that means long time back I think more than a decade :). Now, when we login into fedora or ubuntu, we have to click the partitions to mount them, they are not automatically mounted. So, If you are looking for a method by which you can make them auto mount then here are steps: (for ubuntu you can get some utility, which will do the required task , but still you can follow this steps )<br />
<br />
Step 1: open disk utility and note down the partition / drive labels and corresponding device names e.g. /dev/sda6 etc.<br />
<img alt="Disk Utility Partition Name and Label" height="223" src="http://lh6.ggpht.com/_vLbohfGVN7A/TSg7-T6cLwI/AAAAAAAAA8Y/O3o5_b5Ia38/%5BUNSET%5D.png" width="400" /><br />
Step 2: go to the terminal and either su or use sudo<br />
<br />
Step 3: run the following commands<br />
$cd /media/<br />
$mkdir <drive label> e.g. mkdir Songs<br />
the second command will create folder in the media directory. All the drives will be mounted in media only. So, if you are having 3 drives to mount then create 3 folders by their name. This is what I follow, name of the folder and partition : same. you can name the folders according to your wish also. That means if the partition label is "Softwares" then create a folder named "Softwares" , this is a easy way to avoid confusion between mounted partitions.<br />
<br />
Step 4: open the fstab file which is located in /etc/ in any editor you want<br />
e.g.<br />
$vi /etc/fstab<br />
OR<br />
$gedit /etc/fstab<br />
<br />
Step 5: Till now we having the names of the partitions with their respective drive letters (/dev/sdax) and folders created in /media/, this is where we will mount our volumes. We can mount the volume with different permissions, like only read permission to all users and write permission reserved for root, or read and write permission to every one etc.<br />
<br />
Here is how my fstab looks like, before mounting the partitions:<br />
<br />
#<br />
# /etc/fstab<br />
# Created by anaconda on Fri Nov 5 00:27:12 2010<br />
#<br />
# Accessible filesystems, by reference, are maintained under '/dev/disk'<br />
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info<br />
#<br />
UUID=8d1eeb21-4503-4e3f-b4d5-98ce1a7987dc / ext4 defaults 1 1<br />
UUID=3c478764-9183-48e0-8676-2ca168d965cd /boot ext4 defaults 1 2<br />
UUID=ea5c7972-26de-4f4e-81e0-4890f9942557 /home ext4 defaults 1 2<br />
UUID=1b9dd3f0-bac2-407b-a5a8-2b496945d2b4 swap swap defaults 0 0<br />
tmpfs /dev/shm tmpfs defaults 0 0<br />
devpts /dev/pts devpts gid=5,mode=620 0 0<br />
sysfs /sys sysfs defaults 0 0<br />
proc /proc proc defaults 0 0<br />
<div></div><br />
<br />
Now in the opened fstab file add new lines, e.g. we want to mount a ntfs partition named Songs , and we are having the drive letters as /dev/sda5, we want to give read write to every one, and we already created a folder named Songs in '/media'<br />
<br />
add the line in the fstab file<br />
<br />
/dev/sda5 /media/Songs ntfs-3g defaults 0 0<br />
<br />
which gives me:<br />
#<br />
# /etc/fstab<br />
# Created by anaconda on Fri Nov 5 00:27:12 2010<br />
#<br />
# Accessible filesystems, by reference, are maintained under '/dev/disk'<br />
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info<br />
#<br />
UUID=8d1eeb21-4503-4e3f-b4d5-98ce1a7987dc / ext4 defaults 1 1<br />
UUID=3c478764-9183-48e0-8676-2ca168d965cd /boot ext4 defaults 1 2<br />
UUID=ea5c7972-26de-4f4e-81e0-4890f9942557 /home ext4 defaults 1 2<br />
UUID=1b9dd3f0-bac2-407b-a5a8-2b496945d2b4 swap swap defaults 0 0<br />
tmpfs /dev/shm tmpfs defaults 0 0<br />
devpts /dev/pts devpts gid=5,mode=620 0 0<br />
sysfs /sys sysfs defaults 0 0<br />
proc /proc proc defaults 0 0<br />
/dev/sda5<span style="white-space: pre;"> </span>/media/WareHouse<span style="white-space: pre;"> </span>ntfs-3g<span style="white-space: pre;"> </span>defaults 0 0<br />
/dev/sda6<span style="white-space: pre;"> </span>/media/Installations<span style="white-space: pre;"> </span>ntfs-3g<span style="white-space: pre;"> </span>defaults 0 0<br />
/dev/sda7<span style="white-space: pre;"> </span>/media/SoftwareWareHouse<span style="white-space: pre;"> </span>ntfs-3g defaults 0 0<br />
/dev/sda8<span style="white-space: pre;"> </span>/media/GeekWareHouse<span style="white-space: pre;"> </span>ntfs-3g<span style="white-space: pre;"> </span>defaults 0 0<br />
/dev/sda9<span style="white-space: pre;"> </span>/media/AudioWareHouse<span style="white-space: pre;"> </span>ntfs-3g<span style="white-space: pre;"> </span>defaults 0 0<br />
/dev/sda10<span style="white-space: pre;"> </span>/media/VideoWareHouse<span style="white-space: pre;"> </span>ntfs-3g<span style="white-space: pre;"> </span>defaults<span style="white-space: pre;"> </span>0<span style="white-space: pre;"> </span> 0<br />
<br />
For fat partitions, use vfat instead of ntfs-3g. Now, you are all set to go, save the file, remount the partitions or reboot, and check your /media/directory.<br />
<br />
For a detailed discription of fstab , you can refer to this link: <a href="http://www.tuxfiles.org/linuxhelp/fstab.html" target="_blank" title="Understand Fstab">underStand Fstab</a><br />
<br />
I hope this will help you to auto mount your partitions.Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com2tag:blogger.com,1999:blog-2888347276406533517.post-66957232908258224402010-11-15T06:04:00.000-08:002010-11-15T06:04:48.469-08:00chkdsk on linux ??So, if your boot log or the out put message of mount is telling you to boot in to windows and run chkdsk for ntfs partition, then do not worry, here is the solution for that. In linux, you can find many cli commands for ntfs partition, the only thing is they should be installed.<br />
Problem Statement: $mount /dev/sda5 /media/folder<br />
...<br />
boot from windows and run chkdsk .............<br />
<br />
If you are getting some error like this then , go to terminal, and<br />
<br />
$ntfsfix /dev/sda5<br />
<br />
All done, now try to mount the ntfs partition or reboot !!<br />
<br />
You can also try many other utilities for ntfs partition by typing $ntfs<tab><tab> it will show many commands, e.g.<br />
<br />
ntfs-3g ntfs-3g.secaudit ntfscat ntfscluster ntfscp ntfsinfo ntfsls ntfsresize<br />
ntfs-3g.probe ntfs-3g.usermap ntfsclone ntfscmp ntfsfix ntfslabel ntfsmount ntfsundelete<br />
<div><br />
</div><div>now choose any and run </div><div>$<command> --help OR $man <command name></div><div><br />
</div><div>e.g.</div><div>$ntfsfix --help OR $man ntfsfix</div><div><br />
</div><div>But it is really weired to see that linux is telling us to use windows for disk checking.</div><div>I hope soon they will change this :)</div>Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0tag:blogger.com,1999:blog-2888347276406533517.post-66371675291955920352010-11-07T02:08:00.000-08:002010-11-07T03:50:07.653-08:00How to change Plymouth Theme OR How to change Boot theme in Fedora ?In fedora, the themes which we see at the boot is controlled by plymouth. Here is a step by step tutorial for changing the boot theme:<br />
<br />
Step 1: go to the terminal and run (under su or sudo)<br />
<blockquote>$yum install plymouth-plugin* plymouth-theme*</blockquote><br />
Step 2: Now we got some extra themes, lets check out which one we got:<br />
<blockquote>$ ls -1 /usr/share/plymouth/themes/</blockquote><blockquote>charge</blockquote><blockquote>details</blockquote><blockquote>fade-in</blockquote><blockquote>script</blockquote><blockquote>solar</blockquote><blockquote>spinfinity</blockquote><blockquote>text</blockquote><br />
Step 3: Time to activate one of them (I like solar)<br />
<blockquote>$plymouth-set-default-theme solar</blockquote><br />
Step 4: After setting the default theme, we will have to update the initrd by:<br />
<blockquote>$/usr/libexec/plymouth/plymouth-update-initrd</blockquote><br />
This will take a little time. After this , reboot and see the difference.Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0tag:blogger.com,1999:blog-2888347276406533517.post-69834065692172166612010-10-22T21:40:00.000-07:002010-10-22T21:40:45.684-07:00Moving every thing HereSo, finally I decided to move the contents of my all other blogs related to programming and linux to blog spot, here you will find linux tweaks, programming tutorials , tricks and solutions to every day problems (obviously related to machines)Ashhttp://www.blogger.com/profile/12902694473909317507noreply@blogger.com0