<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Lyner Lim</title>
    <description>The latest articles on Forem by Lyner Lim (@lynerlwl).</description>
    <link>https://forem.com/lynerlwl</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2276744%2F378cd623-9c80-43e5-b7b2-538eea6c5801.jpeg</url>
      <title>Forem: Lyner Lim</title>
      <link>https://forem.com/lynerlwl</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/lynerlwl"/>
    <language>en</language>
    <item>
      <title>MariaDB - can log in via the command line but not through app like TablePlus</title>
      <dc:creator>Lyner Lim</dc:creator>
      <pubDate>Tue, 04 Mar 2025 08:54:48 +0000</pubDate>
      <link>https://forem.com/lynerlwl/mariadb-can-log-in-via-the-command-line-but-not-through-app-like-tableplus-icj</link>
      <guid>https://forem.com/lynerlwl/mariadb-can-log-in-via-the-command-line-but-not-through-app-like-tableplus-icj</guid>
      <description>&lt;p&gt;For MariaDB older than 10.4&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SET PASSWORD FOR 'root'@'localhost' = PASSWORD('NewPassword');
FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SET PASSWORD FOR 'root'@'localhost' = PASSWORD('NewPassword');
FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>mariadb</category>
    </item>
    <item>
      <title>Python - datetime as filename</title>
      <dc:creator>Lyner Lim</dc:creator>
      <pubDate>Tue, 04 Mar 2025 07:40:58 +0000</pubDate>
      <link>https://forem.com/lynerlwl/python-datetime-as-filename-2jep</link>
      <guid>https://forem.com/lynerlwl/python-datetime-as-filename-2jep</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;filename = f'{datetime.now():%Y-%m-%d-%H%M}'

with open(f'{filename}.txt', 'w') as file:
    file.write('hello')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
    </item>
    <item>
      <title>Tweepy - Twitter Data Scraping in 2025</title>
      <dc:creator>Lyner Lim</dc:creator>
      <pubDate>Tue, 04 Mar 2025 06:37:48 +0000</pubDate>
      <link>https://forem.com/lynerlwl/twitter-data-scraping-using-tweepy-in-2025-c5p</link>
      <guid>https://forem.com/lynerlwl/twitter-data-scraping-using-tweepy-in-2025-c5p</guid>
      <description>&lt;p&gt;Note that to select &lt;strong&gt;Read and write&lt;/strong&gt; in &lt;strong&gt;App permissions&lt;/strong&gt; under &lt;strong&gt;User authentication settings&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;client = tweepy.Client(
    bearer_token=BREARER,
    consumer_key=API_KEY,
    consumer_secret=API_KEY_SECRET,
    access_token=ACCESS_TOKEN,
    access_token_secret=ACCESS_TOKEN_SECRET,
    return_type = dict,
    wait_on_rate_limit = True
)

response = client.search_recent_tweets(
    "artifical intelligence OR machine learning lang:en",
    max_results = 10,
    tweet_fields = ['author_id','created_at','text']
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>twitter</category>
    </item>
    <item>
      <title>Git - RPC failed; HTTP 400 curl 22 The requested URL returned error: 400</title>
      <dc:creator>Lyner Lim</dc:creator>
      <pubDate>Wed, 06 Nov 2024 06:46:10 +0000</pubDate>
      <link>https://forem.com/lynerlwl/how-to-solve-git-error-rpc-failed-http-400-curl-22-the-requested-url-returned-error-400-5mf</link>
      <guid>https://forem.com/lynerlwl/how-to-solve-git-error-rpc-failed-http-400-curl-22-the-requested-url-returned-error-400-5mf</guid>
      <description>&lt;p&gt;In my case, this error occurred because I attempted to push a file size of 30MB. We resolved this issue by increasing Git’s HTTP buffer size to accommodate larger pushes. Say we set the size to 150mb, using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;git config --global http.postBuffer 150000000

git config --global --get http.postBuffer
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After entering these two lines, our push should work successfully.&lt;/p&gt;

</description>
      <category>git</category>
    </item>
    <item>
      <title>Ubuntu - Enter sudo Password in a Single Command</title>
      <dc:creator>Lyner Lim</dc:creator>
      <pubDate>Sat, 26 Oct 2024 02:15:09 +0000</pubDate>
      <link>https://forem.com/lynerlwl/how-to-enter-your-password-for-sudo-in-a-single-command-2nfi</link>
      <guid>https://forem.com/lynerlwl/how-to-enter-your-password-for-sudo-in-a-single-command-2nfi</guid>
      <description>&lt;p&gt;If you’re using the terminal on Linux or Mac, &lt;code&gt;echo &amp;lt;password&amp;gt; | sudo -S &amp;lt;command&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you’re doing this programmatically, for example in Python, &lt;code&gt;os.system(f'echo {password} | sudo -S {command}')&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Troubleshooting: curl/wget Fetching HTML Instead of Files</title>
      <dc:creator>Lyner Lim</dc:creator>
      <pubDate>Sat, 26 Oct 2024 01:40:20 +0000</pubDate>
      <link>https://forem.com/lynerlwl/troubleshooting-curlwget-fetching-html-instead-of-files-1m44</link>
      <guid>https://forem.com/lynerlwl/troubleshooting-curlwget-fetching-html-instead-of-files-1m44</guid>
      <description>&lt;p&gt;Have you ever tried to download a file using curl or wget, only to end up with an HTML page instead? It’s likely that the URL isn’t pointing directly to the file. Let’s use downloading a file from GitHub as an example.&lt;/p&gt;

&lt;p&gt;If you just click on the file like this link (&lt;a href="https://github.com/docker/docker-install/blob/master/install.sh" rel="noopener noreferrer"&gt;https://github.com/docker/docker-install/blob/master/install.sh&lt;/a&gt;), right click to inspect and you will see it is in html.&lt;/p&gt;

&lt;p&gt;What we should do is click on the Raw to get this link (&lt;a href="https://raw.githubusercontent.com/docker/docker-install/refs/heads/master/install.sh" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/docker/docker-install/refs/heads/master/install.sh&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;Now, &lt;code&gt;wget https://raw.githubusercontent.com/docker/docker-install/refs/heads/master/install.sh&lt;/code&gt; or &lt;code&gt;curl -O https://raw.githubusercontent.com/docker/docker-install/refs/heads/master/install.sh&lt;/code&gt; will download the install.sh file to your local directory.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
