<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Suhas Tech</title><id>https://suhastech.com/feed/atom/</id><link rel="self" href="https://suhastech.com/feed/atom/"/><updated>2018-09-18T12:49:05Z</updated>
  <entry><title>Use Tableau AWS Quick Start to launch a standalone server in an existing VPC</title><link href="https://suhastech.com/use-tableau-aws-quick-start-to-launch-a-standalone-server-in-an-existing-vpc/"/><id>http://suhastech.com/?p=2421</id><updated>2018-09-18T12:49:05Z</updated><author><name>Suhas</name></author><content type="html">&lt;p&gt;Tableau server doesn’t have this option by default in their website&amp;nbsp;https://aws.amazon.com/quickstart/architecture/tableau-server/&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; class=&quot;aligncenter size-full wp-image-2422&quot; src=&quot;/wp-content/uploads/2018/09/Screen-Shot-2018-09-18-at-6.12.46-PM.png&quot; alt=&quot;&quot; width=&quot;691&quot; height=&quot;592&quot; srcset=&quot;/wp-content/uploads/2018/09/Screen-Shot-2018-09-18-at-6.12.46-PM.png 691w, /wp-content/uploads/2018/09/Screen-Shot-2018-09-18-at-6.12.46-PM-300x257.png 300w&quot; sizes=&quot;auto, (max-width: 691px) 100vw, 691px&quot;&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Open their template file&lt;/p&gt;
&lt;p&gt;https://aws-quickstart.s3.amazonaws.com/quickstart-tableau-server/templates/tableau-single-server-master.template&lt;/p&gt;
&lt;p&gt;I wanted the Ubuntu instance. I could figure out that the Ubuntu Template exists here:&lt;br&gt;
https://aws-quickstart.s3.amazonaws.com/quickstart-tableau-server/templates/tableau-single-server-ubuntu.template&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Edit this file. Under “AWS::EC2::SecurityGroup”&lt;br&gt;
Add Property “VpcId”: “vpc-xxxxxx”&lt;/p&gt;
&lt;p&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; class=&quot;aligncenter size-full wp-image-2425&quot; src=&quot;/wp-content/uploads/2018/09/Screen-Shot-2018-09-18-at-6.15.43-PM.png&quot; alt=&quot;&quot; width=&quot;950&quot; height=&quot;500&quot; srcset=&quot;/wp-content/uploads/2018/09/Screen-Shot-2018-09-18-at-6.15.43-PM.png 950w, /wp-content/uploads/2018/09/Screen-Shot-2018-09-18-at-6.15.43-PM-300x158.png 300w, /wp-content/uploads/2018/09/Screen-Shot-2018-09-18-at-6.15.43-PM-768x404.png 768w&quot; sizes=&quot;auto, (max-width: 950px) 100vw, 950px&quot;&gt;&lt;/p&gt;
&lt;p&gt;Under “AWS::EC2::Instance”&lt;/p&gt;
&lt;p&gt;Add Property&amp;nbsp; “SubnetId”: “subnet-xxxxx”&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; class=&quot;aligncenter size-full wp-image-2426&quot; src=&quot;/wp-content/uploads/2018/09/Screen-Shot-2018-09-18-at-6.17.34-PM.png&quot; alt=&quot;&quot; width=&quot;678&quot; height=&quot;428&quot; srcset=&quot;/wp-content/uploads/2018/09/Screen-Shot-2018-09-18-at-6.17.34-PM.png 678w, /wp-content/uploads/2018/09/Screen-Shot-2018-09-18-at-6.17.34-PM-300x189.png 300w&quot; sizes=&quot;auto, (max-width: 678px) 100vw, 678px&quot;&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content></entry>
  <entry><title>Getting dovecot running on Mac OS X</title><link href="https://suhastech.com/getting-dovecot-running-on-mac-os-x/"/><id>http://suhastech.com/?p=2419</id><updated>2018-07-21T12:10:04Z</updated><author><name>Suhas</name></author><content type="html">&lt;ol&gt;
