<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://alicansag.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://alicansag.github.io/" rel="alternate" type="text/html" /><updated>2026-03-29T13:22:36+00:00</updated><id>https://alicansag.github.io/feed.xml</id><title type="html">Can’s Blog</title><subtitle>Thoughts and experiments</subtitle><author><name>alicansag</name></author><entry><title type="html">Getting Reverse Shell in crAPI - Part I</title><link href="https://alicansag.github.io/2026/03/29/crApi/" rel="alternate" type="text/html" title="Getting Reverse Shell in crAPI - Part I" /><published>2026-03-29T00:00:00+00:00</published><updated>2026-03-29T00:00:00+00:00</updated><id>https://alicansag.github.io/2026/03/29/crApi</id><content type="html" xml:base="https://alicansag.github.io/2026/03/29/crApi/"><![CDATA[<h3 id="introduction">Introduction</h3>
<hr />

<p>Recently, I’ve started to play with <a href="https://github.com/OWASP/crAPI">OWASP crAPI</a> (completely ridiculous API) to help me prepare for INE eWPTX certification. There are a lot of vulnerable apps and environments (Juice shop, Multillidae, DVWA, WebGoat and so on) to get hands-on experience in application security testing in a safe way. However crAPI got my attention because it is designed specifically for API security tests and includes modern features (like LLM, email and OTP integrations).</p>

<h3 id="security-assessment-of-video-upload-feature">Security Assessment of Video Upload Feature</h3>
<hr />

<p>During my inspection on video upload feature of crAPI, I realized some sensitive data is being returned (<code class="language-plaintext highlighter-rouge">conversion_params</code>). This data exposure weakness is also known as <a href="https://cwe.mitre.org/data/definitions/213.html">CWE-213</a>.</p>

<p><img src="/assets/images/crapi-upload-0.png" alt="upload-0" /></p>

<p>During testing to change video name feature, I suspected that it may also be vulnerable to mass assignment (see <a href="https://cwe.mitre.org/data/definitions/915.html">CWE-915</a> and <a href="https://owasp.org/API-Security/editions/2023/en/0xa3-broken-object-property-level-authorization/">BOPLA in OWASP API Security Top 10</a>). I wanted to check if the request body was being passed directly into database query (without stripping out the properties other than <code class="language-plaintext highlighter-rouge">videoName</code>).</p>

<p><img src="/assets/images/crapi-upload-1.png" alt="upload-1" />
<img src="/assets/images/crapi-upload-2.png" alt="upload-2" /></p>

<h3 id="verifying-the-vulnerability">Verifying The Vulnerability</h3>
<hr />

<p>To test if other parameters are passed to database query, I injected <code class="language-plaintext highlighter-rouge">conversion_params</code> into the request (by intercepting and manipulating the communication between browser and web server via Burp Suite).</p>

<p>I assumed those params are passed to a video processing tool like <code class="language-plaintext highlighter-rouge">ffmpeg</code>, so tested if it is being executed directly. I’ve appended <code class="language-plaintext highlighter-rouge">&amp;&amp; sleep 10</code> to test command injection weakness (CWE-78) along with mass assignment. I assumed the conversion operation is done by combining command and conversion params (something like: <code class="language-plaintext highlighter-rouge">ffmpeg ${conversion_params} -i ${video_name} ${video_output_name}</code>).</p>

<p>As you can see the image below, <strong>user input is stored as it is</strong> in the database. Hence I confirmed that it is vulnerable to mass assignment.</p>

<p><img src="/assets/images/crapi-upload-3.png" alt="upload-3" /></p>

<p>If it did wait 10 seconds to return the response, I would prepare my script and listening ports to get a reverse shell inside the web server. But the response returned within a second.</p>

<p>At this point, I am thinking that this video conversion is not done in this endpoint, and most probably done by a separate worker process. This is a <strong>logical thing to do in a good system design</strong>, since video conversion may take a while and users do not need to wait for it.</p>

<p>Then I saw the “<em>Share video with community</em>” button in the application. When I clicked, browser sent a <code class="language-plaintext highlighter-rouge">GET</code> request to <code class="language-plaintext highlighter-rouge">/identity/api/v2/user/videos/convert_video?video_id=52</code> endpoint and it returned following error response:</p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
    </span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Thi-S endpoint S-hould be accessed only inte-Rnally. -Fine? , endpoint_url http://crapi-identity:8080/identity/api/v2/user/videos/convert_video"</span><span class="p">,</span><span class="w">
    </span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="mi">403</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p><img src="/assets/images/crapi-upload-4.png" alt="upload-4" />
<img src="/assets/images/crapi-upload-5.png" alt="upload-5" /></p>

<p>crAPI creators gave a hint for the next step (see abbreviation for <a href="https://owasp.org/Top10/2021/A10_2021-Server-Side_Request_Forgery_%28SSRF%29/">S-S-R-F</a> - Server Side Request Forgery), which supports validity of my assumptions.</p>

