<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux &#8211; Henry Poon&#039;s Blog</title>
	<atom:link href="https://blog.henrypoon.com/blog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.henrypoon.com</link>
	<description></description>
	<lastBuildDate>Tue, 04 Oct 2022 22:11:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">83044199</site>	<item>
		<title>Running Selenium Webdriver on WSL2</title>
		<link>https://blog.henrypoon.com/blog/2020/09/27/running-selenium-webdriver-on-wsl2/</link>
					<comments>https://blog.henrypoon.com/blog/2020/09/27/running-selenium-webdriver-on-wsl2/#respond</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Mon, 28 Sep 2020 00:49:34 +0000</pubDate>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[engineering]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[APT]]></category>
		<category><![CDATA[AWK]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Computer architecture]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Drive]]></category>
		<category><![CDATA[Error message]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Firefox version history]]></category>
		<category><![CDATA[Flag]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Graphical user interface testing]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[IP address]]></category>
		<category><![CDATA[ise]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Lag]]></category>
		<category><![CDATA[lamb]]></category>
		<category><![CDATA[Language]]></category>
		<category><![CDATA[Lie]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Messages]]></category>
		<category><![CDATA[Net]]></category>
		<category><![CDATA[Operating systems]]></category>
		<category><![CDATA[Parameter]]></category>
		<category><![CDATA[PATH]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Resolv.conf]]></category>
		<category><![CDATA[Rolling]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[Sleep]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[STR]]></category>
		<category><![CDATA[Struct]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Ubuntu version history]]></category>
		<category><![CDATA[USR]]></category>
		<category><![CDATA[Variable]]></category>
		<category><![CDATA[Web development software]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Z]]></category>
		<guid isPermaLink="false">https://blog.henrypoon.com/?p=6269</guid>

					<description><![CDATA[This is a newer version of the post that I made before on how to run Selenium on WSL, but this one is on doing it in WSL2. The instructions are similar at a high level but there are some additional gotchas. You will need: WSL2 setup with Firefox installed (mine uses Ubuntu 20.04) VcXsrv [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">This is a newer version of the post that I made before on <a href="https://blog.henrypoon.com/blog/2017/06/18/running-selenium-webdriver-on-bash-for-windows/" target="_blank" rel="noreferrer noopener">how to run Selenium on WSL</a>, but this one is on doing it in WSL2.  The instructions are similar at a high level but there are some additional gotchas.</p>



<p class="wp-block-paragraph">You will need:</p>



<ul class="wp-block-list"><li><a rel="noreferrer noopener" href="https://msdn.microsoft.com/en-us/commandline/wsl/install_guide" target="_blank">WSL2 setup</a> with Firefox installed (mine uses Ubuntu 20.04)</li><li><a rel="noreferrer noopener" href="https://sourceforge.net/projects/vcxsrv/" target="_blank">VcXsrv</a></li><li><a rel="noreferrer noopener" href="https://github.com/mozilla/geckodriver/releases" target="_blank">geckodriver</a></li></ul>



<h2 class="wp-block-heading">How it works</h2>



<p class="wp-block-paragraph">VcXsrv starts up an X server on the Windows host machine, and what WSL will do is connect to this server to pass on the details of what programs need to be displayed (in this case, the browser window).  Geckodriver is there purely as a middle layer for Selenium to be able to interact with Firefox.</p>



<h2 class="wp-block-heading">VcXsrv setup</h2>



<p class="wp-block-paragraph">This setups the X server so that Windows can display graphical data coming from the Ubuntu instance.</p>



<ol class="wp-block-list"><li>Download and install</li><li>Start it up with the the command line parameter &#8220;-ac&#8221;.  This flag removes access control restrictions for connecting clients (which is okay as long as this server isn&#8217;t exposed on the open Internet and that the only client connecting is the Ubuntu instance)</li><li>Allow connections to VcXsrv on Windows Firewall</li></ol>



<p class="wp-block-paragraph">The &#8220;-ac&#8221; flag and allowing the program through Windows Firewall is pretty important.  When I didn&#8217;t do this, Ubuntu would give me cryptic error messages like &#8220;Broadway display type not supported&#8221;, but once I set up these access controls, everything was fine.</p>



<h2 class="wp-block-heading">Bash setup</h2>



<p class="wp-block-paragraph">Install firefox</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo apt install firefox</code></pre>



<p class="wp-block-paragraph">Export DISPLAY variable in .bashrc (or for whatever terminal you use, maybe .zshrc, etc.)</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">export DISPLAY=$(ip route | awk '{print $3; exit}'):0</code></pre>



<p class="wp-block-paragraph">This will configure your DISPLAY variable to use the IP address listed in the resolv.conf file.  The IP address listed there is the IP address of the X server that will be used for displaying the browser window.</p>



<p class="wp-block-paragraph">Start up VcXsrv as described in the above and then try to open Firefox.  The Firefox window should open.</p>



<h2 class="wp-block-heading">Geckodriver setup</h2>



<p class="wp-block-paragraph">This acts purely as the API interface that allows Selenium to interact with Firefox.  Selenium looks for this executable when controlling the web browser.</p>



<ol class="wp-block-list"><li>Download geckodriver (make sure to get the Linux one and not the Windows one)</li><li>Put it in /usr/bin (or alternatively some other folder in your PATH)</li></ol>



<h2 class="wp-block-heading">Selenium sample on Python</h2>



<p class="wp-block-paragraph">I tend to use Python when running Selenium code, and I haven&#8217;t tried it on another language (I imagine the principles are similar).  Here is a piece of sample code for starting up the browser and opening up a website, but really any Selenium code can be used.</p>



<pre class="wp-block-code"><code lang="python" class="language-python">import time

from selenium import webdriver
from selenium.webdriver import DesiredCapabilities

def execute_with_retry(method, max_attempts):
    e = None
    for i in range(0, max_attempts):
        try:
            return method()
        except Exception as e:
            print(e)
            time.sleep(1)
    if e is not None:
        raise e

capabilities = DesiredCapabilities.FIREFOX
capabilities["marionette"] = True
firefox_bin = "/usr/bin/firefox"
browser = execute_with_retry(lambda: webdriver.Firefox(
    firefox_binary=firefox_bin, capabilities=capabilities), 10)

browser.get("https://www.google.com")

time.sleep(10)

browser.close()</code></pre>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2020/09/27/running-selenium-webdriver-on-wsl2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6269</post-id>	</item>
		<item>
		<title>Installing Seafile with Docker and Apache 2</title>
		<link>https://blog.henrypoon.com/blog/2019/06/12/installing-seafile-with-docker-and-apache-2/</link>
					<comments>https://blog.henrypoon.com/blog/2019/06/12/installing-seafile-with-docker-and-apache-2/#respond</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Wed, 12 Jun 2019 07:12:42 +0000</pubDate>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[engineering]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[9]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache 2]]></category>
		<category><![CDATA[Apache HTTP Server]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Chan]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[cloud storage]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Dia]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[DROPBOX]]></category>
		<category><![CDATA[EAR]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[File sharing]]></category>
		<category><![CDATA[Free software]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[Gran]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[IOS]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Lie]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Matt]]></category>
		<category><![CDATA[Nap]]></category>
		<category><![CDATA[Net]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[OS-level virtualisation]]></category>
		<category><![CDATA[Page]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[PATH]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[seafile]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[System software]]></category>
		<category><![CDATA[Systemd]]></category>
		<category><![CDATA[Thou]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[URL]]></category>
		<category><![CDATA[USR]]></category>
		<category><![CDATA[ypres]]></category>
		<category><![CDATA[Z]]></category>
		<guid isPermaLink="false">https://blog.henrypoon.com/?p=3509</guid>

					<description><![CDATA[Seafile is an open source file sharing software that allows its users to setup their own cloud storage at home. Think Dropbox, but self-hosted. This post is about deploying an instance of Seafile using Docker on a non-standard port (i.e. not 80 and 443). The reason to deploy the app on a non-standard port is [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><a rel="noreferrer noopener" aria-label="Seafile (opens in a new tab)" href="https://www.seafile.com" target="_blank">Seafile</a> is an open source file sharing software that allows its users to setup their own cloud storage at home.  Think Dropbox, but self-hosted.</p>



<p class="wp-block-paragraph">This post is about deploying an instance of Seafile using Docker on a non-standard port (i.e. not 80 and 443).  The reason to deploy the app on a non-standard port is usually because there is already another webserver running on that port (in my case Apache 2).  In such scenarios, it is necessary to set up a reverse proxy so the Seafile port can be exposed by Apache on ports 80/443.  Under typical circumstances, deploying Seafile on a standard port would mean that the app would host itself without the need for Apache 2 at all.  This post also assumes Ubuntu 16.04 as the operating system, but in theory should apply to other Linux OS&#8217;s.</p>



<p class="has-text-align-left wp-block-paragraph">The process can be split into multiple parts:</p>



<ol class="wp-block-list"><li>Setup Docker</li><li>Deploy Seafile</li><li>Configure Apache 2</li><li>Setup systemd</li><li>Setup e-mail (optional)</li><li>Backing up the image</li><li>Troubleshooting</li></ol>



<h2 class="wp-block-heading">Setup Docker</h2>



<p class="wp-block-paragraph">This guide won&#8217;t go into depth on how to setup Docker, but rather the setup guide and more information about what Docker is can be found here: <a rel="noreferrer noopener" aria-label="https://docs.docker.com/get-started/ (opens in a new tab)" href="https://docs.docker.com/get-started/" target="_blank">https://docs.docker.com/get-started/</a></p>



<h2 class="wp-block-heading">Deploy Seafile</h2>



<p class="wp-block-paragraph">The key page in the Seafile documentation for deploying Seafile within Docker can be found here: <a href="https://github.com/haiwen/seafile-docker" target="_blank" rel="noreferrer noopener">https://github.com/haiwen/seafile-docker</a>.  The command I used is as follows:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">docker run -d --name seafile \
  -e SEAFILE_SERVER_HOSTNAME=seafile.example.com \
  -e SEAFILE_ADMIN_EMAIL=me@example.com \
  -e SEAFILE_ADMIN_PASSWORD=a_very_secret_password \
  -v /opt/seafile-data:/shared \
  -p 8000:80 \
  seafileltd/seafile:latest</code></pre>



<p class="wp-block-paragraph">I recommend setting up Seafile with an actual secret password because it&#8217;s not easy to change once it&#8217;s set up.</p>



<p class="wp-block-paragraph">Note that the port argument shows 8000:80.  It means that Docker will use the host port 8000 and the container will use port 80 &#8211; meaning that using Docker will interpret requests from my host OS on port 8000 as requests on port 80 in the container.  8000 was used on my setup because port 80 was already used. </p>



<p class="wp-block-paragraph">Once the command is executed, the necessary files will be downloaded and the container will start and will be accessible on port 8000.</p>



<p class="wp-block-paragraph">There is also an option to setup Seafile with an SSL cert from <a rel="noreferrer noopener" aria-label="Let's Encrypt (opens in a new tab)" href="https://letsencrypt.org/" target="_blank">Let&#8217;s Encrypt</a>, but I didn&#8217;t do this because I already had a cert that I wanted to reuse.</p>



<p class="wp-block-paragraph">Once the server is up, navigate to <a href="#">https://seafile.example.com/sys/settings/</a> and change SERVICE_URL and FILE_SERVER_URL to match your domain name.</p>



<h2 class="wp-block-heading">Configure Apache 2</h2>



<p class="wp-block-paragraph">Adding a reverse proxy on Apache 2 will allow Apache 2 to route requests to port 8000, which will go to port 80 in the container.  The main reference for this section is this: <a href="https://manual.seafile.com/deploy/deploy_with_apache/" target="_blank" rel="noreferrer noopener">https://manual.seafile.com/deploy/deploy_with_apache/</a>.  This is done by adding a new site to Apache 2.  The following configuration assumes that a LetsEncrypt SSL certificate is used.</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">cd /etc/apache2/sites-available
sudo nano seafile.conf</code></pre>



<pre class="wp-block-code"><code lang="apacheconf" class="language-apacheconf">&lt;IfModule mod_ssl.c&gt;
&lt;VirtualHost *:443&gt;
    ServerName seafile.example.com
    ServerAdmin me@example.com

    RewriteEngine On

    # ModSecurity does not process requests.  There is a hard limit of 1 GB
    # with ModSecurity.
    SecRuleEngine Off

    # Whitelist internal IPs for mod_evasive
    DOSWhitelist 192.168.1.*

    &lt;Location /media&gt;
        Require all granted
    &lt;/Location&gt;

    # Stuff for seafile server
    ProxyPass /seafhttp http://127.0.0.1:8082
    ProxyPassReverse /seafhttp http://127.0.0.1:8082
    RewriteRule ^/seafhttp - [QSA,L]

    # Stuff for seahub
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:8000/
    ProxyPassReverse / http://127.0.0.1:8000/

    ErrorLog ${APACHE_LOG_DIR}/seafile_error.log
    CustomLog ${APACHE_LOG_DIR}/seafile_access.log combined

    Include /etc/letsencrypt/options-ssl-apache.conf

    SSLCertificateFile /path/to/cert/file.pem
    SSLCertificateKeyFile /path/to/cert/key/file.pem
&lt;/VirtualHost&gt;
&lt;/IfModule&gt;
</code></pre>



<p class="wp-block-paragraph">I&#8217;ve added my local domain to the whitelist so that mod_evasive doesn&#8217;t think my local host is a threat.</p>



<p class="wp-block-paragraph">There are two sets of ProxyPass and ProxyPassReverse lines.  The reason for this is that Seafile is split up into Seahub and Seafile, where one uses port 8082 (by default), while the other uses 8000.  These two lines are essentially what allows Apache to read requests from port 443 and pass them on to the container.</p>



<p class="wp-block-paragraph">Once the file is saved, execute the following</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo a2ensite seafile.conf
sudo service apache2 reload</code></pre>



<p class="wp-block-paragraph">Navigating to the site at the Apache 2 defined port should now load Seafile without having to go to port 8000.</p>



<h2 class="wp-block-heading">Setup systemd</h2>



<p class="wp-block-paragraph">systemd allows the Docker container to be started up on boot, and be controlled like this:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo service seafile start/stop/restart</code></pre>



<p class="wp-block-paragraph">The configuration is as follows:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo nano /etc/systemd/system/seafile.service</code></pre>



<pre class="wp-block-code"><code lang="properties" class="language-properties">[Unit]
Description=Seafile Server
After=network.target mysql.service

[Service]
Type=oneshot
ExecStart=/usr/bin/docker container start seafile
ExecStop=/usr/bin/docker container stop seafile
ExecReload=/usr/bin/docker container restart seafile
RemainAfterExit=yes
User=root
Group=root

[Install]
WantedBy=multi-user.target</code></pre>



<p class="wp-block-paragraph">Once the configuration is saved, shut off the existing running instance of Seafile and then let systemd start it up for you.</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo systemctl daemon-reload
sudo service seafile start</code></pre>



<p class="wp-block-paragraph">At this point, Seafile should start automatically on boot, with Apache 2 doing a reverse proxy to the true Seafile port.</p>



<h2 class="wp-block-heading">Setup e-mail (optional)</h2>



<p class="wp-block-paragraph">Optionally, Seafile can be configured to send e-mails.  The reference is here: <a href="https://manual.seafile.com/config/sending_email/" target="_blank" rel="noreferrer noopener">https://manual.seafile.com/config/sending_email/</a>.  The config file should be under:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">/opt/seafile-data/seafile/conf/seahub_settings.py</code></pre>



<p class="wp-block-paragraph">I happen to be using Gmail SMTP, so at the end of the file I&#8217;ve added</p>



<pre class="wp-block-code"><code lang="properties" class="language-properties">EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'me@example.com'
EMAIL_HOST_PASSWORD = 'password'
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
SERVER_EMAIL = EMAIL_HOST_USER</code></pre>



<h2 class="wp-block-heading">Backing up the image</h2>



<p class="wp-block-paragraph">After setting everything up, you&#8217;ll probably want to backup the Docker image.  First, print out the list of running containers</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo docker ps</code></pre>



<p class="wp-block-paragraph">Then take a snapshot of the current running state:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">docker commit -p &lt;container ID&gt; &lt;whatever you want to call this snapshot&gt;</code></pre>



<p class="wp-block-paragraph">Running this command lists all the images and should show this newly saved image:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo docker images</code></pre>



<p class="wp-block-paragraph">I don&#8217;t have a private docker repository, so I saved the image to the disk and backed up the file by doing the below.  Just make sure to actually move the image to an actual backup location.</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo docker save -o &lt;whatever path you want&gt;/&lt;filename&gt;.tar &lt;the name used earlier&gt;</code></pre>



<p class="wp-block-paragraph">The image should be backed up now.  To restore the image, it&#8217;s a matter of running this:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo docker load -i &lt;path to the backup file&gt;</code></pre>



<p class="wp-block-paragraph">Listing the images as above should show that the image was successfully loaded.  Running this starts it back up again.</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo docker run &lt;container name&gt;</code></pre>



<h2 class="wp-block-heading">Troubleshooting</h2>



<p class="wp-block-paragraph">Seafile logs can be helpful if it doesn&#8217;t start up correctly.  These can be found at:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">/opt/seafile-data/logs/seafile</code></pre>



<p class="wp-block-paragraph">There may be a need to ssh into the Docker container.  The command for that is:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo docker exec -it seafile /bin/bash</code></pre>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2019/06/12/installing-seafile-with-docker-and-apache-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3509</post-id>	</item>
		<item>
		<title>Setting up your own Counter-Strike 1.6 dedicated server via Docker</title>
		<link>https://blog.henrypoon.com/blog/2018/09/23/setting-up-your-own-counter-strike-1-6-dedicated-server-via-docker/</link>
					<comments>https://blog.henrypoon.com/blog/2018/09/23/setting-up-your-own-counter-strike-1-6-dedicated-server-via-docker/#respond</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Sun, 23 Sep 2018 20:00:12 +0000</pubDate>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[Chan]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Computer architecture]]></category>
		<category><![CDATA[Contents]]></category>
		<category><![CDATA[Counter-Strike]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Directory]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[Filesystem Hierarchy Standard]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[HLDS]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[ise]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Net]]></category>
		<category><![CDATA[Operating systems]]></category>
		<category><![CDATA[PATH]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[Sleep]]></category>
		<category><![CDATA[STR]]></category>
		<category><![CDATA[System administration]]></category>
		<category><![CDATA[System software]]></category>
		<category><![CDATA[Systemd]]></category>
		<category><![CDATA[Team]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[USR]]></category>
		<category><![CDATA[Variable]]></category>
		<guid isPermaLink="false">https://blog.henrypoon.com/?p=2992</guid>

					<description><![CDATA[Once upon a time, you had to run the HLDSUpdateTool, and then SteamCMD. But now, awesome people on the internet have created Docker images for setting up a Counter-Strike 1.6 dedicated server. Now, all you have to do is: Install Docker on your machine Get a Docker image for a CS 1.6 server (I created [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Once upon a time, you had to run the HLDSUpdateTool, and then SteamCMD. But now, awesome people on the internet have created Docker images for setting up a Counter-Strike 1.6 dedicated server. Now, all you have to do is:</p>



<ol class="wp-block-list"><li>Install Docker on your machine</li><li>Get a Docker image for a CS 1.6 server (I created <a rel="noreferrer noopener" href="https://github.com/hpoon/HLDS-CS1.6" target="_blank">this one</a>, which is based off of an <a rel="noreferrer noopener" href="https://github.com/kriansa/cs-16-server" target="_blank">existing one</a>. Mine has:<ul><li>A lot of maps</li><li>Metamod</li><li>AMXModX (with high ping kicker, podbot control menu, round money, rock the vote, and admin all in one)</li><li>Podbot</li></ul></li><li>Customise the server (e.g. editing the server.cfg, amxx.cfg, and other config files, etc.)</li><li>Start it up! (the README.md in the above linked Git repos has more info on this)</li></ol>



<p class="wp-block-paragraph">As far as ports go, I only needed to forward 27015 on my machine, but your mileage may vary. Others have reported that <a rel="noreferrer noopener" href="https://developer.valvesoftware.com/wiki/Half-Life_Dedicated_Server" target="_blank">some more ports</a> must also be forwarded on some machines.</p>



<p class="wp-block-paragraph">Then optionally, if you&#8217;re running Ubuntu and you want this server to start up like a service via systemd, you&#8217;ll need this:</p>



<ol class="wp-block-list"><li>An executable script with path /usr/local/bin/hlds with contents (make sure the DIR variable matches your installation directory):</li></ol>



<pre class="wp-block-code"><code lang="bash" class="language-bash">#!/bin/sh

# Do not change this path
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin

# The path to the game you want to host. example = /home/newuser/dod
DIR=/opt/cs-16-server/bin
DAEMON=./server

start()
{
    echo  -n "Starting HLDS"
    if [ -e $DIR ]; then
        cd $DIR
        $DAEMON start
    else
        echo "No such directory: $DIR!"
    fi
}

stop()
{
    echo -n "Stopping HLDS"
    if [ -e $DIR ]; then
        cd $DIR
        $DAEMON stop
    else
        echo "No such directory: $DIR!"
    fi
}

reload()
{
    echo -n "Restarting HLDS"
    stop
    sleep 1
    start
}

case "$1" in
    start|stop|reload)
        "$1"
        ;;
    *)
        echo  "Usage: $ 0 {start | stop | reload | status}"
        exit  1
        ;;
esac

exit  0</code></pre>



<ol class="wp-block-list" start="2"><li>A script with path /etc/systemd/system/hlds.service with contents:</li></ol>



<pre class="wp-block-code"><code lang="properties" class="language-properties">[Unit]
Description=HLDS

[Service]
Type=oneshot
ExecStart=/usr/local/bin/hlds start
ExecStop=/usr/local/bin/hlds stop
ExecReload=/usr/local/bin/hlds reload
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target</code></pre>



<ol class="wp-block-list" start="3"><li>Then execute:</li></ol>



<pre class="wp-block-code"><code lang="bash" class="language-bash">systemctl daemon-reload
systemctl enable hlds
service hlds start</code></pre>



<p class="wp-block-paragraph">Feel free to check out my server that&#8217;s running right now with the same Docker image! Here&#8217;s the command to connect via the console.</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">connect henrypoon.com:27015</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2018/09/23/setting-up-your-own-counter-strike-1-6-dedicated-server-via-docker/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2992</post-id>	</item>
		<item>
		<title>Moving an OS to another disk and still have it boot with Linux</title>
		<link>https://blog.henrypoon.com/blog/2016/01/28/moving-an-os-to-another-disk-and-still-have-it-boot-with-linux/</link>
					<comments>https://blog.henrypoon.com/blog/2016/01/28/moving-an-os-to-another-disk-and-still-have-it-boot-with-linux/#respond</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Fri, 29 Jan 2016 05:18:36 +0000</pubDate>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Booting]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Contents]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Device file]]></category>
		<category><![CDATA[Disk partitioning]]></category>
		<category><![CDATA[Disk partitions]]></category>
		<category><![CDATA[Drive]]></category>
		<category><![CDATA[Final]]></category>
		<category><![CDATA[GNU GRUB]]></category>
		<category><![CDATA[GNU Parted]]></category>
		<category><![CDATA[GParted]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Multi-booting]]></category>
		<category><![CDATA[Net]]></category>
		<category><![CDATA[Operating systems]]></category>
		<category><![CDATA[Plug]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Solid-state drive]]></category>
		<category><![CDATA[System software]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Z]]></category>
		<guid isPermaLink="false">https://blog.henrypoon.com/?p=2194</guid>

					<description><![CDATA[For the longest time, I&#8217;ve had an 80 GB HDD running my Windows partition (dual-boot setup with Ubuntu on a SSD), but now I&#8217;ve finally upgraded the Windows partition to an SSD as well. I looked into how to clone my Windows partition onto the SSD, such that I can still boot the disk. I [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">For the longest time, I&#8217;ve had an 80 GB HDD running my Windows partition (dual-boot setup with Ubuntu on a SSD), but now I&#8217;ve finally upgraded the Windows partition to an SSD as well. I looked into how to clone my Windows partition onto the SSD, such that I can still boot the disk.</p>



<p class="wp-block-paragraph">I already have Ubuntu as my main OS, so copying the disk was easy using <a href="http://linux.die.net/man/1/dd" target="_blank" rel="noopener noreferrer">dd</a>, which allows copying all the contents of one disk to another. This works well when the new hard drive is greater than or the same size as the current hard drive (I upgraded from a 80GB HDD to a 128GB SSD).</p>



<p class="wp-block-paragraph">First I run this to see which disk I am copying from and to</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">fdisk -l</code></pre>



<p class="wp-block-paragraph">Then I run dd. If I am copying from /dev/sda to /dev/sda, then it&#8217;s:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">dd if=/dev/sda of=/dev/sdb</code></pre>



<p class="wp-block-paragraph">But sometimes the disks don&#8217;t have the same size, so I used gparted to move/resize the partitions to make use of the extra space on the new disk. gparted complained that it might make my disk no bootable, but the disk was still bootable for me nonetheless. I didn&#8217;t even have to mess with any grub bootloader settings either. I simply unplugged the old disk, and left the new disk plugged in and booted into the new disk no problem.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2016/01/28/moving-an-os-to-another-disk-and-still-have-it-boot-with-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2194</post-id>	</item>
		<item>
		<title>Running League of Legends in PlayOnLinux (Ubuntu 14.04)</title>
		<link>https://blog.henrypoon.com/blog/2015/03/08/running-league-of-legends-in-playonlinux-ubuntu-14-04/</link>
					<comments>https://blog.henrypoon.com/blog/2015/03/08/running-league-of-legends-in-playonlinux-ubuntu-14-04/#comments</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Mon, 09 Mar 2015 01:45:11 +0000</pubDate>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[9]]></category>
		<category><![CDATA[APT]]></category>
		<category><![CDATA[Chan]]></category>
		<category><![CDATA[Click]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Comment]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Dia]]></category>
		<category><![CDATA[Directory]]></category>
		<category><![CDATA[Drive]]></category>
		<category><![CDATA[Find]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Icon]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[league of legends]]></category>
		<category><![CDATA[Lie]]></category>
		<category><![CDATA[Light]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[lol]]></category>
		<category><![CDATA[Nap]]></category>
		<category><![CDATA[Net]]></category>
		<category><![CDATA[NVIDIA]]></category>
		<category><![CDATA[Object]]></category>
		<category><![CDATA[Over]]></category>
		<category><![CDATA[PATH]]></category>
		<category><![CDATA[Pawn]]></category>
		<category><![CDATA[PlayOnLinux]]></category>
		<category><![CDATA[Radeon HD 5000 Series]]></category>
		<category><![CDATA[Riot Games]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Speed]]></category>
		<category><![CDATA[STR]]></category>
		<category><![CDATA[Struct]]></category>
		<category><![CDATA[System software]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Video cards]]></category>
		<category><![CDATA[Video gaming]]></category>
		<category><![CDATA[Vol]]></category>
		<category><![CDATA[Volume]]></category>
		<category><![CDATA[WINE]]></category>
		<category><![CDATA[Z]]></category>
		<guid isPermaLink="false">https://www.henrypoon.com/blog/?p=2053</guid>

					<description><![CDATA[There are various guides floating around on the Internet for running League of Legends on Linux, and no single guide worked for me, but after piecing the information together from various places, I managed to get it to work on my system. My computer specifications: Intel Core i5-4570 16 GB Memory Radeon HD 5770 I [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">There are various guides floating around on the Internet for running League of Legends on Linux, and no single guide worked for me, but after piecing the information together from various places, I managed to get it to work on my system.</p>



<p class="wp-block-paragraph">My computer specifications:</p>



<ul class="wp-block-list"><li>Intel Core i5-4570</li><li>16 GB Memory</li><li>Radeon HD 5770</li></ul>



<p class="wp-block-paragraph">I followed the instructions <a href="http://askubuntu.com/questions/459888/shop-and-in-game-item-shop-not-working-in-league-of-legend-lol/461256#461256" target="_blank" rel="noopener noreferrer">here</a>, with these changes:</p>



<ul class="wp-block-list"><li>Using video driver &#8220;fglrx-updates&#8221; (the tutorial talks about NVIDIA cards)</li><li>Did not install TuxLoL</li><li>Did not do anything regarding the &#8220;Maestro error&#8221; since it only applies to Optimus Notebook users</li><li>Did not follow step 6 because I did not run into the problem for big item icon text for the item shop</li><li>EDIT: Thanks to Ingvar&#8217;s comment, the installation progress for the game can be viewed like so: open terminal (Ctrl+Alt+T) and execute: </li></ul>



<pre class="wp-block-code"><code lang="bash" class="language-bash">tail -f ~/.PlayOnLinux/wineprefix/LeagueOfLegends/drive_c/Riot\ Games/League\ of\ Legends/Logs/Patcher\ Logs/*.log</code></pre>



<p class="wp-block-paragraph">There are also other steps that I had to do, which I read from <a href="https://www.playonlinux.com/en/app-1135-League_Of_Legends.html" target="_blank" rel="noopener noreferrer">here</a>:</p>



<ul class="wp-block-list"><li>Click configure for the &#8220;League of Legends&#8221; entry in &#8220;PlayOnLinux&#8221; and find the &#8220;Display&#8221; tab and then choose the following options: <ul><li>Direct Draw Renderer &#8211; gdi</li><li>Video memory size &#8211; 4096 (or something else depending on graphics card)</li><li>Offscreen rendering mode &#8211; fbo\0</li><li>Everything else on default </li></ul></li><li>Create a file called &#8220;game.cfg&#8221; in the directory &#8220;/home/your-username-here/PlayOnLinux&#8217;s virtual drives/LeagueOfLegends/drive_c/Riot Games/League of Legends/Config&#8221;. Below is what I have in my &#8220;game.cfg&#8221;:</li></ul>



<pre class="wp-block-code"><code lang="properties" class="language-properties">[General]
EnableAudio=1
GameMouseSpeed=10
UserSetResolution=1
BindSysKeys=0
SnapCameraOnRespawn=0
OSXMouseAcceleration=1
AutoAcquireTarget=0
EnableLightFx=0
WindowMode=0
ShowTurretRangeIndicators=0
PredictMovement=0
WaitForVerticalSync=0
Colors=32
Height=1080
Width=1920
SystemMouseSpeed=0
CfgVersion=5.3.296
x3d_platform=1</code></pre>



<pre class="wp-block-code"><code lang="properties" class="language-properties">[HUD]
CameraLockMode=0
MiddleClickDragScrollEnabled=0
KeyboardScrollSpeed=0.5000
ChatScale=50
ObjectTooltips=0
AutoDisplayTarget=0
ShowAllChannelChat=1
ShowTimestamps=1
ItemShopPrevY=39
ItemShopPrevX=106
NameTagDisplay=1
ShowChampionIndicator=0
ShowSummonerNames=1
ScrollSmoothingEnabled=0
MiddleMouseScrollSpeed=0.5000
MapScrollSpeed=0.5000
ShowAttackRadius=0
NumericCooldownFormat=1
SmartCastOnKeyRelease=0
EnableLineMissileVis=0
FlipMiniMap=1
ItemShopResizeHeight=0
ItemShopResizeWidth=164
ItemShopPrevResizeHeight=1080
ItemShopPrevResizeWidth=1920
ItemShopItemDisplayMode=1
ItemShopStartPane=1</code></pre>



<pre class="wp-block-code"><code lang="properties" class="language-properties">[Performance]
CharacterInking=1
ShadowsEnabled=1
EnableHUDAnimations=0
PerPixelPointLighting=0
EnableParticleOptimizations=0
BudgetOverdrawAverage=0
BudgetSkinnedVertexCount=0
BudgetSkinnedDrawCallCount=0
BudgetTextureUsage=0
BudgetVertexCount=0
BudgetTriangleCount=0
BudgetDrawCallCount=0
EnableGrassSwaying=0
EnableFXAA=0
AdvancedShader=0
FrameCapType=6
GammaEnabled=0
Full3DModeEnabled=0
AutoPerformanceSettings=0
CharacterQuality=4
EffectsQuality=4
EnvironmentQuality=4
ShadowQuality=4
GraphicsSlider=6
paths=0</code></pre>



<pre class="wp-block-code"><code lang="properties" class="language-properties">[FloatingText]
EnemyTrueDamageCritical_Enabled=1
EnemyMagicalDamageCritical_Enabled=1
EnemyPhysicalDamageCritical_Enabled=1
TrueDamageCritical_Enabled=1
MagicalDamageCritical_Enabled=1
PhysicalDamageCritical_Enabled=1
Countdown_Enabled=0
EnemyTrueDamage_Enabled=0
EnemyMagicalDamage_Enabled=0
EnemyPhysicalDamage_Enabled=0
TrueDamage_Enabled=0
MagicalDamage_Enabled=0
PhysicalDamage_Enabled=0
Score_Enabled=0
QuestComplete_Enabled=0
QuestReceived_Enabled=0
Disable_Enabled=0
Level_Enabled=0
Dodge_Enabled=0
Heal_Enabled=0
Special_Enabled=0
Invulnerable_Enabled=0
Debug_Enabled=0
Absorbed_Enabled=0
OMW_Enabled=0
EnemyCritical_Enabled=0
MagicCritical_Enabled=0
Critical_Enabled=0</code></pre>



<pre class="wp-block-code"><code lang="properties" class="language-properties">[Volume]
SfxVolume=0.5
MasterVolume=0.5</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2015/03/08/running-league-of-legends-in-playonlinux-ubuntu-14-04/feed/</wfw:commentRss>
			<slash:comments>27</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2053</post-id>	</item>
		<item>
		<title>Running TurboTax 2014 in PlayOnLinux</title>
		<link>https://blog.henrypoon.com/blog/2015/03/07/running-turbotax-2014-in-playonlinux/</link>
					<comments>https://blog.henrypoon.com/blog/2015/03/07/running-turbotax-2014-in-playonlinux/#comments</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Sun, 08 Mar 2015 05:08:28 +0000</pubDate>
				<category><![CDATA[gaming]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[.exe]]></category>
		<category><![CDATA[9]]></category>
		<category><![CDATA[APT]]></category>
		<category><![CDATA[Click]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Drive]]></category>
		<category><![CDATA[EAR]]></category>
		<category><![CDATA[Find]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Installation software]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Net]]></category>
		<category><![CDATA[PlayOnLinux]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[Shortcut]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[System software]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[TurboTax]]></category>
		<category><![CDATA[UNC]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows Installer]]></category>
		<category><![CDATA[WINE]]></category>
		<guid isPermaLink="false">https://www.henrypoon.com/blog/?p=2050</guid>

					<description><![CDATA[This guide describes how to run TurboTax 2014 in PlayOnLinux. &#160;The PlayOnLinux (in combination with WINE) software allows users to install Windows-based software. CAVEAT: NETFILE&#160;did not work for me. &#160;I had to submit my taxes through an installation done on Windows Install&#160;PlayOnLinux and then run it (e.g. starting it through the Terminal) sudo apt-get install [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This guide describes how to run TurboTax 2014 in <a href="https://www.playonlinux.com/en/" target="_blank" rel="noopener noreferrer">PlayOnLinux</a>. &nbsp;The PlayOnLinux (in combination with <a href="https://www.winehq.org/" target="_blank" rel="noopener noreferrer">WINE</a>) software allows users to install Windows-based software.</p>
<hr />
<p>CAVEAT: NETFILE&nbsp;did not work for me. &nbsp;I had to submit my taxes through an installation done on Windows</p>
<hr />
<ol>
<li>Install&nbsp;PlayOnLinux and then run it (e.g. starting it through the Terminal)</li>
</ol>
<pre>sudo apt-get install playonlinux</pre>
<ol start="2">
<li>Click &#8220;Tools&#8221; &gt; &#8220;Manage wine versions&#8221;</li>
<li>Choose 1.7.27 under &#8220;Available Wine versions&#8221; and then click the right arrow &#8220;&gt;&#8221;</li>
<li>Go through the steps in the installer and let it finish</li>
<li>Back in the PlayOnLinux main screen, click &#8220;Install&#8221; in the menu, and then click &#8220;Install a non-listed program&#8221; on the bottom left</li>
<li>Choose &#8220;Use another version of Wine&#8221;, when asked, and then choose 1.7.27</li>
<li>Choose &#8220;Install a program in a new virtual drive&#8221;, when asked</li>
<li>Choose &#8220;32 bits windows installation&#8221;, when asked</li>
<li>Find the location of setup.exe for the TurboTax installer (I copied the files off of the disc to a place on my hard drive)</li>
<li>Ignore the message &#8220;Error in FS_Check&#8221; if it appears</li>
<li>Let the install complete, but do not launch TurboTax right away</li>
<li>Choose &#8220;tt2014.exe&#8221;, if asked to create a shortcut</li>
<li>Back in the PlayOnLinux main screen, select entry for TurboTax and click &#8220;Configure&#8221; in the menu</li>
<li>Make sure the &#8220;Wine version&#8221; is set to 1.7.27</li>
<li>Under &#8220;Install components&#8221;, install the following in this order (some of these may not be required, but I don&#8217;t know which since this is the configuration that worked for me):
<ul>
<li>vcrun2012</li>
<li>Microsoft Core Fonts</li>
<li>msvc100</li>
<li>RegisterFonts</li>
<li>vcrun2010</li>
<li>dotnet40</li>
<li>d3dx9</li>
<li>mono28</li>
<li>Internet Explorer 8 (click &#8220;Restart&#8221; in the installer)</li>
<li>crypt32</li>
</ul>
</li>
<li>Back in the PlayOnLinux main screen, clicking &#8220;Run&#8221; for TurboTax 2014 should now work!</li>
</ol>
<p>This is what worked for me, so hopefully this will work for others.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2015/03/07/running-turbotax-2014-in-playonlinux/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2050</post-id>	</item>
		<item>
		<title>Running LINE Messenger in Ubuntu 14.04</title>
		<link>https://blog.henrypoon.com/blog/2015/02/09/running-line-messenger-in-ubuntu-14-04/</link>
					<comments>https://blog.henrypoon.com/blog/2015/02/09/running-line-messenger-in-ubuntu-14-04/#comments</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Mon, 09 Feb 2015 22:25:38 +0000</pubDate>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[9]]></category>
		<category><![CDATA[APT]]></category>
		<category><![CDATA[BackSlash Linux]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Chrome OS]]></category>
		<category><![CDATA[Computer architecture]]></category>
		<category><![CDATA[Computing platforms]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[EAR]]></category>
		<category><![CDATA[Extension]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Lie]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Lubuntu]]></category>
		<category><![CDATA[Microsoft Windows]]></category>
		<category><![CDATA[Net]]></category>
		<category><![CDATA[Operating systems]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[STR]]></category>
		<category><![CDATA[System software]]></category>
		<category><![CDATA[Thou]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WINE]]></category>
		<guid isPermaLink="false">https://www.henrypoon.com/blog/?p=2039</guid>

					<description><![CDATA[LINE is a messaging program kind of like WhatsApp, but it has a desktop client. &#160;However, this desktop client only runs on Windows. &#160;On Linux, it has to run under Wine, which&#160;allows running Windows programs (some) inside the Linux environment. &#160;Caveat: sending stickers does not appear to work. UPDATE 7. JULY 2015: Since this post, [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">LINE is a messaging program kind of like WhatsApp, but it has a desktop client. &nbsp;However, this desktop client only runs on Windows. &nbsp;On Linux, it has to run under <a href="https://www.winehq.org/" target="_blank" rel="noopener noreferrer">Wine</a>, which&nbsp;allows running Windows programs (some) inside the Linux environment. &nbsp;Caveat: sending stickers does not appear to work.</p>



<p class="wp-block-paragraph">UPDATE 7. JULY 2015: Since this post, my version of LINE has been updated to 4.0.3.367, and it looks like stickers work now!</p>



<p class="wp-block-paragraph"><span style="color: #ff0000;">UPDATE 31. JULY 2016: Looks like in July 2015, LINE released a Chrome app.  Users of Chrome can just use that extension instead of using this method:</span> <a href="https://chrome.google.com/webstore/detail/line/ophjlpahpchlmihnnnihgmmeilfjmjjc" target="_blank" rel="noreferrer noopener">Link</a></p>



<p class="wp-block-paragraph">Running LINE in Ubuntu 14.04</p>



<ol class="wp-block-list"><li>Install Wine</li></ol>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo apt-get install wine</code></pre>



<ol class="wp-block-list" start="2"><li>Install VC++ 2008 Redistributable</li></ol>



<pre class="wp-block-code"><code lang="bash" class="language-bash">winetricks vcrun2008</code></pre>



<ol class="wp-block-list" start="3"><li>Download and install <a href="http://line.me/en-US/download" target="_blank" rel="noopener noreferrer">LINE</a> for Windows</li></ol>



<p class="wp-block-paragraph">Without installing the VC++ 2008 Redistributable, LINE would intermittently crash (even though it was able to start correctly). &nbsp;This worked on my Ubuntu 14.04 x64 system.</p>



<p class="wp-block-paragraph">LINE Version: 3.9.1.188<br>Wine Version: 1.6.2</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2015/02/09/running-line-messenger-in-ubuntu-14-04/feed/</wfw:commentRss>
			<slash:comments>26</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2039</post-id>	</item>
		<item>
		<title>Disabling Mouse Acceleration in Ubuntu</title>
		<link>https://blog.henrypoon.com/blog/2015/01/25/disabling-mouse-acceleration-in-ubuntu/</link>
					<comments>https://blog.henrypoon.com/blog/2015/01/25/disabling-mouse-acceleration-in-ubuntu/#comments</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Sun, 25 Jan 2015 08:31:32 +0000</pubDate>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[AWK]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Computer mice]]></category>
		<category><![CDATA[Computer mouse]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Counter-Strike]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Digital technology]]></category>
		<category><![CDATA[DirectInput]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[IME]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mass]]></category>
		<category><![CDATA[mouse acceleration]]></category>
		<category><![CDATA[Plan]]></category>
		<category><![CDATA[Plug]]></category>
		<category><![CDATA[Programming languages]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[Sleep]]></category>
		<category><![CDATA[STR]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[Trac]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">https://www.henrypoon.com/blog/?p=1955</guid>

					<description><![CDATA[I&#8217;ve been quite accustomed to disabling mouse acceleration on my Windows machine (thanks to playing massive amounts of Counter-Strike back in the day), but now that I&#8217;ve started to use Linux a bit more, I&#8217;ve found that disabling mouse acceleration was not as easy as in Windows. Script I&#8217;ve managed to produce a script to [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I&#8217;ve been quite accustomed to disabling mouse acceleration on my Windows machine (thanks to playing massive amounts of Counter-Strike back in the day), but now that I&#8217;ve started to use Linux a bit more, I&#8217;ve found that disabling mouse acceleration was not as easy as in Windows.</p>



<h1 class="wp-block-heading">Script</h1>



<p class="wp-block-paragraph">I&#8217;ve managed to produce a script to disable mouse acceleration (works for me on Ubuntu 14.04).  However, this script needs to be run every time the computer boots because the settings don&#8217;t stay.  Here is the script:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">#wait for the desktop to settle
sleep 5

#gets the hardware id's of all mice plugged into the system
hardwareIds=$(xinput | grep -i mouse | awk '{print substr($(NF-3),4)}')

#turn off mouse acceleration
for i in $hardwareIds
do
xinput set-prop ${i} 'Device Accel Profile' -1
xinput set-prop ${i} 'Device Accel Velocity Scaling' 1
done</code></pre>



<h1 class="wp-block-heading">Explanation</h1>



<p class="wp-block-paragraph">The script works by extracting the hardware id&#8217;s of the mice that are connected to the system and then applying properties to them that disable mouse acceleration for that device.  The extraction of the mouse hardware id&#8217;s are done with this:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">#gets the hardware id's of all mice plugged into the system
hardwareIds=$(xinput | grep -i mouse | awk '{print substr($(NF-3),4)}')</code></pre>



<p class="wp-block-paragraph">Calling xinput in the Terminal will list all the connected input devices, which is grepped (case insensitively) for the word &#8220;mouse&#8221;, which gives something like this on my machine:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>⎜ ↳ Logitech G500s Laser Gaming Mouse id=14 [slave pointer (2)]<br>⎜ ↳ Logitech G500s Laser Gaming Mouse id=15 [slave pointer (2)]</p></blockquote>



<p class="wp-block-paragraph">The call to awk extracts the hardware id&nbsp;from those two lines (14, 15 in the above case) and stores them in an array that is iterated through when setting the mouse properties.</p>



<h1 class="wp-block-heading">Reference</h1>



<p class="wp-block-paragraph">This is the website that showed me how to disable mouse acceleration to begin with:&nbsp;<a href="http://ubuntuforums.org/showthread.php?t=1734400" target="_blank" rel="noopener noreferrer">http://ubuntuforums.org/showthread.php?t=1734400</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2015/01/25/disabling-mouse-acceleration-in-ubuntu/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1955</post-id>	</item>
		<item>
		<title>Installing RXTX for Serial Communication with Java</title>
		<link>https://blog.henrypoon.com/blog/2010/12/25/installing-rxtx-for-serial-communication-with-java/</link>
					<comments>https://blog.henrypoon.com/blog/2010/12/25/installing-rxtx-for-serial-communication-with-java/#comments</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Sun, 26 Dec 2010 05:41:03 +0000</pubDate>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[64-bit computers]]></category>
		<category><![CDATA[64-bit computing]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Comment]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Computing platforms]]></category>
		<category><![CDATA[Cross-platform software]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Digital technology]]></category>
		<category><![CDATA[Directory]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Go]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[ise]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java platform]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Operating systems]]></category>
		<category><![CDATA[Page]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[Program Files]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Programming languages]]></category>
		<category><![CDATA[RAR]]></category>
		<category><![CDATA[Serial]]></category>
		<category><![CDATA[Serial communication]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[STR]]></category>
		<category><![CDATA[Struct]]></category>
		<category><![CDATA[Thou]]></category>
		<category><![CDATA[tuna]]></category>
		<category><![CDATA[UNIX System V]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[X86]]></category>
		<category><![CDATA[Z]]></category>
		<guid isPermaLink="false">http://henrypoon.mooo.com/blog/installing-rxtx-for-serial-communication-with-java</guid>

					<description><![CDATA[Java supports communication to serial ports, but not with its default installation.&#160; It requires an installation of an external library.&#160; Currently, two options exist for achieving serial communication: RXTX JavaComm Unfortunately, the current version of JavaComm does not support Windows, and only supports Solaris SPARC, Solaris x86, and Linux x86.&#160; Since I use none of [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Java supports communication to serial ports, but not with its default installation.&nbsp; It requires an installation of an external library.&nbsp; Currently, two options exist for achieving serial communication:</p>



<ul class="wp-block-list"><li><a href="http://rxtx.qbang.org/wiki/index.php/Main_Page" target="_blank" rel="noreferrer noopener">RXTX</a></li><li><a rel="noopener noreferrer" href="http://www.oracle.com/technetwork/java/index-jsp-141752.html" target="_blank">JavaComm</a></li></ul>



<p class="wp-block-paragraph">Unfortunately, the current version of JavaComm does not support Windows, and only supports Solaris SPARC, Solaris x86, and Linux x86.&nbsp; Since I use none of those operating systems, this article will only discuss how to install RXTX in Windows.</p>



<p class="wp-block-paragraph">UPDATE: 12 Sept 2011 – Thanks to a comment from Kurt Zoglmann, there are instructions on how to do this with a Mac!  I never tried this myself because I don’t have a Mac, but the procedures stated there look good to me (see <a href="#comments">comments</a>).</p>



<p class="wp-block-paragraph">A 32 and 64 bit version of the library exists. &nbsp; I&#8217;ve updated this article from when it was first published to include the new locations for where to download the libraries, but I have not gone through the installation of the libraries again, so I&#8217;m not surprised if the rest of the content on this page is outdated too.</p>



<p class="wp-block-paragraph">32-bit version: <a rel="noopener noreferrer" href="http://rxtx.qbang.org/wiki/index.php/Download" target="_blank">http://rxtx.qbang.org/wiki/index.php/Download</a><br>64-bit version: <a rel="noopener noreferrer" href="http://fizzed.com/oss/rxtx-for-java" target="_blank">http://fizzed.com/oss/rxtx-for-java</a></p>



<p class="wp-block-paragraph">To install the libraries (instructions from <a href="http://www.jcontrol.org/download/readme_rxtx_en.html" target="_blank" rel="noopener noreferrer">JControl</a>):</p>



<ol class="wp-block-list"><li>Copy rxtxSerial.dll to %JAVA_HOME%\bin, (%JAVA_HOME% is the folder where JRE is installed on your system; e.g. c:\Program Files\Java\j2re1.4.1_01)</li><li>Copy RXTXcomm.jar to %JAVA_HOME%\lib\ext</li></ol>



<p class="wp-block-paragraph">Once installed, the IDE will need to know where to look for these installed files.&nbsp; Even though the files exist in the JRE directory, each project needs to know about these files.&nbsp; More information on <a href="http://rxtx.qbang.org/wiki/index.php/Using_RXTX" target="_blank" rel="noopener noreferrer">this website</a>.</p>



<p class="wp-block-paragraph">In order to start coding with this library, import gnu.io.*.  For more information about Java Serial Programming, look <a href="http://henrypoon.wordpress.com/2010/10/11/java-serial-programming/" target="_blank" rel="noreferrer noopener">here</a>.</p>



<p class="wp-block-paragraph">Happy coding!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2010/12/25/installing-rxtx-for-serial-communication-with-java/feed/</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">543</post-id>	</item>
		<item>
		<title>Java Serial Programming</title>
		<link>https://blog.henrypoon.com/blog/2010/10/11/java-serial-programming/</link>
					<comments>https://blog.henrypoon.com/blog/2010/10/11/java-serial-programming/#comments</comments>
		
		<dc:creator><![CDATA[hp]]></dc:creator>
		<pubDate>Tue, 12 Oct 2010 00:35:19 +0000</pubDate>
				<category><![CDATA[computer stuff]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[COM]]></category>
		<category><![CDATA[Computer buses]]></category>
		<category><![CDATA[Cookbook]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Electromagnetism]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Embedded systems]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[It]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[Page]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[Physical computing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[RAR]]></category>
		<category><![CDATA[Run]]></category>
		<category><![CDATA[Serial]]></category>
		<category><![CDATA[Serial communication]]></category>
		<category><![CDATA[Thou]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">http://henrypoon.mooo.com/blog/java-serial-programming</guid>

					<description><![CDATA[After fiddling with using the Serial Monitor on the Arduino IDE for serial communication inputs, I thought it was very useful to set up my own program to achieve the serial communication so that I didn’t have to rely on the Serial Monitor for it.&#160; I came across a serial communication API called JavaComm (more [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>After fiddling with using the Serial Monitor on the Arduino IDE for serial communication inputs, I thought it was very useful to set up my own program to achieve the serial communication so that I didn’t have to rely on the Serial Monitor for it.&nbsp; I came across a serial communication API called JavaComm (more info in the link below).&nbsp; Only its 2.0 version will run on Windows, but there is a 3.0 version that is available for Linux users.&nbsp; The article discusses how to use the library to achieve serial communication, and has a lot of example code to follow.&nbsp; The PDF in the other link below has information on how to use the JavaComm API, and the information there is presented a little better than Wiki pages, since Wiki pages seem to be loaded with technical information that beginners (like me), can’t really follow too well.</p>
<p>Link: <a title="http://en.wikibooks.org/wiki/Serial_Programming/Serial_Java" href="http://en.wikibooks.org/wiki/Serial_Programming/Serial_Java" target="_blank" rel="noopener noreferrer">http://en.wikibooks.org/wiki/Serial_Programming/Serial_Java</a></p>
<p>Link: <a title="http://java.sun.com/developer/Books/javaprogramming/cookbook/11.pdf" href="http://java.sun.com/developer/Books/javaprogramming/cookbook/11.pdf" target="_blank" rel="noopener noreferrer">http://java.sun.com/developer/Books/javaprogramming/cookbook/11.pdf</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.henrypoon.com/blog/2010/10/11/java-serial-programming/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">429</post-id>	</item>
	</channel>
</rss>
