<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <mtitle>Mauriat Miranda:linux</mtitle>
    <title>Linuxes on Mauriat Miranda</title>
    <link>https://mjmwired.net/linux/</link>
    <description>Recent content in Linuxes on Mauriat Miranda</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 05 Jun 2020 18:28:20 -0400</lastBuildDate>
    
    <atom:link href="https://mjmwired.net/linux/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Go Hugo</title>
      <link>https://mjmwired.net/linux/go-hugo/</link>
      <pubDate>Fri, 05 Jun 2020 18:28:20 -0400</pubDate>
      
      <guid>https://mjmwired.net/linux/go-hugo/</guid>
      <description>&lt;p&gt;*tap* *tap* is this thing on?&lt;/p&gt;
&lt;p&gt;So after a great deal of internal debate, I ditched server-side LAMP based blogging software and migrated to a statically generated system, namely &lt;a href=&#34;https://gohugo.io&#34;&gt;Hugo&lt;/a&gt;. Ultimately the decision came down to maintenance. I was creating content at a lower rate than Wordpress (and its plugins/themes/etc.) required updates. Nevermind the need to keep the server software (Apache, MySQL, PHP) secure and updated as well.&lt;/p&gt;
&lt;p&gt;Even though the migration was painful and the new system can be restricting, I&amp;rsquo;m glad I did it. Ultimately Hugo is a great resource for producing technical documentation quickly and having the content last indefinately.&lt;/p&gt;
&lt;h3 id=&#34;migration&#34;&gt;Migration&lt;/h3&gt;
&lt;p&gt;I used &lt;a href=&#34;https://github.com/wooni005/exitwp-for-hugo&#34; rel=&#34;nofollow&#34; target=&#34;_blank&#34;&gt;exitwp-for-hugo&lt;/a&gt; which converts a Wordpress export into MarkDown files compatible with Hugo. In retrospect this was a bad idea. Not only did I have to tweak the code to get my content right, I still had to manually adjust a large number of files for markup issues and then write additional code to manually add the categories.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;My recommendation:&lt;/strong&gt; is to write some custom &lt;code&gt;PHP&lt;/code&gt; or &lt;code&gt;Python&lt;/code&gt; code with some &lt;code&gt;SQL&lt;/code&gt; to just export all past content as &lt;code&gt;HTML&lt;/code&gt; and use &lt;code&gt;unsafe = true&lt;/code&gt; under &lt;code&gt;[markup.goldmark.renderer]&lt;/code&gt; to render it. Then write only your future content in MarkDown (or if you must revisit a past post, manually update it).&lt;/p&gt;
&lt;h3 id=&#34;comments&#34;&gt;Comments&lt;/h3&gt;
&lt;p&gt;I know community participation is important but given my update frequency, I&amp;rsquo;m just not going to deal with comments for now. I&amp;rsquo;ll revisit in the future.&lt;/p&gt;
&lt;p&gt;I didn&amp;rsquo;t really see a common convention for &lt;em&gt;comments&lt;/em&gt; in Hugo. In my above &lt;code&gt;Python&lt;/code&gt; code, I just decided to extract comments into a &lt;code&gt;YAML&lt;/code&gt; array and store them in the &lt;em&gt;front matter&lt;/em&gt; as &lt;code&gt;comments&lt;/code&gt; parameter for each file. Then in my template I iterated through them. I don&amp;rsquo;t know if this was the right solution and it looks messy, but it worked well and I don&amp;rsquo;t intend to do it again.&lt;/p&gt;
&lt;p&gt;Example markdown parameter:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span style=&#34;color:#309;font-weight:bold&#34;&gt;comments&lt;/span&gt;:&lt;span style=&#34;color:#bbb&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;  &lt;/span&gt;-&lt;span style=&#34;color:#bbb&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#309;font-weight:bold&#34;&gt;id&lt;/span&gt;:&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#f60&#34;&gt;123&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#309;font-weight:bold&#34;&gt;author&lt;/span&gt;:&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;somebody&lt;span style=&#34;color:#bbb&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#309;font-weight:bold&#34;&gt;date&lt;/span&gt;:&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;2012-06-11 06:16:49&lt;span style=&#34;color:#bbb&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#309;font-weight:bold&#34;&gt;content&lt;/span&gt;:&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#c30&#34;&gt;&amp;#34;thank you that works!&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;  &lt;/span&gt;-&lt;span style=&#34;color:#bbb&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#309;font-weight:bold&#34;&gt;id&lt;/span&gt;:&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#f60&#34;&gt;145&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#309;font-weight:bold&#34;&gt;author&lt;/span&gt;:&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;BobSmith&lt;span style=&#34;color:#bbb&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#309;font-weight:bold&#34;&gt;date&lt;/span&gt;:&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;2012-06-21 07:28:25&lt;span style=&#34;color:#bbb&#34;&gt;
&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#309;font-weight:bold&#34;&gt;content&lt;/span&gt;:&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#c30&#34;&gt;&amp;#34;Comment with html.&amp;lt;br&amp;gt;Thanks for the post.&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Example template snippet:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;&lt;code class=&#34;language-go&#34; data-lang=&#34;go&#34;&gt;  {{ &lt;span style=&#34;color:#069;font-weight:bold&#34;&gt;if&lt;/span&gt; .Params.comments }}
    &amp;lt;p&amp;gt;{{ len .Params.comments }} Comments:&amp;lt;&lt;span style=&#34;color:#555&#34;&gt;/&lt;/span&gt;p&amp;gt;
    &amp;lt;ul&amp;gt;
    {{&lt;span style=&#34;color:#069;font-weight:bold&#34;&gt;range&lt;/span&gt; .Params.comments}}
      &amp;lt;li&amp;gt;&amp;lt;h6&amp;gt;{{ .author }} on {{ dateFormat &lt;span style=&#34;color:#c30&#34;&gt;&amp;#34;January 2, 2006 ~ 03:15 PM&amp;#34;&lt;/span&gt; .date }}&amp;lt;&lt;span style=&#34;color:#555&#34;&gt;/&lt;/span&gt;h6&amp;gt;
      &amp;lt;p&amp;gt;{{ .content | markdownify }}&amp;lt;&lt;span style=&#34;color:#555&#34;&gt;/&lt;/span&gt;p&amp;gt;&amp;lt;&lt;span style=&#34;color:#555&#34;&gt;/&lt;/span&gt;li&amp;gt;
    {{end}}
    &amp;lt;&lt;span style=&#34;color:#555&#34;&gt;/&lt;/span&gt;ul&amp;gt;
  {{end}}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;deployment&#34;&gt;Deployment&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;m waiting for all the &lt;code&gt;404&lt;/code&gt; errors to show up so I can write &lt;code&gt;mod_rewrite&lt;/code&gt; rules to redirect. The cool thing about Hugo is all ~1,700 &lt;code&gt;html&lt;/code&gt; files render in less than 200ms! So its quick to patch an error and push updated files. And the resulting static content can be deployed on practically any webserver with minimal work.&lt;/p&gt;
&lt;h3 id=&#34;future-learningsupdates&#34;&gt;Future Learnings/Updates&lt;/h3&gt;
&lt;p&gt;While writing content is quick and easy, tracking it and filtering the meta data can be a bit confusing. I&amp;rsquo;m sure there are tips and hints out there to help. For now I&amp;rsquo;ll assume that &lt;em&gt;tags&lt;/em&gt; and &lt;em&gt;categories&lt;/em&gt; may be quirky.&lt;/p&gt;
&lt;p&gt;I still have a long list of tweaks needed for the output side as well.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I need to find a better &lt;a href=&#34;https://mjmwired.net/contact&#34;&gt;Contact&lt;/a&gt; method. I&amp;rsquo;ve been terrible about this, but you can find me on twitter or figure out my email rather easily.&lt;/li&gt;
&lt;li&gt;The styling needs some creativity (I do miss my old blue).&lt;/li&gt;
&lt;li&gt;Still lots of &amp;ldquo;\&amp;rdquo; and unicode conversion issues.&lt;/li&gt;
&lt;li&gt;Related: I would like to possibly release a custom theme for Hugo. None actually appealed to me and I wanted something simple.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On a personal note, this undertaking was spurred by being forced to work-from-home due to Covid-19. I am &lt;em&gt;really glad&lt;/em&gt; that I found something to put my energy into. I look forward to publishing some technical content (and personal posts as well) in the near future.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Migrate from Perforce to Git</title>
      <link>https://mjmwired.net/linux/2017/10/12/migrate-from-perforce-to-git/</link>
      <pubDate>Fri, 13 Oct 2017 00:41:22 +0000</pubDate>
      
      <guid>https://mjmwired.net/linux/2017/10/12/migrate-from-perforce-to-git/</guid>
      <description>&lt;p&gt;I had been using &lt;a href=&#34;https://www.perforce.com/perforce-packages&#34;&gt;Perforce&lt;/a&gt; for revision control mostly for Windows and binary files (excel, PDF, etc.). It worked amazingly well and had a powerful GUI! However I finally decided to consolidate on Git.&lt;/p&gt;
&lt;p&gt;Primary instructions are from &lt;a href=&#34;https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git&#34;&gt;git scm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In CentOS you will need the helper package:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ sudo yum install git-p4
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following steps worked perfectly for me.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;My Git projects are in &lt;code&gt;~/git&lt;/code&gt; (where the converted project will end up)&lt;/li&gt;
&lt;li&gt;My Perforce server is on &lt;code&gt;atlas&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;I use &lt;code&gt;~/work&lt;/code&gt; as my working directory (where I clone, checkout, etc.)&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;[mirandam@atlas ~]$ mkdir ~/git/p4proj
[mirandam@atlas ~]$ cd ~/git/p4proj

[mirandam@atlas p4proj]$ git init --bare
[mirandam@atlas p4proj]$ cd ~/work

[mirandam@atlas work]$ export P4PORT=atlas:1666
[mirandam@atlas work]$ p4 login
Enter password: 
User mirandam logged in. 

[mirandam@atlas work]$ git p4 clone //depot@all p4proj
Importing from //depot@all into p4proj
Reinitialized existing Git repository in /home/mirandam/work/p4proj/.git/
Import destination: refs/remotes/p4/master
Importing revision 189 (100%)

[mirandam@atlas work]$ cd p4proj

[mirandam@atlas p4proj]$ git remote add origin ~/git/p4proj
[mirandam@atlas p4proj]$ git push origin master
Counting objects: 2268, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (770/770), done.
Writing objects: 100% (2268/2268), 159.98 MiB | 128.79 MiB/s, done.
Total 2268 (delta 1272), reused 2268 (delta 1272)
To /home/mirandam/git/p4proj
 * [new branch]      master -&amp;gt; master
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now in my work directory I can perform changes and continue working.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Migrate from Mercurial Hg to Git</title>
      <link>https://mjmwired.net/linux/2017/04/02/migrate-from-mercurial-hg-to-git/</link>
      <pubDate>Sun, 02 Apr 2017 19:38:30 +0000</pubDate>
      
      <guid>https://mjmwired.net/linux/2017/04/02/migrate-from-mercurial-hg-to-git/</guid>
      <description>&lt;p&gt;I had one last Mercurial project that I still actively developed. Everything new I&amp;rsquo;ve completed restarted with Git but this was a last hold out.&lt;/p&gt;
&lt;p&gt;I blindly followed this Stack Overflow &lt;a href=&#34;http://stackoverflow.com/questions/16037787/convert-mercurial-project-to-git&#34;&gt;answer&lt;/a&gt; which says to use &lt;a href=&#34;http://repo.or.cz/w/fast-export.git&#34;&gt;fast-export&lt;/a&gt;. However I ran into the following problem, and the Stack Overflow &lt;a href=&#34;http://stackoverflow.com/questions/2816369/git-push-error-remote-rejected-master-master-branch-is-currently-checked&#34;&gt;answer&lt;/a&gt; didn&amp;rsquo;t help much.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ git push origin master
remote: error: refusing to update checked out branch: refs/heads/master
...
! [remote rejected] master -&amp;gt; master (branch is currently checked out)
error: failed to push some refs to &#39;/home/mirandam/git/project&#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;After some trial and error, the following steps worked exactly how I expected.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;My Git projects are in &lt;code&gt;~/git&lt;/code&gt; (where the converted project will end up)&lt;/li&gt;
&lt;li&gt;My Mercurial projects are in &lt;code&gt;~/hg&lt;/code&gt; (this is where the project to be converted will live)&lt;/li&gt;
&lt;li&gt;I use &lt;code&gt;~/work&lt;/code&gt; as my working directory (where I clone, checkout, etc.)&lt;/li&gt;
&lt;li&gt;I use &lt;code&gt;~/tmp&lt;/code&gt; as just a scratch temporary directory&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;[mirandam@atlas ~]$ mkdir ~/git/project-new
[mirandam@atlas ~]$ cd ~/git/project-new

[mirandam@atlas project-new]$ git init --bare
[mirandam@atlas project-new]$ cd ~/tmp

[mirandam@atlas tmp]$ git clone git://repo.or.cz/fast-export.git
[mirandam@atlas tmp]$ cd ~/work/

[mirandam@atlas work]$ git clone ~/git/project-new
[mirandam@atlas work]$ cd ~/work/project-new

[mirandam@atlas project-new]$ ~/tmp/fast-export/hg-fast-export.sh -r ~/hg/project-old
[mirandam@atlas project-new]$ git checkout HEAD
[mirandam@atlas project-new]$ git push origin master
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now in my work directory I can perform changes and continue working.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>CentOS Server and Desktop Updates</title>
      <link>https://mjmwired.net/linux/2016/09/09/centos-server-and-desktop-updates/</link>
      <pubDate>Sat, 10 Sep 2016 02:30:39 +0000</pubDate>
      
      <guid>https://mjmwired.net/linux/2016/09/09/centos-server-and-desktop-updates/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been using my previous hosting provider (&lt;a href=&#34;http://www.powervps.com/&#34;&gt;PowerVPS&lt;/a&gt;) for over 10 years now! They had incredibly reliable service so I never switched. But for the past few years so many smaller companies have been providing much more competitive options. However I was just too lazy to make the switch.&lt;/p&gt;
&lt;p&gt;Just for fun: the last tweet by @PowerVPS was to me from the last time I purchased a server from them!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href=&#34;https://twitter.com/Mauriat&#34;&gt;@mauriat&lt;/a&gt; I&amp;rsquo;m glad it was an enjoyable 5 years, we wish you the best.  Let us know if we can ever help again.&lt;/p&gt;
&lt;p&gt;&amp;ndash; PowerVPS (@PowerVPS) &lt;a href=&#34;https://twitter.com/PowerVPS/status/58503323443138560&#34;&gt;April 14, 2011&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The mistake I made was setting up a server with &lt;em&gt;CentOS 5 instead of 6&lt;/em&gt; at the time. So now, almost everything is way out of support.&lt;/p&gt;
&lt;p&gt;I decided I did not need all the features a full VPS with CPanel provided (primarily a full web based administration tool and countless plugins). I know I have enough experience just to setup the critical things I cared about. After some research I decided that &lt;a href=&#34;https://www.linode.com/?r=11fd93288278ab9afe7f46a1724cb653e976e032&#34;&gt;Linode&lt;/a&gt; (*) was the best balance of price and features. The best part was I could pick a clean minimal install of the latest version of CentOS!&lt;/p&gt;
&lt;p&gt;So it took me about 2 weeks to get everything working and I still have some sites to migrate but for the most part I&amp;rsquo;m very happy with what I&amp;rsquo;ve got working. I fully intend to write up a lot of this stuff and share it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All server software is from up-to-date binary packages from reliable repositories. (No more manual compiles of Apache, etc. just to be current)&lt;/li&gt;
&lt;li&gt;I switched all my site development code to be deployed through a combination of &lt;code&gt;ssh&lt;/code&gt; and &lt;code&gt;git&lt;/code&gt; (more on this later)&lt;/li&gt;
&lt;li&gt;I have fully switched over to secure sites! Have &lt;code&gt;https&lt;/code&gt; on almost everything! Courtesy of &lt;a href=&#34;https://letsencrypt.org/&#34;&gt;Let&amp;rsquo;s Encrypt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Everything runs so much faster and smoother than I ever had in the past 5 years!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;On the desktop side, I finally switched my main Linux desktop to CentOS 7 - a whole year after I intended to do it. But that really is a good thing since my CentOS 6 setup was so solid that everything worked. I was just getting tired of not being able to try out new software (more on this later). I did update to Windows 10 as well and have been playing with the Ubuntu Linux system embedded in Windows, and I must say I&amp;rsquo;m really impressed (more on this later as well).&lt;/p&gt;
&lt;p&gt;So I&amp;rsquo;m ashamed that I stated &lt;em&gt;over a year ago&lt;/em&gt; that I would &lt;a href=&#34;https://mjmwired.net/linux/2015/06/10/resurrecting-my-linux-blog/&#34;&gt;resurrect this blog&lt;/a&gt;! But a recent &lt;a href=&#34;https://mjmwired.net/blog/read/10-days-without-social-media&#34;&gt;kick in the pants&lt;/a&gt; finally got me working on cool stuff that I&amp;rsquo;ve always enjoyed. Greatly looking forward to writing up a lot of the stuff I&amp;rsquo;ve been working on!&lt;/p&gt;
&lt;p&gt;(* Linode is a referral link)&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Resurrecting my Linux Blog</title>
      <link>https://mjmwired.net/linux/2015/06/10/resurrecting-my-linux-blog/</link>
      <pubDate>Thu, 11 Jun 2015 03:05:14 +0000</pubDate>
      
      <guid>https://mjmwired.net/linux/2015/06/10/resurrecting-my-linux-blog/</guid>
      <description>&lt;p&gt;The last 4 and half years had left me with no spare time to pursue my interests in all things Linux. Recent career choices have given me the breathing room to change that. I intend to bring up my site back to what I&amp;rsquo;ve always wanted it to be: &lt;strong&gt;useful to me&lt;/strong&gt; and hopefully &lt;em&gt;useful to others&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Lots has changed in the linux and open source world, but even so I&amp;rsquo;ll slowly start contributing again. (I&amp;rsquo;m really rusty)&lt;/p&gt;
&lt;p&gt;To the countless people who have emailed me and I never replied, I am truly sorry. Thank you to all those who have sent private words of encouragement.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