<h3 id="wrap-up">Wrap Up</h3>
<hr />

<p>Up to this point, I’ve confirmed that <code class="language-plaintext highlighter-rouge">POST /identity/api/v2/user/videos</code> endpoint has Broken Object Property Level Authorization vulnerabilities (excessive data exposure and mass assignment weaknesses are exploitable). These types of vulnerabilities can be prevented by mapping and validating user input, specifying expected structure (via Data Transfer Objects - DTOs).</p>

<p>Also see <a href="https://cheatsheetseries.owasp.org/cheatsheets/Mass_Assignment_Cheat_Sheet.html">OWASP Cheatsheet for Mass Assignment</a> for understanding and preventing such vulnerabilities.</p>

<p>The next steps can be:</p>
<ul>
  <li>finding some other part of the application which is vulnerable to SSRF,</li>
  <li>then get a reverse shell by chaining this vulnerable video upload feature.</li>
</ul>

<p>I will cover these in next blog posts.</p>]]></content><author><name>alicansag</name></author><summary type="html"><![CDATA[Introduction]]></summary></entry><entry><title type="html">Creating a swap space in Linux</title><link href="https://alicansag.github.io/2024/04/03/linux-swap/" rel="alternate" type="text/html" title="Creating a swap space in Linux" /><published>2024-04-03T00:00:00+00:00</published><updated>2024-04-03T00:00:00+00:00</updated><id>https://alicansag.github.io/2024/04/03/linux-swap</id><content type="html" xml:base="https://alicansag.github.io/2024/04/03/linux-swap/"><![CDATA[<p>Tried Digital ocean’s droplets, the cheapest ones.</p>

<p>And tried to install <a href="https://n8n.io/">n8n</a> on them via npm and had following error:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
</code></pre></div></div>

<p>As error log tells, I need to tell npm to use less memory. I set heap ceiling limit for node with <code class="language-plaintext highlighter-rouge">NODE_OPTIONS="--max-old-space-size=512"</code>. Still receiving the same error.</p>

<p>Then I figured out that there is no swap space set in the VM! Probably digital ocean does not set it up since my droplet’s RAM is too low.</p>

<p>Anyway, I have learned <a href="https://gist.github.com/rhythmic1234/98f12fa7aa4f97edb9e729f897a61f78">how to setup swap space</a> in Ubuntu 23.10 today.</p>

<p>After a while, I found out there is a guide on <a href="https://docs.n8n.io/hosting/installation/server-setups/digital-ocean/">setting up n8n on a Digital ocean droplet with docker</a>. Yet, I’ve learned something today 🙃</p>]]></content><author><name>alicansag</name></author><summary type="html"><![CDATA[Tried Digital ocean’s droplets, the cheapest ones.]]></summary></entry><entry><title type="html">Coffee Shop Loyality Program - Part I</title><link href="https://alicansag.github.io/2024/03/24/coffee-shop-loyality-part-1/" rel="alternate" type="text/html" title="Coffee Shop Loyality Program - Part I" /><published>2024-03-24T00:00:00+00:00</published><updated>2024-03-24T00:00:00+00:00</updated><id>https://alicansag.github.io/2024/03/24/coffee-shop-loyality-part-1</id><content type="html" xml:base="https://alicansag.github.io/2024/03/24/coffee-shop-loyality-part-1/"><![CDATA[<h1 id="1-problem">1) Problem</h1>
<p>Today, I went to my local coffee shop and ordered a latte. The staff asked me to mark the loyality card if I have any. I told her that I have it but left it at home. Then she told me that every customer tells the same thing and she could mark it in my next appearance. This led me questioning whether such thing (forgetting loyality card at home) can be prevented.</p>

<p>I don’t want to carry anything more at my wallet or bag, so keeping the card with me all the time is not an option for me (obviously for others too).</p>

<p>But everybody carries their phones all the time, so can’t we use those? Starbucks developed a mobile app for this but why develop another for my local coffee shop?</p>

<p>Then I wondered if blockchain can be used. This would be a challange for me to build a complete product (at least MVP version).</p>

<p>So in this post, I am sharing my chain of thought for the problem: how I can develop a customer loyality program using blockchain.
In future posts, I will be sharing my experiences on development of this program.</p>

<h1 id="2-keywords">2) Keywords</h1>
<p>A quick search led me some of these keywords:</p>
<ul>
  <li>loyality program / token</li>
  <li>web3 loyality scheme</li>
  <li>token redemption (for discounts, free products, special offers)</li>
  <li>NFT</li>
</ul>

<h1 id="3-related-links">3) Related links</h1>
<ul>
  <li><a href="https://www2.deloitte.com/us/en/pages/financial-services/articles/making-blockchain-real-customer-loyalty-rewards-programs.html">Making blockchain real for customer loyalty rewards programs - Deloitte</a></li>
  <li><a href="https://news.fuse.io/revolutionizing-loyalty-programs-the-power-of-web3-and-blockchain/">The Power of Web3 and Blockchain</a></li>
  <li><a href="https://blog.usetada.com/en/companies-adopting-blockchain-loyalty-programs">Other companies adopting loyality programs</a> - like airlines, restaurants</li>
  <li><a href="https://blaize.tech/services/blockchain-integration/blockchain-loyalty-programs/">Raise of blockchain loyality programs</a></li>
