<?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>DEV Community: Tony Vlček</title>
    <description>The latest articles on DEV Community by Tony Vlček (@tonyvlcek).</description>
    <link>https://dev.to/tonyvlcek</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%2F1112356%2F489ea399-5278-458d-8f19-ac7ffae01102.jpg</url>
      <title>DEV Community: Tony Vlček</title>
      <link>https://dev.to/tonyvlcek</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tonyvlcek"/>
    <language>en</language>
    <item>
      <title>Bibliography from Mendeley to Overleaf</title>
      <dc:creator>Tony Vlček</dc:creator>
      <pubDate>Wed, 08 May 2024 11:10:13 +0000</pubDate>
      <link>https://dev.to/tonyvlcek/bibliography-from-mendeley-to-overleaf-1jaa</link>
      <guid>https://dev.to/tonyvlcek/bibliography-from-mendeley-to-overleaf-1jaa</guid>
      <description>&lt;p&gt;A cheeky (free) workaround that lets you automatically synchronize references from Mendeley to Overleaf.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setup Mendeley to automatically sync .bib file onto your local drive.&lt;/li&gt;
&lt;li&gt;Make sure that the file is synced to Google Drive (or is accessible somewhere else on the Internet).&lt;/li&gt;
&lt;li&gt;Get the URL for the raw content of the file.&lt;/li&gt;
&lt;li&gt;Import to Overleaf &lt;em&gt;From External URL&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Mendeley serves me well as an environment for collecting, organizing, reading, and highlighting PDFs. However, it can also automatically generate &lt;code&gt;.bib&lt;/code&gt; files that can then be referenced in LaTeX documents.&lt;/p&gt;

&lt;p&gt;Overleaf is a cloud-based LaTex editor. It has a free and premium version. Most of the time, you wouldn't even notice that you're using the free version. So far, I've bumped into just very few features that are part of the premium, and these are nice-to-have rather than must-have.&lt;/p&gt;

&lt;p&gt;One of these features is a built-in &lt;a href="https://www.overleaf.com/learn/how-to/How_to_link_your_Overleaf_account_to_Mendeley_and_Zotero"&gt;Mendeley integration&lt;/a&gt;. A neat feature, but I'd have a hard time justifying the ~$17/month just for that. Fortunately, there is a fairly simple workaround:&lt;/p&gt;

&lt;h3&gt;
  
  
  1️⃣ Setup BibTeX syncing in Mendeley
&lt;/h3&gt;

&lt;p&gt;Open up your Mendeley desktop app, go to Tools &amp;gt; Options &amp;gt; BibTex and enable BibText Syncing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frv8rh0cip9f45m8y203b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frv8rh0cip9f45m8y203b.png" alt="BibTeX syncing settings in Mendeley App" width="672" height="235"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;BibTeX syncing settings in Mendeley AppI'm using the "per group" option so that each of my folders will have its own &lt;code&gt;.bib&lt;/code&gt; file.&lt;br&gt;
You can find more info &lt;a href="https://blog.mendeley.com/2011/10/25/howto-use-mendeley-to-create-citations-using-latex-and-bibtex/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2️⃣ Use the cloud(s)
&lt;/h3&gt;

&lt;p&gt;Make sure that the &lt;code&gt;.bib&lt;/code&gt; files that Mendeley generates are shared in some cloud storage. I'm using Google Drive in this example, but there are ways to make this work for the different cloud storage solutions.&lt;/p&gt;

&lt;p&gt;💡If you're on Linux, you can try InSync.&lt;/p&gt;

&lt;h3&gt;
  
  
  3️⃣ Get the URL of the raw file
&lt;/h3&gt;

&lt;p&gt;In Google Drive, the standard sharing link won't give you the raw content of the file. Here's the URL you &lt;code&gt;https://docs.google.com/uc?export=download&amp;amp;id=[yourFileID]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can get your FileId from the sharing link that Google generated for you (it's the long, messy part of the URL).&lt;/p&gt;

&lt;h3&gt;
  
  
  4️⃣ Import to Overleaf - From External URL
&lt;/h3&gt;

