<?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>Personal &#8211; Luxing Huang</title>
	<atom:link href="https://luxing.im/category/personal/feed/" rel="self" type="application/rss+xml" />
	<link>https://luxing.im</link>
	<description>Thoughs and things</description>
	<lastBuildDate>Mon, 19 Jul 2021 22:14:35 +0000</lastBuildDate>
	<language>en-CA</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
<site xmlns="com-wordpress:feed-additions:1">58771605</site>	<item>
		<title>Lenovo Y510p BIOS flash to remove wifi card whitelist</title>
		<link>https://luxing.im/lenovo-y510p-bios-flash-to-remove-wifi-card-whitelist/</link>
					<comments>https://luxing.im/lenovo-y510p-bios-flash-to-remove-wifi-card-whitelist/#respond</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Mon, 19 Jul 2021 22:12:04 +0000</pubDate>
				<category><![CDATA[Personal]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=914</guid>

					<description><![CDATA[Lenovo Y510p has been out for more than 7 years, to this date I am still using it as my go-to workstation. The specification is quite old and I have upgraded and replaced everything that I could, except the wireless card, due to the infamous BIOS whitelisting. Thanks to techinferno, there are people sharing the &#8230; <p class="link-more"><a href="https://luxing.im/lenovo-y510p-bios-flash-to-remove-wifi-card-whitelist/" class="more-link">Continue reading<span class="screen-reader-text"> "Lenovo Y510p BIOS flash to remove wifi card whitelist"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>Lenovo Y510p has been out for more than 7 years, to this date I am still using it as my go-to workstation. The specification is quite old and I have upgraded and replaced everything that I could, except the wireless card, due to the infamous BIOS whitelisting.</p>
<p><span id="more-914"></span></p>
<p>Thanks to techinferno, there are people sharing the modded BIOS and the steps are listed in the following article:</p>
<p><a href="https://www.techinferno.com/index.php?/forums/topic/3546-lenovo-y410p-y510p-unlocked-bios-wlan-whitelist-mod-vbios-mod/" rel="noopener" target="_blank">https://www.techinferno.com/index.php?/forums/topic/3546-lenovo-y410p-y510p-unlocked-bios-wlan-whitelist-mod-vbios-mod/</a></p>
<p>Note: In order to downgrade BIOS, people will need to turn on back flash feature in the BIOS setting (press F2 on boot)</p>
<p>Here is the zipped file if you need it.</p>
<p><a href="https://luxing.im/wp-content/uploads/2021/07/LENOVO-BIOS.zip">LENOVO BIOS</a></p>
<p>I bought a wifi card that has BCM4352 chip on it, the chip is installed on a PCI slot (check via lspci). on Manjaro, you need to install network-broadcom-wl via mhwd:</p>
<pre>
sudo mhwd -i pci network-broadcom-wl
</pre>
<p>Now my wifi speed is upgraded from 20Mbps to 500Mbps. Very nice!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/lenovo-y510p-bios-flash-to-remove-wifi-card-whitelist/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">914</post-id>	</item>
		<item>
		<title>Lenovo Legion 5 Gen 6 AMD with nvidia backlight issue under Manjaro</title>
		<link>https://luxing.im/lenovo-legion-5-gen-6-amd-with-nvidia-backlight-issue-under-manjaro/</link>
					<comments>https://luxing.im/lenovo-legion-5-gen-6-amd-with-nvidia-backlight-issue-under-manjaro/#respond</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Thu, 08 Jul 2021 19:03:05 +0000</pubDate>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Techie Stuff]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=891</guid>

					<description><![CDATA[The Legion 5 Gen 6 AMD Ryzen with NVIDIA graphics (15ACH6H, model 82JU00APUS) is what I have on my hand. The Linux system I use is Manjaro due to its simplicity. I&#8217;ve experienced a very common backlight issue, Fn key won&#8217;t adjust the backlight at all, it&#8217;s always on 100% brightness. I use discrete / &#8230; <p class="link-more"><a href="https://luxing.im/lenovo-legion-5-gen-6-amd-with-nvidia-backlight-issue-under-manjaro/" class="more-link">Continue reading<span class="screen-reader-text"> "Lenovo Legion 5 Gen 6 AMD with nvidia backlight issue under Manjaro"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>The Legion 5 Gen 6 AMD Ryzen with NVIDIA graphics (15ACH6H, model 82JU00APUS) is what I have on my hand. The Linux system I use is Manjaro due to its simplicity. I&#8217;ve experienced a very common backlight issue, Fn key won&#8217;t adjust the backlight at all, it&#8217;s always on 100% brightness. I use discrete / dedicated nvidia graphics all the time, so this solution may not be suitable for everyone.</p>
<p><span id="more-891"></span></p>
<p>Here are the steps I tried with my setup, all commands are executed as root:</p>
<p>1 Install manjaro with proprietary driver (nvidia-drm), not nouveau open source driver.</p>
<p>2 Generate xorg.conf with <code>nvidia-xconfig</code></p>
<p>3 Write the following content to /etc/X11/xorg.conf.d/20-nvidia-backlight.conf</p>
<pre>
Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection
</pre>
<p>4 Add these kernel parameters to <code>/etc/default/grub</code>:</p>
<pre>amdgpu.backlight=0 acpi_backlight=vendor</pre>
<p>And run <code>update-grub</code></p>
<p>5 Reboot into the newly configured kernel.</p>
<p>6 Test if we can adjust the backlight via setting system values:</p>
<pre>echo "50" > /sys/class/backlight/nvidia_0/brightness</pre>
<p>If it works, we are able to use acpi events to tune the brightness.</p>
<p>7 Enable and start the acpid service.</p>
<pre>systemctl enable acpid</pre>
<p>then start</p>
<pre>systemctl start acpid</pre>
<p>and then monitor its logs</p>
<pre>journalctl -u acpid -f</pre>
<p>8 Press Fn+F5 or Fn+F6 key to toggle brightness up/down, we should see the acpid complain about <code>ACPI group/action undefined: video/brightnessup</code> or brightnessdown. If we do not see this error, then the next thing won&#8217;t work.</p>
<p>9 Assuming we can see the undefined error, we can write some scripts to override the brightness value.</p>
<pre>
cd /etc/acpi
mkdir handlers

cd handlers
</pre>
<p>vim backlight and paste the following content to it</p>
<pre>
#!/bin/sh
bl_dev=/sys/class/backlight/nvidia_0
step=6

case $1 in
  -) echo $(($(< $bl_dev/brightness) - $step)) >$bl_dev/brightness;;
  +) echo $(($(< $bl_dev/brightness) + $step)) >$bl_dev/brightness;;
esac
</pre>
<p>Let&#8217;s continue.</p>
<pre>
chmod +x backlight

cd ../events
</pre>
<p>vim bl_d and copy the following script to it</p>
<pre> 
event=video/brightnessdown
action=/etc/acpi/handlers/backlight -
</pre>
<p>vim bl_u and copy the following script to it</p>
<pre>
event=video/brightnessup
action=/etc/acpi/handlers/backlight +
</pre>
<p>10 Restart acpid service</p>
<pre>systemctl restart acpid</pre>
<p>11 Use your Fn+F5 or Fn+F6 to adjust brightness, note the value presented on your screen does not reflect the real brightness.</p>
<p>ACPI example usages and docs: <a href="https://wiki.archlinux.org/title/Acpid#Enabling_backlight_control" rel="noopener" target="_blank">https://wiki.archlinux.org/title/Acpid#Enabling_backlight_control</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/lenovo-legion-5-gen-6-amd-with-nvidia-backlight-issue-under-manjaro/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">891</post-id>	</item>
		<item>
		<title>Purchased a Minisforum X35G</title>
		<link>https://luxing.im/purchased-a-minisforum-x35g/</link>
					<comments>https://luxing.im/purchased-a-minisforum-x35g/#comments</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Wed, 16 Dec 2020 22:49:03 +0000</pubDate>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Techie Stuff]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[mini pc]]></category>
		<category><![CDATA[pc]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=867</guid>

					<description><![CDATA[Just when I was thinking of what gift to buy for myself for the Christmas holiday, I came to an Indiegogo crowd funding project: Minisforum X35G. And I suddenly realized that I need to use a mini PC to replace my 5-year-old Lenovo Y50P laptop running as my side router. I have the following reasons &#8230; <p class="link-more"><a href="https://luxing.im/purchased-a-minisforum-x35g/" class="more-link">Continue reading<span class="screen-reader-text"> "Purchased a Minisforum X35G"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>Just when I was thinking of what gift to buy for myself for the Christmas holiday, I came to an Indiegogo crowd funding project: <a href="https://www.indiegogo.com/projects/the-new-core-intel-10nm-minis/x/25145204#/" rel="noopener" target="_blank">Minisforum X35G</a>.</p>
<p><span id="more-867"></span></p>
<p>And I suddenly realized that I need to use a mini PC to replace my 5-year-old Lenovo Y50P laptop running as my side router. I have the following reasons to deprecate my laptop:</p>
<ol>
<li>It was a gaming laptop (from 2015), so power consumption is not low.</li>
<li>It was a laptop after all, not suppose to run 24&#215;7 like a router or server.</li>
<li>I may need to use the laptop, even boot into a Windows OS for some tasks/tests, then all devices connected to this side router will be disconnected from the Internet.</li>
<li>I setup LUKS encrypted disk earlier, every time I need to type password when boot / reboot.</li>
<li>Fedora 31 is installed, now deprecated.</li>
</ol>
<p>Mini PCs are perfect for this task. I know using a Mini PC as a side router is a little overkill, with the new server I am able to run more stuff in our little machine.</p>
<p>The X35G has a 10th generation Intel CPU <a href="https://ark.intel.com/content/www/us/en/ark/products/196588/intel-core-i3-1005g1-processor-4m-cache-up-to-3-40-ghz.html" rel="noopener" target="_blank">i3-1005G1</a>.</p>
<p>Let&#8217;s take a look at the little thing.</p>
<p>The front and side:<br />
<img decoding="async" src="https://ext2.ke.fo/2020/12/16/Image_20201215_1536527019087705740543560.jpg" alt="" /></p>
<p>The back:<br />
<img decoding="async" src="https://ext2.ke.fo/2020/12/16/Image_20201215_1536345903288731777928109.jpg" alt="" /></p>
<p>This little machine is about the size of Mac Mini, the entire chassis is made of aluminium, the hand feel is great!</p>
<p>I am not going to go through the specs, you can find it out on its <a href="https://store.minisforum.com/products/minisforum-x35g-mini-pc" rel="noopener" target="_blank">official website</a>.</p>
<p>The version I got is the cheapest one from Indiegogo, which does not come with a M.2 NVMe disk because I have a left-over <a href="https://www.amazon.ca/gp/product/B07J2WBKXF/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&#038;psc=1" rel="noopener" target="_blank">NVMe disk</a> from my junk desktop PC. The disassembly process is a little tricky, the NVMe slot is at the back of the motherboard which you need to unscrew all screws to see, but still, it is a good practise for enthusiasts like me.</p>
<p><img decoding="async" src="https://ext2.ke.fo/2020/12/16/Image_20201215_1603058826270590755926528.jpg" alt="" /></p>
<p>At work, I have been using CentOS, Amazon Linux, RHEL and Ubuntu the most of the time, I do want to get a taste in ArchLinux. The OS I installed is Manjaro Architect 20.0.3. The boot time is about 10s.</p>
<p>UnixBench mark: 3467.8. I can barely hear the fan on full load. My furnace is even louder than that.</p>
<pre>
Dhrystone 2 using register variables      133599372.3 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                    26195.5 MWIPS (9.9 s, 7 samples)
Execl Throughput                              15115.9 lps   (29.8 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks       1207122.0 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          337511.7 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       3982041.8 KBps  (30.0 s, 2 samples)
Pipe Throughput                             4874841.9 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 752660.2 lps   (10.0 s, 7 samples)
Process Creation                              31625.7 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                  10665.2 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                   1553.2 lpm   (60.1 s, 2 samples)
System Call Overhead                        4602072.3 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0  133599372.3  11448.1
Double-Precision Whetstone                       55.0      26195.5   4762.8
Execl Throughput                                 43.0      15115.9   3515.3
File Copy 1024 bufsize 2000 maxblocks          3960.0    1207122.0   3048.3
File Copy 256 bufsize 500 maxblocks            1655.0     337511.7   2039.3
File Copy 4096 bufsize 8000 maxblocks          5800.0    3982041.8   6865.6
Pipe Throughput                               12440.0    4874841.9   3918.7
Pipe-based Context Switching                   4000.0     752660.2   1881.7
Process Creation                                126.0      31625.7   2510.0
Shell Scripts (1 concurrent)                     42.4      10665.2   2515.4
Shell Scripts (8 concurrent)                      6.0       1553.2   2588.7
System Call Overhead                          15000.0    4602072.3   3068.0
                                                                   ========
System Benchmarks Index Score                                        3467.8
</pre>
<p>The memory used with all the existing customized service is: 269MB / 15.4GB. I have a lot to explore!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/purchased-a-minisforum-x35g/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">867</post-id>	</item>
		<item>
		<title>Resolve virsh start a domain (VM) failed problem</title>
		<link>https://luxing.im/resolve-virsh-start-a-domain-vm-failed-problem/</link>
					<comments>https://luxing.im/resolve-virsh-start-a-domain-vm-failed-problem/#respond</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Tue, 18 Jun 2019 15:41:28 +0000</pubDate>
				<category><![CDATA[Personal]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=804</guid>

					<description><![CDATA[After CVE-2019-11477 and a few other CVEs broke out, Linux kernel released 5.1.11 to address the vulnerabilities. My VM host machine is constantly running on the latest kernel (provided by ELRepo). When I reboot into the new kernel and want to start one of my KVM boxes, this error appears: Host CPU does not provide &#8230; <p class="link-more"><a href="https://luxing.im/resolve-virsh-start-a-domain-vm-failed-problem/" class="more-link">Continue reading<span class="screen-reader-text"> "Resolve virsh start a domain (VM) failed problem"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>After <a href="https://access.redhat.com/security/cve/cve-2019-11477" rel="noopener noreferrer" target="_blank">CVE-2019-11477</a> and a few other CVEs broke out, Linux kernel released <a href="https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.1.11" rel="noopener noreferrer" target="_blank">5.1.11</a> to address the vulnerabilities. My VM host machine is constantly running on the latest kernel (provided by ELRepo).</p>
<p>When I reboot into the new kernel and want to start one of my KVM boxes, this error appears:</p>
<pre>Host CPU does not provide required features: spec-ctrl</pre>
<p><span id="more-804"></span></p>
<p>After a bit of Googling, I understand this is related to kernel updates, the guest CPU model name of the VM&#8217;s XML setting does not match. The resolution is very quick also.</p>
<p>Find out what model your host machine is:</p>
<style>.gist table { margin-bottom: 0; }</style>
<div style="tab-size: 8" id="gist97525183" class="gist">
<div class="gist-file" translate="no" data-color-mode="light" data-light-theme="light">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container">
<div id="file-gistfile1-txt" class="file my-2">
<div itemprop="text"
      class="Box-body p-0 blob-wrapper data type-text  "
      style="overflow: auto" tabindex="0" role="region"
      aria-label="file-gistfile1-txt"
    ></p>
<div class="js-check-bidi js-blob-code-container blob-code-content">
<p>  <template class="js-file-alert-template"></p>
<div data-view-component="true" class="flash flash-warn flash-full d-flex flex-items-center">
  <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg><br />
    <span><br />
      This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.<br />
      <a class="Link--inTextBlock" href="https://github.co/hiddenchars" target="_blank">Learn more about bidirectional Unicode characters</a><br />
    </span></p>
<div data-view-component="true" class="flash-action">        <a href="{{ revealButtonHref }}" data-view-component="true" class="btn-sm btn">    Show hidden characters<br />
</a>
</div>
</div>
<p></template><br />
<template class="js-line-alert-template"><br />
  <span aria-label="This line has hidden Unicode characters" data-view-component="true" class="line-alert tooltipped tooltipped-e"><br />
    <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg><br />
</span></template></p>
<table data-hpc class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip data-tagsearch-path="gistfile1.txt">
<tr>
<td id="file-gistfile1-txt-L1" class="blob-num js-line-number js-blob-rnum" data-line-number="1"></td>
<td id="file-gistfile1-txt-LC1" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="file-gistfile1-txt-L2" class="blob-num js-line-number js-blob-rnum" data-line-number="2"></td>
<td id="file-gistfile1-txt-LC2" class="blob-code blob-code-inner js-file-line">virsh capabilities</td>
</tr>
<tr>
<td id="file-gistfile1-txt-L3" class="blob-num js-line-number js-blob-rnum" data-line-number="3"></td>
<td id="file-gistfile1-txt-LC3" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="file-gistfile1-txt-L4" class="blob-num js-line-number js-blob-rnum" data-line-number="4"></td>
<td id="file-gistfile1-txt-LC4" class="blob-code blob-code-inner js-file-line">&lt;capabilities&gt;</td>
</tr>
<tr>
<td id="file-gistfile1-txt-L5" class="blob-num js-line-number js-blob-rnum" data-line-number="5"></td>
<td id="file-gistfile1-txt-LC5" class="blob-code blob-code-inner js-file-line">
</td>
</tr>
<tr>
<td id="file-gistfile1-txt-L6" class="blob-num js-line-number js-blob-rnum" data-line-number="6"></td>
<td id="file-gistfile1-txt-LC6" class="blob-code blob-code-inner js-file-line">  &lt;host&gt;</td>
</tr>
<tr>
<td id="file-gistfile1-txt-L7" class="blob-num js-line-number js-blob-rnum" data-line-number="7"></td>
<td id="file-gistfile1-txt-LC7" class="blob-code blob-code-inner js-file-line">    &lt;uuid&gt;161bf4fa-b9d9-e011-8919-505054503030&lt;/uuid&gt;</td>
</tr>
<tr>
<td id="file-gistfile1-txt-L8" class="blob-num js-line-number js-blob-rnum" data-line-number="8"></td>
<td id="file-gistfile1-txt-LC8" class="blob-code blob-code-inner js-file-line">    &lt;cpu&gt;</td>
</tr>
<tr>
<td id="file-gistfile1-txt-L9" class="blob-num js-line-number js-blob-rnum" data-line-number="9"></td>
<td id="file-gistfile1-txt-LC9" class="blob-code blob-code-inner js-file-line">      &lt;arch&gt;x86_64&lt;/arch&gt;</td>
</tr>
<tr>
<td id="file-gistfile1-txt-L10" class="blob-num js-line-number js-blob-rnum" data-line-number="10"></td>
<td id="file-gistfile1-txt-LC10" class="blob-code blob-code-inner js-file-line">      &lt;model&gt;IvyBridge&lt;/model&gt;</td>
</tr>
<tr>
<td id="file-gistfile1-txt-L11" class="blob-num js-line-number js-blob-rnum" data-line-number="11"></td>
<td id="file-gistfile1-txt-LC11" class="blob-code blob-code-inner js-file-line">&#8230; # skipped</td>
</tr>
</table>
</div></div>
</p></div>
</div></div>
<div class="gist-meta">
        <a href="https://gist.github.com/hlx98007/a7e4717dc5c6211ef4abdb58124fdc00/raw/bb852535dbb8ec1ba6ad14c4c5cb79ea2de83e9b/gistfile1.txt" style="float:right" class="Link--inTextBlock">view raw</a><br />
        <a href="https://gist.github.com/hlx98007/a7e4717dc5c6211ef4abdb58124fdc00#file-gistfile1-txt" class="Link--inTextBlock"><br />
          gistfile1.txt<br />
        </a><br />
        hosted with &#10084; by <a class="Link--inTextBlock" href="https://github.com">GitHub</a>
      </div>
</p></div>
</div>
<p>My model is IvyBridge</p>
<p>Edit the VM&#8217;s XML configuration</p>
<pre>
virsh edit --domain vm1
</pre>
<p>The model of the VM is <code>IvyBridge-IBRS</code>, so I deleted the <code>-IBRS</code> part.</p>
<p>Start VM</p>
<pre>
virsh start vm1
</pre>
<p>Done!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/resolve-virsh-start-a-domain-vm-failed-problem/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">804</post-id>	</item>
		<item>
		<title>tmux select then copy to clipboard</title>
		<link>https://luxing.im/tmux-select-then-copy/</link>
					<comments>https://luxing.im/tmux-select-then-copy/#comments</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Sun, 25 Nov 2018 20:21:51 +0000</pubDate>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Techie Stuff]]></category>
		<category><![CDATA[clipboard]]></category>
		<category><![CDATA[paste]]></category>
		<category><![CDATA[tmux]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=776</guid>

					<description><![CDATA[Using mouse to select text with tmux sometimes is inefficient. For my setup, I&#8217;ll have to press shift key during text selection and keyboard copy will convert empty line as spaces. The following 2 lines in the configuration file works with version 2.8 (latest at the time of writing). As I am using Linux, the &#8230; <p class="link-more"><a href="https://luxing.im/tmux-select-then-copy/" class="more-link">Continue reading<span class="screen-reader-text"> "tmux select then copy to clipboard"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>Using mouse to select text with tmux sometimes is inefficient. For my setup, I&#8217;ll have to press shift key during text selection and keyboard copy will convert empty line as spaces. The following 2 lines in the configuration file works with version 2.8 (latest at the time of writing).</p>
<p><span id="more-776"></span></p>
<p>As I am using Linux, the command line clipboard program is <code>xclip</code>. For mac users you need to use <code>pbcopy</code>.</p>
<p>Add those lines to your <code>~/.tmux.conf</code></p>
<pre>
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "xclip -i -sel c"
</pre>
<p>Now when you are on the select mode (<code>prefix+[</code>), hit v or space to start selecting. After, press y to yank lines to clipboard. You can paste it anywhere else.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/tmux-select-then-copy/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">776</post-id>	</item>
		<item>
		<title>Currency Conversion on Bash</title>
		<link>https://luxing.im/currency-conversion-on-bash/</link>
					<comments>https://luxing.im/currency-conversion-on-bash/#comments</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Tue, 06 Nov 2018 20:11:48 +0000</pubDate>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Techie Stuff]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[currency]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[tools]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=770</guid>

					<description><![CDATA[Currency.sh I had an idea long ago to convert currency on bash. So first you need a live currency conversion API in order to get a most up-to-date conversion rate data, preferably free. After searching through the internet, this one is a good API. I&#8217;ve been using it for some time and normally it is &#8230; <p class="link-more"><a href="https://luxing.im/currency-conversion-on-bash/" class="more-link">Continue reading<span class="screen-reader-text"> "Currency Conversion on Bash"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p><a href="https://luxing.im/wp-content/uploads/2018/11/currency.png"><img decoding="async" src="https://luxing.im/wp-content/uploads/2018/11/currency-300x108.png" alt="" width="300" height="108" class="alignleft size-medium wp-image-771" srcset="https://luxing.im/wp-content/uploads/2018/11/currency-300x108.png 300w, https://luxing.im/wp-content/uploads/2018/11/currency.png 343w" sizes="(max-width: 300px) 100vw, 300px" /></a> Currency.sh<br />
<span id="more-770"></span></p>
<p>I had an idea long ago to convert currency on bash.</p>
<p>So first you need a live currency conversion API in order to get a most up-to-date conversion rate data, preferably free. After searching through the internet, <a href="https://free.currencyconverterapi.com/" rel="noopener noreferrer" target="_blank">this one</a> is a good API. I&#8217;ve been using it for some time and normally it is quite stable.</p>
<p>The only dependency you need to install is jq, please use your package manager to install.</p>
<p>Usage:</p>
<pre>currency.sh <currency1> <currency2> [quantity]</pre>
<p>You currency code must meet <a href="https://en.wikipedia.org/wiki/ISO_4217" rel="noopener noreferrer" target="_blank">ISO 4217</a> standard.</p>
<p>Script:</p>
<pre>
#!/bin/bash
jq 2> /dev/null
if [ "$?" != 2 ]; then
  echo "Please install jq"
  exit 1
fi

if [ -z "$1" -o -z "$2" ]; then
  echo "Please provide first and second currency."
  echo "e.g. $0 CAD USD [amount]"
  exit 1
fi

currency1=`echo -n $1 | tr '[:lower:]' '[:upper:]'`
currency2=`echo -n $2 | tr '[:lower:]' '[:upper:]'`

unit_price_f=$(curl -s "https://free.currencyconverterapi.com/api/v5/convert?q=${currency1}_${currency2}&compact=y" | jq ".${currency1}_${currency2}.val")

unit_price=$(printf "%.8f" $unit_price_f)

echo Unit price buy $1 from $2 is $unit_price.

if [ ! -z "$3" ]; then
  echo
  echo -n "$3 $1 is "
  echo "$3 * $unit_price" | bc -l | tr -d "\n"
  echo " $2"
fi
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/currency-conversion-on-bash/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">770</post-id>	</item>
		<item>
		<title>WPS library fix for Linux for WPP</title>
		<link>https://luxing.im/wps-library-fix-for-linux-for-wpp/</link>
					<comments>https://luxing.im/wps-library-fix-for-linux-for-wpp/#respond</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Fri, 15 Jun 2018 18:15:15 +0000</pubDate>
				<category><![CDATA[Personal]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=758</guid>

					<description><![CDATA[WPS for Linux is a great software for processing Microsoft Office files, however after installing the latest RPM on Fedora 27 I failed to start WPP (presentation). The error message says: /opt/kingsoft/wps-office/office6/wpp: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory libbz2 is a common library used by &#8230; <p class="link-more"><a href="https://luxing.im/wps-library-fix-for-linux-for-wpp/" class="more-link">Continue reading<span class="screen-reader-text"> "WPS library fix for Linux for WPP"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>WPS for Linux is a great software for processing Microsoft Office files, however after installing the latest RPM on Fedora 27 I failed to start WPP (presentation).<br />
<span id="more-758"></span></p>
<p>The error message says:</p>
<pre>
/opt/kingsoft/wps-office/office6/wpp: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory
</pre>
<p>libbz2 is a common library used by a lot of software, the one I installed on my machine is 1.0.6. If this library is not installed, please execute:</p>
<pre>
sudo dnf install bzip2-libs
</pre>
<p>By looking at <code>/usr/lib64</code>, we have <code>libbz2.so.1.0.6</code>. Since the one I installed is also on 1.0 branch, I though I would just do a soft link and try it out.</p>
<p>Execute the following command in <code>/usr/lib64</code></p>
<pre>
ln -s libbz2.so.1.0.6 libbz2.so.1.0
</pre>
<p>Then WPP is then usable again!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/wps-library-fix-for-linux-for-wpp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">758</post-id>	</item>
		<item>
		<title>Weechat &#8211; FiSH key exceed 56 bytes (448 bits)</title>
		<link>https://luxing.im/weechat-fish-key-exceed-56-bytes-448-bits/</link>
					<comments>https://luxing.im/weechat-fish-key-exceed-56-bytes-448-bits/#respond</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Mon, 17 Oct 2016 15:55:18 +0000</pubDate>
				<category><![CDATA[Personal]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=701</guid>

					<description><![CDATA[Recently I came across a problem. My friend could not decrypt the channel message in IRC as the channel has a blowfish key exceeds 56 bytes of size. I don&#8217;t know about the mIRC implementation (fish10) but in weechat under Linux, I found a solution. The core is to not use pycrypto. The default fish.py &#8230; <p class="link-more"><a href="https://luxing.im/weechat-fish-key-exceed-56-bytes-448-bits/" class="more-link">Continue reading<span class="screen-reader-text"> "Weechat &#8211; FiSH key exceed 56 bytes (448 bits)"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>Recently I came across a problem. My friend could not decrypt the channel message in IRC as the channel has a blowfish key exceeds 56 bytes of size. I don&#8217;t know about the mIRC implementation (fish10) but in weechat under Linux, I found a solution.<br />
<span id="more-701"></span></p>
<p>The core is to not use pycrypto. The default fish.py script in weechat is limited by pycrypto&#8217;s limit of 56 bytes, where blowfish key standard is up to 72 bytes long.</p>
<p><a href="https://github.com/bioboy/FiSH-weechat" target="_blank">https://github.com/bioboy/FiSH-weechat</a></p>
<p>The above repository modifies the built-in fish.py to use the original FISH blowfish cipher rather than pycrypto.</p>
<p>1. Clone the repository<br />
2. Run <code>make</code> to build the binary<br />
3. Run <code>make install</code> to install it to your home <code>.weechat/python</code> directory.<br />
4. If you want to autoload it, move the fish.py and blowfish.so files to <code>~/.weechat/python/autoload</code> directory.</p>
<p>Now you&#8217;ll be able to use 72 bytes key size to decrypt blowfish messages!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/weechat-fish-key-exceed-56-bytes-448-bits/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">701</post-id>	</item>
		<item>
		<title>Operate Django from directly executing python file over command line</title>
		<link>https://luxing.im/operate-django-from-directly-executing-python-file-over-command-line/</link>
					<comments>https://luxing.im/operate-django-from-directly-executing-python-file-over-command-line/#respond</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Tue, 31 May 2016 04:07:54 +0000</pubDate>
				<category><![CDATA[Personal]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=664</guid>

					<description><![CDATA[Recently I came across a problem which took me some time to find out. I want to write a script that can take arguments to add user to my Django app. This problem was encountered: django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. When I added os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' to the file, this error &#8230; <p class="link-more"><a href="https://luxing.im/operate-django-from-directly-executing-python-file-over-command-line/" class="more-link">Continue reading<span class="screen-reader-text"> "Operate Django from directly executing python file over command line"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>Recently I came across a problem which took me some time to find out.</p>
<p>I want to write a script that can take arguments to add user to my Django app. This problem was encountered:<br />
<span id="more-664"></span></p>
<pre>django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured.</pre>
<p>When I added </p>
<pre>os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'</pre>
<p> to the file, this error happend:</p>
<pre>django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.</pre>
<p>So in the end, I used this:</p>
<pre>
import sys, os
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
import django
django.setup()
</pre>
<p><code>sys</code> is needed for my snippet. You may remove it if you want.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/operate-django-from-directly-executing-python-file-over-command-line/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">664</post-id>	</item>
		<item>
		<title>Fix Mutt auto complete problem</title>
		<link>https://luxing.im/fix-mutt-auto-complete-problem/</link>
					<comments>https://luxing.im/fix-mutt-auto-complete-problem/#respond</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Tue, 03 May 2016 16:26:52 +0000</pubDate>
				<category><![CDATA[Personal]]></category>
		<guid isPermaLink="false">https://luxing.im/?p=656</guid>

					<description><![CDATA[I was using 1.5.x version of Mutt and recently upgraded to 1.6.x. When I tried to use tab key to select from my aliases, it wouldn&#8217;t work and will show Query command not defined error. The solution is simple. According to https://groups.google.com/forum/#!topic/vinux-support/qfaog4LF_PM we only need to unset 2 binds in muttrc. Code below: #bind editor &#8230; <p class="link-more"><a href="https://luxing.im/fix-mutt-auto-complete-problem/" class="more-link">Continue reading<span class="screen-reader-text"> "Fix Mutt auto complete problem"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>I was using 1.5.x version of Mutt and recently upgraded to 1.6.x. When I tried to use tab key to select from my aliases, it wouldn&#8217;t work and will show <code>Query command not defined</code> error.<br />
<span id="more-656"></span></p>
<p>The solution is simple. According to <a href="https://groups.google.com/forum/#!topic/vinux-support/qfaog4LF_PM" target="_blank">https://groups.google.com/forum/#!topic/vinux-support/qfaog4LF_PM</a> we only need to unset 2 binds in muttrc.</p>
<p>Code below:</p>
<pre>
#bind editor <Tab> complete-query
#bind editor ^T complete
</pre>
<p>Then you&#8217;ll be able to use tab key again.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/fix-mutt-auto-complete-problem/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">656</post-id>	</item>
	</channel>
</rss>