</ul>

<h1 id="4-requirements">4) Requirements</h1>
<p>These requirements are determined solely by me, without gathering with customers or coffee shop’s owner.</p>

<ul>
  <li>low transaction fees (less than 50 cents)</li>
  <li>fast (transactions are completed within less than one minute)</li>
  <li>mobile phones shall be used, but no custom mobile app shall be developed
    <ul>
      <li>only frontend as a web app shall be developed</li>
    </ul>
  </li>
  <li>user friendly, frictionless onboarding for people who don’t have experience with any blockchain technologies.
    <ul>
      <li>
        <p>users should be guided for wallet creation &amp; usage, and those operations should be simplest</p>
      </li>
      <li>
        <p>common wallet apps like Metamask is preferred since many of the customers do not have enough experience, nor want to install another app to their phones</p>
      </li>
    </ul>
  </li>
  <li>easy to use by coffee shop personnel who will verify the customers’ rewards</li>
  <li>all transaction fees shall be paid by coffee shop’s wallet</li>
  <li>coffee shop staff can have their own accounts different than coffee shop owner’s</li>
  <li>easy and fast development</li>
</ul>

<h1 id="5-so-which-blockchain-platform-is-best-for-such-use-cases">5) So which blockchain platform is best for such use cases?</h1>
<p>Quick search using ChatGPT, several projects are offered such as;</p>
<ul>
  <li><strong>Stellar</strong></li>
  <li><strong>Solana</strong></li>
  <li><strong>Polygon</strong></li>
  <li><strong>Binance Smart Chain (BSC)</strong></li>
  <li><strong>EOSIO</strong></li>
  <li><strong>Tezos</strong></li>
</ul>

<p>I know this is a very bad architectural decision making but I am opting out the projects that I do not have prior knowledge. Keeping Solana, Polygon and BSC.</p>

<p>All of them provide low transaction fees and high speed. But in terms of customer onboarding, Polygon and BSC are better alternatives since they are supported in Metamask. But for Solana, another mobile app needs to be installed as a wallet app, which can cause friction. Remember, one of my requirement is easy integration for people with little experience in blockchain technologies.</p>

<p>However, I stumbled another wallet called Phantom, which can replace Metamask, I will look into that. If Phantom wallet is used, then Solana can still be an option.</p>

<p>BSC has an advantage since probably most of customers have Binance app installed in Turkey. However, Binance has a separate app (Binance TR) to operate in Turkey, which does not support such features yet. Hence, I cannot use this advantage.</p>

<p>So Polygon is the final candidate. It has a good community, which will make my development easier.</p>

<h1 id="6-before-implementation">6) Before implementation</h1>

<p>I prefer to determine example use cases before doing any development.</p>

<p>After that, I want to visualize those operations from each user (role)’s perspective. Hence, I prefer starting front-end mockups before any backend development.</p>

<p>I did not generate any mockups yet, since I need to speculate about possible features first.</p>

<h1 id="7-minimal-viable-product">7) Minimal Viable Product</h1>

<p>Starting from frontend, only single feature</p>

<p>⇒ <em>after each 10 product purchase, customers can redeem 1 free product as a reward</em></p>

<p>I can develop a responsive Next.js app and free Vercel deployments can be used!</p>

<p>Basic features:</p>
<ul>
  <li>1 product type (generic like “coffee”, not specific like “americano” or “latte”)</li>
  <li>3 user roles: customer, staff, shop owner</li>
  <li>Each user is initially hard-coded. Customers can:
    <ul>
      <li>purchase a product</li>
      <li>redeem a reward</li>
    </ul>
  </li>
  <li>Conditions for reward redemption:
    <ol>
      <li>Calculate non-redeemed reward count
        <ul>
          <li>customer may have purchased 32 products with no redemption, so they can have total 3 free products (in any time)
            <ul>
              <li>example flow for tests ⇒ 32 purchase + 1 redemption + 1 purchase + 1 redemption + 7 purchase + 1 redemption + 1 redemption</li>
            </ul>
          </li>
        </ul>
      </li>
      <li>If user has not-redeemed reward → allow redemption:
        <ul>
          <li>coffee shop’s wallet will pay the fee for NFT minting or transaction</li>
        </ul>
      </li>
    </ol>
  </li>
</ul>

<h1 id="8-next-features">8) Next Features</h1>