&lt;li&gt;
&lt;hr&gt;
&lt;p&gt;Install dovecot with `brew install dovecot`&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;Open /usr/local/etc/dovecot/dovecot.conf&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;pre class=&quot;brush: plain; title: ; notranslate&quot; title=&quot;&quot;&gt;# A comma separated list of IPs or hosts where to listen in for connections.
# &quot;*&quot; listens in all IPv4 interfaces, &quot;::&quot; listens in all IPv6 interfaces.
# If you want to specify non-default ports or anything more complex,
# edit conf.d/master.conf.
listen = 127.0.0.1

# Protocols we want to be serving.
protocols = imap


# Static passdb.

# This can be used for situations where Dovecot doesn&apos;t need to verify the
# username or the password, or if there is a single password for all users:
passdb {
  driver = static
  args = password=CHANGE_THIS
}

# Location for users&apos; mailboxes. The default is empty, which means that Dovecot
# tries to find the mailboxes automatically. This won&apos;t work if the user
# doesn&apos;t yet have any mail, so you should explicitly tell Dovecot the full
# location.
#
# If you&apos;re using mbox, giving a path to the INBOX file (eg. /var/mail/%u)
# isn&apos;t enough. You&apos;ll also need to tell Dovecot where the other mailboxes are
# kept. This is called the &quot;root mail directory&quot;, and it must be the first
# path given in the mail_location setting.
#
# There are a few special variables you can use, eg.:
#
#   %u - username
#   %n - user part in user@domain, same as %u if there&apos;s no domain
#   %d - domain part in user@domain, empty if there&apos;s no domain
#   %h - home directory
#
# See doc/wiki/Variables.txt for full list. Some examples:
#
#   mail_location = maildir:~/Maildir
#   mail_location = mbox:~/mail:INBOX=/var/mail/%u
#   mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n
#
# &amp;amp;lt;doc wiki=&quot;&quot; maillocation.txt=&quot;&quot;&amp;amp;gt;
#
mail_location = maildir:/Users/YOURUSERNAME/mail


# System user and group used to access mails. If you use multiple, userdb
# can override these by returning uid or gid fields. You can use either numbers
# or names. &amp;amp;lt;doc wiki=&quot;&quot; userids.txt=&quot;&quot;&amp;amp;gt;
mail_uid = YOURUSERNAME
mail_gid = admin

# SSL/TLS support: yes, no, required. &amp;amp;lt;doc wiki=&quot;&quot; ssl.txt=&quot;&quot;&amp;amp;gt;
ssl = no

# Login user is internally used by login processes. This is the most untrusted
# user in Dovecot system. It shouldn&apos;t have access to anything at all.
default_login_user = _dovenull

# Internal user is used by unprivileged processes. It should be separate from
# login user, so that login processes can&apos;t disturb other processes.
default_internal_user = _dovecot
# Internal group is expected to be the primary group of the default_internal_user.
default_internal_group = mail

# Setting limits.
default_process_limit = 10
default_client_limit = 50


&lt;/pre&gt;
&lt;p&gt;Change the YOURUSERNAME to your local username&lt;/p&gt;
&lt;p&gt;3. Run this command.&lt;/p&gt;
&lt;p&gt;sudo brew services restart dovecot&lt;/p&gt;
&lt;p&gt;Permission issues:&lt;/p&gt;
&lt;p&gt;sudo chgrp&amp;nbsp;/Users/YOURUSERNAME/mail mail&lt;/p&gt;
&lt;p&gt;Logs are found here: sudo tail -f /usr/local/var/log/dovecot/dovecot.log&lt;/p&gt;
&lt;/pre&gt;</content></entry>
  <entry><title>How to implement Sparkle Update framework in a Sandboxed Mac app</title><link href="https://suhastech.com/how-to-implement-sparkle-update-framework-in-a-sandboxed-mac-app/"/><id>http://suhastech.com/?p=2415</id><updated>2018-05-16T18:34:30Z</updated><author><name>Suhas</name></author><content type="html">&lt;p&gt;.There seems to be a fork of Sparkle which supports Sandboxing. It’s current in beta. The install instructions are slightly confusing.&lt;/p&gt;
