<?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: schollii</title>
    <description>The latest articles on DEV Community by schollii (@schollii).</description>
    <link>https://dev.to/schollii</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%2F132168%2F9776921b-6bea-4366-a8be-503ab96e54ee.jpg</url>
      <title>DEV Community: schollii</title>
      <link>https://dev.to/schollii</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/schollii"/>
    <language>en</language>
    <item>
      <title>See System Restarts in 3 clicks (after one-time setup)</title>
      <dc:creator>schollii</dc:creator>
      <pubDate>Thu, 13 Oct 2022 15:59:31 +0000</pubDate>
      <link>https://dev.to/schollii/see-system-restarts-in-3-clicks-after-one-time-setup-1a6e</link>
      <guid>https://dev.to/schollii/see-system-restarts-in-3-clicks-after-one-time-setup-1a6e</guid>
      <description>&lt;p&gt;Frustrating how it is so &lt;em&gt;non-obvious&lt;/em&gt; to find when a Windows system has rebooted! I should just have to click a couple of buttons and have that information easily browsable. &lt;/p&gt;

&lt;p&gt;The following setup, once complete, will make this info only a couple of mouse clicks away. On Windows 11: (the first and last steps are slightly different on earlier versions of Windows, but you should not have any trouble figuring it out):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;open &lt;code&gt;Event Viewer&lt;/code&gt; (which you can find via the Search box or magnifying glass in Windows menu)
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I_Re81jC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ulagw4the4fvg71zz9rc.png" alt="Search for Event Viewer" width="880" height="826"&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HvgURMwF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6zwli1oq2hgkhw5dpnt3.png" alt="Event Viewer Window" width="880" height="469"&gt;
&lt;/li&gt;
&lt;li&gt;expand the &lt;code&gt;Windows Logs&lt;/code&gt;, right-click the &lt;code&gt;System&lt;/code&gt; item, select &lt;code&gt;Create Custom View&lt;/code&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7-z-dqs8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r7n3qpx8o4qpo4j83ecs.png" alt="Select Create Custom View on System" width="477" height="494"&gt;
&lt;/li&gt;
&lt;li&gt;where it says &lt;code&gt;&amp;lt;All Event IDs&amp;gt;&lt;/code&gt;, enter &lt;code&gt;41,1074,6006,6008&lt;/code&gt; and click OK
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7VgyIZ6X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bx8vhmu7in1kgmwsc1vw.png" alt="Filter Window for Custom View" width="678" height="689"&gt;
&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;Save Filter to Custom View&lt;/code&gt; dialog will appear; name the view something like &lt;code&gt;System Restarts&lt;/code&gt; and click OK.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rx85kjh0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g4sw7mft6a3dafozn80c.png" alt="Name the Filter" width="491" height="420"&gt;
&lt;/li&gt;
&lt;li&gt;(Optional) To group by &lt;em&gt;day&lt;/em&gt; (very handy), right-click the new view in &lt;code&gt;Custom Views&lt;/code&gt;, then &lt;code&gt;View&lt;/code&gt; -&amp;gt; &lt;code&gt;Group by&lt;/code&gt; -&amp;gt; &lt;code&gt;Date and Time&lt;/code&gt; 
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3B-AuTw1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ilus2xke34vpkdo3t9y.png" alt="Group by Day" width="880" height="836"&gt;
&lt;/li&gt;
&lt;li&gt;On the desktop Task bar, while the &lt;code&gt;Event Viewer&lt;/code&gt; window is still open, right-click the &lt;code&gt;Event Viewer&lt;/code&gt; icon and select &lt;code&gt;Pin to Taskbar&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now seeing these restart-related events is a couple of clicks: click the &lt;code&gt;Event Viewer&lt;/code&gt; in task bar, expand &lt;code&gt;Custom Views&lt;/code&gt;, click &lt;code&gt;System Restarts&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;My &lt;code&gt;Event Viewer&lt;/code&gt; now looks like this: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OV0Bt3QE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a2ioho1td0bujmsehzin.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OV0Bt3QE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a2ioho1td0bujmsehzin.png" alt="Event Viewer with new Restarts Custom View" width="880" height="907"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Eg, my last restart shows a &lt;code&gt;User32&lt;/code&gt; event type (1074): &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;for the following reason: Operating System: Service pack (Planned)&lt;br&gt;
 Reason Code: 0x80020010&lt;br&gt;
 Shutdown Type: restart&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Whereas the previous event shows a &lt;code&gt;Kernel-Power&lt;/code&gt; event marked &lt;code&gt;Critical&lt;/code&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The system has rebooted without cleanly shutting down first. This error could be caused if the system stopped responding, crashed, or lost power unexpectedly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Have fun!&lt;/p&gt;

