<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Jax's blog]]></title><description><![CDATA[A journey in The Art of Technomancy.]]></description><link>https://jsiu22.github.io/blog</link><image><url>https://jsiu22.github.io//img/intro-bg.jpg</url><title>Jax&apos;s blog</title><link>https://jsiu22.github.io/blog</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 16 May 2017 20:18:44 GMT</lastBuildDate><atom:link href="https://jsiu22.github.io/blog/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Post JSON to a RESTful service without wget, curl, netcat.]]></title><description><![CDATA[<div class="paragraph">
<p>If your REST URL looks like this:</p>
</div>
<div class="literalblock">
<div class="content">
<pre> http://some.server:8080/URI/TO/RESTful/API</pre>
</div>
</div>
<div class="paragraph">
<p><code>1.</code> Construct your JSON variable.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>#No indentations otherwise heredoc may break.
json=$(cat &lt;&lt;EOF
{
       "personID": $personID,
       "firstname": "$firstname",
       "lastname": "$lastname"
}
EOF
)</pre>
</div>
</div>
<div class="paragraph">
<p><code>2.</code> Calculate Content-Length.</p>
</div>
<div class="literalblock">
<div class="content">
<pre> len=${#json}</pre>
</div>
</div>
<div class="paragraph">
<p><code>3.</code> Open TCP socket using descriptor (3).</p>
</div>
<div class="literalblock">
<div class="content">
<pre>#exec 3&lt;&gt;/dev/tcp/SERVER/PORT
 exec 3&lt;&gt;/dev/tcp/some.server/8080</pre>
</div>
</div>
<div class="paragraph">
<p><code>4.</code> ECHO spoofed header to descriptor (3).</p>
</div>
<div class="literalblock">
<div class="content">
<pre>#This must be on 1 line.
 echo -e "POST /URI/TO/RESTful/API HTTP/1.1\r\nHost: some.server\r\nContent-type: application/json\r\nContent-length: $len\r\nConnection: close \r\n\r\n$json"&gt;&amp;3</pre>
</div>
</div>
<div class="literalblock">
<div class="content">
<pre># Breaking down the header
# POST /URI/TO/RESTful/API HTTP/1.1\r\n
# Host: some.server\r\n
# Content-type: application/json\r\n
# Content-length: $len\r\n
# Connection: close \r\n\r\n
# $json</pre>
</div>
</div>
<div class="paragraph">
<p><code>5.</code> Show response and close descriptor (3).</p>
</div>
<div class="literalblock">
<div class="content">
<pre> cat &lt;&amp;3
 exec 3&lt;&amp;-</pre>
</div>
</div>]]></description><link>https://jsiu22.github.io/blog/2017/05/16/Post-JSON-to-a-RES-Tul-service-without-wget-curl-netcat.html</link><guid isPermaLink="true">https://jsiu22.github.io/blog/2017/05/16/Post-JSON-to-a-RES-Tul-service-without-wget-curl-netcat.html</guid><category><![CDATA[Linux]]></category><category><![CDATA[Unix]]></category><category><![CDATA[REST]]></category><category><![CDATA[CLI]]></category><category><![CDATA[BASH]]></category><dc:creator><![CDATA[Jax]]></dc:creator><pubDate>Tue, 16 May 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Linux kill process by user & executable]]></title><description><![CDATA[<div class="paragraph">
<p>Sometimes I find myself spawning a lot of identical processes by mistake.</p>
</div>
<div class="listingblock">
<div class="content">
<pre>pkill -u user -f cmd_or_process_name</pre>
</div>
</div>]]></description><link>https://jsiu22.github.io/blog/2017/03/31/Linux-kill-process-by-user-executable.html</link><guid isPermaLink="true">https://jsiu22.github.io/blog/2017/03/31/Linux-kill-process-by-user-executable.html</guid><category><![CDATA[Linux]]></category><category><![CDATA[ CLI]]></category><dc:creator><![CDATA[Jax]]></dc:creator><pubDate>Fri, 31 Mar 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[What init system am I using?]]></title><description><![CDATA[<div class="paragraph">
<p>I had a bit of trouble finding the init system used for a Linux box I was using. Since the init process is always assigned PID 1, you can use the proc virtual file system to access the init used.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>sudo /proc/1/exe --version</pre>
</div>
</div>
<div class="paragraph">
<p>The output should be something like this:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>exe (upstart 0.6.5)
...</pre>
</div>
</div>
<div class="paragraph">
<p>or this:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>systemd 231
...</pre>
</div>
</div>]]></description><link>https://jsiu22.github.io/blog/2017/03/16/What-init-system-am-I-using.html</link><guid isPermaLink="true">https://jsiu22.github.io/blog/2017/03/16/What-init-system-am-I-using.html</guid><category><![CDATA[Linux]]></category><category><![CDATA[ Bash]]></category><category><![CDATA[ CLI]]></category><dc:creator><![CDATA[Jax]]></dc:creator><pubDate>Thu, 16 Mar 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Git repo permissions and hook scripts]]></title><description><![CDATA[<div class="paragraph">
<p>I had pretty frustrating time with my Git repo. Having setup a git group and adding the appropriate users, I found myself still having trouble when multiple people push to the repo.</p>
</div>
<div class="paragraph">
<p>Turns out Git doesn&#8217;t keep file metadata (including permissions and ownership).</p>
</div>
<div class="paragraph">
<p>How do you solve this issue? Git provides a hooks directory (.git/hooks) where you can plop down scripts that fire on repo events. Here you can change the appropriate files back to their original permissions.</p>
</div>]]></description><link>https://jsiu22.github.io/blog/2017/03/15/Git-repo-permissions-and-hook-scripts.html</link><guid isPermaLink="true">https://jsiu22.github.io/blog/2017/03/15/Git-repo-permissions-and-hook-scripts.html</guid><category><![CDATA[Git]]></category><category><![CDATA[ Development]]></category><category><![CDATA[ Bash]]></category><category><![CDATA[ CLI]]></category><dc:creator><![CDATA[Jax]]></dc:creator><pubDate>Wed, 15 Mar 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[EGit showing 'Nothing to fetch']]></title><description><![CDATA[<div class="paragraph">
<p>If you&#8217;re using EGit and its showing 'Nothing to fetch' but you&#8217;re sure your remote has updates. Try adding the following to your <code>.git/config</code> file under <code>[remote "remote_name"]</code>.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>fetch = +refs/heads/*:refs/remotes/origin/*</pre>
</div>
</div>
<div class="paragraph">
<p>This makes Git fetch all refs from your remote server starting at <code>refs/heads/</code> and store them under <code>refs/remotes/origin/</code> locally. It does so with all branches.</p>
</div>]]></description><link>https://jsiu22.github.io/blog/2017/03/15/E-Gt-showing-Nothing-to-fetch.html</link><guid isPermaLink="true">https://jsiu22.github.io/blog/2017/03/15/E-Gt-showing-Nothing-to-fetch.html</guid><category><![CDATA[Git]]></category><category><![CDATA[ Eclipse]]></category><category><![CDATA[ IDE]]></category><category><![CDATA[ Development]]></category><category><![CDATA[ Fix]]></category><category><![CDATA[ Error]]></category><dc:creator><![CDATA[Jax]]></dc:creator><pubDate>Wed, 15 Mar 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Git shows everything as modified. Fix]]></title><description><![CDATA[<div class="paragraph">
<p>If your repository and development machines use different OS and git or your IDE shows everything as modified. You probably have a line ending issue.</p>
</div>
<div class="paragraph">
<p>Simply type the following command in your Git repository.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>git config core.autocrlf false</pre>
</div>
</div>
<div class="paragraph">
<p>Alternately you can edit your Git repo&#8217;s config file.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>nano .git/config
...
[core]
...
autocrlf = false</pre>
</div>
</div>
<div class="paragraph">
<p>The next time you pull it should work normally.</p>
</div>]]></description><link>https://jsiu22.github.io/blog/2017/03/14/Git-shows-everything-as-modified-Fix.html</link><guid isPermaLink="true">https://jsiu22.github.io/blog/2017/03/14/Git-shows-everything-as-modified-Fix.html</guid><category><![CDATA[Git]]></category><category><![CDATA[ Linux]]></category><category><![CDATA[ Windows]]></category><category><![CDATA[ IDE]]></category><category><![CDATA[ Error]]></category><category><![CDATA[ Fix]]></category><category><![CDATA[ Development]]></category><dc:creator><![CDATA[Jax]]></dc:creator><pubDate>Tue, 14 Mar 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Linux Heredoc]]></title><description><![CDATA[<div class="paragraph">
<p>Very handy tool, personally I like to use it to quickly make scripts, or populate files.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash" data-lang="bash">cat &lt;&lt; EOF &gt; /tmp/yourfilehere
These contents will be written to the file.
        This line is indented.