&lt;p&gt;Download the latest build from https://github.com/sparkle-project/Sparkle/tree/ui-separation-and-xpc&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Open Terminal and cd into the directory&lt;/p&gt;
&lt;p&gt;run ‘make release’&lt;/p&gt;
&lt;p&gt;That will open up a directory with all the needed files.&lt;/p&gt;
&lt;p&gt;The update signing is more important now in your appcast.&lt;/p&gt;
&lt;p&gt;So, use /bin/generate_keys to generate dsa_pub.pem and dsa_priv.pem&lt;/p&gt;
&lt;p&gt;The official repo should help you do that.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Include 3 files into your project.&lt;/p&gt;
&lt;p&gt;org.sparkle-project.InstallerConnection.xpc&lt;/p&gt;
&lt;p&gt;org.sparkle-project.InstallerStatus.xpc&lt;/p&gt;
&lt;p&gt;org.sparkle-project.InstallerLauncher.xpc&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now sign them with your Developer ID keys. You just need to do this once. So, I’m not putting them in the build phase.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;./bin/codesign_xpc “Developer ID Application” org.sparkle-project.InstallerConnection.xpc&lt;/p&gt;
&lt;p&gt;./bin/codesign_xpc “Developer ID Application” org.sparkle-project.InstallerStatus.xpc&lt;/p&gt;
&lt;p&gt;./bin/codesign_xpc “Developer ID Application” org.sparkle-project.InstallerLauncher.xpc&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;If your sandboxes app doesn’t have access to the internet from sandboxing, also include&amp;nbsp;org.sparkle-project.Downloader.xpc&lt;/p&gt;
&lt;p&gt;./bin/codesign_xpc “Developer ID Application” org.sparkle-project.Downloader.xpc –entitlements&amp;nbsp;com.apple.security.network.client&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After including these files in your project. Add a build phase that will copy the above files to the XPC Services folder.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; class=&quot;aligncenter wp-image-2416 size-full&quot; src=&quot;/wp-content/uploads/2018/05/Screen-Shot-2018-05-17-at-12.00.21-AM.png&quot; alt=&quot;&quot; width=&quot;516&quot; height=&quot;236&quot; srcset=&quot;/wp-content/uploads/2018/05/Screen-Shot-2018-05-17-at-12.00.21-AM.png 516w, /wp-content/uploads/2018/05/Screen-Shot-2018-05-17-at-12.00.21-AM-300x137.png 300w&quot; sizes=&quot;auto, (max-width: 516px) 100vw, 516px&quot;&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To debug, open the Console.app and search for your app. The debug logs are quite helpful. I got stuck with not having the dsa_pub in the update I was trying to make.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content></entry>
  <entry><title>Preheat or generate fragment cache on deploy – Rails 5</title><link href="https://suhastech.com/preheat-generate-fragment-cache-deploy-rails-5/"/><id>http://suhastech.com/?p=2413</id><updated>2018-01-05T15:20:12Z</updated><author><name>Suhas</name></author><content type="html">&lt;p&gt;If you have a page that takes a lot of time to generate the cache. The first user who stumbles upon it is in pain. Sometimes it times out before it gets generated completed. &lt;/p&gt;
&lt;p&gt;So, I created a method in one of the helper class&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;br&gt;
    def self.recreate_cache&lt;/code&gt;&lt;/p&gt;&lt;code&gt;
&lt;p&gt;        the_controller = ActionController::Base.new&lt;br&gt;
        # Set any instance variables required by your partial in the controller,&lt;br&gt;
        # they will be passed to the partial with the view_context reference&lt;br&gt;
        the_controller.instance_variable_set &quot;@users&quot;, User.all&lt;/p&gt;
&lt;p&gt;        view_renderer = ActionView::Renderer.new the_controller.lookup_context&lt;br&gt;
        view_renderer.render the_controller.view_context, {template: &apos;users/index.html.erb&apos;}&lt;/p&gt;