</description>
      <category>windows</category>
      <category>restart</category>
      <category>reboot</category>
      <category>events</category>
    </item>
    <item>
      <title>Using jq to find the latest master tag of an AWS ECR repository</title>
      <dc:creator>schollii</dc:creator>
      <pubDate>Thu, 15 Apr 2021 01:13:01 +0000</pubDate>
      <link>https://dev.to/schollii/using-jq-to-find-the-latest-master-tag-of-an-aws-ecr-repository-25jg</link>
      <guid>https://dev.to/schollii/using-jq-to-find-the-latest-master-tag-of-an-aws-ecr-repository-25jg</guid>
      <description>&lt;p&gt;Lately I've had to use jq a few times and got to understand the power of its pipe system. Here is an example of how to get the latest docker image tag in a specific docker repo of AWS ECR. &lt;/p&gt;

&lt;p&gt;Firstly you have to know that &lt;code&gt;aws ecr describe-images --repository-name $repo_name&lt;/code&gt; returns a json object which consists of a list of objects, each object looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  {
    "registryId": ...,
    "repositoryName": ...,
    "imageDigest": "sha256:...",
    "imageTags": [
      "..."
    ],
    "imageSizeInBytes": ...,
    "imagePushedAt": ...,
    "imageManifestMediaType": "application/...",
    "artifactMediaType": "application/..."
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not all objects have an &lt;code&gt;imageTags&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Further requirements: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I don't want objects that have a non-master-branch tag (they have "dev" in their tag)&lt;/li&gt;
&lt;li&gt;I am only interested in the first tag of each object&lt;/li&gt;
&lt;li&gt;I want to output the tag in a form that I can consume in a script later, in my case &lt;code&gt;REPO_NAME=tag&lt;/code&gt; where &lt;code&gt;REPO_NAME&lt;/code&gt; is an environment variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ecr describe-images --repository-name $repo_name  | jq '.[] | map(select(has("imageTags"))) | sort_by(.imagePushedAt) | map(select(.imageTags[0] | contains("dev") | not)) | .[-1] | [(.repositoryName | gsub("-";"_") | ascii_upcase), .imageTags[0]] | join("=")'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I explain each line (the following block of code will not run as-is due to the comments; use the above snippet instead):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  repo_name=...
  aws ecr describe-images --repository-name $repo_name | 
    # don't want quotes around the final output so -r:
    jq -r '
    # loop over all objects of the list:
    .[] 
    # select those that have imageTags:
    | map(select(has("imageTags")))
    # filter out those that have "dev" in their tag:
    | map(select(.imageTags[0] | contains("dev") | not))
    # sort remaining ones by push date:
    | sort_by(.imagePushedAt)
    # keep only the most recent one
    | .[-1] 
    # create pair based on fields of the selected object
    | [
         # 1st is env var name for the repo: all upper, and underscores:
         (.repositoryName | gsub("-"; "_") | ascii_upcase), 
         # 2nd is the tag itself:
         .imageTags[0]
      ]
    # format items of the pair into ENV_VAR_NAME=tag:
    | join("=")'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MY_REPO_NAME=2021.03.22-9941301
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Create and Merge Pull Requests Programmatically in BitBucket</title>
      <dc:creator>schollii</dc:creator>
      <pubDate>Mon, 03 Aug 2020 23:05:31 +0000</pubDate>
      <link>https://dev.to/schollii/create-and-merge-pull-requests-programmatically-in-bitbucket-1a1f</link>
      <guid>https://dev.to/schollii/create-and-merge-pull-requests-programmatically-in-bitbucket-1a1f</guid>
      <description>&lt;p&gt;On this one large project the bitbucket account has a large number of git repos in Atlassian BitBucket Cloud. Sometimes for one JIRA ticket, we need to fix code across a whole bunch of repos, say to change the URL for a server because it was not parametrized, or to adopt a new naming convention. With JetBrains IDE (like IntelliJ, PyCharm, etc), it’s easy to do a bulk commit of all repos for that one change as you can use the same commit message, same referenced JIRA ticket number etc. A couple of button clicks and you’re done that part, piece of cake. Or just use a for loop in bash if you prefer to work in terminal.&lt;/p&gt;

&lt;p&gt;But then you have to create a pull request for each repo, ouch!! Each one will likely have the same set of reviewers, same description, etc. I have no patience for that type of repetitive work. And pycharm (as of 2020.1) provides no assistance here. &lt;/p&gt;

&lt;p&gt;After a bit of digging and trial and error, I found a convenient way to create pull requests programmatically using bitbucket’s REST API, and after they have all be reviewed and approved, to merge them. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create one PR in the web UI on one of the repos. Write a useful title, description, select all the reviewers you might need across all repos. Don’t forget to checkmark the "Delete branch on merge" if that is part of your process. &lt;/li&gt;
&lt;li&gt;After the PR is created, note its number in the URL (let's call it &lt;code&gt;PR_NUMBER_JUST_CREATED&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From a terminal shell, use this to get the JSON of that PR into a file. Note that your username is the one defined in your Profile Settings, and can be changed. For me it is not the name I use to login with.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BB_URL=https://api.bitbucket.org/2.0/repositories/YOUR_ORG_NAME
PR_NUMBER_JUST_CREATED=&amp;lt;PR_NUMBER_JUST_CREATED&amp;gt;
curl $BB_URL/REPO_NAME/pullrequests/$PR_NUMBER_JUST_CREATED \
    -u USERNAME:PASSWORD | jq . &amp;gt; pr_get.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Edit the file to remove most elements of it, keeping only the following: &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;close_source_branch&lt;/code&gt;, &lt;code&gt;reviewers&lt;/code&gt;, and &lt;code&gt;source&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In &lt;code&gt;source&lt;/code&gt; element, keep only &lt;code&gt;branch&lt;/code&gt;, remove the rest.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create the remaining PR's programmatically:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for repo in $REPOS; do 
    curl -s $BB_URL/$repo/pullrequests --user USERNAME:PASSWORD \
        --request POST --header 'Content-Type: application/json' \
        --data @pr_get.json \
    | jq -r .links.merge.href
done &amp;gt; pr_merges.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Once they are all ready for merging, run this:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for merge in $( cat pr_merges.txt ); do
    curl $merge --user USERNAME:PASSWORD --request POST
done
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There's various improvements that could be done of course, say to turn these into a bash command, get password from stdin, etc. This has been good enough so far. &lt;/p&gt;

&lt;p&gt;I posted this originally in &lt;a href="https://medium.com/@oliver.schoenborn/create-pull-requests-programmatically-in-bitbucket-d5e4f7dc9b1b"&gt;Create Pull Requests programmatically in BitBucket&lt;/a&gt; and &lt;a href="https://medium.com/@oliver.schoenborn/merge-pull-requests-programmatically-in-bitbucket-3a89b9440721"&gt;Merge Pull Requests programmatically in BitBucket&lt;/a&gt;. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>HAProxy watch status when no web browser or syslog!</title>
      <dc:creator>schollii</dc:creator>
      <pubDate>Mon, 20 Jul 2020 15:20:07 +0000</pubDate>
      <link>https://dev.to/schollii/haproxy-watch-status-when-no-web-browser-or-syslog-4pm5</link>
      <guid>https://dev.to/schollii/haproxy-watch-status-when-no-web-browser-or-syslog-4pm5</guid>
      <description>&lt;p&gt;The other day I got a challenge: I had to 1) do a basic setup of haproxy so one frontend would round-robin on 3 backends (simple task), but 2) verify that it was actually round-robin'ing, without using a web browser (to access the stats page that haproxy can be &lt;br&gt;