<ul>
  <li>Onboarding for users without a wallet/metamask etc
    <ul>
      <li>QR code scanning</li>
    </ul>
  </li>
  <li>Customer and staff can see
    <ul>
      <li>Customer’s purchase and reward history</li>
    </ul>
  </li>
  <li>Staff
    <ul>
      <li>Can view history of particular customer</li>
      <li>Verify/approve reward by scanning a QR after customer has successfully redeemed the reward</li>
      <li>Add/remove new products:
        <ul>
          <li>If carrot cake is added to the menu, staff can insert to blockchain (or remove it)</li>
        </ul>
      </li>
      <li>Generate different reward types:
        <ul>
          <li>50% discount for products X, Y, or Z</li>
          <li>For product X: 1 purchase - 1 free</li>
        </ul>
      </li>
      <li>generate time-limited rewards:
        <ul>
          <li>50% discount on all cakes until the end of the day/tomorrow night</li>
          <li>1 free americano for any product purchase between April 20 and 27</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>Owner
    <ul>
      <li>All things staff can do, plus:
        <ul>
          <li>Add/remove staffs</li>
          <li>Deposit or withdraw money from/to coffee shop wallet</li>
        </ul>
      </li>
      <li>See stats like:
        <ul>
          <li>How many rewards have given in this month</li>
          <li>How many purchases have done in this month</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

<h1 id="9-next">9) Next</h1>
<ul>
  <li>Should I use Phantom wallet instead of Metamask?</li>
  <li>Why <a href="https://www.ccn.com/news/starbucks-odyssey-nft-beta-web3s-potential-bolster-loyalty-programs/">starbucks is dropping its nft program</a>?</li>
  <li>Similar projects in Github that are already developed</li>
  <li>See <a href="https://www.openloyalty.io/insider/the-rise-of-blockchain-loyalty-programs-with-cezary-olejarczyk">Open Loyality</a> - uses Hyperledger fabric</li>
  <li>Find out <strong>the average fee in peak times</strong> to calculate possible cost</li>
</ul>]]></content><author><name>alicansag</name></author><summary type="html"><![CDATA[1) Problem Today, I went to my local coffee shop and ordered a latte. The staff asked me to mark the loyality card if I have any. I told her that I have it but left it at home. Then she told me that every customer tells the same thing and she could mark it in my next appearance. This led me questioning whether such thing (forgetting loyality card at home) can be prevented.]]></summary></entry><entry><title type="html">A License Generation and Verification System - Part I</title><link href="https://alicansag.github.io/2024/03/17/license-part-1/" rel="alternate" type="text/html" title="A License Generation and Verification System - Part I" /><published>2024-03-17T00:00:00+00:00</published><updated>2024-03-17T00:00:00+00:00</updated><id>https://alicansag.github.io/2024/03/17/license-part-1</id><content type="html" xml:base="https://alicansag.github.io/2024/03/17/license-part-1/"><![CDATA[<h1 id="1-intro">1) Intro</h1>
<hr />
<p>Recently, I’ve been working on a licensing mechanism that should work offline (client’s on-prem environment without internet access).
This is an age-old problem, I remember variety of cracking methods &amp; keygens in Windows OS and games.
But hopefully, using the concepts I have learned in my cyber security masters degree, I came up with a solution. I want to share a simplified version of it.</p>

<p>In this post, I am roughly specifying the terms, requirements and ideas on the problem. In the future posts, I will share details on how &amp; why we have implemented these in a particular way.</p>

<h1 id="2-problem">2) Problem</h1>
<hr />
<ul>
  <li>We have a product that shall be installed in on-prem environments and there can be no internet access after the installation</li>
  <li>We want to control which features are enabled in customers according to the license keys that is provided by us</li>
  <li>We need to do this as secure as possible (focusing specifically: confidentiality, integrity and non-repudiation)</li>
  <li>Many month later, we may provide another license key to the customer and the verification mechanism should work just fine without an internet connection</li>
  <li>Customers should not be able to generate their own license, inject it to our product or bypass the license feature checking mechanism anyhow</li>
</ul>

<h1 id="3-defining-some-terms">3) Defining some terms</h1>
<hr />
<ul>
  <li>License feature
    <ul>
      <li>the functionality we want to enable</li>
      <li>fields such as: feature name, description, start date, expiry date, and other details (such as feature quota)</li>
    </ul>
  </li>
  <li>License document
    <ul>
      <li>a JSON formatted document including required information like start date, expiry date and enabled features</li>
      <li>if a feature is not included in license document, then it is not enabled</li>
    </ul>
  </li>
  <li>License key
    <ul>
      <li><strong>encrypted</strong> version of the license document</li>
      <li>encryption is necessary to ensure that document is generated by us, not anyone else</li>
      <li>as a side effect, encryption helps obscuring document details</li>
    </ul>
  </li>
  <li>License encryption/decryption key
    <ul>
      <li>a symmetric key that will be used during both encryption &amp; decryption of the license document</li>
    </ul>
  </li>
  <li>License certificates
    <ul>
      <li>PEM formatted X.509 certificates for storing license decryption key</li>
    </ul>
  </li>
  <li>License verification mechanism
    <ul>
      <li>checking validity of license document and certificates
        <ul>
          <li>whether certificate chaining is correct and license can be decrypted</li>
          <li>whether current date is within start-expiry date range of certificates,</li>
        </ul>
      </li>
      <li>checking whether current date is within start-expiry date range of license document,</li>
      <li>checking whether a specific feature is in the license document</li>
      <li>(optional) checking whether quota is sufficient for the specific feature</li>
    </ul>
  </li>
  <li>License feature check
    <ul>
      <li>checking whether a license feature is enabled &amp; available in the license document</li>
    </ul>
  </li>