&lt;/code&gt;&lt;p&gt;&lt;code&gt;    end&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This will render all the fragment cache. &lt;/p&gt;
&lt;p&gt;Hook this code in capistrano’s deploy method and it should be able to generate it every time you deploy. You could wrap it in a delayed job if you need your deploys faster.&lt;/p&gt;</content></entry>
  <entry><title>[Fix] PG::CharacterNotInRepertoire: ERROR: invalid byte sequence for encoding “UTF8”</title><link href="https://suhastech.com/fix-pgcharacternotinrepertoire-error-invalid-byte-sequence-for-encoding-utf8/"/><id>http://suhastech.com/?p=2408</id><updated>2015-03-10T16:37:54Z</updated><author><name>Suhas</name></author><content type="html">&lt;p&gt;I was trying to store Random IVs generated for AES encryption but couldn’t store them into a PostgreSQL database.&lt;/p&gt;
&lt;p&gt;The Random IVs generated were binary data. So, you have to escape them.&lt;/p&gt;
&lt;p&gt;While storing, do this&lt;/p&gt;
&lt;p&gt;PGconn.escape_bytea(data)&lt;/p&gt;
&lt;p&gt;While retrieving, do this&lt;/p&gt;
&lt;p&gt;PGconn.unescape_bytea(data)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content></entry>
  <entry><title>How to create a singleton scaffold in Rails 4</title><link href="https://suhastech.com/how-to-create-a-singleton-scaffold-in-rails-4/"/><id>http://suhastech.com/?p=2405</id><updated>2015-03-01T10:06:25Z</updated><author><name>Suhas</name></author><content type="html">&lt;p&gt;I thought I would quickly post this.&lt;/p&gt;
&lt;p&gt;Use the usual command to generate the scaffold.&lt;/p&gt;
&lt;p&gt;rails generate scaffold Model&lt;/p&gt;
&lt;p&gt;then in routes.rb&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Change&lt;/p&gt;
&lt;p&gt;resource :models&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;resource :models, :path =&amp;gt; ‘model’&lt;/p&gt;</content></entry>
  <entry><title>Briefly describe your current experience with computers and computer programming</title><link href="https://suhastech.com/briefly-describe-your-current-experience-with-computers-and-computer-programming/"/><id>http://suhastech.com/?p=2333</id><updated>2013-05-25T05:52:16Z</updated><author><name>Suhas</name></author><content type="html">&lt;p&gt;I was applying for RubyConf India scholarship which I want to go badly. I missed the last one in Bangalore because I wasn’t in the Ruby scene back then. They did have this question:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Briefly describe your current experience with computers and computer programming&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Midway&amp;nbsp;through&amp;nbsp;writing the answer when I figured it was pretty long,&amp;nbsp;unnecessary&amp;nbsp;and would make a nice blogpost after a long break. I don’t think they’d have the time to read this.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The answer&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;It was during 11th standard when I was introduced to blogging. Possibly the best thing that happened because I had this stupid need to optimise it.&lt;br&gt;