configured to serve, eg see “HAProxy Stats Page” on &lt;a href="https://www.haproxy.com/blog/introduction-to-haproxy-logging/"&gt;https://www.haproxy.com/blog/introduction-to-haproxy-logging/&lt;/a&gt;) or syslog. &lt;/p&gt;

&lt;p&gt;I tried curl which technically is not a web browser, but html was horribly formatted and didn't seem to have the backend status up/down etc; and converting to markdown and plain text with pandoc did not help. &lt;/p&gt;

&lt;p&gt;This won't be news to those who work with haproxy all the time, but for those starting: &lt;/p&gt;

&lt;p&gt;Turns out the haproxy makes status available through a unix socket that can be configured in the &lt;code&gt;global&lt;/code&gt; section of &lt;code&gt;/etc/haproxy/haproxy.cfg&lt;/code&gt;. On my centOS it defaults to  &lt;code&gt;/var/lib/haproxy/stats&lt;/code&gt;, whereas on ubuntu it defaults to &lt;code&gt;/run/haproxy/admin.sock&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;After a bit of research I found it was sufficient to send the &lt;code&gt;show stat&lt;/code&gt; command to the socket, and then process the output. Even better,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;watch 'echo "show stat" | sudo nc -U /var/lib/haproxy/stats | cut -d "," -f 1,2,8-10,18 | column -s, -t'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;on the load balancer host (LB_HOST) to get the stats. Then in a separate terminal (same or different host), I ran&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while true; do curl LB_HOST:HAPROXY_PORT; sleep 1; done 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;to generate http requests on the load balancer, and in a third terminal I could add/remove backend servers and observe the load-balancer status up/down. Example output of the watched command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ echo "show stat" | sudo nc -U /run/haproxy/admin.sock | cut -d "," -f 1,2,8-10,18 | column -s, -t
# pxname       svname    stot  bin    bout   status
test_frontend  FRONTEND  275   21725  67755  OPEN
test_backend   server1   158   12482  39026  UP
test_backend   server2   93    6399   19871  DOWN
test_backend   server3   39    2844   8858   DOWN
test_backend   BACKEND   275   21725  67755  UP
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Pretty cool!&lt;/p&gt;