</ul>

<h1 id="4-requirements">4) Requirements</h1>
<hr />
<h3 id="a-license-document-should-be-confidential-not-in-plaintext">A <em>license document</em> should be confidential (not in plaintext)</h3>
<p>We need an encryption mechanism to ensure confidentiality</p>

<h3 id="a-license-document-should-include-necessary-info">A <em>license document</em> should include necessary info</h3>
<ul>
  <li>Client’s basic info (like company name)</li>
  <li>Features enabled</li>
  <li>Start and expiry dates</li>
  <li>JSON format is good enough</li>
</ul>

<h3 id="a-license-document-cannot-be-tampered-if-so-it-should-be-detected">A <em>license document</em> cannot be tampered (if so, it should be detected)</h3>
<ul>
  <li>The system should accept only the documents/keys that are generated by us</li>
  <li>Again we can use cryptography for checking license’s validity</li>
  <li>Digital signatures are an option</li>
  <li>Also since a plain-text license document is a simple JSON object, JWT comes to mind</li>
  <li>A JWT can be verified easily with digital signatures</li>
</ul>

<h3 id="license-verification-mechanism-cannot-be-bypassed"><em>License verification mechanism</em> cannot be bypassed</h3>
<ul>
  <li>In other words, this is not a good idea: storing boolean fields in a Postgresql table, and using that to mark features as on or off</li>
  <li>This is not a good idea either: decrypting the <em>license key</em>, storing the plain-text <em>license document</em> in database and using that plain-text version for <em>license feature check</em>s
    <ul>
      <li>Since the product is in customer’s own environment, they can access database tables and manipulate documents there</li>
    </ul>
  </li>
  <li>Ideally, everything should be verified every time we want to check whether a feature is allowed or not
    <ul>
      <li>Every time we do a <em>license feature check</em>, we should verify every part:
        <ul>
          <li><em>license key</em> (to be decrypted and parsed as <em>license document</em>),</li>
          <li><em>license certificates</em>,</li>
          <li>and whether a specific <em>license feature</em> is in the <em>license document</em></li>
        </ul>
      </li>
      <li>In other words, we should only store encrypted data (<em>license key</em>) at rest. We should do decryption &amp; other verifications in run-time</li>
      <li>Here we are assuming that customers are not able to intercept and manipulate our product’s Linux processes in run-time</li>
    </ul>
  </li>
</ul>

<h3 id="if-customers-share-license-keys-between-each-other-the-system-should-detect-it">If customers share license keys between each other, the system should detect it</h3>
<p>If customer A shares the encrypted license key to customer B, system should reject it in customer B’s environment.
To implement this, each customer should have their own <em>license encryption/decryption key</em></p>

<hr />

<p>In the next blog posts, I will dive into the reasoning that led us to a particular solution.</p>]]></content><author><name>alicansag</name></author><summary type="html"><![CDATA[1) Intro Recently, I’ve been working on a licensing mechanism that should work offline (client’s on-prem environment without internet access). This is an age-old problem, I remember variety of cracking methods &amp; keygens in Windows OS and games. But hopefully, using the concepts I have learned in my cyber security masters degree, I came up with a solution. I want to share a simplified version of it.]]></summary></entry><entry><title type="html">Future with AI</title><link href="https://alicansag.github.io/2024/03/10/ensemble-of-ai-models/" rel="alternate" type="text/html" title="Future with AI" /><published>2024-03-10T00:00:00+00:00</published><updated>2024-03-10T00:00:00+00:00</updated><id>https://alicansag.github.io/2024/03/10/ensemble-of-ai-models</id><content type="html" xml:base="https://alicansag.github.io/2024/03/10/ensemble-of-ai-models/"><![CDATA[<h1 id="intro">Intro</h1>
<p>I have been following talks on latest developments in AI and I want to share one that caught my attention very much.</p>

<p>In <a href="https://www.youtube.com/watch?v=Se91Pn3xxSs">this talk</a>, Tom Bilyeu talks with Emad Mostaque, who is founder of Stability AI. Here I am dumping my raw notes on the talk.</p>

<p>PS: I will be using “AI” without adding “models”, “apps” or “services” afterwards. You know what I mean.</p>

<p>PS #2: I am using the emoji (👀) for marking my observations.</p>

<h1 id="keywords">Keywords</h1>
<ul>
  <li>AGI → artificial general intelligence</li>
  <li>ensemble of models</li>
  <li>talented young people</li>
  <li>open models and private data</li>
  <li>augmentation vs generalization</li>
</ul>

<h1 id="notes">Notes</h1>