&lt;a href=&quot;/my-blogging-ramblings-in-2009/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Blogging ramblings in 2009&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Being jobless, I wanted to SEO “optimise” for Blogger (which was free). I was naive back then, I thought meta&amp;nbsp;tags actually worked and wrote:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/easily-add-meta-tags-to-individual-blogger-pages/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Meta tag generator&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;/all-in-one-seo-pack-for-blogger-blogspot-platform/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;A greasemonkey extension to extend Blogger.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On hindsight I learnt a lot of stuff, web development with PHP (free hosts!), Javascript, DOM manipulation, XML, RSS. On the whole how the awesome piece of technology called the web worked.&lt;/p&gt;
&lt;p&gt;I got a tiny bit of money and could afford a web host (cheapest one at $20/year) and moved to the hot new WordPress platform, wrote a plugin for that too.&lt;br&gt;
&lt;a href=&quot;/seo-blogger-to-wordpress-301-redirector-plugin/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Blogger to WordPress Plugin&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I still had the blog “optimisation” thing going on and was on my summer break, I wrote&lt;br&gt;
&lt;a href=&quot;/tweet-random-stuff-from-your-rss-atom-feed/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Tweet Random stuff from your RSS feed&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;which I finally had to shutdown because I couldn’t afford it and was a newbie when it comes to monetization. It used to crash my server on every cron execution.&lt;/p&gt;
&lt;p&gt;On hindsight, I learnt full stack web development. I wrote my own shitty&amp;nbsp;user authentication working with sessions, oAuth, Javascript (jQuery).&lt;/p&gt;
&lt;p&gt;I played around with TxtWeb API for a while and wrote&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/open-source-pushmail-on-sms/&quot;&gt;Pushmail on SMS&lt;/a&gt;&amp;nbsp;(won a contest&amp;nbsp;&lt;a href=&quot;/a-little-say-cheese-moment/&quot;&gt;with that&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;I won an iPad when it launched (2010), I wanted to build an app that plays Flash videos. I did struggle a bit to build a hackintosh&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/how-to-amd-hackintosh-install-dual-boot-windows-7-and-mac-os-x-snow-leopard-10-6-6-or-10-6-7/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;AMD Hackintosh&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I learnt a bit of Objective C when I found out about SkyFire and dropped the project. This would help me a year later. I fell in love with the Mac,&amp;nbsp;I did a lot of freelancing just to buy the cheapest Macbook.&lt;/p&gt;
&lt;p&gt;and then my Google account was disabled for no apparent reason. Got pissed and wrote using Ruby and Objective C.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://thehorcrux.com/why-i-built-horcrux-app/&quot;&gt;Horcrux Email Backup&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;My first commercial project, a nice pocket money for a college kid.&lt;/p&gt;</content></entry>
  <entry><title>How to get reverse SSH access to a Linux Machine behind NAT</title><link href="https://suhastech.com/reverse-ssh-access-to-an-ubuntu-linux-machine-behind-nat/"/><id>http://suhastech.com/?p=2173</id><updated>2012-10-22T04:00:58Z</updated><author><name>Suhas</name></author><content type="html">&lt;p&gt;My friend wanted access to a computer at college because he was working on his college project where they had to create a cloud farm using OpenStack.&lt;/p&gt;
&lt;p&gt;He wanted to work from home (that is one of the perk if you are a software person). The computer was behind the college NAT. So, doing something like this would need the SysAdmin and presumably a convoluted process.&lt;/p&gt;
&lt;p&gt;I found this nice remote forwarding flag in the SSH command.&lt;br&gt;
 [-R [bind_address:]port:host:hostport] [-S ctl_path]&lt;/p&gt;
&lt;p&gt;So, in fact you can forward any services from your machine not just SSH, set host port to 80, 9418 or whatever.&lt;/p&gt;
&lt;p&gt;Here’s how to do it:&lt;/p&gt;
&lt;p&gt;1) Create a Virtual Linux machine on the Cloud (I love AWS, they do have a free tier). Say its IP is 13.37.13.37. I’ll call this “Cloud Machine” and the machine you need access to as “Access Machine”&lt;/p&gt;
&lt;p&gt;2) Install OpenSSH on the “Access Machine” if you haven’t. Easiest way on Ubuntu is&lt;/p&gt;
&lt;pre class=&quot;brush: plain; title: ; notranslate&quot; title=&quot;&quot;&gt;sudo apt-get install taskel
sudo taskel
&lt;/pre&gt;
&lt;p&gt;3) Get the SSH key and place it somewhere in the “Access Machine”. Make necessary changes in the following shell script and make sure it is executed at startup. In Ubuntu you can paste this at “/etc/rc.local” (This is a shell script &lt;em&gt;file&lt;/em&gt;)&lt;/p&gt;
&lt;pre class=&quot;brush: plain; title: ; notranslate&quot; title=&quot;&quot;&gt;#!/bin/bash
port=2000 # any port greater than 1024, lets call this &quot;local port&quot;
keyfile=/home/somewhere/key.pem
username=ubuntu # The user in the cloud machine
IP=13.37.13.37 # The IP of cloud machine
timeout=300  # The timeout for the connect back

while [ true ]
do

        sudo ssh -R $port:localhost:22 -i $keyfile $username@$IP
        sleep $timeout