&lt;p&gt;You can even have a "prompt" where you can do various things other than stats, like take down one of the backend servers for maintenance, debug certificates/SSL, etc. &lt;/p&gt;

&lt;p&gt;Eg with only servers 1 and 2 up (ie 3 is down), I disabled 1 and 2 in haproxy for maintenance, by doing this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo nc -U /run/haproxy/admin.sock
prompt
&amp;gt; disable server test_backend/server1
&amp;gt; disable server test_backend/server2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;then the watch automatically updated to show this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# pxname       svname    stot  bin    bout    status
test_frontend  FRONTEND  674   53246  164642  OPEN
test_backend   server1   472   37288  116584  MAINT
test_backend   server2   148   11692  36556   MAINT
test_backend   server3   0     0      0       DOWN
test_backend   BACKEND   674   53246  164642  DOWN
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Notice now the whole BACKEND is down too, because of server 3. Start server 3 and observe its state going from DOWN to UP, and then that of BACKEND does same. &lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

&lt;p&gt;A couple of useful refs: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://superuser.com/questions/1193917/how-to-view-haproxy-status-on-the-command-line-using-a-socket"&gt;A post on stackexchange&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://cbonte.github.io/haproxy-dconv/2.2/management.html#9"&gt;Section 9 "Statistics and Monitoring" of the docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Convert date formats in Google Sheets</title>
      <dc:creator>schollii</dc:creator>
      <pubDate>Sat, 04 Jul 2020 16:12:36 +0000</pubDate>
      <link>https://dev.to/schollii/convert-date-formats-in-google-sheets-4j19</link>
      <guid>https://dev.to/schollii/convert-date-formats-in-google-sheets-4j19</guid>
      <description>&lt;p&gt;The other day I downloaded transactions from my bank account and found that the date format had changed from DD/MM/YYYY to MM/DD/YYYY. There is nothing in the CSV file that tells Google Sheets what the format is, so I was seeing 01/09/2019 as "Jan 9, 2019". &lt;/p&gt;

&lt;p&gt;I bet TD Bank is not even aware of this, nor the mess this will cause, but anyways, I couldn't find any builtin function in Google Sheets to fix that. Data format did not help either (I guess the formatting says how to render, not how to interpret data). &lt;/p&gt;