<h2 id="humans-vs-ai">Humans vs AI</h2>

<blockquote>
  <p>AI won’t replace humans.
<u>Humans with AI</u> will replace the humans that don’t use AI</p>
</blockquote>

<p>Bilyeu says we will have better friends who will be AI apps. But if you have introvert personality and have problems of drug abuse, many will completely cut off from the world. Since feeling “no need”</p>

<p>Emad is using gpt4 as therapist.
Also he shares his own story: his autistic child, searched for causes (there can be multiple)
Used AI to curate latest research in the literature</p>

<h3 id="curating-knowledge">Curating knowledge</h3>

<blockquote>
  <p>Wouldn’t it be great if someone can find the latest knowledge easily?</p>
</blockquote>

<p>He states that we (humans) can never scale intelligence &amp; expertise. So, his vision is that everything will be <strong>personalized AI</strong>. Like a personal trainer.</p>

<h4 id="-talented-young-individuals">💡 Talented young individuals</h4>
<p>Another example from him on scaling intelligence &amp; expertise:</p>

<blockquote>
  <p>Imagine that you are not alone anymore.
You have a team of <strong>talented young people</strong>.
And this team <strong>can also build other teams</strong> !</p>
</blockquote>

<p>👀 This part has a huge impact on me!
Since models can do a lot of things (both correctly and incorrectly), they are <u>like new graduates</u>.
So with AI, finding and working with new graduates will take less time and resources.</p>

<h3 id="attention-is-all-you-need--inner-workings-of-gpt">Attention is all you need &amp; inner workings of GPT</h3>
<p>The working principle of GPTs: <strong>not all data is important</strong> → paying attention to most important parts of speech.</p>

<blockquote>
  <p><em>From Shannon’s info theory</em>
❝ Information is valuable only if it changes ❞</p>
</blockquote>

<p>A Gpt model is just a single file, like a codec.
Gets input and maps it to some of its content
It is just <strong>compression of intelligence</strong> or <strong>a filter</strong>
Similarly, a book is compressed knowledge</p>

<p>Emad suggests viewers to watch alphago documentary, it plays with itself → hallucinations.</p>

<h2 id="emads-aim-in-stability-ai-layer-1-for-ai">Emad’s aim in Stability AI: Layer-1 for AI</h2>
<ul>
  <li><strong>open models</strong> and <strong>private data</strong>
    <ul>
      <li>for addressing privacy concerns.</li>
      <li>models will be shared publicly, anyone can find and use them</li>
      <li>apps will be built using these open models but not sharing the data they generate with external third parties (like OpenAI).</li>
    </ul>
  </li>
  <li>models will be small &amp; specialized
    <ul>
      <li>gpt-4 has all the knowledge that it don’t need</li>
      <li>like if you won’t ask calculus, there is no need for storing those data</li>
    </ul>
  </li>
  <li>multiple models
    <ul>
      <li>as if they are <strong>teachers who specialized different areas</strong>”</li>
      <li>not just one model but an <strong>ensemble of models</strong>, a model combining other models with a right flow, chaining one’s output to another’s input
        <ul>
          <li>just like a talented youngster organizing other talented youngster in a right flow</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>He is not building big enough models that can be used as AGI <u>on purpose !</u>
    <ul>
      <li>because AGI may benefit or destroy the humanrace. Two very polarized results
        <ul>
          <li>“<em>embed guardrails, standards, make it predictable &amp; boring</em>”</li>
        </ul>
      </li>
      <li>His objective is <strong>augmentation not generalization !</strong></li>
    </ul>
  </li>
</ul>

<h2 id="effects-of-ai-on-education">Effects of AI on Education</h2>
<p>It will transform many things!
Like <strong>personalized tailored content</strong> &amp; learning methods <strong>according to your skills &amp; tendencies !</strong></p>

<blockquote>
  <p>Current education needs 1-on-1 attention. With AI, this can be done <strong>1-to-many</strong>, much more efficiently.</p>
</blockquote>

<blockquote>
  <p>Since every person is unique and different needs,
multiple AI models can guide you by adapting your needs (such as audio/visual learner etc).
So AI can generate content according to your level. 
This is also called <strong>adaptive learning</strong>.</p>
</blockquote>

<blockquote>
  <p>As well as single child can have multiple “AI teachers”, an AI model can guide multiple children, which makes teaching efficient.</p>
</blockquote>

<h2 id="on-medicine">on Medicine</h2>
<blockquote>
  <p>Doctors will be the most affected since AI will have more empathy</p>
</blockquote>

<h2 id="alignment">Alignment</h2>
<p>Emad thinks that:</p>
<blockquote>
  <p>There is <strong>no way to align outputs</strong>, we can <strong>align inputs</strong>, in other words, raising a child right</p>
</blockquote>

<p>This is done by controlling the AI, making it predictable, “boring”.
Tom says that this is not alignment, this is enslavement.</p>

<p>👀 I can related to arguments of both sides, controlled freedom is required. But wait, isn’t this concept already employed on humans? 🧐</p>