&lt;p&gt;This is the trick that finally connects the dots. In Overleaf, click Upload and select the From External URL option, pasting in the URL from the previous step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzhjaktsjd0p56graoo5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzhjaktsjd0p56graoo5.png" alt="From External URL modal in Overleaf" width="800" height="335"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;And that's it. Now you can use &lt;a href="https://www.overleaf.com/blog/532-creating-and-managing-bibliographies-with-bibtex-on-overleaf"&gt;BibTeX like you normally would&lt;/a&gt;. This time, Mendeley will sync your references to the local file, InSync will get it to the cloud, and Overleaf will pull it from the URL 👏&lt;/p&gt;

&lt;p&gt;⚠️ I haven't yet figured out how often (if ever) Overleaf pulls the file's updated content, but you have a button to check for updates, making it easy to force Overleaf to pull the newest version.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Create a User With Access to Only One Schema in CloudSQL</title>
      <dc:creator>Tony Vlček</dc:creator>
      <pubDate>Wed, 08 May 2024 10:55:46 +0000</pubDate>
      <link>https://dev.to/tonyvlcek/create-a-user-with-access-to-only-one-schema-in-cloudsql-5c07</link>
      <guid>https://dev.to/tonyvlcek/create-a-user-with-access-to-only-one-schema-in-cloudsql-5c07</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; After you create a user in Google Cloud Console, don't forget to &lt;code&gt;REVOKE 'cloudsqlsuperuser'@'%' FROM 'your-user'@'%';&lt;/code&gt; if you only want this user to access specific schemas.&lt;/p&gt;




&lt;p&gt;Creating a MySQL user via the Google Cloud Console automatically adds the &lt;code&gt;cloudsqlsuperuser&lt;/code&gt; role that allows the user access to everything on that MySQL instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SHOW&lt;/span&gt; &lt;span class="n"&gt;GRANTS&lt;/span&gt; &lt;span class="k"&gt;FOR&lt;/span&gt; &lt;span class="s1"&gt;'user-from-gcp-console'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'%'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;------------------------------------------------------------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;Grants&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;user&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;gcp&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;console&lt;/span&gt;&lt;span class="o"&gt;@%&lt;/span&gt;                          &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;------------------------------------------------------------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;USAGE&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="nv"&gt;`user-from-gcp-console`&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="nv"&gt;`%`&lt;/span&gt;           &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="nv"&gt;`cloudsqlsuperuser`&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="nv"&gt;`%`&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="nv"&gt;`user-from-gcp-console`&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="nv"&gt;`%`&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;------------------------------------------------------------+&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Google mentions this in the &lt;a href="https://cloud.google.com/sql/docs/mysql/users#cloudsqlsuperuser"&gt;About MySQL users&lt;/a&gt; article of their Knowledge Base.&lt;/p&gt;

&lt;p&gt;To create a user with access to only one schema, you either need to create the user without the console by running something along the lines of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="s1"&gt;'your-user'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'%'&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt;
    &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="s1"&gt;'mysql_native_password'&lt;/span&gt;
    &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;some-strong-password&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;your&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;schema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="s1"&gt;'your-user'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'%'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or by creating the user via the console but then not forgetting to remove the &lt;code&gt;cloudsqlsuperuser&lt;/code&gt; role:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Create a user via the Google Cloud Console

REVOKE 'cloudsqlsuperuser'@'%' FROM 'your-user'@'%';
GRANT ALL ON your-schema.* TO 'your-user'@'%';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Closing notes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The user is uniquely identified by the user name and the host. &lt;code&gt;%&lt;/code&gt; stands for any host, the commands might differ when you’re limiting the user access only to some hosts (e.g. &lt;code&gt;your-user%localhost&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;You might make use of the Cloud SQL Proxy in combination with IAM instead. Read more in the &lt;a href="https://cloud.google.com/sql/docs/mysql/iam-authentication"&gt;IAM Authentication&lt;/a&gt; article.&lt;/li&gt;
&lt;li&gt;There is now also the &lt;a href="https://cloud.google.com/sql/docs/mysql/manage-data-using-studio"&gt;Cloud SQL Studio&lt;/a&gt; [in preview] that might come in handy.&lt;/li&gt;
&lt;li&gt;More info about user management in MySQL db &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>googlecloud</category>
      <category>mysql</category>
      <category>cloudsql</category>
    </item>
  </channel>
</rss>
