tag:blogger.com,1999:blog-153507562024-03-13T05:40:16.752+03:00My public cheat sheetkerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-15350756.post-59189172162209968132019-12-23T21:31:00.000+03:002019-12-23T21:31:08.699+03:00Implementing componentWillMount() with Functional components<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<script src="https://gist.github.com/kerematam/d147f946c5a9c76a6b45842adc20ab4d.js"></script>
</div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-28802767576711252792019-12-14T12:05:00.002+03:002019-12-14T20:29:34.733+03:00Shadow Lock Components with Wrapper<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<br /></div>
<iframe allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin" src="https://codesandbox.io/embed/antd-reproduction-template-66zsu?fontsize=14&hidenavigation=1&theme=dark" style="border-radius: 4px; border: 0; height: 500px; overflow: hidden; width: 100%;" title="antd reproduction template"></iframe>
</div>
<br />
Example usage:
<script src="https://gist.github.com/kerematam/5ed22e8660fbcf4b7a50a42fd70baefa.js"></script></div>
Wrapper component:
<script src="https://gist.github.com/kerematam/ae54b1127e7d18b6a37725b683a96fe7.js"></script>
Wrapper component syles:
<script src="https://gist.github.com/kerematam/528cce08f1161a2f3d12841a63552154.js"></script>kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-34256433382941389292019-12-10T00:08:00.001+03:002020-02-24T09:50:12.800+03:00Stateless Way of Handling Modal in React<div dir="ltr" style="text-align: left;" trbidi="on">
You ever wanted to call your modal in React as you call builtin <span style="color: #6f42c1;">alert()</span> method. It can be handy if you want to have a modal that able to be fired anywhere in your application and you don't want to mess with either render tree or redux store with all those actions to be dispatched etc.<br />
<br />
Wouldn't be easier to have just show and hide your modal like this :<br />
<br />
<span style="background-color: white; color: #24292e; font-family: , "consolas" , "liberation mono" , "menlo" , monospace; white-space: pre;"> </span><span class="pl-smi" style="background-color: white; box-sizing: border-box; color: #24292e; font-family: , "consolas" , "liberation mono" , "menlo" , monospace; white-space: pre;">myModal</span><span style="background-color: white; color: #24292e; font-family: , "consolas" , "liberation mono" , "menlo" , monospace; white-space: pre;">.</span><span class="pl-en" style="background-color: white; box-sizing: border-box; color: #6f42c1; font-family: , "consolas" , "liberation mono" , "menlo" , monospace; white-space: pre;">show</span><span style="background-color: white; color: #24292e; font-family: , "consolas" , "liberation mono" , "menlo" , monospace; white-space: pre;">();</span><br />
<span style="background-color: white; color: #24292e; font-family: , "consolas" , "liberation mono" , "menlo" , monospace; white-space: pre;"><br /></span>
<span style="background-color: white; color: #24292e; font-family: , "consolas" , "liberation mono" , "menlo" , monospace; white-space: pre;"> </span><span class="pl-smi" style="background-color: white; box-sizing: border-box; color: #24292e; font-family: , "consolas" , "liberation mono" , "menlo" , monospace; white-space: pre;">myModal</span><span style="background-color: white; color: #24292e; font-family: , "consolas" , "liberation mono" , "menlo" , monospace; white-space: pre;">.</span><span class="pl-en" style="background-color: white; box-sizing: border-box; color: #6f42c1; font-family: , "consolas" , "liberation mono" , "menlo" , monospace; white-space: pre;">hide</span><span style="background-color: white; color: #24292e; font-family: , "consolas" , "liberation mono" , "menlo" , monospace; white-space: pre;">();</span><br />
<div style="text-align: left;">
<br />
Well, you can achieve this by injecting your component directly to HTML DOM.<br />
<br />
<script src="https://gist.github.com/kerematam/c095db57811e51a65618a4e735ddca74.js"></script>
<br />
Check full example :<br />
<br />
<script async src="//jsfiddle.net/kerematam/kzg698j5/86/embed/"></script></div>
</div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-20415745237191484062019-12-08T23:45:00.002+03:002019-12-09T00:06:54.394+03:00Git Cheat Shit v2<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: left;">
Squash last N Commits</h3>
Carry the HEAD where you want to start squashing (eg. 3 commits before) :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> reset --hard HEAD~3
</code></pre>
<code>HEAD@{1}</code> is previous location on branch. Merge it to last commit of your branch :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> merge --squash HEAD@<span class="token punctuation">{</span>1<span class="token punctuation">}</span>
</code></pre>
Then commit your change :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> commit
</code></pre>
<strong>Option 2: Soft Reset</strong><br />
Soft reset :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> reset HEAD~3
</code></pre>
stage all change (better not use --all and handle all of them manually):<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> add ./changed-file1.md src/file.2.md blabla/bla.md
</code></pre>
commit again with message:<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> commit -m <span class="token string">"This is squash merge"</span>
</code></pre>
<ul>
<li><strong>Note:</strong> Compared the previous option you need to carefully stage add all files that need to be included and commit message will not automatically include all messages of squashed commits. I can’t see any advantage of this over first option.</li>
</ul>
<strong>Option 3:</strong> You may also use interactive <code>rebase</code> for this. But you might end up solving conflicts for past merges. Given solutions above is far more cleaner.<br />
<h3 id="create--apply-patch">
</h3>
<hr />
<div>
<br /></div>
<h3 id="create--apply-patch" style="text-align: left;">
Create & Apply Patch</h3>
<h4 id="create-patch-">
Create Patch :</h4>
Create patch file from stash :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> stash show -p stash@<span class="token punctuation">{</span>0<span class="token punctuation">}</span> <span class="token operator">></span> mychanges.patch
</code></pre>
Create patch file from commit (this will have commit author data as well) :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> format-patch -1 <span class="token operator"><</span>commit id<span class="token operator">></span>
</code></pre>
<h4 id="apply-patch-">
Apply Patch :</h4>
<ul>
<li>Check which files will be patched :</li>
</ul>
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> apply --stat mychanges.patch
</code></pre>
Check if patch file can be applicable :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> apply --check mychanges.patch
</code></pre>
Just apply :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> apply --3way mychanges.patch
</code></pre>
<strong>Note:</strong> You better use this option if you create your patch from diff file where no commit info is included<br />
Apply as a commit (with author and shit) :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> am --3way <span class="token operator"><</span> mychanges.patch</code></pre>
<hr />
<h3 id="stash-with-message">
Stash with message</h3>
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> stash push -m <span class="token string">"message"</span>
</code></pre>
You may use apply option to not lose your<br />
<h3 id="stash-untracked-and-ignored-files">
Stash Untracked and Ignored Files</h3>
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> stash --all</code></pre>
<hr />
<h3 id="clean-local-branch-be-carefull">
Clean Local Branch (BE CAREFULL)</h3>
This will remove your uncommited changes, dont forget to stash them if you need them later :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> fetch
$<span class="token operator">></span> <span class="token function">git</span> reset origin/<span class="token operator"><</span>branch-name<span class="token operator">></span> --hard
</code></pre>
Carry head to past commits<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> reset <span class="token operator"><</span>commit id<span class="token operator">></span> --hard</code></pre>
<hr />
<h3 id="backward-rebase">
Backward Rebase</h3>
<strong>Note:</strong> You will need to resolve all conflicts for merge commits.<br />
A : branch should go back to commit c0<br />
<pre><code>├── c0 ── c1 ── c2 ── c3
└──(A)──c4──c5──c6
├── c0 ── c1 ── c2 ── c3
└──(A)──c4──c5──c6
</code></pre>
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> checkout A
$<span class="token operator">></span> <span class="token function">git</span> rebase -i --onto c0 c4^
</code></pre>
During rebase solve conflicts, stage them and just do <code>git commit</code> to proceed.<br />
<hr />
<h3 id="change-last-commit-author">
Change Last Commit Author</h3>
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> commit --amend --author<span class="token operator">=</span><span class="token string">"John Doe <john@doe.org>"</span>
</code></pre>
Type <code>:wq</code> in vim and proceed.<br />
<hr />
<h3 id="change-author-of-specific-commit-in-past">
Change Author of Specific Commit in Past</h3>
<ul>
<li>This can be go ugly if so much merge commits flying around.<br />
Check : <a href="https://stackoverflow.com/questions/3042437/how-to-change-the-commit-author-for-one-specific-commit">https://stackoverflow.com/questions/3042437/how-to-change-the-commit-author-for-one-specific-commit</a></li>
<li>Replace option is cleaner.</li>
</ul>
<hr />
<h3 id="include-new-changes-to-last-commit">
Include New Changes to Last commit</h3>
Stage your change :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> add changed.md
</code></pre>
Include it to last commit :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> commit --amend
</code></pre>
Type <code>:wq</code> in vim and proceed.<br />
If you wanna change it on remote branch too, then you will need to push it with force as history is changed now :<br />
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> push --force</code></pre>
<hr />
<h3 id="abort-cherry-pick-rebase-or-merge">
Abort Cherry-pick, Rebase or Merge</h3>
<pre class=" language-bash"><code class="prism language-bash">$<span class="token operator">></span> <span class="token function">git</span> merge --abort
$<span class="token operator">></span> <span class="token function">git</span> rebase --abort
$<span class="token operator">></span> <span class="token function">git</span> cherry-pick --abort
</code></pre>
</div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-83683978340154716342017-09-07T16:20:00.001+03:002017-09-07T17:12:43.078+03:00Duplicate IP Detection in Network<div dir="ltr" style="text-align: left;" trbidi="on">
Duplicate IP problem can create trouble time in your network; mostly you will feel it frequenclty dropped connection. It might be caused by wrong DCHP server configuration or more than one network device functioning as DHCP server.<br />
<br />
Option 1 :<br />
<br />
To detect if it is the case for your problem; you can simply check ARP packets with Wireshark and you will see some packets like the capture below :<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://1.bp.blogspot.com/-LpdCutBHBHs/WbEO3jnvaKI/AAAAAAAADDg/t0wM0dofz8gYxlTp4qjxwoQ4Pkw_vEmRACLcBGAs/s1600/Selection_130.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="333" data-original-width="1298" height="163" src="https://1.bp.blogspot.com/-LpdCutBHBHs/WbEO3jnvaKI/AAAAAAAADDg/t0wM0dofz8gYxlTp4qjxwoQ4Pkw_vEmRACLcBGAs/s640/Selection_130.png" width="640" /></a></div>
<br />
<br />
Option 2 :<br />
<br />
If you dont have Wireshark installed on your device with you. You can use arp-scan command :<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">$ sudo arp-scan -I eth0 -l | grep -i dup</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">10.10.5.68<span style="white-space: pre;"> </span>e0:ca:94:d9:ed:80<span style="white-space: pre;"> </span>Askey Computer (DUP: 2)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">10.10.5.89<span style="white-space: pre;"> </span>bc:a9:20:e4:85:8e<span style="white-space: pre;"> </span>(Unknown) (DUP: 2)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">10.10.5.94<span style="white-space: pre;"> </span>78:31:c1:c4:54:e4<span style="white-space: pre;"> </span>(Unknown) (DUP: 2)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">10.10.5.71<span style="white-space: pre;"> </span>5c:f8:a1:e7:80:5a<span style="white-space: pre;"> </span>(Unknown) (DUP: 2)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">10.10.5.83<span style="white-space: pre;"> </span>b0:70:2d:a4:9c:97<span style="white-space: pre;"> </span>(Unknown) (DUP: 2)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">10.10.5.143<span style="white-space: pre;"> </span>10:a5:d0:05:9c:85<span style="white-space: pre;"> </span>(Unknown) (DUP: 1)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">10.10.5.100<span style="white-space: pre;"> </span>80:19:34:82:34:a8<span style="white-space: pre;"> </span>(Unknown) (DUP: 2)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">10.10.5.114<span style="white-space: pre;"> </span>40:40:a7:e1:80:02<span style="white-space: pre;"> </span>(Unknown) (DUP: 1)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">10.10.5.99<span style="white-space: pre;"> </span>b0:72:bf:7d:e4:f0<span style="white-space: pre;"> </span>(Unknown) (DUP: 2)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">10.10.5.125<span style="white-space: pre;"> </span>64:bc:0c:64:54:87<span style="white-space: pre;"> </span>(Unknown) (DUP: 1)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">10.10.5.146<span style="white-space: pre;"> </span>c4:9a:02:5a:2d:db<span style="white-space: pre;"> </span>(Unknown) (DUP: 1)</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">10.10.5.146<span style="white-space: pre;"> </span>c4:9a:02:5a:2d:db<span style="white-space: pre;"> </span>(Unknown) (DUP: 2)</span><br />
<div>
<br /></div>
<br /></div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-57411329109070027562017-04-10T00:09:00.002+03:002017-04-10T16:10:10.877+03:00A Bluetooth IoT Gateway (BLE-CC41A)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "arial" , "helvetica" , sans-serif;">An</span><span style="font-family: "arial" , "helvetica" , sans-serif;"> IoT gateway is the bridge for your <b>things </b>(within this project's scope; it is embedded Bluetooth nodes)<b> </b>to make them able to talk to your cloud server. Most of embedded WiFi modules comes with support of application layer capabilities (such as HTTP requests). But non Bluetooth modules that i have seen had such capabilities in application layer - at least the ones i saw. Most of Bluetooth modules that i tested, access to internet through mobile phone applications. But you might not have "a mobile phone" in your system design all the time. So this was one of my project that i started with such motivation, but sadly i had to leave it in half way. This piece of code manages Bluetooth modules and give them HTTP request capability.</span><span style="font-family: "arial" , "helvetica" , sans-serif;"> Even though this project have long way to go; it does what it has to in modest level.</span><span style="font-family: "arial" , "helvetica" , sans-serif;"></span><br />
<span style="font-size: small;"><span style="color: #24292e; font-family: "arial" , "helvetica" , sans-serif;"><b><br />Github : </b></span></span><span style="color: #24292e; font-family: "arial" , "helvetica" , sans-serif;"><a href="https://github.com/kerematam/IoT-Gateway-BLE-CC41a">https://github.com/kerematam/IoT-Gateway-BLE-CC41a</a></span><br />
<h3 style="text-align: left;">
<span style="font-size: small;"><br /><b><span style="font-family: "arial" , "helvetica" , sans-serif;">What does this Gateway do? :</span></b></span></h3>
<ol style="box-sizing: border-box; color: #24292e; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;"><span style="font-family: "arial" , "helvetica" , sans-serif;">This Gateway automatically searches for BLE-CC41A module on each serial port.</span></li>
<li style="box-sizing: border-box; margin-top: 0.25em;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Configures the serially connected BLE-CC41A module as master.</span></li>
<li style="box-sizing: border-box; margin-top: 0.25em;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Searches for availible slave modules around.</span></li>
<li style="box-sizing: border-box; margin-top: 0.25em;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Establishes connection between master and slaves.</span></li>
<li style="box-sizing: border-box; margin-top: 0.25em;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Sends requests of slaves to cloud server.</span></li>
</ol>
<div style="box-sizing: border-box; color: #24292e; margin-bottom: 16px;">
<h3 style="text-align: left;">
<span style="font-size: small;"><b><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></b><b><span style="font-family: "arial" , "helvetica" , sans-serif;">Requirements :</span></b></span></h3>
</div>
<ol style="box-sizing: border-box; color: #24292e; margin-bottom: 16px; margin-top: 0px; padding-left: 2em; text-align: left;">
<li style="box-sizing: border-box;"><span style="font-family: "arial" , "helvetica" , sans-serif;">A linux machine able to run Python 2.7. I have developed and tested this gateway on Ubuntu 14.04 machine.</span></li>
<li style="box-sizing: border-box; margin-top: 0.25em;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Gateway hardware should have at least one ethernet (to cloud server) and one serial USB port (for BLE-CC41A module).</span></li>
<li style="box-sizing: border-box; margin-top: 0.25em;"><span style="font-family: "arial" , "helvetica" , sans-serif;">A cloud server: I have used my own cloudserver. <br />3.1. You can go with thingspeak.com and update the code accordingly. <br />3.2. Wait for me to upload my cloudserver code to handle http requests<br />3.3. Write your own servercode.</span></li>
<li style="box-sizing: border-box; margin-top: 0.25em;"><span style="font-family: "arial" , "helvetica" , sans-serif;">Couple of BLE-CC41A modules. It is clone of HM10.</span></li>
</ol>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<h3 style="color: #24292e; text-align: left;">
<b><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small;">Configuration :</span></b><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small; font-weight: normal;">You must modify </span><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small; font-weight: normal;">server_url</span><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small; font-weight: normal;"> and </span><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small; font-weight: normal;">api_key</span><span style="font-family: "arial" , "helvetica" , sans-serif; font-size: small; font-weight: normal;"> variables in main.py</span></h3>
<div>
<br /></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://github.com/kerematam/IoT-Gateway-BLE-CC41a/raw/master/iot-gateway-bluetooth.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img alt="alt tag" border="0" height="481" src="https://github.com/kerematam/IoT-Gateway-BLE-CC41a/raw/master/iot-gateway-bluetooth.png" style="max-width: 100%;" width="640" /></a></div>
<ol style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
</ol>
</div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-3772392372755887602017-03-05T22:06:00.001+03:002017-03-08T14:36:12.580+03:00Hands on Docker Tutorial : Running a Container with WordPress - kerem izzet atam<div dir="ltr" style="text-align: left;" trbidi="on">
In this tutorial i will show my steps to install Docker on Ubuntu 14.04 and run container having WordPress on it. I have prepared this tutorial within my first attempt to try Docker so don't judge me for any miss leading parts.<br />
<br />
I have been hearing mighty """Docker""" and its capabilities for a while but never dare to share time to read and learn so far. Today it was my first attempt to investigate as one of my colleague was talking about it again with such excitement. So i decided give a shot. As i am lazy person to read and excited person to try technologies i directly go into doing something... Lets run some server application (WordPresss) with Docker on my Ubuntu 14.04 machine.<br />
<br />
Before we start let me tell how you might like Docker (as my friend's words) : "<b>It runs like virtual machine but lot more light weight with container mechanism</b>" and "<b>You can search for different containers with different configurations and install it to your PC in seconds</b>".<br />
<br />
As i am lazy, selfish, solution oriented, so-called engineer, i ask "how is it useful for me?" So...<br />
<br />
<b>Is Docker useful for you?</b><br />
<ul style="text-align: left;">
<li>Do you remember the time your efforts to prepare your development environment again and again each time you need to copy it other PCs; messing with all these tool chain installations, satisfying all those repository requirements and so on. </li>
<li>Do you remember when you need to create independent environment variables for different projects and applications like php 5 for this php 7 for that.</li>
<li>Do you remember the time when you work with team overseas and you need to share same configurations to your colleague of your OS.</li>
<li>Do you remember your struggles to move your cloud server; re configuring all those configurations and facing same problems during installations.</li>
</ul>
<div>
If you remember, yes! Probably it will save your time as you will have very light weight version of your PC or server as container. You can keep those containers on cloud and install it whenever you want, like an application.</div>
<div>
<b><br /></b></div>
<div>
<b>STEPS </b></div>
<div>
<br /></div>
<div>
As summary of istructions on this official tutorial : <a href="https://docs.docker.com/engine/installation/linux/ubuntu/#install-using-the-repository">https://docs.docker.com/engine/installation/linux/ubuntu/#install-using-the-repository</a></div>
<div>
<br /></div>
<div>
1 - Clean if you have old versions of it : </div>
<div>
<br /></div>
<div>
<span class="gp" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">$ </span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">sudo apt-get remove docker docker-engine</span></div>
<div>
<br /></div>
<div>
2- Update and Install :</div>
<div>
<br /></div>
<div>
<span class="gp" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">$ </span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">sudo apt-get </span><span class="hljs-keyword" style="background-color: #f5f8fa; box-sizing: border-box; color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; font-weight: bold; white-space: pre-wrap;">update</span></div>
<div>
<span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">
</span><span class="gp" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">$ </span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">sudo apt-</span><span class="hljs-keyword" style="background-color: #f5f8fa; box-sizing: border-box; color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; font-weight: bold; white-space: pre-wrap;">get</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;"> </span><span class="hljs-keyword" style="background-color: #f5f8fa; box-sizing: border-box; color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; font-weight: bold; white-space: pre-wrap;">install</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;"> </span><span class="se" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">\</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">
linux-image-extra-</span><span class="k" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">$(</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">uname -r</span><span class="k" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">)</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;"> </span><span class="se" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">\</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">
linux-image-extra-</span><span class="hljs-keyword" style="background-color: #f5f8fa; box-sizing: border-box; color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; font-weight: bold; white-space: pre-wrap;">virtual</span></div>
<div>
<br /></div>
<div>
<span class="gp" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">$ </span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">sudo apt-get </span><span class="hljs-keyword" style="background-color: #f5f8fa; box-sizing: border-box; color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; font-weight: bold; white-space: pre-wrap;">install</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;"> </span><span class="se" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">\</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">
apt-transport-https </span><span class="se" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">\</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">
ca-certificates </span><span class="se" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">\</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">
curl </span><span class="se" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">\</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">
software-properties-common</span></div>
<div>
<span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;"><br /></span></div>
<div>
<span class="gp" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">$ </span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">sudo apt-get </span><span class="hljs-keyword" style="background-color: #f5f8fa; box-sizing: border-box; color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; font-weight: bold; white-space: pre-wrap;">install</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;"> </span><span class="se" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">\</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">
apt-transport-https </span><span class="se" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">\</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">
ca-certificates </span><span class="se" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">\</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">
curl </span><span class="se" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">\</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">
software-properties-common</span></div>
<div>
<br /></div>
<div>
3- Verify finger prints :</div>
<div>
<br /></div>
<div>
<span class="gp" style="background-color: #f5f8fa; box-sizing: border-box; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">$ </span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">curl -fsSL </span><span class="hljs-symbol" style="background-color: #f5f8fa; box-sizing: border-box; color: #990073; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">https:</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">/</span><span class="hljs-regexp" style="background-color: #f5f8fa; box-sizing: border-box; color: #009926; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">/download.docker.com/linux</span><span class="hljs-regexp" style="background-color: #f5f8fa; box-sizing: border-box; color: #009926; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">/ubuntu/gpg</span><span style="background-color: #f5f8fa; color: #0c5176; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;"> | sudo apt-key add -</span></div>
<div>
<span style="background-color: white; color: #445d6e; font-family: "open sans" , sans-serif; font-size: 14px;"><br /></span></div>
<div>
<span style="background-color: white; color: #445d6e; font-family: "open sans" , sans-serif; font-size: 14px;">Verify that the key fingerprint is </span><code class="highlighter-rouge" style="background-color: rgba(12, 81, 118, 0.0980392); border-radius: 2px; box-sizing: border-box; color: rgb(12, 81, 118) !important; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12.6px; padding: 3px 7px;">9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88</code><span style="background-color: white; color: #445d6e; font-family: "open sans" , sans-serif; font-size: 14px;">.</span></div>
<div>
<div class="language-bash highlighter-rouge" style="background-color: white; box-sizing: border-box; color: #445d6e; font-family: "Open Sans", sans-serif; font-size: 14px;">
<pre class="highlight" style="background-color: #f5f8fa; border-radius: 4px; border: 1px solid rgb(245, 248, 250); box-sizing: border-box; color: #f3f3f3; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.42857; margin-bottom: 10px; overflow: auto; padding: 9.5px; word-break: break-all; word-wrap: break-word;"><code class="hljs perl" style="background-color: transparent; border-radius: 0px; box-sizing: border-box; color: #333333; display: block; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: inherit; overflow-x: auto; padding: 0.5em; white-space: pre-wrap;"><span class="gp" style="box-sizing: border-box;">$ </span>sudo apt-key fingerprint 0EBFCD88
pub <span class="hljs-number" style="box-sizing: border-box; color: teal;">4096</span>R/0EBFCD88 <span class="hljs-number" style="box-sizing: border-box; color: teal;">2017</span>-<span class="hljs-number" style="box-sizing: border-box; color: teal;">02</span>-<span class="hljs-number" style="box-sizing: border-box; color: teal;">22</span>
Key fingerprint <span class="o" style="box-sizing: border-box;">=</span> <span class="hljs-number" style="box-sizing: border-box; color: teal;">9</span>DC8 <span class="hljs-number" style="box-sizing: border-box; color: teal;">5822</span> <span class="hljs-number" style="box-sizing: border-box; color: teal;">9</span>FC7 DD38 <span class="hljs-number" style="box-sizing: border-box; color: teal;">854</span>A E2D8 <span class="hljs-number" style="box-sizing: border-box; color: teal;">8</span>D81 <span class="hljs-number" style="box-sizing: border-box; color: teal;">803</span>C 0EBF CD88
uid Docker Release <span class="o" style="box-sizing: border-box;">(</span>CE deb<span class="o" style="box-sizing: border-box;">)</span> <docker docker.com="">
<span class="hljs-function" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; font-weight: bold;">sub</span> 4096<span class="hljs-title" style="box-sizing: border-box; color: #990000; font-weight: bold;">R</span>/<span class="hljs-title" style="box-sizing: border-box; color: #990000; font-weight: bold;">F273FCD8</span> 2017-02-22</span></docker></code></pre>
</div>
</div>
<div>
Done! Dockers is installed.</div>
<div>
<br /></div>
<div>
4- Now go to site : <a href="https://hub.docker.com/">https://hub.docker.com/</a> , Search for "WordPress" and click on detail of first result.</div>
<div>
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://4.bp.blogspot.com/-Qc6kEiDZK7k/WLxIDpkowJI/AAAAAAAAC3c/iruYEozO43cZPrp1EBo-ROoxAk14HwzswCLcB/s1600/keremizzetatam_docker_wordpress.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="238" src="https://4.bp.blogspot.com/-Qc6kEiDZK7k/WLxIDpkowJI/AAAAAAAAC3c/iruYEozO43cZPrp1EBo-ROoxAk14HwzswCLcB/s320/keremizzetatam_docker_wordpress.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-85Ba1QFvfrg/WLxIDpiAgxI/AAAAAAAAC3Y/l_5KagY35UE0mTeaytsb056wQtXFAh1GACLcB/s1600/kerematam_docker_wordpress.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="141" src="https://3.bp.blogspot.com/-85Ba1QFvfrg/WLxIDpiAgxI/AAAAAAAAC3Y/l_5KagY35UE0mTeaytsb056wQtXFAh1GACLcB/s320/kerematam_docker_wordpress.png" width="320" /></a></div>
<div>
<a href="https://1.bp.blogspot.com/-nyj0fw47Uf4/WLxJ-L3s5SI/AAAAAAAAC3k/zm9wWr3T-CQcFt8RtmixjKIovGDwDcr2ACLcB/s1600/kerem%2Bizzet%2Batam%2Bwordpress_docker_detail.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br /></a><a href="https://1.bp.blogspot.com/-nyj0fw47Uf4/WLxJ-L3s5SI/AAAAAAAAC3k/zm9wWr3T-CQcFt8RtmixjKIovGDwDcr2ACLcB/s1600/kerem%2Bizzet%2Batam%2Bwordpress_docker_detail.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br /></a><a href="https://1.bp.blogspot.com/-nyj0fw47Uf4/WLxJ-L3s5SI/AAAAAAAAC3k/zm9wWr3T-CQcFt8RtmixjKIovGDwDcr2ACLcB/s1600/kerem%2Bizzet%2Batam%2Bwordpress_docker_detail.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br /></a><a href="https://1.bp.blogspot.com/-nyj0fw47Uf4/WLxJ-L3s5SI/AAAAAAAAC3k/zm9wWr3T-CQcFt8RtmixjKIovGDwDcr2ACLcB/s1600/kerem%2Bizzet%2Batam%2Bwordpress_docker_detail.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="141" src="https://1.bp.blogspot.com/-nyj0fw47Uf4/WLxJ-L3s5SI/AAAAAAAAC3k/zm9wWr3T-CQcFt8RtmixjKIovGDwDcr2ACLcB/s320/kerem%2Bizzet%2Batam%2Bwordpress_docker_detail.png" width="320" /></a><a href="https://1.bp.blogspot.com/-nyj0fw47Uf4/WLxJ-L3s5SI/AAAAAAAAC3k/zm9wWr3T-CQcFt8RtmixjKIovGDwDcr2ACLcB/s1600/kerem%2Bizzet%2Batam%2Bwordpress_docker_detail.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br /></a><a href="https://1.bp.blogspot.com/-nyj0fw47Uf4/WLxJ-L3s5SI/AAAAAAAAC3k/zm9wWr3T-CQcFt8RtmixjKIovGDwDcr2ACLcB/s1600/kerem%2Bizzet%2Batam%2Bwordpress_docker_detail.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
5- You will see page under this URL <a href="https://hub.docker.com/_/wordpress/">https://hub.docker.com/_/wordpress/</a> and check the command to command to pull this container as :</div>
<div>
<span class="gp" style="background-color: #f5f8fa; box-sizing: border-box; color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">$ sudo pull wordpress</span></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
6- Run the container : </div>
<div>
<span style="background-color: #f5f8fa; color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">$ sudo pull wordpress</span></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
7- Access to shell of container :</div>
<div>
<span style="background-color: #f5f8fa; color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">$ sudo docker run -it wordpress /bin/bash</span></div>
<div>
<br /></div>
<div>
8- Check running containers on host PC :</div>
<div>
<div>
<span style="background-color: #f5f8fa; color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">$ sudo docker ps -a</span></div>
<div>
<span style="background-color: #f5f8fa; font-size: 13px; white-space: pre-wrap;"><span style="color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace;">CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
</span><span style="color: red; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace;"><b>0acccb9e18ce </b></span><span style="color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace;"> wordpress "docker-entrypoint..." 10 seconds ago Up 9 seconds 80/</span></span></div>
<div>
<span style="color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace;"><span style="font-size: 13px; white-space: pre-wrap;"><br /></span></span></div>
<div>
9- Query IP of container by ID. We learn ID of our container from previous command as <span style="color: red;">0acccb9e18ce</span> :</div>
</div>
<div>
<span style="font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace;"><span style="background-color: #f5f8fa; font-size: 13px; white-space: pre-wrap;"><span style="color: #333333;">sudo docker inspect </span><span style="color: red;"><b>0acccb9e18ce</b></span><span style="color: #333333;"> | grep "IPAddress"</span></span></span></div>
<div>
<div>
<span style="color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace;"><span style="background-color: #f5f8fa; font-size: 13px; white-space: pre-wrap;"> "SecondaryIPAddresses": null,</span></span></div>
<div>
<span style="color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace;"><span style="background-color: #f5f8fa; font-size: 13px; white-space: pre-wrap;"> "IPAddress": "172.17.0.2",</span></span></div>
<div>
<span style="color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace;"><span style="background-color: #f5f8fa; font-size: 13px; white-space: pre-wrap;"> "IPAddress": "172.17.0.2",</span></span></div>
</div>
<div>
<div>
<br />
10- Now i can browse through my WordPress container from IP "<span style="background-color: #f5f8fa; color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">172.17.0.2"</span></div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://3.bp.blogspot.com/-uJgou3jcjic/WLxgSykTMYI/AAAAAAAAC30/0nBrHD17jFYIQ1KOMC0dKzGifk-c16TIACLcB/s1600/kerem%2Bizzet%2Batam_wordpress.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://3.bp.blogspot.com/-uJgou3jcjic/WLxgSykTMYI/AAAAAAAAC30/0nBrHD17jFYIQ1KOMC0dKzGifk-c16TIACLcB/s320/kerem%2Bizzet%2Batam_wordpress.png" width="272" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div>
This tutorial is only for testing. Step 6 should be applied with command below according to instruction in WordPress. This will link our WordPress container with another container having mySQL. :</div>
<div>
<span style="color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace; font-size: 13px; white-space: pre-wrap;">sudo </span><span style="color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace;"><span style="font-size: 13px; white-space: pre-wrap;">docker run --name some-wordpress --link some-mysql:mysql -d wordpress </span></span><br />
<span style="color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace;"><span style="font-size: 13px; white-space: pre-wrap;"><br /></span></span>
<span style="color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace;"><span style="font-size: 13px; white-space: pre-wrap;"><br /></span></span>
<span style="color: #333333; font-family: "menlo" , "monaco" , "consolas" , "courier new" , monospace;"><span style="font-size: 13px; white-space: pre-wrap;"><span style="color: black; font-family: "times new roman"; font-size: small; white-space: normal;">Kerem İzzet ATAM</span></span></span></div>
</div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-70979571784430470332017-02-13T03:24:00.001+03:002017-03-07T00:02:40.672+03:00Interview About Duyum Project has made into Turkish TV - kerem izzet atam<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Duyum Project is smart home automation that we have been developing for a while to solve daily life problems of people with hearing troubles in home environment. It allows these people to feel sounds from various sources in home like door bell, baby cry or any kinds of alarms with the Duyum sensor nodes. Once Duyum node triggers with sound, it notifies Pebble smart watch on person with both vibration and related image.<br />
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/Jkx4sHcJSro?start=135" width="560"></iframe><br />
<div style="text-align: left;">
<br /></div>
</div>
</div>
<h2 hidden="">
kerem izzet atam</h2>
</div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-40966094146493709512016-12-03T01:46:00.001+03:002017-03-07T00:02:29.772+03:00Creating Script to Run on Boot for OpenWRT (Chaos Calmer) - kerem izzet atam<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Chaos Calmer has brand new process management daemon to handle init scripts to run on boot, named <b>procd</b>. You can do further reading links below if my shitty tutorial wont work for you. Sadly documentation about procd in OpenWRT wiki site has not been finished at the moment while i was writing this dramatic blog post... ;_; <br />
<br />
Anyway ssh to your OpenWRT device and follow steps below. All <span style="color: red;"><b>red</b></span> parts are personal shit, so put your personal own file names and commands according to your configuration : <br />
<br />
1 - create script file under "/etc/init.d/" I named my script <span style="color: red;">start-shit.sh</span> :<br />
<br />
<b><span style="font-family: "courier new" , "courier" , monospace;">root@OpenWrt:/# vim /etc/init.d/<span style="color: red;">start-shit.sh</span></span></b><br />
<br />
2- copy and paste lines below to your file : <br />
<br />
<b><span style="font-family: "courier new" , "courier" , monospace;">#!/bin/sh /etc/rc.common<br /> </span></b><br />
<b><span style="font-family: "courier new" , "courier" , monospace;"># it is run order of your script, make it high to not fuck up with other init scripts<br />START=100 </span></b><br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"><b>USE_PROCD=1<br /><br />start_service() {<br /> procd_open_instance<br /> procd_set_param command <span style="color: red;">/target/to/your/shitty/command -some -shit -here</span> <br />}</b></span><br />
<br />
3- Give execute permission to your script :<br />
<br />
<b>root@OpenWrt:/# chmod +x /etc/init.d<span style="color: red;">/start-shit.sh</span></b><br />
<br />
4- Enable init script with the command below. It will create symlink in /etc/rc.d directory so it makes your script run on boot :<br />
<br />
<b>root@OpenWrt:/# /etc/init.d/start-shit.sh enable</b><br />
<br />
And done! Reboot your device and check if it works. Check links below for further reading :<b><br /></b><a href="https://wiki.openwrt.org/doc/techref/init.detail.cc">https://wiki.openwrt.org/doc/techref/init.detail.cc</a><br />
<a href="https://wiki.openwrt.org/inbox/procd-init-scripts">https://wiki.openwrt.org/inbox/procd-init-scripts </a><br />
<a href="https://wiki.openwrt.org/doc/techref/procd">https://wiki.openwrt.org/doc/techref/procd</a><b><br /></b><br />
<b><br /></b></div>
<h2 hidden="">
kerem izzet atam</h2>
</div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-1028373355312664052015-10-25T22:46:00.001+03:002017-07-05T15:18:32.677+03:00Creating Script to Run on Startup for OpenWRT (Barrier Breaker) - kerem izzet atam<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: inherit;">Today I wanted to create some script to mount my USB disk to my OpenWRT device on start up and run some script in it. You might also need it if you have some huge binary to run on boot which is stored in your USB plugged in your OpenWRT device.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">There is quite good source about it : <a href="http://wiki.openwrt.org/doc/techref/initscripts">http://wiki.openwrt.org/doc/techref/initscripts</a></span><br />
<span style="font-family: inherit;">But if you are even lazy to read it, here is what work for me.</span><br />
<br />
<span style="font-family: inherit;">1- Create some file under</span> <span style="background-color: rgba(255 , 255 , 255 , 0.8); color: #333333; font-family: "courier new" , "courier" , monospace; font-size: 14px; line-height: 19.6px; white-space: pre;">/etc/init.d/</span><span style="font-family: inherit;"><span style="background-color: rgba(255 , 255 , 255 , 0.8); color: #333333; font-size: 14px; line-height: 19.6px; white-space: pre;"> </span>I have named mine as </span><span style="font-family: "georgia" , "times new roman" , serif;"><span style="background-color: rgba(255 , 255 , 255 , 0.8); color: #333333; font-size: 14px; line-height: 19.6px; white-space: pre;"> "</span></span><span style="background-color: rgba(255 , 255 , 255 , 0.8); color: #333333; font-family: "consolas" , "andale mono wt" , "andale mono" , "bitstream vera sans mono" , "nimbus mono l" , "monaco" , "courier new" , monospace; font-size: 14px; line-height: 19.6px; white-space: pre;"><span style="font-family: "courier new" , "courier" , monospace;">usb-script.sh</span>"</span><br />
<span style="background-color: rgba(255 , 255 , 255 , 0.8); color: #333333; font-family: "consolas" , "andale mono wt" , "andale mono" , "bitstream vera sans mono" , "nimbus mono l" , "monaco" , "courier new" , monospace; font-size: 14px; line-height: 19.6px; white-space: pre;"><br /></span>
<span style="font-family: inherit;">2- I have put my commands (in red) under start function in my</span><span style="color: red;"><span style="font-family: inherit;"> </span><span style="font-family: "courier new" , "courier" , monospace;">usb-script.sh</span></span><span style="font-family: inherit;"> file :</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">#!/bin/sh /etc/rc.common</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">START=100</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">start() {</span><br />
<span style="color: red; font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mkdir /mnt/usb</span><br />
<span style="color: red; font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>mount /dev/sda1 /mnt/usb/</span><br />
<span class="Apple-tab-span" style="color: red; font-family: "courier new" , "courier" , monospace; white-space: pre;"> </span><span style="color: red; font-family: "courier new" , "courier" , monospace;">./mnt/usb/my-script-to-save-the-world.sh</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">}</span><br />
<div>
<br /></div>
<span style="font-family: inherit;">START parameter defines the run order of your script among other init scripts. I have defined relatively bigger number (100) to the other scripts to make it safer (at least i hope that way). Check the </span><a href="http://wiki.openwrt.org/doc/techref/initscripts" style="font-family: inherit;">source</a><span style="font-family: inherit;"> i gave above for further reading about it. You can simply look START values of other scripts with the command below :</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">root@OpenWrt:/# grep START= /etc/init.d/*</span><br />
<br />
<span style="font-family: inherit;">And you will likely to see output like this (You can see my usb-script.sh at undermost) :</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/boot:START=10</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/cron:START=50</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/dnsmasq:START=60</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/done:START=95</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/dropbear:START=50</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/firewall:START=19</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/led:START=96</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/log:START=12</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/network:START=20</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/odhcpd:START=35</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/openflow:START=43</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/openvswitch:START=15</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/sysctl:START=11</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/sysfixtime:START=00</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/sysntpd:START=98</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/system:START=10</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/telnet:START=50</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/uhttpd:START=50</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/etc/init.d/usb-script.sh:START=100</span><br />
<div>
<br /></div>
<span style="font-family: inherit;">3- Give execute permission to your script :</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="background-color: rgba(255 , 255 , 255 , 0.901961); color: #333333; line-height: 19.6px;">root@OpenWrt:/# </span>chmod +x <span style="background-color: rgba(255 , 255 , 255 , 0.8); color: #333333; line-height: 19.6px; white-space: pre;">/etc/init.d/</span><span style="background-color: rgba(255, 255, 255, 0.8); line-height: 19.6px; white-space: pre;"><span style="color: red;">usb-script.sh</span></span></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="background-color: rgba(255, 255, 255, 0.8); line-height: 19.6px; white-space: pre;"><span style="color: red;"><br /></span></span></span>
<span style="background-color: rgba(255, 255, 255, 0.8); line-height: 19.6px;"><span style="font-family: inherit;"><span style="font-family: inherit;"><span style="font-family: inherit;">4- Run command below. It will c</span>reate simlink in</span> </span></span><code style="background-color: rgba(255, 255, 255, 0.8); border-radius: 2px; color: #333333; direction: ltr; font-size: 14px; line-height: 19.6px; white-space: pre;"><span style="font-family: "courier new" , "courier" , monospace;">/etc/rc.d </span></code><code style="background-color: rgba(255, 255, 255, 0.8); border-radius: 2px; color: #333333; direction: ltr; font-family: Arial, Helvetica, sans-serif; line-height: 19.6px; white-space: pre;"><span style="font-family: inherit;">directory so it makes your script run on boot :</span></code><br />
<div style="text-align: left;">
<code style="background-color: rgba(255, 255, 255, 0.8); border-radius: 2px; direction: ltr; line-height: 19.6px; white-space: pre;"><span style="font-family: "courier new" , "courier" , monospace;"><span style="background-color: rgba(255 , 255 , 255 , 0.901961); color: #333333; line-height: 19.6px;">root@OpenWrt:/# </span><span style="color: #333333; line-height: 19.6px;">/etc/init.d/</span><span style="line-height: 19.6px;"><span style="color: red;">usb-script.sh </span>enable</span></span></code></div>
<br />
<span style="font-family: inherit;">Yeah, that is it. Hope it works.</span><br />
<br /></div>
<h2 hidden="">
kerem izzet atam</h2>
</div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com2tag:blogger.com,1999:blog-15350756.post-37587646185774150862013-09-01T04:10:00.000+03:002017-02-28T01:32:19.289+03:00Windows PC'yi WiFi Hotspot Olarak Kullanma<div dir="ltr" style="text-align: left;" trbidi="on">
3G VINN benzeri mobil internet hizmetleri kullanıyorsanız, bunu aynı zamanda çevrenizdeki cihazlara kendi bilgisayarınız ile wifi üzerinden paylaşabilirsiniz. Aynı zamanda aynı yöntemle kablolu ethernet bağlantınız üzeriden aynı paylaşımı yapmanız mümkün. Aşağıda ilgili adımları 5 adımda en basit şekilde anlatmaya çalıştım.<br />
<br />
1- Öncelikle administrator yetkileri ile"cmd" penceresini açın.<br />
(Windows8'de basitçe fare imlecini ekranın en sol altına getirip, sağ tıkaldıktan sonra "Command Prompt (Admin)" dan açabilirsiniz.)<br />
<a href="http://3.bp.blogspot.com/-ZZkUi8SoM9g/UiKKX70QqTI/AAAAAAAAB20/scycjuxVm8U/s1600/cmd_admin.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-ZZkUi8SoM9g/UiKKX70QqTI/AAAAAAAAB20/scycjuxVm8U/s320/cmd_admin.bmp" height="274" width="320" /></a><br />
<br />
2- Bilgisayarınızın WiFi kartı bu desteği verip vermediğini kontrol etmek üzere :<br />
<span style="font-family: Courier New, Courier, monospace;"><span style="color: red; font-size: large;"><b>netsh wlan show driver</b></span> </span>yazın ve enter'a basın.<br />
<span style="color: red;">Hosted network supported : Yes</span> şeklinde ibareyi görmeniz gerekiyor.<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="http://2.bp.blogspot.com/-i4T1XuJl73w/UiKKcBQKknI/AAAAAAAAB3I/7FDiSq_5DvE/s1600/hosted_network_supported.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-i4T1XuJl73w/UiKKcBQKknI/AAAAAAAAB3I/7FDiSq_5DvE/s640/hosted_network_supported.JPG" height="534" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
3- Ardından kablosuz iletişim alanı (hotspot) oluşturmak üzere aşağıdaki komutu girin :</div>
<div class="separator" style="clear: both; text-align: left;">
<b><span style="color: red; font-family: Courier New, Courier, monospace; font-size: large;">netsh wlan set hostednetwork mode=allow ssid=</span><span style="color: #38761d; font-family: Courier New, Courier, monospace; font-size: large;">ISIM</span><span style="color: red; font-family: Courier New, Courier, monospace; font-size: large;"> key=</span><span style="color: #38761d; font-family: Courier New, Courier, monospace; font-size: large;">SIFRE_8_KARAKTER</span></b></div>
<div class="separator" style="clear: both; text-align: left;">
Yeşil ile gösterdiğim kısımlara arzu ettiğiniz isim ve en az sekiz karakterli şifrenizi girin.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://1.bp.blogspot.com/-1h033xhPo7s/UiKKcdKWVoI/AAAAAAAAB3Q/YEU0MDh3u80/s1600/netsh+wlan+set+hostednetwork+mode%253Dallow.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-1h033xhPo7s/UiKKcdKWVoI/AAAAAAAAB3Q/YEU0MDh3u80/s640/netsh+wlan+set+hostednetwork+mode%253Dallow.JPG" height="110" width="640" /></a></div>
<br />
4- Şimdi de kablosuz iletişim alanınızı (hotspot) aktive etmek üzere aşağıdaki komutu girin.<br />
<span style="color: red; font-family: Courier New, Courier, monospace; font-size: large;"><b>netsh wlan start hostednetwork</b></span><br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://4.bp.blogspot.com/-Nfgn33iEPRQ/UiKKcgAcQfI/AAAAAAAAB3U/5z4TiVlGTIs/s1600/netsh+wlan+start+hostednetwork.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-Nfgn33iEPRQ/UiKKcgAcQfI/AAAAAAAAB3U/5z4TiVlGTIs/s400/netsh+wlan+start+hostednetwork.JPG" height="79" width="400" /></a></div>
<br />
5- Network connections'ı (ağ bağlantıları) açın, burada bende Wi-Fi-2 olarak eklediğim hospot gözükmekte. Sizde bu isim farklı olabilir ( mesela : Local Area Connection2).<br />
<br />
<span style="background-color: yellow;">Control Panel >> Network and Internet >> Network and Sharing Center</span><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://1.bp.blogspot.com/-0iCSrCBMvC0/UiKQMIVa0vI/AAAAAAAAB3o/ZbmJHKTotyI/s1600/VINN_hotspot.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-0iCSrCBMvC0/UiKQMIVa0vI/AAAAAAAAB3o/ZbmJHKTotyI/s640/VINN_hotspot.JPG" height="118" width="640" /></a></div>
<br />
6- Son olarak 3G VINN bağlantınızı kurduğunuz hotspot'a açmanız gerekiyor.<br />
<br />
Bunun için Mobile broadband'a sağ tıkladıktan sonra "sharing" kısmından aşağıdaki görselde gösterildiği gibi yeni eklenen (Wi-Fi 2) adaptörü ekledikten sonra gerekli izin için ilgili alanı tiklemeniz gerekiyor.<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="http://2.bp.blogspot.com/-GLBSCZvv8sQ/UiKKcFxJycI/AAAAAAAAB3c/ESQHo4uEFVg/s1600/mobile+broadband+properties.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/-GLBSCZvv8sQ/UiKKcFxJycI/AAAAAAAAB3c/ESQHo4uEFVg/s400/mobile+broadband+properties.JPG" height="400" width="328" /></a></div>
<br />
Bundan sonra diğer cihazlarınızda her hangi bir WiFi modeme bağlanır gibi internet erişiminizi sağlayabilirsiniz. </div>
<h2 hidden>kerem izzet atam</h2>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com7tag:blogger.com,1999:blog-15350756.post-42320886542502258632013-08-26T18:10:00.000+03:002017-02-28T01:32:44.038+03:00WireShark'ı Root Yetkileri Olmadan Çalıştırma<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="text-align: left;">
<b>Uyarı Mesajı : "There are no interfaces on which a capture can be done"</b></h3>
Linux'da wireshark'ı yeni kurup, paketleri dinlemeye başlayacaktım ki yukarıdaki uyarı mesajı beni karşıladı.<br />
<br />
Sorun WireShark'ın mesaj trafiğini dinlemesi için Linux üzerinde yeterli yetkilerinin olmaması, yani Root yetkileri ile çalıştırdığınızda bu sorun ortada kalkmış oluyor. Fakat WireShark 1.5 milyon satır kaynak koda sahip devasa bir program ve Root yetkileri ile çalıştırmak sisteminizi beklenmedik tehlikelere atacağı için kesinlikle tavsiye edilen birşey değil.<br />
<br />
Bunun yerine kendi kendi kullanıcınıza belli yetkiler vererek bunu halledebilirisiniz. WireShark paket trafiğini izlemek için "dumcap" adlı ayrı bir program kullanıyor. Kendi kullanıcınıza "dumcap" için gerekli izinleri verdiğiniz taktirde WireShark'ı root yetkilerini kullanmaksızın açabilirsiniz.<br />
<h3 style="text-align: left;">
<b> </b></h3>
<h3 style="text-align: left;">
<b>Nasıl yapılıyor?</b></h3>
<div dir="ltr" id="docs-internal-guid-5c9166eb-82e8-d9ed-bf77-8918bf08d9de" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
WireShark için dumpcap'i çalıştırmak üzere bir yetki grubu tanımlıyoruz ve bu yetki grubuna kendi kullanıcımızı dahil ediyoruz : <b><span style="color: red;"><span style="font-size: small;"><span style="background-color: transparent; font-family: "arial"; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;"> </span></span></span></b></div>
<div dir="ltr" id="docs-internal-guid-5c9166eb-82e8-d9ed-bf77-8918bf08d9de" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<br /></div>
<div dir="ltr" id="docs-internal-guid-5c9166eb-82e8-d9ed-bf77-8918bf08d9de" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: red;"><b><span style="font-size: small;"><span style="background-color: transparent; font-family: "arial"; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;">$ sudo -s</span></span></b></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: red;"><b><span style="font-size: small;"><span style="background-color: transparent; font-family: "arial"; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;"># groupadd wireshark</span></span></b></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: red;"><b><span style="font-size: small;"><span style="background-color: transparent; font-family: "arial"; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;"># usermod -a -G wireshark <span style="background-color: #f3f3f3;">kullanıcı_adı</span></span></span></b></span></div>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: red;"><b><span style="font-size: small;"><span style="background-color: transparent; font-family: "arial"; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;"># chgrp wireshark /usr/bin/dumpcap</span></span></b></span></div>
<span style="color: red;"><b><span style="font-size: small;"><span style="background-color: transparent; font-family: "arial"; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline;"># chmod 4750 /usr/bin/dumpcap</span></span></b></span><br />
<br />
Yukarıda <span style="background-color: #eeeeee;">kullanıcı_adı</span> kısmına mevcut kullanmakta olduğunuz kullanıcı hesabına ait ismi girmeniz gerekiyor. Kullanıcı isminizin ne olduğundan emin değilseniz, root terminalinden çıkıp, aşağıda belirtilen : <b><span style="color: red;"> </span></b><br />
<b><span style="color: red;">>echo "$USER" </span></b><br />
komutu ile mevcut kullacı adın öğrenebilirsiniz.<br />
<br />
Bu komutları çalıştırdıktan sonra mevcut kullanıcınızdan çıkıp tekrar login olmanız gerekiyor. <br />
<br />
<h3 style="text-align: left;">
<b>Faydalı bağlantılar : </b></h3>
<span style="color: black;"><a href="https://blog.wireshark.org/2010/02/running-wireshark-as-you/">https://blog.wireshark.org/2010/02/running-wireshark-as-you/</a></span><br />
<span style="color: black;"><a href="http://packetlife.net/blog/2010/mar/19/sniffing-wireshark-non-root-user/">http://packetlife.net/blog/2010/mar/19/sniffing-wireshark-non-root-user/</a></span></div>
<h2 hidden>kerem izzet atam</h2>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-25368168068526270662013-08-26T11:18:00.003+03:002013-08-26T11:18:54.751+03:00Linux'da ekran parlaklık ayarı problemi<div dir="ltr" style="text-align: left;" trbidi="on">
Geçen hafta kurduğum Debian üzerinde böyle bir sorunla karşılaşmıştım. Ekran parlaklığı hiç bir şekilde değiştirilemiyordu. Bir süre araştırma yaptım ve bu sorunun sıkça karşılaşıldığını gördüm. Sorun bilgisayar açılırken işletim sistemini yükleyen GRUB bootloader'dan kaynaklanıyormuş. Çözüm basit. Üç adet terminal komutunu çalıştırdıktan sonra bilgisayarınızı tekrar açarak (reboot yaptırarak) halledilebiliyor. Aşağıda en basit şekilde anlatmaya çalıştım. <br /><br />
<ul style="text-align: left;">
<li>Terminali açın ve altaki komut'u komut satırına kopyalayıp-yapıştırın, enter'a basın.<b><span style="color: red;"><br />sudo sed "s/\(GRUB_CMDLINE_LINUX=\)\"\"/\1\"acpi_osi=Linux acpi_backlight=vendor\"/" /etc/default/grub -i </span></b><b><span style="color: red;"></span></b></li>
</ul>
<div id="eow-description">
</div>
<ul style="text-align: left;">
<li>Şifrenizi girin ve tekrar enterlayın. (Root Terminal'deyseniz bu adıma gerek yok) <br /></li>
<li>Ardından aşağıdaki komutu yapıştırıp, enterlayın.<b><span style="color: red;"><br />sudo update-grub<br /></span></b></li>
<li><b><span style="color: red;"></span></b>Son olarak alltaki komutu çalıştırın ve işletim sisteminin tekrar yüklenmesini bekleyin.<b><span style="color: red;"><br />sudo reboot<br /></span></b></li>
</ul>
</div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com3tag:blogger.com,1999:blog-15350756.post-30507803882237858752013-02-15T13:29:00.001+02:002013-02-15T15:00:07.834+02:00CSS ile Metin Kutusuna Resim Koyma<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Sitenizde kayıt formlarında javascript ve Ajax ile (email,username,password confirm gibi) belli kontroller yapıp, kullanıcıya geri bildirim yapmak isteyebilirsiniz. Ben istiyorum en azından ve bunu formun sağına soluna köşesine taşırmadan direk text box'ın üzerinde bir resimle göstermek tasarımınıza daha şık bir görünüm katacaktır.<br />
<br /></div>
<script src="https://gist.github.com/anonymous/13baa1b4845fbe43a5c2.js"></script>
"no-repeat" ile resmin tekrarlaranarak tüm metin kutusunu doldurmasını engelleniyor.<br />
170px resmi metin kutusu içerisinde soldan kaydırılma miktarı,<br />
0px ise metin kutusunun üst hizası göre mesefe miktarı oluyor.<br />
height ile de resmin boyutune uyumlu olarak metin kutusunun yükseliğini ayarlayabilirsiniz.<br />
<br /></div>
<script src="https://gist.github.com/anonymous/1f49b74d45c89bf9ab95.js"></script>
Yukarıdaki kod browser üzerinde derlendikten sonra aşağıdaki gibi gözükecek :<br />
<br />
<input style="background: #FFFFFF url(http://imgim.com/3046incic1604746.gif) no-repeat 170px 0px; height: 40px; width: 210px;" type="text" value="database'den sorgu gelirken" /><br />
<br />
<input style="background: #FFFFFF url(http://imgim.com/677incio6019521.png) no-repeat 170px 0px; font-size: 14px; height: 40px; width: 210px;" type="text" value="girdi geçerli" /><br />
Yukarıdaki örnekte yazının boyutu metin kutusunda daha iyi durması için fontsize 14px yaptım.<br />
Fakat resim üste dayanmış. Biraz daha aşağıda durması gerekiyor.<br />
<br />
<input style="background: #FFFFFF url(http://imgim.com/9083incip237099.png) no-repeat 170px 7px; font-size: 17pt; height: 40px; width: 210px;" type="text" value="girdi geçersiz" /><br />
Bu örnekte ise fontsize'ı biraz daha büyütüp 17px yaptım ve resmi ortalamak için 0px'i 7px yaparak resmi biraz daha aşağıya çektim.<br />
<br />
Bi ara üşenmezsem yukarıdaki gibi bir form için AJAX kodlarını ve anlatımını da paykaşırım. <br />
Şimdlik <a href="http://youhack.me/2010/05/04/username-availability-check-in-registration-form-using-jqueryphp/">burdaki linkten</a> faydalanabilirsiniz.<br />
<br />
Kolay gelsin.<br />
<br /></div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-76942577306998410802012-12-30T18:15:00.000+02:002012-12-30T20:38:29.166+02:00SQL Reporting Services'in Sonlandırılması<div dir="ltr" style="text-align: left;" trbidi="on">
Bilindiği üzere Apache server, port 80'nin kullanımda olduğu durumlarda bloklarnır ve açılması mümkün olmaz. Aynı nedenden dolayı XAMPP üzerinden Apache server'ı çalıştırmaya kalktığımda, başka bir işlemin port 80'i kullandığı için, çalıştırmam mümkün olmadı. Bunun nedeni Skype ve benzeri bir çok program olabilir. Ben de ise bu sorun "SQL Server Reporting Services" neden olduğunu öğrendim.<br />
<br />
Hangi işlemin port 80 meşgul ettiğini görmek için cmd arayüzünden<br />
<span style="color: red;"><b><span style="background-color: white; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;">netstat -o -n -a | findstr "0:80"</span></b></span><br />
komutunu kullarak hangi işlem ID'sine sahip programın port 80'ini kullandığını görelim.<br />
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="http://1.bp.blogspot.com/-vzVtweKCcUM/UOBew-kRRBI/AAAAAAAABvg/JhnIlP_BVYA/s1600/PID+4+NESTAT+-AON+80.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="36" src="http://1.bp.blogspot.com/-vzVtweKCcUM/UOBew-kRRBI/AAAAAAAABvg/JhnIlP_BVYA/s640/PID+4+NESTAT+-AON+80.JPG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Burda Process ID'si 4 olan bir program port 80'i meşgul ediyormuş. Port 80 kullanan bu programı bulmam uzunca vaktime aldı. Sonunda SQL'in reporting service'lerinin buna neden olduğunu öğrendim.</div>
<div class="separator" style="clear: both; text-align: left;">
SQL Reporting Services'i kapatmak için:</div>
<div class="separator" style="clear: both; text-align: left;">
<b style="color: red;">start >> run>>services.msc </b></div>
<div class="separator" style="clear: both; text-align: left;">
(Eğer Windows 8 kullanıyorsanız basitçe start ekranına geçip services.msc yazmanız yeterli.)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://1.bp.blogspot.com/-SgrP4krsPgE/UOBj6cjUonI/AAAAAAAABv0/8yVt2fCfiX4/s1600/SQL+REPORTING+SERVICES+MSC.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="280" src="http://1.bp.blogspot.com/-SgrP4krsPgE/UOBj6cjUonI/AAAAAAAABv0/8yVt2fCfiX4/s640/SQL+REPORTING+SERVICES+MSC.JPG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
Sizi yukarıda görülen pencerenin karışlaması gerekiyor. Daha sonra karşınıza çıkan bu pencereden SQL Reporting Services'e sağ tıklayıp <span style="color: red;">"stop"</span> diyerek sonlandırabilirsiniz. Bu sorunun tekrar tekrar karşınıza çıkmaması için sağ tıklayıp <span style="color: red;">Properties</span>'den, Startup type'ı Disabled olarak seçildikten sonra Apply diyerek pencereden çıkılabilir.<br />
<div>
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: left;">
<a href="http://2.bp.blogspot.com/-UMCaEjAy_T0/UOBkeSCThVI/AAAAAAAABv8/OUeQg6bg_98/s1600/SQL+REPORTING+SERVICES+MSC.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-UMCaEjAy_T0/UOBkeSCThVI/AAAAAAAABv8/OUeQg6bg_98/s320/SQL+REPORTING+SERVICES+MSC.JPG" width="288" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Tekrar CMD'ye geçip port 80'ni kontrol ettiğimizde bu sefer bu portu meşgul eden her hangi bir işlemin olmadığınız göreceğiz.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-_VKPo85Jr8M/UOBmBiWOG1I/AAAAAAAABwM/pGbYv5Dogb4/s1600/PID+4+NESTAT+-AON+80.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="64" src="http://3.bp.blogspot.com/-_VKPo85Jr8M/UOBmBiWOG1I/AAAAAAAABwM/pGbYv5Dogb4/s640/PID+4+NESTAT+-AON+80.JPG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Apache Server'ı çalıştırğımızda ise bu sefer port 80'nin apache server'a ait PID 1100 tarafından kullanıldığını görülecektir.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-pldxUy_pULo/UOBmZAhIegI/AAAAAAAABwU/P2mYVbBJ220/s1600/APACHE+SERVER+PORT+80.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="42" src="http://1.bp.blogspot.com/-pldxUy_pULo/UOBmZAhIegI/AAAAAAAABwU/P2mYVbBJ220/s640/APACHE+SERVER+PORT+80.JPG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Umarım karşılaştığınız sorunu gidermenizde yardımcı olabilmişimdir. Kolay gelsin.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-71167004904079684082011-07-13T11:51:00.001+03:002011-07-13T13:00:06.804+03:00ABAP - Debug Yaparken Data Explorer'ı Kullanmak<div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-8RU4je84DVI/Th1cJnsemMI/AAAAAAAABIQ/zbg1FME3OCQ/s1600/1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="205" src="http://3.bp.blogspot.com/-8RU4je84DVI/Th1cJnsemMI/AAAAAAAABIQ/zbg1FME3OCQ/s320/1.PNG" width="320" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-ESf5Rfq2hnU/Th1cNSwIRDI/AAAAAAAABIU/MZ-aN7GU2zc/s1600/2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="http://3.bp.blogspot.com/-ESf5Rfq2hnU/Th1cNSwIRDI/AAAAAAAABIU/MZ-aN7GU2zc/s320/2.PNG" width="320" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-Gs_UlsxBep0/Th1cOR741rI/AAAAAAAABIY/ITBryQ1HS0Y/s1600/3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="245" src="http://4.bp.blogspot.com/-Gs_UlsxBep0/Th1cOR741rI/AAAAAAAABIY/ITBryQ1HS0Y/s320/3.PNG" width="320" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-iJFeyb3KyWk/Th1cQwKJsTI/AAAAAAAABIc/W3rRWGy2kLQ/s1600/4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="191" src="http://2.bp.blogspot.com/-iJFeyb3KyWk/Th1cQwKJsTI/AAAAAAAABIc/W3rRWGy2kLQ/s320/4.PNG" width="320" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-42Qgc-EDa60/Th1cR1dQd_I/AAAAAAAABIg/emJoOaQ79ew/s1600/5.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="148" src="http://4.bp.blogspot.com/-42Qgc-EDa60/Th1cR1dQd_I/AAAAAAAABIg/emJoOaQ79ew/s320/5.PNG" width="320" /></a></div>kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-21004856550318570352011-07-13T11:02:00.004+03:002012-12-30T18:23:26.629+02:00Arka Planda Program Çalıştırmak ve Görüntülemek<div class="separator" style="clear: both; text-align: left;">
Derlenmesi uzun süren programların biz başka işle meşgulken arka planda çalışmasını isteyebiliriz. Bu durumda aşaüğıdaki adımlar izlenerek programın arka planda çalışması sağlanır.</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://4.bp.blogspot.com/-HTibGbvQXT0/Th1G_bdYGaI/AAAAAAAABHs/vzMZwdihrsI/s1600/1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="280" src="http://4.bp.blogspot.com/-HTibGbvQXT0/Th1G_bdYGaI/AAAAAAAABHs/vzMZwdihrsI/s640/1.PNG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
1- Derkenmek üzere SE38 (ABAP Editor) açılır.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://4.bp.blogspot.com/-FLulaoJtfJ0/Th1G_7ZpZbI/AAAAAAAABHw/TI3PL0h11W4/s1600/2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="260" src="http://4.bp.blogspot.com/-FLulaoJtfJ0/Th1G_7ZpZbI/AAAAAAAABHw/TI3PL0h11W4/s640/2.PNG" width="640" /></a></div>
<div style="text-align: left;">
2 - Arka planda çalıştırmak istediğimiz program seçilir. Ben burda daha önce hazıladğım Z_BACKGROUND_PROGRAM 'ı seçiyorum.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://2.bp.blogspot.com/-SmgqWnAz1KY/Th1HE2mYyfI/AAAAAAAABH0/RHD_ul-ie28/s1600/3.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="288" src="http://2.bp.blogspot.com/-SmgqWnAz1KY/Th1HE2mYyfI/AAAAAAAABH0/RHD_ul-ie28/s640/3.bmp" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
3- Daha sonra direk display demek yerine yukarıda görüldüğü üzere Program>> Execure >> Background Seçilir.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://1.bp.blogspot.com/-OfulUhtHIm4/Th1HGHx_4VI/AAAAAAAABH4/E2w6xg-DucA/s1600/4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="509" src="http://1.bp.blogspot.com/-OfulUhtHIm4/Th1HGHx_4VI/AAAAAAAABH4/E2w6xg-DucA/s640/4.PNG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
4- Çıkan ekranda "Execute Immed." butonuna basılarak derlenme işlemi gerçekleştirilir.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://2.bp.blogspot.com/-zQX-uCKLaIQ/Th1HGkmubGI/AAAAAAAABH8/xZQkrrH1TVE/s1600/5.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="313" src="http://2.bp.blogspot.com/-zQX-uCKLaIQ/Th1HGkmubGI/AAAAAAAABH8/xZQkrrH1TVE/s640/5.PNG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
5- Arka planda çalıştırdığımız prgoramı görüntülemek için ilk menüden SM37'ye girilir.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://4.bp.blogspot.com/-x2S829RL9Po/Th1HHLSZkVI/AAAAAAAABIA/gyS2DH5v3wE/s1600/6.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="395" src="http://4.bp.blogspot.com/-x2S829RL9Po/Th1HHLSZkVI/AAAAAAAABIA/gyS2DH5v3wE/s640/6.PNG" width="640" /></a></div>
<div style="text-align: left;">
6- Çıkan ekranda üst menüden Execut butonuna basılır.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://4.bp.blogspot.com/-dEGAdb4TCsY/Th1HHkipUjI/AAAAAAAABIE/MvARSxSrX58/s1600/7.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="351" src="http://4.bp.blogspot.com/-dEGAdb4TCsY/Th1HHkipUjI/AAAAAAAABIE/MvARSxSrX58/s640/7.PNG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
7- Arka planda çalıştırdığımız program seçilir.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://1.bp.blogspot.com/-KXOMMJFd2V4/Th1HIKCxZAI/AAAAAAAABII/_PP-w1to_-Y/s1600/8.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="402" src="http://1.bp.blogspot.com/-KXOMMJFd2V4/Th1HIKCxZAI/AAAAAAAABII/_PP-w1to_-Y/s640/8.PNG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
8- Çıkan ekranda TYPE 'ın altındaki ikona taklanarak programımızın derlenmiş halini görüntüleyebiliriz.</div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://1.bp.blogspot.com/-RGYGw_Qx0NM/Th1HI9FEllI/AAAAAAAABIM/wf7r4OEQp9A/s1600/9.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="321" src="http://1.bp.blogspot.com/-RGYGw_Qx0NM/Th1HI9FEllI/AAAAAAAABIM/wf7r4OEQp9A/s640/9.PNG" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
9- Üstte daha önceden yazdığımız program derlenmiş olarak gözükmekte. </div>
<div class="separator" style="clear: both; text-align: left;">
Ben basitçe WRITE:/ 'backgorunda çalışan program görüntüleniyor.'. yazmıştım.</div>
<span id="goog_1489919519"></span><span id="goog_1489919520"></span>kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-44374133630708957622011-07-12T15:02:00.003+03:002011-07-12T15:29:09.890+03:00ABAP - Subroutine Kullanarak Recursive Program YapmakABAP'ta PERFORM ifadesi program içinde alt bir programa(subroutine) dallanmasını sağlar. Böylece uzun bir program parçasını sadece PERFORM ifadesini yazarak tekrar tekrar çağrılabilir.<br />
<br />
Aşağıdaki örnekte SUBROUTINE kullanarak recursive bir şekilde kullanıcıdan alınan rakamdan geriye sayan bir program.<br />
<br />
<pre style="background-color: whitesmoke; border-left-color: rgb(185, 211, 238); border-left-style: double; border-left-width: 6px; color: #888888; font-size: 12px; line-height: 14px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"><style type="text/css">
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S31 {
font-style: italic;
color: #808080;
}
.L0S32 {
color: #3399FF;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}
</style>
<span class="L0S55">
<span class="L0S52">REPORT </span>Z_PERFORM_REC<span class="L0S55">.</span>
<span class="L0S52">parameters </span>sayi <span class="L0S52">type </span><span class="L0S52">i</span><span class="L0S55">.</span>
<span class="L0S31">*</span>
<span class="L0S52">perform </span>test<span class="L0S55">.</span>
<span class="L0S31">*</span>
<span class="L0S52">form </span>test<span class="L0S55">.</span>
<span class="L0S52">if </span>sayi > <span class="L0S32">0</span><span class="L0S55">.</span>
<span class="L0S52">write </span><span class="L0S55">:</span>/ <span class="L0S33">'sayi :'</span><span class="L0S55">, </span>sayi </span><span class="L0S55"><span class="L0S55">.
</span></span><span class="L0S55"> </span><span class="Apple-style-span" style="color: black; font-family: 'Courier New'; font-size: 13px;">sayi <span class="L0S55" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: purple; font-family: 'Courier New'; font-size: 10pt;">= </span>sayi <span class="L0S70" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: grey; font-family: 'Courier New'; font-size: 10pt;">- </span><span class="L0S32" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #3399ff; font-family: 'Courier New'; font-size: 10pt;">1</span><span class="L0S55" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: purple; font-family: 'Courier New'; font-size: 10pt;">.</span></span><span class="L0S55">
</span><span class="L0S55"> <span class="L0S52">PERFORM </span>TEST<span class="L0S55">.</span>
<span class="L0S52">else</span><span class="L0S55">.</span>
<span class="L0S52">write </span><span class="L0S33">'islem tamamlandi'</span><span class="L0S55">.</span>
<span class="L0S52">endif</span><span class="L0S55">.</span>
<span class="L0S52">endform</span><span class="L0S55">.
</span></span></pre><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-A5CZvgpSlrA/Thw9WbfbjuI/AAAAAAAABHA/UF7dDfpwDo0/s1600/IP_1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="105" src="http://4.bp.blogspot.com/-A5CZvgpSlrA/Thw9WbfbjuI/AAAAAAAABHA/UF7dDfpwDo0/s320/IP_1.PNG" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: left;">Programda SAYI değişkenini kullanıcıdan alınıyor. Sonra PERFORM komutu ile TEST formunun içine giriyor. Burda SAYI değişkeni 0'dan büyükse SAYI'yi yazdırıyor, sonra '1' çıkartıp tekrar kendini çağırıyor. Ardından tekrar aynı işlem gerçekleşiyor. Bu işlem SAYI'nın değeri 0 olana kadar devam ediyor. Ardından ENDFORM ifadesiyle SUBROUTINE'den çıkılıyor.</div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-68Vsf0bg9FY/Thw9W0tDipI/AAAAAAAABHE/y-LizdzjY60/s1600/IP_2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="132" src="http://1.bp.blogspot.com/-68Vsf0bg9FY/Thw9W0tDipI/AAAAAAAABHE/y-LizdzjY60/s320/IP_2.PNG" width="320" /></a></div>kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-50325114959849967142011-07-11T15:44:00.004+03:002011-07-11T15:50:52.213+03:00ABAP- Dinamik ve Statik Kaynakta BelirtmeStatik veri çekme database'deki her hangi bir tablodan bir filtre uygulamaksızın belli sayıda satırın getirilmesini sağlar. Aşağıda MARA tablosundan MANDT ve ERNAM kolonlarını çeken ABAP kodları mevcut. Görüldüğü üzere "<span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px; line-height: 14px; white-space: pre;"><span class="L0S52" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;">FROM </span></span><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px; line-height: 14px; white-space: pre;">mara </span><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px; line-height: 14px; white-space: pre;"><span class="L0S52" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;">UP </span></span><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px; line-height: 14px; white-space: pre;"><span class="L0S52" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;">TO </span></span><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px; line-height: 14px; white-space: pre;"><span class="L0S32" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: #3399ff; font-family: 'Courier New'; font-size: 10pt;">4 </span></span><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px; line-height: 14px; white-space: pre;"><span class="L0S52" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: blue; font-family: 'Courier New'; font-size: 10pt;">ROWS</span></span><span class="Apple-style-span" style="font-family: 'Courier New'; font-size: 13px; line-height: 14px; white-space: pre;"><span class="L0S55" style="background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; color: purple; font-family: 'Courier New'; font-size: 10pt;">.</span></span>" komutu ile tablodan sadece 4 satır çağrılmış.<br />
<br />
<pre style="background-color: whitesmoke; border-left: 6px double rgb(185, 211, 238); color: #888888; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code><style type="text/css">
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S32 {
color: #3399FF;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}
</style>
<span class="L0S52">REPORT </span>demo_select_static_database<span class="L0S55">.</span>
<span class="L0S52">DATA </span>wa <span class="L0S52">TYPE </span>mara<span class="L0S55">.</span>
<span class="L0S52">SELECT </span>*
<span class="L0S52">INTO </span>wa
<span class="L0S52">FROM </span>mara <span class="L0S52">UP </span><span class="L0S52">TO </span><span class="L0S32">4 </span><span class="L0S52">ROWS</span><span class="L0S55">.</span>
<span class="L0S52">WRITE</span><span class="L0S55">: </span>/ wa<span class="L0S70">-</span>mandt<span class="L0S55">, </span>wa<span class="L0S70">-</span>ernam<span class="L0S55">.</span>
<span class="L0S52">ENDSELECT</span><span class="L0S55">.</span></code></pre><pre style="background-color: whitesmoke; border-left-color: rgb(185, 211, 238); border-left-style: double; border-left-width: 6px; color: #888888; font-size: 12px; line-height: 14px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"></pre>Program çıktısı:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-MweVzpdCQgU/Thrwa8uG7WI/AAAAAAAABG8/nDAgsEuEG7M/s1600/Statik_IP.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="118" src="http://4.bp.blogspot.com/-MweVzpdCQgU/Thrwa8uG7WI/AAAAAAAABG8/nDAgsEuEG7M/s320/Statik_IP.PNG" width="320" /></a></div><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Dinamik'te ise WHERE ifadesi kullanılarak hedef tablo filtre edilerek getirilir. Aşağıdaki kodlarda MANDT kolonunun 800'e eşit olduğu satırlar filtre edilerek ekrana çağrılır.<br />
<pre style="background-color: whitesmoke; border-left-color: rgb(185, 211, 238); border-left-style: double; border-left-width: 6px; color: #888888; font-size: 12px; line-height: 14px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"><style type="text/css">
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}
</style>
<span class="L0S52">REPORT </span>demo_select_dynamic_database <span class="L0S55">.</span>
<span class="L0S52">DATA </span>wa <span class="L0S52">TYPE </span>mara<span class="L0S55">.</span>
<span class="L0S52">SELECT </span>*
<span class="L0S52">INTO </span>wa
<span class="L0S52">FROM </span><span class="L0S55">(</span><span class="L0S33">'mara'</span><span class="L0S55">) </span><span class="L0S52">CLIENT </span><span class="L0S52">SPECIFIED</span>
<span class="L0S52">WHERE </span>mandt <span class="L0S55">= </span><span class="L0S33">'800'</span><span class="L0S55">.</span>
<span class="L0S52">WRITE</span><span class="L0S55">: </span>/ wa-mandt, wa<span class="L0S70">-</span>ernam<span class="L0S55">.</span>
<span class="L0S52">ENDSELECT</span><span class="L0S55">.</span>
</pre><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="separator" style="clear: both; text-align: left;">Programı çıktısı:</div><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-exYgIfSWI6U/ThrJp3toLeI/AAAAAAAABG4/CwH2PwFHmHs/s1600/Dinamik_IP.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="172" src="http://1.bp.blogspot.com/-exYgIfSWI6U/ThrJp3toLeI/AAAAAAAABG4/CwH2PwFHmHs/s320/Dinamik_IP.PNG" width="320" /></a></div><br />
<div><br />
</div>kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-75158785519719721162011-07-08T16:32:00.000+03:002011-07-08T16:32:31.665+03:00ABAP- INNER ve LEFT OUTER JOINAşağıda basit bir LEFT OUTER JOIN örneği mevcut.<br />
<br />
<pre style="background-color: whitesmoke; border-left-color: rgb(185, 211, 238); border-left-style: double; border-left-width: 6px; color: #888888; font-size: 12px; line-height: 14px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"><style type="text/css">
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}
</style>
<span class="L0S52">REPORT </span>demo_select_left_outer_join <span class="L0S55">.</span></pre><pre style="background-color: whitesmoke; border-left-color: rgb(185, 211, 238); border-left-style: double; border-left-width: 6px; color: #888888; font-size: 12px; line-height: 14px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"><span class="L0S52">DATA</span><span class="L0S55">: </span><span class="L0S52">BEGIN </span><span class="L0S52">OF </span>wa<span class="L0S55">,</span>
carrid <span class="L0S52">TYPE </span>scarr<span class="L0S70">-</span>carrid<span class="L0S55">,</span>
carrname <span class="L0S52">TYPE </span>scarr<span class="L0S70">-</span>carrname<span class="L0S55">,</span>
connid <span class="L0S52">TYPE </span>spfli<span class="L0S70">-</span>connid<span class="L0S55">,</span>
cityfrom <span class="L0S52">TYPE </span>spfli<span class="L0S70">-</span>cityfrom<span class="L0S55">, </span>
<span class="L0S52">END </span><span class="L0S52">OF </span>wa<span class="L0S55">,</span>
itab <span class="L0S52">LIKE </span><span class="L0S52">SORTED </span><span class="L0S52">TABLE </span><span class="L0S52">OF </span>wa
<span class="L0S52">WITH </span><span class="L0S52">NON-UNIQUE </span><span class="L0S52">KEY </span>carrid<span class="L0S55">.</span>
<span class="L0S52">SELECT </span>s<span class="L0S70">~</span>carrid s<span class="L0S70">~</span>carrname p<span class="L0S70">~</span>connid p<span class="L0S70">~</span>cityfrom
<span class="L0S52">INTO </span>CORRESPONDING <span class="L0S52">FIELDS </span><span class="L0S52">OF </span><span class="L0S52">TABLE </span>itab
<span class="L0S52">FROM </span>scarr <span class="L0S52">AS </span>s
<span class="L0S52">LEFT </span>OUTER <span class="L0S52">JOIN </span>spfli <span class="L0S52">AS </span>p <span class="L0S52">ON </span>s<span class="L0S70">~</span>carrid <span class="L0S55">= </span>p<span class="L0S70">~</span>carrid <span class="L0S52">AND</span>
p<span class="L0S70">~</span>cityfrom <span class="L0S55">= </span><span class="L0S33">'FRANKFURT'</span><span class="L0S55">.</span>
<span class="L0S52">LOOP </span><span class="L0S52">AT </span>itab <span class="L0S52">INTO </span>wa<span class="L0S55">.</span>
<span class="L0S52">WRITE</span><span class="L0S55">: </span>/ wa<span class="L0S70">-</span>carrid<span class="L0S55">, </span>wa<span class="L0S70">-</span>carrname<span class="L0S55">, </span>wa<span class="L0S70">-</span>connid<span class="L0S55">, </span>wa<span class="L0S70">-</span>cityfrom<span class="L0S55">.</span>
<span class="L0S52">ENDLOOP</span><span class="L0S55">.</span></pre><br />
Program çıktısı aşağıdaki gibidir. Görüldüğü üzere FRANKFURT ile eşleşmeyen satırlar da çağrılmış durumda.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-lQAZHa1vW2I/ThcE0xexrWI/AAAAAAAABGw/Vv0rpFA1vvY/s1600/LEFT+OUTER+JOIN+IP.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="http://4.bp.blogspot.com/-lQAZHa1vW2I/ThcE0xexrWI/AAAAAAAABGw/Vv0rpFA1vvY/s320/LEFT+OUTER+JOIN+IP.PNG" width="289" /></a></div><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Aynı örnek INNER JOIN ile yapıldığında ise FRANKFURT'la eşleşmeyen satırlar gözükmeyecektir.<br />
<pre style="background-color: whitesmoke; border-left-color: rgb(185, 211, 238); border-left-style: double; border-left-width: 6px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"><span style="color: #888888; font-size: 12px; line-height: 14px;">
<span class="L0S52">REPORT </span>demo_select_inner_join <span class="L0S55">.</span>
<span class="L0S52">DATA</span><span class="L0S55">: </span><span class="L0S52">BEGIN </span><span class="L0S52">OF </span>wa<span class="L0S55">,</span>
carrid <span class="L0S52">TYPE </span>scarr<span class="L0S70">-</span>carrid<span class="L0S55">,</span>
carrname <span class="L0S52">TYPE </span>scarr<span class="L0S70">-</span>carrname<span class="L0S55">,</span>
connid <span class="L0S52">TYPE </span>spfli<span class="L0S70">-</span>connid<span class="L0S55">,</span>
cityfrom <span class="L0S52">TYPE </span>spfli<span class="L0S70">-</span>cityfrom<span class="L0S55">, </span>
<span class="L0S52">END </span><span class="L0S52">OF </span>wa<span class="L0S55">,</span>
itab <span class="L0S52">LIKE </span><span class="L0S52">SORTED </span><span class="L0S52">TABLE </span><span class="L0S52">OF </span>wa
<span class="L0S52">WITH </span><span class="L0S52">NON-UNIQUE </span><span class="L0S52">KEY </span>carrid<span class="L0S55">.</span>
<span class="L0S52">SELECT </span>s<span class="L0S70">~</span>carrid s<span class="L0S70">~</span>carrname p<span class="L0S70">~</span>connid p<span class="L0S70">~</span>cityfrom
<span class="L0S52">INTO </span>CORRESPONDING <span class="L0S52">FIELDS </span><span class="L0S52">OF </span><span class="L0S52">TABLE </span>itab
<span class="L0S52">FROM </span>scarr <span class="L0S52">AS </span>s
INNER <span class="L0S52">JOIN </span>spfli <span class="L0S52">AS </span>p <span class="L0S52">ON </span>s<span class="L0S70">~</span>carrid <span class="L0S55">= </span>p<span class="L0S70">~</span>carrid <span class="L0S52">AND</span>
p<span class="L0S70">~</span>cityfrom <span class="L0S55">= </span><span class="L0S33">'FRANKFURT'</span><span class="L0S55">.</span>
<span class="L0S52">LOOP </span><span class="L0S52">AT </span>itab <span class="L0S52">INTO </span>wa<span class="L0S55">.</span>
<span class="L0S52">WRITE</span><span class="L0S55">: </span>/ wa<span class="L0S70">-</span>carrid<span class="L0S55">, </span>wa<span class="L0S70">-</span>carrname<span class="L0S55">, </span>wa<span class="L0S70">-</span>connid<span class="L0S55">, </span>wa<span class="L0S70">-</span>cityfrom<span class="L0S55">.</span>
<span class="L0S52">ENDLOOP</span><span class="L0S55">.</span></span></pre><br />
Program çıktısı aşağıdaki gibidir.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-ndy646QWUeE/ThcG1Bycf2I/AAAAAAAABG0/R_BHL7_hmqI/s1600/COMPARE+LEFT+OUTER+WITH+INNER+JOIN.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="158" src="http://1.bp.blogspot.com/-ndy646QWUeE/ThcG1Bycf2I/AAAAAAAABG0/R_BHL7_hmqI/s320/COMPARE+LEFT+OUTER+WITH+INNER+JOIN.PNG" width="320" /></a></div>kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-11672040544565059772011-07-08T10:03:00.007+03:002013-09-02T10:26:13.749+03:00ABAP - TYPES ve DATA ifadeleri kullanımı<div dir="ltr" style="text-align: left;" trbidi="on">
TYPES ifadesi programda yerel veri TYPE'ları oluşturmak için kullanılır.<br />
DATA ise programda yeni bir veri objesi oluşturmak için kullanılır.<br />
<br />
Aşağıda basit bir örnek mevcut.<br />
<br />
<pre style="background-color: whitesmoke; border-left-color: rgb(185, 211, 238); border-left-style: double; border-left-width: 6px; color: #888888; font-size: 12px; line-height: 14px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"><style type="text/css">
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S32 {
color: #3399FF;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
</style>
<span class="L0S52">REPORT </span>demo_types_statement<span class="L0S55">.</span>
<span class="L0S52">TYPES </span>yazi<span class="L0S55">(</span><span class="L0S32">10</span><span class="L0S55">) </span><span class="L0S52">TYPE </span><span class="L0S52">c</span><span class="L0S55">.</span>
<span class="L0S52">TYPES </span>sonuc <span class="L0S52">TYPE </span>p <span class="L0S52">DECIMALS </span><span class="L0S32">2</span><span class="L0S55">.</span>
<span class="L0S52">DATA </span><span class="L0S52">text </span><span class="L0S52">TYPE </span>yazi<span class="L0S55">.</span>
<span class="L0S52">DATA </span>amount <span class="L0S52">TYPE </span>sonuc<span class="L0S55">.</span>
<span class="L0S52">text </span><span class="L0S55">= </span><span class="L0S33">' 4 / 3 = '</span><span class="L0S55">.</span>
amount <span class="L0S55">= </span><span class="L0S32">4 </span>/ <span class="L0S32">3 </span><span class="L0S55">.</span>
<span class="L0S52">WRITE</span><span class="L0S55">: </span><span class="L0S52">text</span><span class="L0S55">, </span>amount<span class="L0S55">.</span></pre>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Program çıktısı aşağıdaki gibidir.</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-0h3H1plGsGI/Thau0RV3PhI/AAAAAAAABGo/ghDStVxsnyE/s1600/TYPES+DATA+1.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="183" src="http://2.bp.blogspot.com/-0h3H1plGsGI/Thau0RV3PhI/AAAAAAAABGo/ghDStVxsnyE/s320/TYPES+DATA+1.PNG" width="320" /></a></div>
<br />
Bu programda yazi ve sonuc, yerel data Type'ları olarak tanımlanmış. Böylelikle amount ve text gibi yeni data objeleri tanımlarken 'c' veya 'p' yazmak yerine bu yerel ifadeler kullanılır. Bu programı aşağıdaki gibi de yazsak bir şey fark etmeyecekti.<br />
<br />
<pre style="background-color: whitesmoke; border-left-color: rgb(185, 211, 238); border-left-style: double; border-left-width: 6px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"><span style="color: #888888; font-size: 12px; line-height: 14px;"><span class="L0S52">REPORT </span>demo_types_statement<span class="L0S55">.</span>
<span class="L0S31">*</span>
<span class="L0S31">*TYPES yazi(10) TYPE c.</span>
<span class="L0S31">*TYPES sonuc TYPE p DECIMALS 2.</span>
<span class="L0S52">DATA </span><span class="L0S52">text</span><span class="L0S55">(</span><span class="L0S32">10</span><span class="L0S55">) </span><span class="L0S52">TYPE </span><span class="L0S52">c</span><span class="L0S55">.</span>
<span class="L0S52">DATA </span>amount <span class="L0S52">TYPE </span>p <span class="L0S52">DECIMALS </span><span class="L0S32">2</span><span class="L0S55">.</span>
<span class="L0S52">text </span><span class="L0S55">= </span><span class="L0S33">' 4 / 3 = '</span><span class="L0S55">.</span>
amount <span class="L0S55">= </span><span class="L0S32">4 </span>/ <span class="L0S32">3 </span><span class="L0S55">.</span>
<span class="L0S52">WRITE</span><span class="L0S55">: </span><span class="L0S52">text</span><span class="L0S55">, </span>amount<span class="L0S55">.</span></span></pre>
<br />
<br />
<br />
Aşağıda başka bir örnek daha mevcut. Bu örnek biraz daha amaca uygun, tekrar tekrar uzun bir şekilde TYPE yapısı yazmak yerine önceden tanımlanmış yerel TYPE'ı kullanarak DATA objelerine referans veriyor.<br />
<br />
<pre style="background-color: whitesmoke; border-left-color: rgb(185, 211, 238); border-left-style: double; border-left-width: 6px; color: #888888; font-size: 12px; line-height: 14px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"><span class="L0S52">REPORT </span>demo_structure<span class="L0S55">.</span>
<span class="L0S52">TYPES</span><span class="L0S55">: </span><span class="L0S52">BEGIN </span><span class="L0S52">OF </span>name<span class="L0S55">,</span>
<span class="L0S52">title</span><span class="L0S55">(</span><span class="L0S32">5</span><span class="L0S55">) </span><span class="L0S52">TYPE </span><span class="L0S52">c</span><span class="L0S55">,</span>
first_name<span class="L0S55">(</span><span class="L0S32">10</span><span class="L0S55">) </span><span class="L0S52">TYPE </span><span class="L0S52">c</span><span class="L0S55">,</span>
last_name<span class="L0S55">(</span><span class="L0S32">10</span><span class="L0S55">) </span><span class="L0S52">TYPE </span><span class="L0S52">c</span><span class="L0S55">,</span>
<span class="L0S52">END </span><span class="L0S52">OF </span>name<span class="L0S55">.</span>
<span class="L0S52">TYPES</span><span class="L0S55">: </span><span class="L0S52">BEGIN </span><span class="L0S52">OF </span>mylist<span class="L0S55">,</span>
<span class="L0S52">client </span><span class="L0S52">TYPE </span>name<span class="L0S55">,</span>
<span class="L0S52">number </span><span class="L0S52">TYPE </span><span class="L0S52">i</span><span class="L0S55">,</span>
<span class="L0S52">END </span><span class="L0S52">OF </span>mylist<span class="L0S55">.</span>
<span class="L0S52">DATA </span>list1 <span class="L0S52">TYPE </span>mylist<span class="L0S55">.</span>
<span class="L0S52">DATA </span>list2 <span class="L0S52">TYPE </span>mylist<span class="L0S55">.</span>
<span class="L0S52">DATA </span>list3 <span class="L0S52">TYPE </span>mylist<span class="L0S55">.</span>
list1<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span><span class="L0S52">title </span><span class="L0S55">= </span><span class="L0S33">'Lord'</span><span class="L0S55">.</span>
list1<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>first_name <span class="L0S55">= </span><span class="L0S33">'Howard'</span><span class="L0S55">.</span>
list1<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>last_name <span class="L0S55">= </span><span class="L0S33">'Mac Duff'</span><span class="L0S55">.</span>
list1<span class="L0S70">-</span><span class="L0S52">number </span><span class="L0S55">= </span><span class="L0S32">1</span><span class="L0S55">.</span>
list2<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span><span class="L0S52">title </span><span class="L0S55">= </span><span class="L0S33">'Mr.'</span><span class="L0S55">.</span>
list2<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>first_name <span class="L0S55">= </span><span class="L0S33">'Kerem izzet'</span><span class="L0S55">.</span>
list2<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>last_name <span class="L0S55">= </span><span class="L0S33">'Atam'</span><span class="L0S55">.</span>
list2<span class="L0S70">-</span><span class="L0S52">number </span><span class="L0S55">= </span><span class="L0S32">2</span><span class="L0S55">.</span>
list3<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span><span class="L0S52">title </span><span class="L0S55">= </span><span class="L0S33">'Sir'</span><span class="L0S55">.</span>
list3<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>first_name <span class="L0S55">= </span><span class="L0S33">'Hasan'</span><span class="L0S55">.</span>
list3<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>last_name <span class="L0S55">= </span><span class="L0S33">'Huseyin'</span><span class="L0S55">.</span>
list3<span class="L0S70">-</span><span class="L0S52">number </span><span class="L0S55">= </span><span class="L0S32">3</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list1<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span><span class="L0S52">title</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list1<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>first_name<span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list1<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>last_name<span class="L0S55">.</span>
<span class="L0S52">WRITE </span>/ <span class="L0S33">'Number'</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list1<span class="L0S70">-</span><span class="L0S52">number</span><span class="L0S55">.</span>
<span class="L0S52">skip</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list2<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span><span class="L0S52">title</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list2<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>first_name<span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list2<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>last_name<span class="L0S55">.</span>
<span class="L0S52">WRITE </span>/ <span class="L0S33">'Number'</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list2<span class="L0S70">-</span><span class="L0S52">number</span><span class="L0S55">.</span>
<span class="L0S52">skip</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list3<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span><span class="L0S52">title</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list3<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>first_name<span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list3<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>last_name<span class="L0S55">.</span>
<span class="L0S52">WRITE </span>/ <span class="L0S33">'Number'</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list3<span class="L0S70">-</span><span class="L0S52">number</span><span class="L0S55">.</span></pre>
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
Program çıktısı aşağıdaki gibidir.</div>
<div>
<br /></div>
<br />
<a href="http://3.bp.blogspot.com/-IbISlK9_JTY/Tha0RQcex9I/AAAAAAAABGs/wgjSFkU29Q4/s1600/TYPES+DATA+2.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="151" src="http://3.bp.blogspot.com/-IbISlK9_JTY/Tha0RQcex9I/AAAAAAAABGs/wgjSFkU29Q4/s320/TYPES+DATA+2.PNG" width="320" /></a>Yukarıdaki örnekte name ve mylist yapıları yerel TYPE olarak tanımlanarak programın sonraki parçalarında list1, list2 ve list3; DATA yapılarına tek bir ifade olarak referans gösterilmiş. Daha sonraki adımlarda ise list1, list2 ve list3 DATA yapısına veriler girilmiş ve yazdırılmış.<br />
<br />
<br />
<br />
<b>LIKE ve TYPE 'ın kullanımı</b><br />
<b><br />
</b><br />
Yukarıdaki örnekteki gibi yerel TYPE tanımlamayıp, aynı yapıyı tekrar tekrar kullanmak isteseydik. Bu durumda ilk DATA yapısını tanımlayıp sonraki yapılarda LIKE ifadesini kullanarap ilk DATA yapısı referans alınabilir. Aşağıdaki örnkte TYPES ifadesi kullanılmadan aynı program derlenmiştir program çıktısı yukardakinin aynısı olacaktır.<br />
<br />
<br />
<pre style="background-color: whitesmoke; border-left-color: rgb(185, 211, 238); border-left-style: double; border-left-width: 6px; color: #888888; font-size: 12px; line-height: 14px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"><span class="L0S52">REPORT </span>demo_structure<span class="L0S55">.</span>
<span class="L0S52">DATA </span><span class="L0S55">: </span><span class="L0S52">BEGIN </span><span class="L0S52">OF </span>name<span class="L0S55">,</span>
<span class="L0S52">title</span><span class="L0S55">(</span><span class="L0S32">5</span><span class="L0S55">) </span><span class="L0S52">TYPE </span><span class="L0S52">c</span><span class="L0S55">,</span>
first_name<span class="L0S55">(</span><span class="L0S32">10</span><span class="L0S55">) </span><span class="L0S52">TYPE </span><span class="L0S52">c</span><span class="L0S55">,</span>
last_name<span class="L0S55">(</span><span class="L0S32">10</span><span class="L0S55">) </span><span class="L0S52">TYPE </span><span class="L0S52">c</span><span class="L0S55">,</span>
<span class="L0S52">END </span><span class="L0S52">OF </span>name<span class="L0S55">.</span>
<span class="L0S52">DATA </span><span class="L0S55">: </span><span class="L0S52">BEGIN </span><span class="L0S52">OF </span>list1<span class="L0S55">,</span>
<span class="L0S52">client </span><span class="L0S52">LIKE </span>name<span class="L0S55">,</span>
<span class="L0S52">number </span><span class="L0S52">TYPE </span><span class="L0S52">i</span><span class="L0S55">,</span>
<span class="L0S52">END </span><span class="L0S52">OF </span>list1<span class="L0S55">.</span>
<span class="L0S52">DATA </span>list2 <span class="L0S52">LIKE </span>list1<span class="L0S55">.</span>
<span class="L0S52">DATA </span>list3 <span class="L0S52">LIKE </span>list1<span class="L0S55">.</span>
list1<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span><span class="L0S52">title </span><span class="L0S55">= </span><span class="L0S33">'Lord'</span><span class="L0S55">.</span>
list1<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>first_name <span class="L0S55">= </span><span class="L0S33">'Howard'</span><span class="L0S55">.</span>
list1<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>last_name <span class="L0S55">= </span><span class="L0S33">'Mac Duff'</span><span class="L0S55">.</span>
list1<span class="L0S70">-</span><span class="L0S52">number </span><span class="L0S55">= </span><span class="L0S32">1</span><span class="L0S55">.</span>
list2<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span><span class="L0S52">title </span><span class="L0S55">= </span><span class="L0S33">'Mr.'</span><span class="L0S55">.</span>
list2<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>first_name <span class="L0S55">= </span><span class="L0S33">'Kerem izzet'</span><span class="L0S55">.</span>
list2<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>last_name <span class="L0S55">= </span><span class="L0S33">'Atam'</span><span class="L0S55">.</span>
list2<span class="L0S70">-</span><span class="L0S52">number </span><span class="L0S55">= </span><span class="L0S32">2</span><span class="L0S55">.</span>
list3<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span><span class="L0S52">title </span><span class="L0S55">= </span><span class="L0S33">'Sir'</span><span class="L0S55">.</span>
list3<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>first_name <span class="L0S55">= </span><span class="L0S33">'Hasan'</span><span class="L0S55">.</span>
list3<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>last_name <span class="L0S55">= </span><span class="L0S33">'Huseyin'</span><span class="L0S55">.</span>
list3<span class="L0S70">-</span><span class="L0S52">number </span><span class="L0S55">= </span><span class="L0S32">3</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list1<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span><span class="L0S52">title</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list1<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>first_name<span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list1<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>last_name<span class="L0S55">.</span>
<span class="L0S52">WRITE </span>/ <span class="L0S33">'Number'</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list1<span class="L0S70">-</span><span class="L0S52">number</span><span class="L0S55">.</span>
<span class="L0S52">skip</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list2<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span><span class="L0S52">title</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list2<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>first_name<span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list2<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>last_name<span class="L0S55">.</span>
<span class="L0S52">WRITE </span>/ <span class="L0S33">'Number'</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list2<span class="L0S70">-</span><span class="L0S52">number</span><span class="L0S55">.</span>
<span class="L0S52">skip</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list3<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span><span class="L0S52">title</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list3<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>first_name<span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list3<span class="L0S70">-</span><span class="L0S52">client</span><span class="L0S70">-</span>last_name<span class="L0S55">.</span>
<span class="L0S52">WRITE </span>/ <span class="L0S33">'Number'</span><span class="L0S55">.</span>
<span class="L0S52">WRITE </span>list3<span class="L0S70">-</span><span class="L0S52">number</span><span class="L0S55">.</span></pre>
</div>
kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-3148756679231784432011-07-07T15:47:00.004+03:002011-07-07T17:17:32.267+03:00ABAP'da basit INNER JOIN UygulamasıSAP GUI'de MARA ve MAKT tabloları arasında basit bir INNER JOIN uygulaması kodlar aşağıdaki gibidir. matnr ve mandt iki tabloda da bulunan key attribute'lar oldukları için JOIN'de tabloları bağlamak için kullanılır. <br />
<br />
<pre style="background-color: whitesmoke; border-left-color: rgb(185, 211, 238); border-left-style: double; border-left-width: 6px; color: #888888; font-size: 12px; line-height: 14px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; width: 100%;"><style type="text/css">
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}
</style>
<span class="L0S52">REPORT </span>demo_select_left_outer_join <span class="L0S55">.</span>
<span class="L0S52">DATA</span><span class="L0S55">: </span><span class="L0S52">BEGIN </span><span class="L0S52">OF </span>wa<span class="L0S55">,</span>
matnr <span class="L0S52">TYPE </span>MARA<span class="L0S70">-</span>matnr<span class="L0S55">,</span>
ersda <span class="L0S52">TYPE </span>MARA<span class="L0S70">-</span>ersda<span class="L0S55">,</span>
spras <span class="L0S52">TYPE </span>MAKT<span class="L0S70">-</span>spras<span class="L0S55">,</span>
maktx <span class="L0S52">TYPE </span>MAKT<span class="L0S70">-</span>maktx<span class="L0S55">,</span>
<span class="L0S52">END </span><span class="L0S52">OF </span>wa<span class="L0S55">,</span>
itab <span class="L0S52">LIKE </span><span class="L0S52">SORTED </span><span class="L0S52">TABLE </span><span class="L0S52">OF </span>wa
<span class="L0S52">WITH </span><span class="L0S52">NON-UNIQUE </span><span class="L0S52">KEY </span>matnr ersda spras maktx<span class="L0S55">.</span>
<span class="L0S52">SELECT </span>MR<span class="L0S70">~</span>matnr MR<span class="L0S70">~</span>ersda MK<span class="L0S70">~</span>spras MK<span class="L0S70">~</span>maktx
<span class="L0S52">INTO </span>CORRESPONDING <span class="L0S52">FIELDS </span><span class="L0S52">OF </span><span class="L0S52">TABLE </span>itab
<span class="L0S52">FROM </span>MARA <span class="L0S52">AS </span>MR
INNER <span class="L0S52">JOIN </span>MAKT <span class="L0S52">AS </span>MK <span class="L0S52">ON </span>MR<span class="L0S70">~</span>matnr <span class="L0S55">= </span>MK<span class="L0S70">~</span>matnr <span class="L0S52">AND</span>
MR<span class="L0S70">~</span>mandt <span class="L0S55">= </span>MK<span class="L0S70">~</span>mandt<span class="L0S55">.</span>
<span class="L0S52">LOOP </span><span class="L0S52">AT </span>itab <span class="L0S52">INTO </span>wa<span class="L0S55">.</span>
<span class="L0S52">WRITE</span><span class="L0S55">: </span>/ wa<span class="L0S70">-</span>matnr<span class="L0S55">, </span>wa<span class="L0S70">-</span>ersda<span class="L0S55">, </span>wa<span class="L0S70">-</span>spras <span class="L0S55">,</span>wa<span class="L0S70">-</span>maktx<span class="L0S55">.</span>
<span class="L0S52">ENDLOOP</span><span class="L0S55">.</span></pre><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-klbbOFfMFe4/ThW-k_adknI/AAAAAAAABGY/XY2LQYfVLhQ/s1600/INNER+JOIN+IP.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br />
</a><a href="http://2.bp.blogspot.com/-klbbOFfMFe4/ThW-k_adknI/AAAAAAAABGY/XY2LQYfVLhQ/s1600/INNER+JOIN+IP.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="521" src="http://2.bp.blogspot.com/-klbbOFfMFe4/ThW-k_adknI/AAAAAAAABGY/XY2LQYfVLhQ/s640/INNER+JOIN+IP.PNG" width="640" /></a></div>Programın derleme ekranı şekildeki gibidir.kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0tag:blogger.com,1999:blog-15350756.post-720917061828972472010-08-28T09:52:00.002+03:002010-08-28T09:52:50.974+03:00TC Kimlik No Algoritması<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Bilindiği üzere TC No toplamda 11 haneden oluşuyor. Fakat en sağdaki iki hane kendisinden önceki dokuz haneden belli bir algoritmaya göre türetiliyor. Böylelikle herhangi bir 11 haneli sayı TC kimlik no özelliğini taşımamış oluyor.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>Kimlik numarasının 10'uncu hanesi</b>;</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">kimilk numarsanın 1'inci, 3'üncü, 5'inci, 7'inci ve 9'uncu hanelerindeki rakamların toplamının 7 ile çarpımından,</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">kimlik nurasanın 2'inci, 4'üncü, 6'ıncı ve 8'inci hanlerindeki rakamların çıkarılmasından elde edilen sayının 10'a bölümünden kalan ile elde ediliyor.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">10uncu= mod 10 [ 7x (1inci + 3üncü + 5inci + 7nci + 9uncu) - ( 2inci + 4üncü + 6ıncı + 8inci ) ]</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>Kimlik numarasının 11'uncu hanesi</b>;</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">kimlik numarasının kendisinden önce gelen 10 hanedeki rakamların toplamının 10'a bölümünden kalan ile elde ediliyor.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">11inci= mod 10 [ 1inci + 2inci + 3üncü + 4üncü + 5inci + 6ıncı + 7nci + 8inci + 9uncu + 10uncu ]</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>Akraba kimlik numarası </b>elde etmek için de, (sizinle aynı soyadını paylaşann başka birinin kimlik numarasına ulaşmak için);</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Kimlik numarasının anlamlı dokuz rakamı alınır ve baştan dört hane ve sonraki beş hane olmak üzere ikiye ayrılır.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Örnek(1) 1111 - 11111- 10 gibi...</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Ardından 5 basamaklaı kısma 3 ekleyip, 4 basamaklı kısımdan 1 çıkarıldığında elde edilen yeni dokuz haneli sayıydan yukarıda belirtildiği gibi 10'uncu ve 11'inci hanelerin hesaplanması ile yeni kimilk numarası elde edilmiş olur.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Örnek(2): 11114- 1110 - 56</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Bu şekilde genelde sizden yaşça daha büyük bir akrabalarınızın kimlik numarasına ualşırısnız.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><u></u></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Aynı şekilde 3 çıkartılıp, 1 eklediğiniz taktirde tam tersi gerçekleşir.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Yukarı da bu hesaplamaları kolaylaştırma amacıyla JavaScript'te bu algoritmayı uygulamaya çalıştım. Program şuan dört dörtlük çalışmasa bile aşağı yukarı istenileni veriyor. Hataları düzeltmeye çalışıyorum henüz.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Ben bu yolla en son 1903 doğumlu babamın halasının kimlik numarasına kadar yaklaşık 40 akrabamın kimlik numaralarına ulaştım. Çoktan vefat etmiş kişilerin bile kimlik numaralarının çıkarılması ilginç.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Üretilen Kimlik no'larının sahiplerini <a href="https://secure.kamilkoc.com.tr/YolKartBasvuru.aspx">https://secure.kamilkoc.com.tr/YolKartBasvuru.aspx</a> adresinden öğrenebilirsiniz.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Kişi hala yaşıyorsa ikamet ettiği adres bilgilerini <a href="http://www.ysk.gov.tr/ysk/index.html">http://www.ysk.gov.tr/ysk/index.html</a> adresinden elde edebilirsiniz.</div>kerem izzet atamhttp://www.blogger.com/profile/15317897548450908773noreply@blogger.com0