<h2 id="web3">Web3</h2>
<p>Emad says web3 has no AI in it, it is just solving problems of identity and value transfer.</p>

<p>But AI will play well with the ledger idea, since it is automating the value transfer.</p>

<blockquote>
  <p>Autonomous AI agents won’t be using banks but will use crypto.</p>
</blockquote>

<p>Tom mentions “protocol 6551” ~russian nesting doll, wallet + storing other data
But Emad says that storage value of blockchain may not be that important, but the identy concept is important.</p>

<p>I can relate to that because (currently) storage is not so efficient</p>

<h2 id="future-of-culture--society">Future of Culture &amp; Society</h2>

<blockquote>
  <p>How would your life/society/community/business change
if you have infinite <em>talented young people</em> ?</p>
</blockquote>

<p>Emad thinks AI as:</p>
<ul>
  <li><em>talented young people</em></li>
  <li>army of analysts &amp; teachers</li>
</ul>

<blockquote>
  <ul>
    <li>How will we adapt to potential widescale job loss ?</li>
    <li>What are the cults, religions and political movement over 5 to 10 years?</li>
  </ul>
</blockquote>

<p>This question is important because those will be hyper-organized/persuasive utilizing AI.
Tom says these <u>may even be started by AI</u> !</p>

<blockquote>
  <p>On the one hand, we will have youths with AI girlfriends.
On the other hand, youths that want to believe something bigger to fill the void. Here who is gonna step in?</p>
</blockquote>

<p>Emad emphasizes that we build many things around stories and whole AI discussions are built around “<strong>power of the controller who tells the story</strong>”</p>

<p>Emad also mentions <strong>positive &amp; negative liberty</strong>:</p>
<ul>
  <li>Positive → freedom to believe in any “ism”s
    <ul>
      <li>fascism, communism, islam(ism)..</li>
    </ul>
  </li>
  <li>Negative → freedom for being told what to do
    <ul>
      <li>capitalism, consumerism</li>
    </ul>
  </li>
</ul>

<p>👀 Are we really free in negative liberty? Or are we being manipulated in some other way (without our consent) ?</p>

<p>👀 I think that main difference between positive &amp; negative libery is:</p>
<ul>
  <li>in positive → we “surrender” our free will <u>with our consent</u></li>
  <li>in negative → we choose(?) what to do, but may be manipulated (i.o.w directed without our consent)</li>
</ul>

<h1 id="conclusion-">Conclusion 👀</h1>

<ul>
  <li>There shall be smaller AI models that specializes more specific areas, instead of a AGI. He calls these “talented young individuals”.
    <ul>
      <li>I remember that Daniel Miessler mentioned similar things in one of his newsteller article.</li>
    </ul>
  </li>
  <li>Businesses will transform rapidly by those who have many “talented young individuals”.</li>
  <li>Our culture is not ready for so rapid changes, we need to ask questions and think more about that.</li>
</ul>]]></content><author><name>alicansag</name></author><summary type="html"><![CDATA[Intro I have been following talks on latest developments in AI and I want to share one that caught my attention very much.]]></summary></entry><entry><title type="html">I’m Back</title><link href="https://alicansag.github.io/2024/01/01/i'm-back/" rel="alternate" type="text/html" title="I’m Back" /><published>2024-01-01T00:00:00+00:00</published><updated>2024-01-01T00:00:00+00:00</updated><id>https://alicansag.github.io/2024/01/01/i&apos;m-back</id><content type="html" xml:base="https://alicansag.github.io/2024/01/01/i&apos;m-back/"><![CDATA[<h1 id="getting-back">Getting back</h1>
<p>I’ve been trying to use Notion to make my blog posts prettier. Notion would allow me to use different page layouts, which I cannot do with markdown files. In addition to those, I wanted to use a custom domain for my blog.</p>

<p>But there were few drawbacks I did not like:</p>

<ul>
  <li>The publicly shared Notion page URL is ugly, so I want to hide that
    <ul>
      <li>So, I don’t prefer redirecting my domain to that URL.</li>
    </ul>
  </li>
  <li>Paid services like Super and Potion are expensive for me</li>
  <li>There is a cool workaround, <a href="https://fruitionsite.com/">Fruition</a>, but it is still too cumbersome for me.</li>
</ul>

<p>So I’m back to Github pages 🙃</p>]]></content><author><name>alicansag</name></author><summary type="html"><![CDATA[Getting back I’ve been trying to use Notion to make my blog posts prettier. Notion would allow me to use different page layouts, which I cannot do with markdown files. In addition to those, I wanted to use a custom domain for my blog.]]></summary></entry><entry><title type="html">Obsidian vault sync from iCloud to Google Drive</title><link href="https://alicansag.github.io/2023/05/28/icloud-to-google-drive/" rel="alternate" type="text/html" title="Obsidian vault sync from iCloud to Google Drive" /><published>2023-05-28T00:00:00+00:00</published><updated>2023-05-28T00:00:00+00:00</updated><id>https://alicansag.github.io/2023/05/28/icloud-to-google-drive</id><content type="html" xml:base="https://alicansag.github.io/2023/05/28/icloud-to-google-drive/"><![CDATA[<p>In this post, I will describe a way to do (one-way) sync of your Obsidian vault from iCloud to Google Drive.</p>

