Jekyll2023-07-29T09:18:49+00:00https://adrian.ng/feed.xmlHomeThis is the website of __Adrian Ng__. _My_ website. Here you will see examples of my _Java projects_ and my notes on writing _SQL_Adrian Ngcontact@adrian.ngFitness Dashboard (dev)2020-04-07T00:00:00+00:002020-04-07T00:00:00+00:00https://adrian.ng/fitness-dev<html>
<iframe width="100%" height="4000" src="https://datastudio.google.com/embed/reporting/75ace9ec-f901-4345-80f7-d40e08044d70/page/WqDLB" frameborder="0" style="border:0" allowfullscreen=""></iframe>
</html>Adrian Ngcontact@adrian.ngWitness the FitnessFitness Dashboard2020-04-05T00:00:00+00:002020-04-05T00:00:00+00:00https://adrian.ng/fitness-dashboard<html>
<iframe width="100%" height="4000" src="https://datastudio.google.com/embed/reporting/75ace9ec-f901-4345-80f7-d40e08044d70/page/WqDLB" frameborder="0" style="border:0" allowfullscreen=""></iframe>
</html>Adrian Ngcontact@adrian.ngWitness the FitnessHBase2019-03-17T00:00:00+00:002019-03-17T00:00:00+00:00https://adrian.ng/notes/hbase<h2 id="hbase-is-installed-here">HBase is installed here:</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/usr/local/hbase/
</code></pre></div></div>
<h2 id="config-files">Config files:</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/usr/local/hbase/config
</code></pre></div></div>
<h2 id="binaries">Binaries:</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/usr/local/hbase/bin
</code></pre></div></div>
<h2 id="startstop-hbase">Start/Stop HBase:</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/usr/local/hbase/bin<span class="nv">$ </span>./start-hbase.sh
/usr/local/hbase/bin<span class="nv">$ </span>./stop-hbase.sh
</code></pre></div></div>
<h2 id="hbase-files-in-hdfs">HBase files in HDFS:</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>hadoop fs <span class="nt">-ls</span> ../../hbase
</code></pre></div></div>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Found 10 items
drwxr-xr-x - hduser supergroup 0 2019-03-17 11:51 ../../hbase/.tmp
drwxr-xr-x - hduser supergroup 0 2019-03-17 11:51 ../../hbase/MasterProcWALs
drwxr-xr-x - hduser supergroup 0 2019-03-17 11:51 ../../hbase/WALs
drwxr-xr-x - hduser supergroup 0 2019-03-17 11:53 ../../hbase/archive
drwxr-xr-x - hduser supergroup 0 2019-03-17 11:50 ../../hbase/corrupt
drwxr-xr-x - hduser supergroup 0 2019-03-17 00:21 ../../hbase/data
drwxr-xr-x - hduser supergroup 0 2019-03-17 00:21 ../../hbase/hbase
-rw-r--r-- 1 hduser supergroup 42 2019-03-17 00:21 ../../hbase/hbase.id
-rw-r--r-- 1 hduser supergroup 7 2019-03-17 00:21 ../../hbase/hbase.version
drwxr-xr-x - hduser supergroup 0 2019-03-17 11:52 ../../hbase/oldWALs
</code></pre></div></div>
<h2 id="hbase-web-ui">HBase Web UI</h2>
<p><a href="localhost:16010">localhost:16010</a></p>
<h2 id="start-hbase-shell">Start HBase shell:</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>/usr/local/hbase/bin<span class="nv">$ </span>./hbase shell
</code></pre></div></div>Adrian Ngcontact@adrian.ngNote to self - this is how i installed HBase and got it runningGit2019-02-08T00:00:00+00:002019-02-08T00:00:00+00:00https://adrian.ng/notes/git<h2 id="git-setup">git setup</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git config <span class="nt">--global</span> user.name <span class="s2">""</span>
git config <span class="nt">--global</span> user.email <span class="s2">""</span>
git config <span class="nt">--global</span> credential.helper store
</code></pre></div></div>
<h2 id="git-rm">git rm</h2>
<p>This example removes from the local repository all the auxillary files that <code class="language-plaintext highlighter-rouge">TeX</code> likes to generate each time I render my cv.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git <span class="nb">rm</span> <span class="nt">--cached</span> cv.aux cv.fdb_latexmk cv.fls cv.log cv.out .cv.synctex
</code></pre></div></div>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git status
Changes to be committed:
<span class="o">(</span>use <span class="s2">"git reset HEAD <file>..."</span> to unstage<span class="o">)</span>
deleted: cv.aux
deleted: cv.fdb_latexmk
deleted: cv.fls
deleted: cv.log
deleted: cv.out
deleted: cv.synctex.gz
Untracked files:
<span class="o">(</span>use <span class="s2">"git add <file>..."</span> to include <span class="k">in </span>what will be committed<span class="o">)</span>
cv.aux
cv.fdb_latexmk
cv.fls
cv.log
cv.out
cv.synctex.gz
</code></pre></div></div>
<p>Now I need to ignore these files. I create a <code class="language-plaintext highlighter-rouge">.gitignore</code> file in the root of the respository.</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">touch</span> .gitignore
</code></pre></div></div>
<p>And it’s just a matter of adding filenames to this file. After which, they should not long appear in the list of untracked files:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Changes to be committed:
<span class="o">(</span>use <span class="s2">"git reset HEAD <file>..."</span> to unstage<span class="o">)</span>
deleted: cv.aux
deleted: cv.fdb_latexmk
deleted: cv.fls
deleted: cv.log
deleted: cv.out
deleted: cv.synctex.gz
Untracked files:
<span class="o">(</span>use <span class="s2">"git add <file>..."</span> to include <span class="k">in </span>what will be committed<span class="o">)</span>
.gitignore
</code></pre></div></div>Adrian Ngcontact@adrian.nggit setupPackages2019-02-08T00:00:00+00:002019-02-08T00:00:00+00:00https://adrian.ng/notes/packages<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>apt update <span class="o">&&</span> <span class="nb">sudo </span>apt upgrade
</code></pre></div></div>
<h2 id="install-xorg">install xorg</h2>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>apt-get <span class="nb">install </span>xauth
<span class="nb">sudo </span>apt-get <span class="nb">install </span>xorg openbox
</code></pre></div></div>
<h2 id="install-vs-code">install VS code</h2>
<p><a href="https://code.visualstudio.com/docs/setup/linux">Reference</a></p>
<p>The repository and key can also be installed manually with the following script:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl https://packages.microsoft.com/keys/microsoft.asc | gpg <span class="nt">--dearmor</span> <span class="o">></span> microsoft.gpg
<span class="nb">sudo install</span> <span class="nt">-o</span> root <span class="nt">-g</span> root <span class="nt">-m</span> 644 microsoft.gpg /etc/apt/trusted.gpg.d/
<span class="nb">sudo </span>sh <span class="nt">-c</span> <span class="s1">'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'</span>
</code></pre></div></div>
<p>Then update the package cache and install the package using:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>apt-get <span class="nb">install </span>apt-transport-https
<span class="nb">sudo </span>apt-get update
<span class="nb">sudo </span>apt-get <span class="nb">install </span>code
</code></pre></div></div>
<p>This also needs to be installed:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>apt-get <span class="nb">install </span>libasound2
</code></pre></div></div>
<p>To run <em>code</em>:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#normally</span>
code
<span class="c">#if nothing happens</span>
code <span class="nt">--verbose</span>
<span class="c"># if x11 doesn't like your GPU</span>
code <span class="nt">--disable-gpu</span>
</code></pre></div></div>
<h1 id="tex">TeX</h1>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>apt-get <span class="nb">install </span>texlive-full
</code></pre></div></div>
<p>Then i use <em>VS Code</em> as my <code class="language-plaintext highlighter-rouge">TeX</code> editor.</p>Adrian Ngcontact@adrian.ngHow I installed my Ubuntu packagesSSH2019-02-08T00:00:00+00:002019-02-08T00:00:00+00:00https://adrian.ng/notes/ssh<h1 id="ssh">ssh</h1>
<p>because I always have problems with <code class="language-plaintext highlighter-rouge">ssh localhost</code> on <code class="language-plaintext highlighter-rouge">wsl</code></p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>service ssh start
</code></pre></div></div>Adrian Ngcontact@adrian.ngRunning Ubuntu on WSL means I have to restart SSH a lotHardware Timeline2019-01-27T00:00:00+00:002019-01-27T00:00:00+00:00https://adrian.ng/hardware<h2 id="reference">Reference</h2>
<p><a href="https://developers.google.com/chart/interactive/docs/gallery/timeline">https://developers.google.com/chart/interactive/docs/gallery/timeline</a></p>
<h2 id="computer">Computer</h2>
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:["timeline"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('timeline');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Position' });
dataTable.addColumn({ type: 'string', id: 'Name' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
[ 'CPU', 'AMD Athlon/Duron Socket 462', new Date(1999, 0, 1), new Date(2004, 6, 8) ],
[ 'CPU', 'AMD Athlon 64', new Date(2004, 6, 8), new Date(2007, 7, 25) ],
[ 'CPU', 'Intel Core 2 Duo E6750 2.66GHz', new Date(2007, 7, 25), new Date(2011, 8, 19) ],
[ 'CPU', 'Intel Pentium E6600', new Date(2011, 8, 19), new Date(2012, 11, 27) ],
[ 'CPU', 'Intel i5 3570k', new Date(2012, 11, 27), new Date() ],
[ 'Motherboard', 'ASUS A7M-266', new Date(1999, 0, 1), new Date(2004, 6, 8) ],
[ 'Motherboard', 'ASUS K8V-SE Deluxe S754', new Date(2004, 6, 8), new Date(2007, 7, 25) ],
[ 'Motherboard', 'ASUS P5B Socket 775', new Date(2007, 7, 25), new Date(2010, 7, 24) ],
[ 'Motherboard', 'Asus P5Q SE Plus Socket 775', new Date(2010, 7, 24), new Date(2012, 11, 27) ],
[ 'Motherboard', 'Asus P8Z77-V Motherboard LGA 1150', new Date(2012, 11, 27), new Date() ],
[ 'GPU', 'PalitDaytona nVidia Riva TNT2 m64', new Date(1999, 0, 1), new Date(2000, 0, 1) ],
[ 'GPU', 'Geforce 2 mx400 64mb', new Date(2000, 0, 1), new Date(2001, 0, 1) ],
[ 'GPU', 'Geforce 4 4200Ti 128mb', new Date(2001, 0, 1), new Date(2004, 0, 1) ],
[ 'GPU', 'Sapphire 9800 Pro', new Date(2004, 0, 1), new Date(2006, 0, 1) ],
[ 'GPU', 'BFG 7800 GS OC 256MB', new Date(2006, 0, 1), new Date(2007, 8, 22) ],
[ 'GPU', 'EVGA 8800GTS 320MB', new Date(2007, 8, 22), new Date(2012, 11, 27) ],
[ 'GPU', 'EVGA GTX 670 2GB', new Date(2012, 11, 27), new Date(2014, 6, 14) ],
[ 'GPU', 'Asus GeForce GTX 670 DirectCU II OC', new Date(2013,7,13), new Date(2016,7,8) ],
[ 'GPU', 'Asus GeForce GTX 670 DirectCU II OC', new Date(2014, 6, 9), new Date(2016, 7, 8)],
[ 'GPU', 'MSI 1080 Armor OC 8GB', new Date(2016, 7, 8), new Date() ],
[ 'RAM', 'Extra Value 1GB DDR2', new Date(2007,8,22), new Date(2012,11,27)],
[ 'RAM', 'Crucial 4GB DDR2', new Date(2009,4,19), new Date(2012,11,27)],
[ 'RAM', 'Corsair 4GB DDR2', new Date(2011,11,22), new Date(2012,11,27)],
[ 'RAM', 'Corsair Vengeance 8GB DDR3', new Date(2017, 3, 14), new Date()],
[ 'RAM', 'Corsair Vengeance 8GB DDR3', new Date(2012, 11, 27), new Date()],
[ 'Soundcard', 'M-Audio Audiophile 2496', new Date(2011, 3, 3), new Date(2014,6,22)],
[ 'Soundcard', 'Asus Xonar Essence STX', new Date(2014, 6, 22), new Date()],
//[ 'Monitor', 'Dell 1907 fpt', new Date(2007,5,30), new Date(2015,8,9)],
[ 'Monitor', 'Dell Ultrasharp 2407WFP 24', new Date(2007,5,30), new Date(2015,8,9)],
[ 'Monitor', 'Samsung 34 Curved Ultrawide S34E790C', new Date(2015,8,9), new Date()],
[ 'Mouse', 'Logitech Cordless Trackman Wheel', new Date(2004, 11, 11), new Date(2006,11,11)],
[ 'Mouse', 'Logitech G7', new Date(2006, 11, 11), new Date(2008,5,9)],
[ 'Mouse', 'Logitech MX Revolution', new Date(2008, 5, 9), new Date(2012,4,15)],
[ 'Mouse', 'Logitech MX Performance', new Date(2012, 4, 15), new Date(2014,4,21)],
[ 'Mouse', 'Logitech MX Performance', new Date(2014, 4, 21), new Date(2016,4,9)],
[ 'Mouse', 'Logitech MX Master', new Date(2016, 4, 9), new Date()],
[ 'Keyboard', 'Logitech Wave', new Date(2009, 4, 21), new Date(2016,2,30)],
[ 'Keyboard', 'Corsair K70 Cherry MX Blue', new Date(2016, 2, 30), new Date()],
]);
chart.draw(dataTable);
}
</script>
</head>
<body>
<div id="timeline" style="height: 500px;"></div>
</body>
</html>
<h2 id="phones">Phones</h2>
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load("current", {packages:["timeline"]});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var container = document.getElementById('Computer Timeline');
var chart = new google.visualization.Timeline(container);
var dataTable = new google.visualization.DataTable();
dataTable.addColumn({ type: 'string', id: 'Position' });
dataTable.addColumn({ type: 'string', id: 'Name' });
dataTable.addColumn({ type: 'date', id: 'Start' });
dataTable.addColumn({ type: 'date', id: 'End' });
dataTable.addRows([
[ 'Phone', 'Sony Ericsson k700i', new Date(2004,10,14), new Date(2006,4,14)],
[ 'Phone', 'Sony Ericsson k750i', new Date(2006,4,14), new Date(2008,1,14)],
[ 'Phone', 'Sony Ericsson V640i', new Date(2008,1,14), new Date(2009,7,14)],
[ 'Phone', 'Nokia 5800 Music Xpress', new Date(2009,7,14), new Date(2010,7,23)],
[ 'Phone', 'Samsung Galaxy SI', new Date(2010,7,23), new Date(2012,1,16)],
[ 'Phone', 'Samsung Galaxy SII', new Date(2012,1,16), new Date(2013,9,31)],
[ 'Phone', 'Nexus 5', new Date(2013,9,31), new Date(2016,4,30)],
[ 'Phone', 'HTC 10', new Date(2016,4,30), new Date(2018,0,30)],
[ 'Phone', 'Sony Xperia XZ1 Compact', new Date(2018,0,30), new Date(2020,7,9)],
[ 'Phone', 'iPhone 11 Pro', new Date(2020,7,9), new Date()],
[ 'Headphones', 'Sony MDR EX90LP', new Date(2008, 3, 18), new Date(2009, 2, 3)],
[ 'Headphones', 'Sony MDR EX90LP', new Date(2009, 2, 3), new Date(2009, 2, 10)],
[ 'Headphones', 'Sony MDR-EX500LP', new Date(2009, 2, 10), new Date(2011, 9,1)],
[ 'Headphones', 'Sony MDR EX510LPB', new Date(2011, 9,1), new Date()],
[ 'Headphones', 'Philips X1', new Date(2012, 9,30), new Date(2013,3,29)],
[ 'Headphones', 'Philips X1', new Date(2013,3,29), new Date()],
[ 'Headphones', 'AGK K550', new Date(2013, 8,1), new Date()],
[ 'Headphones', 'Sony WH-CH700N', new Date(2019, 2,16), new Date(2020,8,19)],
[ 'Headphones', 'Sony WH-1000XM3', new Date(2020, 8,19), new Date()],
[ 'Tablet', 'iPad Pro', new Date(2021, 3,30), new Date()],
[ 'Tablet', 'iPad Mini', new Date(2022, 2,9), new Date()]
]);
chart.draw(dataTable);
}
</script>
</head>
<body>
<div id="Computer Timeline" style="height: 1000px;"></div>
</body>
</html>Adrian Ngcontact@adrian.ngUsing Google Charts to timeline my hardware purchases over the past decade.We have Email!2018-05-19T00:00:00+00:002018-05-19T00:00:00+00:00https://adrian.ng/email<p>You can now get in touch at <a href="mailto:hi@adrian.ng">hi@adrian.ng</a>.</p>Adrian Ngcontact@adrian.ngYou can now get in touch at hi@adrian.ng.HTTPS2018-05-12T00:00:00+00:002018-05-12T00:00:00+00:00https://adrian.ng/https<p>We are now enforcing HTTPS! Hopefully that should solve some issues we’d been having!</p>Adrian Ngcontact@adrian.ngWe are now enforcing HTTPS! Hopefully that should solve some issues we’d been having!Hello LaTeX!2018-04-01T00:00:00+00:002018-04-01T00:00:00+00:00https://adrian.ng/latex/LaTeX<p>We’ve got LaTeX!</p>
\[\frac{1}{2\pi\sigma^2}exp{-\frac{(x-\mu)^2}{2\sigma^2}}\]
<p>This was done by adding this block of code to <code class="language-plaintext highlighter-rouge">_includes/scripts.html</code>:</p>
<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
<span class="nt"><script </span><span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">async</span>
<span class="na">src=</span><span class="s">"https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"</span><span class="nt">></span>
<span class="nt"></script></span>
</code></pre></div></div>Adrian Ngcontact@adrian.ngWe’ve got LaTeX!