EOF</code></pre>
</div>
</div>
<div class="paragraph">
<p>You can also use the tee command to the same effect.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-bash" data-lang="bash">tee /tmp/yourfilehere &lt;&lt; EOF
These contents will be written to the file.
        This line is indented.
EOF</code></pre>
</div>
</div>]]></description><link>https://jsiu22.github.io/blog/2017/02/28/Linux-Heredoc.html</link><guid isPermaLink="true">https://jsiu22.github.io/blog/2017/02/28/Linux-Heredoc.html</guid><category><![CDATA[Linux]]></category><category><![CDATA[ Bash]]></category><category><![CDATA[ CLI]]></category><dc:creator><![CDATA[Jax]]></dc:creator><pubDate>Tue, 28 Feb 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Eclipse: Unable to acquire the state change lock for the module]]></title><description><![CDATA[<div class="paragraph">
<p>If you get the error: org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity</p>
</div>
<div class="paragraph">
<p>That means you probably exited eclipse abruptly.
To fix this, go to your workspace&#8217;s .metadata (C:\Users\USERNAME\workspace\.metadata) and delete the .lock file.</p>
</div>]]></description><link>https://jsiu22.github.io/blog/2017/02/28/Eclipse-Unable-to-acquire-the-state-change-lock-for-the-module.html</link><guid isPermaLink="true">https://jsiu22.github.io/blog/2017/02/28/Eclipse-Unable-to-acquire-the-state-change-lock-for-the-module.html</guid><category><![CDATA[Eclipse]]></category><category><![CDATA[ Error]]></category><category><![CDATA[ Development]]></category><category><![CDATA[ IDE]]></category><category><![CDATA[ Fix]]></category><dc:creator><![CDATA[Jax]]></dc:creator><pubDate>Tue, 28 Feb 2017 00:00:00 GMT</pubDate></item><item><title><![CDATA[Hey this is my blog]]></title><description><![CDATA[<div class="paragraph">
<p>This is my blog for various programming findings and will act as an archive for tips and tricks I find with technology.</p>
</div>]]></description><link>https://jsiu22.github.io/blog/2017/02/14/Hey-this-is-my-blog.html</link><guid isPermaLink="true">https://jsiu22.github.io/blog/2017/02/14/Hey-this-is-my-blog.html</guid><dc:creator><![CDATA[Jax]]></dc:creator></item></channel></rss>