<h1 id="the-problem">The problem</h1>
<p>I use Obsidian in my iPad + mac.</p>

<p>But I want to be able to use my vault from my android phone too.</p>

<p>But trying to do two way sync by pointing to same folder is making both iCloud and gDrive unstable.</p>

<h1 id="existing-solutions">Existing solutions</h1>
<p>Obsidian Sync and other sync solutions (like MultCloud, syncToy, FolderSync) are too expensive.</p>

<h1 id="aim">Aim</h1>
<p>From my phone, I want to <strong>at least view</strong> my notes  (giving up editing).</p>

<p>So, my aim has became to do one-way sync from iCloud to Google Drive.
I will do this using my old Macbook, keeping it open and running a cron job.</p>

<h1 id="solution">Solution</h1>

<details>
  <summary>
    1- Find out location of iCloud and Google Drive
  </summary>
  
  Find out source folder in iCloud. In `~/Library/Mobile\ Documents/` folder find the folder you want to sync from iCloud.

  In my case, Obsidian data is in `iCloud~md~obsidian/Documents/Obsidian`

  Create destination folder (in Google Drive). The relative path can be like `~/Google\ Drive/My\ Drive/Obsidian/`
  
</details>

<details>
  <summary>
    2- Ensure that crontab and rsync binaries can access iCloud + Google drive folders from MacOS terminal
  </summary>
  
  We need to give **full disk access** to `crontab` and `rsync` binaries. This is required due to Apple's privacy and security policies.

  a. Go to System Preferences/Security &amp; Privacy/Privacy. Click + to add an app.
  ![adding new app](/assets/images/icloud-sync-1-macos-privacy-settings.png)

  b. Click "Cmd + Shift + g" to pick custom path (both _crontab_ and _rsync_ is in **/usr/bin/**)
![custom path selection](/assets/images/icloud-sync-1.png)
  
</details>

<details>
  <summary>
    3- Prepare the sync script using rsync
  </summary>
  
  ### Install latest rsync via brew
  Default rsync shipped in MacOS may give following [error](https://www.jafdip.com/how-to-fix-rsync-error-code-23-on-mac-os-x/):

  `rsync error: some files could not be transferred (code 23) at ...`

  So install latest rsync via brew.

  Then find the binary location, which should be: `/usr/local/opt/rsync/bin/rsync`

  (*/usr/local/opt is a symbolic link used by brew*)

  ### obsidian-sync.sh
  So our script should look like as follows:
  ```bash
  #!/bin/zsh

  OBSIDIAN_SOURCE=~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Obsidian/
  OBSIDIAN_DEST=~/Google\ Drive/My\ Drive/Obsidian/

  # Print date (for logging)
  echo "==== ===== ===="
  echo $(date)

  # synchronize files from iCloud directory to Google Drive directory
  rsync -ahv --delete $OBSIDIAN_SOURCE $OBSIDIAN_DEST

  # force iCloud to re-sync
  killall bird
  ```

  Don't forget to give execute permission to the file `chmod +x obsidian-sync.sh`
  
</details>

<details>
  <summary>
    4- Setup a cronjob to run our script every hour
  </summary>

  ```bash
  # open via `crontab -e` and type the config below
  0 * * * * ~/obsidian-sync.sh &gt; ~/obsidian-sync.log 2&gt;&amp;1
  ```
  
</details>

<details>
  <summary>
    5- Prevent Mac from sleeping to run cronjobs properly
  </summary>

  This is optional. Since I don't use my old mac, I make sure it is awake always.
</details>

<hr />

<h1 id="conclusion">Conclusion</h1>

<p>I have described a simple way to sync files from iCloud to Google Drive. I needed this for accessing my Obsidian vault in iCloud, but you can use it for any other folders you want to sync.</p>

<p>Enjoy.</p>]]></content><author><name>alicansag</name></author><summary type="html"><![CDATA[In this post, I will describe a way to do (one-way) sync of your Obsidian vault from iCloud to Google Drive.]]></summary></entry><entry><title type="html">test title</title><link href="https://alicansag.github.io/2023/05/14/test/" rel="alternate" type="text/html" title="test title" /><published>2023-05-14T00:00:00+00:00</published><updated>2023-05-14T00:00:00+00:00</updated><id>https://alicansag.github.io/2023/05/14/test</id><content type="html" xml:base="https://alicansag.github.io/2023/05/14/test/"><![CDATA[<p>This is a test post for first page.
Yay! 🥳</p>]]></content><author><name>alicansag</name></author><summary type="html"><![CDATA[This is a test post for first page. Yay! 🥳]]></summary></entry></feed>