done
exit 0
&lt;/pre&gt;
&lt;p&gt;Extra Tips:&lt;br&gt;
* If you are on a brain dead Firewall system that blocks port 22 (SSH), set the SSH port to port 80 on your Cloud machine and use “-p” flag on your connection command. This can be done at “/etc/ssh/sshd_config”&lt;br&gt;
* If you are sharing your cloud machine with someone else, you can maybe create a new user and give no file access to that user.&lt;/p&gt;
&lt;p&gt;3) Now, every time you need to connect to the “Access Machine”, connect to the “Cloud Machine”,&lt;/p&gt;
&lt;pre class=&quot;brush: plain; title: ; notranslate&quot; title=&quot;&quot;&gt;sudo ssh -i $keyfile $username@$IP
&lt;/pre&gt;
&lt;p&gt;then, inside it&lt;/p&gt;
&lt;pre class=&quot;brush: plain; title: ; notranslate&quot; title=&quot;&quot;&gt;ssh [local username in Access Machine]@localhost -p [the local port defined in shell script]
&lt;/pre&gt;
&lt;p&gt;And of course, the “Access Machine” must be up and running.&lt;/p&gt;</content></entry>
  <entry><title>WordPress WXR file splitter for Mac OS X</title><link href="https://suhastech.com/wordpress-wxr-xmlfile-splitter-for-mac-os-x/"/><id>http://suhastech.com/?p=2106</id><updated>2012-08-26T10:50:20Z</updated><author><name>Suhas</name></author><content type="html">&lt;p&gt;I had been looking for a WordPress WXR (WordPress eXtended RSS) export file splitter as some hosts has limits over the upload file size limit and at times, I don’t get root access to edit the PHP.ini to lift the limits.&lt;/p&gt;
&lt;p&gt;Windows has a neat little tool that helps people split WXR export files. http://www.rangerpretzel.com/content/view/20/1/&lt;/p&gt;
&lt;p&gt;Sadly, at the time of this writing, none seems to be available for the Mac platform. That was a bummer.&lt;/p&gt;
&lt;p&gt;I had some free time. So, I wrote one. Let me know what you think.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/wp-content/uploads/2012/08/wxr-splitter.png&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; class=&quot;aligncenter size-full wp-image-2116&quot; title=&quot;wxr-splitter&quot; alt=&quot;&quot; src=&quot;/wp-content/uploads/2012/08/wxr-splitter.png&quot; width=&quot;477&quot; height=&quot;300&quot; srcset=&quot;/wp-content/uploads/2012/08/wxr-splitter.png 477w, /wp-content/uploads/2012/08/wxr-splitter-300x188.png 300w&quot; sizes=&quot;auto, (max-width: 477px) 100vw, 477px&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/wp-content/uploads/2012/08/WXR-Splitter.zip&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Click here to Download.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And oh, it’s also open source &lt;a href=&quot;https://github.com/suhastech/Wordpress-WXR-Splitter/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/suhastech/Wordpress-WXR-Splitter/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Known Bugs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;line-height: 13px;&quot;&gt;If a particular post is greater than the maximum size, it doesn’t work. We can’t split it, we could probably make only that file bigger than the maximum size? I’m a bit busy, I’d love to receive a pull request if you stumble upon this.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Shameless plug: I sell a Mac software called &lt;a href=&quot;http://thehorcrux.com&quot;&gt;Horcrux&lt;/a&gt;, it backups emails.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;br&gt;
Suhas&lt;/p&gt;</content></entry>
  <entry><title>How to programmatically assign a category to a post on WordPress</title><link href="https://suhastech.com/how-to-programmatically-assign-a-category-to-a-post-on-wordpress/"/><id>http://suhastech.com/?p=2092</id><updated>2012-07-03T18:11:36Z</updated><author><name>Suhas</name></author><content type="html">&lt;p&gt;Another quick little snippet. This is when you use it in a loop. &lt;/p&gt;
&lt;pre class=&quot;brush: php; title: ; notranslate&quot; title=&quot;&quot;&gt;    $my_post = array();
      $my_post[&apos;ID&apos;] = $post-&amp;gt;ID;

      $catarray = array(31); // 31 is the cat ID you want to assign

      foreach((get_the_category($post-&amp;gt;ID)) as $category) { 
        array_push($catarray, $category-&amp;gt;cat_ID);
    }

      $my_post[&apos;post_category&apos;] = $catarray;
      wp_update_post( $my_post );
&lt;/pre&gt;</content></entry>
</feed>