&lt;p&gt;In the end I resorted to this transformation: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Import data into Google Sheets&lt;/li&gt;
&lt;li&gt;Notice the dates are all messed up, and swear profusely that the data provider did this, try a few things and fail, search web, nothing really comes up except (hopefully!) this post!&lt;/li&gt;
&lt;li&gt;Insert a column to the right of your date column&lt;/li&gt;
&lt;li&gt;Paste the formula &lt;code&gt;=REGEXREPLACE(A1, "(\d+)/(\d+)/(\d+)", "$2/$1/$3")&lt;/code&gt; and fill the remainder of the new column with that formula&lt;/li&gt;
&lt;li&gt;Select the new column and copy it&lt;/li&gt;
&lt;li&gt;Paste the new column over the old, BY VALUE (don't just ctrl-v, instead right-click on the top cell where you want the paste to start, and select &lt;em&gt;Paste... -&amp;gt; Values Only&lt;/em&gt;); ignore that the new column now shows re-inverted date format&lt;/li&gt;
&lt;li&gt;Remove the new column you created; the old column now contains dates correctly interpreted. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note: changing locale might have been an option, didn't try, but for me it wasn't really an option anyways, my current locale is exactly the way I want it. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Expand disk in virtualbox Ubuntu 18 guest</title>
      <dc:creator>schollii</dc:creator>
      <pubDate>Sat, 04 Jul 2020 15:59:17 +0000</pubDate>
      <link>https://dev.to/schollii/expand-disk-in-virtualbox-ubuntu-18-guest-24eo</link>
      <guid>https://dev.to/schollii/expand-disk-in-virtualbox-ubuntu-18-guest-24eo</guid>
      <description>&lt;p&gt;I needed to expand the virtual disk drive of several Ubuntu 18.10 vm guests I had. I looked around the web a bit and found that the posts explaining how to do that involve more steps that is now necessary on Ubuntu 18. So here is what was sufficient on 3 separate VM's: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Resize virtual disk in VirtualBox:

&lt;ol&gt;
&lt;li&gt;Power down the VM &lt;/li&gt;
&lt;li&gt;Go to Virtual Media Manager (VMM) &lt;/li&gt;
&lt;li&gt;Select the disk that corresponds to your VM and resize the disk file (this is possible only on powered down VM)&lt;/li&gt;
&lt;li&gt;Start VM&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Resize partition in guest:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install gparted: &lt;code&gt;sudo apt install gparted&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Start gparted&lt;/li&gt;
&lt;li&gt;Select partition&lt;/li&gt;
&lt;li&gt;Select resize&lt;/li&gt;
&lt;li&gt;Stretch it to desired size&lt;/li&gt;
&lt;li&gt;Check the details to confirm it did what you want&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make OS see the entire partition using pvresize:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo pvresize /dev/sda1
  Physical volume "/dev/sda1" changed
  1 physical volume(s) resized / 0 physical volume(s) not resized
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Resize the logical volume using lvresize:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo lvresize -l +100%FREE /dev/mapper/ubuntu--vg-root
  Size of logical volume ubuntu-vg/root changed from 29.03 GiB (7432 extents) to &amp;lt;48.85 GiB (12505 extents).
  Logical volume ubuntu-vg/root successfully resized.
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;
&lt;li&gt;

&lt;p&gt;Resize the filesystem:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo resize2fs /dev/mapper/ubuntu--vg-root
$ df -h
/dev/mapper/ubuntu--vg-root   48G   21G   26G  45% /
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Two of the pages that helped a lot: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[How to resize an Ubuntu 18.04 LVM disk][&lt;a href="https://vander.host/knowledgebase/operating-systems/how-to-resize-an-ubuntu-18-04-lvm-disk/"&gt;https://vander.host/knowledgebase/operating-systems/how-to-resize-an-ubuntu-18-04-lvm-disk/&lt;/a&gt;]&lt;/li&gt;
&lt;li&gt;[Ubuntu VM in VirtualBox: How to increase the size of a disk and make small(er) exports for distribution][&lt;a href="https://technology.amis.nl/2017/01/30/ubuntu-vm-virtualbox-increase-size-disk-make-smaller-exports-distribution/"&gt;https://technology.amis.nl/2017/01/30/ubuntu-vm-virtualbox-increase-size-disk-make-smaller-exports-distribution/&lt;/a&gt;]&lt;/li&gt;
&lt;/ul&gt;

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