<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://leo.leung.xyz/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=136.159.16.240</id>
	<title>Leo&#039;s Notes - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://leo.leung.xyz/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=136.159.16.240"/>
	<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/Special:Contributions/136.159.16.240"/>
	<updated>2026-10-06T06:41:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=CloudStack&amp;diff=6945</id>
		<title>CloudStack</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=CloudStack&amp;diff=6945"/>
		<updated>2022-10-26T17:26:24Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: systemctl enable --now enables a service and starts it simultaneously, reducing the need to run multiple commands&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Apache CloudStack is open-source cloud computing software. It is used to deploy a infrastructure as a service (IaaS) platform on virtualization technologies such as KVM, VMware, and Xen. This is similar to OpenStack but is significantly simpler to setup and manage (albeit with less features).&lt;br /&gt;
&lt;br /&gt;
This page contains my notes on setting up and using CloudStack 4.15. I am by no means a CloudStack expert so take my notes here with a huge grain of salt and feel free to make corrections.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
This installation is based on CloudStack 4.15 using CentOS 8. The setup described below uses KVM and Open vSwitch. I&#039;m basing the design decisions and approach from the installation guide at [http://docs.cloudstack.apache.org/en/latest/quickinstallationguide/qig.html#management-server-installation http://docs.cloudstack.apache.org/en/latest/quickinstallationguide/qig.html]&lt;br /&gt;
&lt;br /&gt;
===Overview===&lt;br /&gt;
I will have 1 management node and a few bare metal nodes. All nodes will have the same processor (Intel something) and memory (24GB).&lt;br /&gt;
&lt;br /&gt;
Each node will have the same network configuration based on OpenVSwitch. There will be only 1 ethernet connection per node with various VLANs trunked to each node. The VLANs are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Network&lt;br /&gt;
!Vlan&lt;br /&gt;
!Network subnet&lt;br /&gt;
|-&lt;br /&gt;
|Management&lt;br /&gt;
|11, untagged&lt;br /&gt;
|172.19.0.0/20&lt;br /&gt;
|-&lt;br /&gt;
|Storage&lt;br /&gt;
|3205&lt;br /&gt;
|172.22.0.0/24&lt;br /&gt;
|-&lt;br /&gt;
|Guest&lt;br /&gt;
|100 - 200&lt;br /&gt;
|n/a&lt;br /&gt;
|-&lt;br /&gt;
|Public&lt;br /&gt;
|2&lt;br /&gt;
|136.159.1.0/24&lt;br /&gt;
|}&lt;br /&gt;
The network configs for the 4 nodes I&#039;ll be using are listed below. There is also a NFS server used for primary storage. The reason for the weird IPs is because this was set up on an existing network.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Node&lt;br /&gt;
!Networks&lt;br /&gt;
|-&lt;br /&gt;
|management&lt;br /&gt;
|Management: 172.19.12.141/20&lt;br /&gt;
Storage: 172.22.0.241/24&lt;br /&gt;
|-&lt;br /&gt;
|baremetal1&lt;br /&gt;
|Management: 172.19.12.142/20&lt;br /&gt;
Storage: 172.22.0.242/24&lt;br /&gt;
|-&lt;br /&gt;
|baremetal2&lt;br /&gt;
|Management: 172.19.12.143/20&lt;br /&gt;
Storage: 172.22.0.243/24&lt;br /&gt;
|-&lt;br /&gt;
|baremetal3&lt;br /&gt;
|Management: 172.19.12.144/20&lt;br /&gt;
Storage: 172.22.0.244/24&lt;br /&gt;
|-&lt;br /&gt;
|netapp1&lt;br /&gt;
|Storage: 172.22.0.19/24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Switch config===&lt;br /&gt;
For completeness, here&#039;s the configuration of the HP Procurve switch that the nodes are connected to. The switch should have all the guest VLANs defined and tagged.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = config&lt;br /&gt;
&lt;br /&gt;
# Guest VLANs&lt;br /&gt;
vlan 100 name guest100&lt;br /&gt;
vlan 101 name guest101&lt;br /&gt;
...&lt;br /&gt;
vlan 200 name guest 200&lt;br /&gt;
interface 1-8 tagged vlan 100-200&lt;br /&gt;
&lt;br /&gt;
# Public, management, storage VLANs&lt;br /&gt;
vlan 2 name public&lt;br /&gt;
vlan 11 name management&lt;br /&gt;
vlan 3205 name storage&lt;br /&gt;
interface 1-8 untagged vlan 11&lt;br /&gt;
interface 1-8 tagged vlan 2,3205&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Node setup===&lt;br /&gt;
Each node will be set up with the following sub-steps.&lt;br /&gt;
&lt;br /&gt;
====CloudStack Repos====&lt;br /&gt;
Install CloudStack repos.{{Highlight&lt;br /&gt;
| code = # cat &amp;gt; /etc/yum.repos.d/cloudstack.repo &amp;lt;&amp;lt;EOF&lt;br /&gt;
[cloudstack]&lt;br /&gt;
name=cloudstack&lt;br /&gt;
baseurl=http://download.cloudstack.org/centos/8/4.15/&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
EOF&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Install base packages====&lt;br /&gt;
Install all other dependencies.{{Highlight&lt;br /&gt;
| code = # yum -y install epel-release&lt;br /&gt;
# yum -y install bridge-utils net-tools&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}Install OpenVSwitch from CentOS Extras:&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # yum -y install \&lt;br /&gt;
http://mirror.centos.org/centos/8/extras/x86_64/os/Packages/centos-release-nfv-openvswitch-1-3.el8.noarch.rpm \&lt;br /&gt;
http://mirror.centos.org/centos/8/extras/x86_64/os/Packages/centos-release-nfv-common-1-3.el8.noarch.rpm&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Disable SELinux====&lt;br /&gt;
The system should have SELinux disabled. Use &amp;lt;code&amp;gt;setenforce&amp;lt;/code&amp;gt; and edit the selinux config:{{Highlight&lt;br /&gt;
| code = # setenforce 0&lt;br /&gt;
# vi /etc/selinux/config &lt;br /&gt;
## disable selinux&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Disable firewalld====&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # systemctl stop firewalld&lt;br /&gt;
# systemctl disable firewalld&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Configure Open vSwitch====&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # echo &amp;quot;blacklist bridge&amp;quot; &amp;gt;&amp;gt; /etc/modprobe.d/local-blacklist.conf&lt;br /&gt;
# echo &amp;quot;install bridge /bin/false&amp;quot; &amp;gt;&amp;gt; /etc/modprobe.d/local-dontload.conf&lt;br /&gt;
&lt;br /&gt;
# systemctl enable --now openvswitch&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
We will be using network-scripts to configure the Open vSwitch bridges later. I removed NetworkManager but retained network-scripts to ensure NetworkManager doesn&#039;t interfere with my network setup. The install guide leaves NetworkManager around.&lt;br /&gt;
&lt;br /&gt;
I create a &#039;shared&#039; bridge that&#039;s tied to the network interface called &amp;lt;code&amp;gt;nic0&amp;lt;/code&amp;gt;. This was done to make it easier to change the bridge setup during my testing but this could be simplified. Each of the physical networks I later set up in CloudStack are its own individual bridge to make it obvious how VMs get connected to the network.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # ovs-vsctl add-br   nic0&lt;br /&gt;
# ovs-vsctl add-port nic0 enp4s0f0 tag=11 vlan_mode=native-untagged&lt;br /&gt;
# ovs-vsctl set port nic0 trunks=2,11,40-49,3205&lt;br /&gt;
&lt;br /&gt;
# ovs-vsctl add-br management0 nic0 11&lt;br /&gt;
# ovs-vsctl add-br cloudbr0 nic0 2&lt;br /&gt;
# ovs-vsctl add-br cloudbr1 nic0 100&lt;br /&gt;
# ovs-vsctl add-br storage0 nic0 3205&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}The node&#039;s management IP address needs to be removed from the primary network interface and then assigned on the management0 interface. If you&#039;re doing this to a node remotely, this might interrupt your connection.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # ip addr del 172.19.12.141/20 dev enp4s0f0&lt;br /&gt;
# ip addr add 172.19.12.141/20 dev management0&lt;br /&gt;
# ip route add default via 172.19.0.3&lt;br /&gt;
# ip addr add 172.22.0.241/24 dev storage0&lt;br /&gt;
&lt;br /&gt;
# ip link set management0 up&lt;br /&gt;
# ip link set storage0 up&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Network configuration====&lt;br /&gt;
Once the Open vSwitch bridges are set up, configure the interfaces as follows:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Network Interface&lt;br /&gt;
!Role&lt;br /&gt;
!Configuration&lt;br /&gt;
|-&lt;br /&gt;
|enp4s0f0&lt;br /&gt;
|primary NIC in the host&lt;br /&gt;
|up on boot; no IP&lt;br /&gt;
|-&lt;br /&gt;
|nic0&lt;br /&gt;
|network OVS switch that connects to the other bridges to the NIC&lt;br /&gt;
|up on boot; no IP&lt;br /&gt;
|-&lt;br /&gt;
|cloudbr0&lt;br /&gt;
|public traffic.&lt;br /&gt;
|up on boot; no IP&lt;br /&gt;
|-&lt;br /&gt;
|cloudbr1&lt;br /&gt;
|guest traffic&lt;br /&gt;
|up on boot; no IP&lt;br /&gt;
|-&lt;br /&gt;
|management0&lt;br /&gt;
|management traffic&lt;br /&gt;
|up on boot; assigned with management IP&lt;br /&gt;
|-&lt;br /&gt;
|storage0&lt;br /&gt;
|storage traffic&lt;br /&gt;
|up on boot; assigned with storage network IP&lt;br /&gt;
|-&lt;br /&gt;
|cloud0&lt;br /&gt;
|link local traffic&lt;br /&gt;
|up on boot; assigned 169.254.0.1/16&lt;br /&gt;
|}Network configs are applied using network-scripts. The idea here is to have the network interfaces be configured when the system boots automatically. For interfaces that require a static IP address, I used the following network-scripts file. Adjust the device name and IP address as required.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # cat &amp;lt;&amp;lt;EOF &amp;gt; /etc/sysconfig/network-scripts/ifcfg-cloudbr0&lt;br /&gt;
DEVICE=cloudbr0&lt;br /&gt;
TYPE=Bridge&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPV6INIT=no&lt;br /&gt;
IPV6_AUTOCONF=no&lt;br /&gt;
DELAY=5&lt;br /&gt;
IPADDR=172.16.10.2&lt;br /&gt;
GATEWAY=172.16.10.1&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
DNS1=8.8.8.8&lt;br /&gt;
DNS2=8.8.4.4&lt;br /&gt;
USERCTL=no&lt;br /&gt;
NM_CONTROLLED=no&lt;br /&gt;
EOF&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}For devices that don&#039;t require a static IP:&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = cat &amp;lt;&amp;lt;EOF &amp;gt; ifcfg-cloudbr0&lt;br /&gt;
DEVICE=cloudbr0&lt;br /&gt;
TYPE=OVSBridge&lt;br /&gt;
DEVICETYPE=ovs&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
BOOTPROTO=none&lt;br /&gt;
HOTPLUG=no&lt;br /&gt;
NM_CONTROLLED=no&lt;br /&gt;
EOF&lt;br /&gt;
| lang = text&lt;br /&gt;
}}Once configured, verify that your node comes up with the proper network settings on a reboot.&lt;br /&gt;
&lt;br /&gt;
===Management node setup===&lt;br /&gt;
On the management node, set up the network configs and the CloudStack management packages.&lt;br /&gt;
&lt;br /&gt;
====Setup Storage====&lt;br /&gt;
If you intend to use the management server as the primary and secondary storage, you will need to set up a NFS server. If you intend to use an external NFS server as the primary storage, you can skip this step.{{Highlight&lt;br /&gt;
| code = # mkdir -p /export/primary /export/secondary&lt;br /&gt;
# yum -y install nfs-utils&lt;br /&gt;
# cat &amp;gt; /etc/exports &amp;lt;&amp;lt;EOF&lt;br /&gt;
/export/secondary *(rw,async,no_root_squash,no_subtree_check)&lt;br /&gt;
/export/primary *(rw,async,no_root_squash,no_subtree_check)&lt;br /&gt;
EOF&lt;br /&gt;
# systemctl enable --now nfs-server&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====CloudStack management services====&lt;br /&gt;
Install MySQL. MariaDB isn&#039;t supported and the installation fails with it.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # rpm -ivh http://repo.mysql.com/mysql80-community-release-el8.rpm&lt;br /&gt;
# yum -y install mysql-server&lt;br /&gt;
# yum -y install mysql-connector-python&lt;br /&gt;
&lt;br /&gt;
## edit /etc/my.cnf to have the following lines.&lt;br /&gt;
cat &amp;gt;&amp;gt; /etc/my.cnf &amp;lt;&amp;lt;EOF&lt;br /&gt;
[mysqld]&lt;br /&gt;
innodb_rollback_on_timeout=1&lt;br /&gt;
innodb_lock_wait_timeout=600&lt;br /&gt;
max_connections=350&lt;br /&gt;
log-bin=mysql-bin&lt;br /&gt;
binlog-format = &#039;ROW&#039;&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
# systemctl enable --now mysqld&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
Setup CloudStack.{{Highlight&lt;br /&gt;
| code = # yum -y install cloudstack-management&lt;br /&gt;
&lt;br /&gt;
# cloudstack-setup-databases cloud:password@localhost --deploy-as=root&lt;br /&gt;
# cloudstack-setup-management&lt;br /&gt;
# systemctl enable --now cloudstack-management&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}After starting &amp;lt;code&amp;gt;cloudstack-management&amp;lt;/code&amp;gt; for the firs time, it might take from 2-10 minutes for the database to set up completely. During this time, the web interface won&#039;t be responsive. In the mean time, you will need to seed the system VM images to the secondary storage. If you are using an external NFS server for your secondary storage, adjust the mount point in the following command accordingly.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = ## Seed the systemvm into secondary storage&lt;br /&gt;
# /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /export/secondary -u https://download.cloudstack.org/systemvm/4.15/systemvmtemplate-4.15.1-kvm.qcow2.bz2 -h kvm -F&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
We will continue the setup process via the web interface after setting up a bare metal node.&lt;br /&gt;
&lt;br /&gt;
===Bare metal node setup===&lt;br /&gt;
You should set up at least one bare metal node which will be used to set up your first zone and pod.&lt;br /&gt;
&lt;br /&gt;
On a bare metal node, set up everything outlined in the [[CloudStack#Node setup|Node setup]] section above. The node should have the CloudStack repos, Open vSwitch, SElinux/firewalld, and the networking configured. The agent node must have virtualization enabled on the CPU and KVM should be installed. You should be able to find &amp;lt;code&amp;gt;/dev/kvm&amp;lt;/code&amp;gt; on the system.&lt;br /&gt;
&lt;br /&gt;
====CloudStack Agent====&lt;br /&gt;
To set up the node, install the &amp;lt;code&amp;gt;cloudstack-agent&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # yum -y install cloudstack-agent&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Configure &amp;lt;code&amp;gt;qemu&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;libvirtd&amp;lt;/code&amp;gt;.{{Highlight&lt;br /&gt;
| code = ## edit /etc/libvirt/qemu.conf &lt;br /&gt;
vnc_listen=0.0.0.0&lt;br /&gt;
&lt;br /&gt;
## edit /etc/libvirt/libvirtd.conf&lt;br /&gt;
listen_tls = 0&lt;br /&gt;
listen_tcp = 1&lt;br /&gt;
tcp_port = &amp;quot;16509&amp;quot;&lt;br /&gt;
auth_tcp = &amp;quot;none&amp;quot;&lt;br /&gt;
mdns_adv = 0&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}The CloudStack install guide instructs you to edit the libvirtd arguments to &amp;lt;code&amp;gt;--listen&amp;lt;/code&amp;gt;, but this will prevent libvirtd from starting using systemd. Instead, you should skip this step entirely because the CloudStack agent will configure this for you when you add the node to a zone.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = ## The install guide suggests editing /etc/sysconfig/libvirtd to use the listen flag.&lt;br /&gt;
## However, this only works if you&#039;re not using systemd or using the libvirtd-tcp socket.&lt;br /&gt;
## I skipped this step since the agent will configure this later on.&lt;br /&gt;
LIBVIRTD_ARGS=&amp;quot;--listen&amp;quot;&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}Start the CloudStack agent. The CloudStack agent should also automatically bring up libvirtd (it&#039;s a service dependency). &lt;br /&gt;
&lt;br /&gt;
====Allow sudo access====&lt;br /&gt;
Ensure that &amp;lt;code&amp;gt;/etc/sudoers&amp;lt;/code&amp;gt; does not require TTY. In the older documentation, CloudStack requires that the &#039;cloud&#039; user be able to sudo with the addition of &amp;lt;code&amp;gt;Defaults:cloud !requiretty&amp;lt;/code&amp;gt;. However, looking at the installation on the CentOS 8 box, the agent actually runs as root, so perhaps root needs to be able to sudo? &lt;br /&gt;
&lt;br /&gt;
===Setting up your first zone===&lt;br /&gt;
At this point in the process, you should have at least one bare metal host and your management node should be up and running and it should be serving the CloudStack web UI at http://cloudstack:8080/client. Login using the default &amp;lt;code&amp;gt;admin&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;password&amp;lt;/code&amp;gt; credentials.&lt;br /&gt;
&lt;br /&gt;
You will be greeted with a setup wizard. I have had no luck with this and it&#039;s better to ignore it. Instead, navigate to Infrastructure -&amp;gt; zones and manually set up your first zone. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Description&lt;br /&gt;
!Screenshot&lt;br /&gt;
|-&lt;br /&gt;
|There are 3 types of zones that you can create:&lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;Basic zone&#039;&#039;&#039; - All guest VMs are placed on a single shared flat network. There is no isolation or security policies in place to prevent guest VMs from seeing each other.&lt;br /&gt;
#&#039;&#039;&#039;Advanced zone&#039;&#039;&#039; - Guest VMs can be placed in one or more VLAN based networks. Guest networks can either be isolated or L2. Isolated networks (depending on the chosen network offering) comes with a virtual router (VR) which offers NAT/SNAT and firewall services and uses one or more public IP addresses. L2 networks are similar but doesn&#039;t have a virtual router but instead requires these services to be offered externally.  Tenants can also create something called a virtual private cloud (VPC). A VPC is like a regular isolated guest network but with additional features. A VPC allows the user to:&lt;br /&gt;
##Create multiple subnets (called tiers) which can route with each other&lt;br /&gt;
##Network traffic between tiers can be controlled through Network ACLs&lt;br /&gt;
##One or more public IPs can be associated to a VPC.&lt;br /&gt;
##Like an isolated guest network, all subnets can be NATed out through a single public IP&lt;br /&gt;
##You can create a private gateway (and therefore static routes) within a VPC&lt;br /&gt;
##You can create a VPN connection to a VPC&lt;br /&gt;
#&#039;&#039;&#039;Advanced zone with security groups&#039;&#039;&#039; - Guest VMs are placed on a shared network that is publicly routable. There is no concept of a &#039;public&#039; network because the guest network should also be public. As a result, there is no ability to create any other kind of guest networks or VPCs. The only benefit here is the ability to define security groups per-VM (which is implemented via IPTables on the bare metal host). Because enabling security groups in a zone will restrict that zone from being able to create isolated guest networks or VPCs, the security group feature only appears useful in an environment where guests only need to connect to the internet.&lt;br /&gt;
&lt;br /&gt;
Be aware of each type&#039;s limitations before continuing.&lt;br /&gt;
&lt;br /&gt;
We will be creating an advanced network zone.&lt;br /&gt;
|[[File:CloudStack - New Zone 1.png|left|thumb]]&lt;br /&gt;
|-&lt;br /&gt;
|We will add the DNS resolvers for the zone and specify the hypervisor type (KVM). &lt;br /&gt;
Empty the guest CIDR since we&#039;re going to allow users to specify their own.&lt;br /&gt;
|[[File:CloudStack - New Zone 2.png|left|thumb]]&lt;br /&gt;
|-&lt;br /&gt;
|When using the advanced zone, you need to specify the physical networks for the management, storage, and public networks. &lt;br /&gt;
These should correspond to the physical network devices on the hypervisor. Recall that in the previous step where we set up the Open vSwitch bridges, we created the following bridges for each role:&lt;br /&gt;
&lt;br /&gt;
*management - management0&lt;br /&gt;
*storage - storage0&lt;br /&gt;
*public - cloudbr0&lt;br /&gt;
*guest - cloudbr1&lt;br /&gt;
|&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:CloudStack - New Zone 3.png&lt;br /&gt;
File:CloudStack - New Zone 3a.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Specify the public network. The addresses defined here populates the &#039;Public IP&#039; pool.&lt;br /&gt;
&lt;br /&gt;
All isolated guest networks and all VPCs will use one of the addresses defined in this pool for the SNAT/NAT. The addresses specified here should therefore be accessible from the internet.&lt;br /&gt;
|[[File:CloudStack - New Zone 4.png|left|thumb]]&lt;br /&gt;
|-&lt;br /&gt;
|Create a new pod. &lt;br /&gt;
&lt;br /&gt;
The pod network here should cover your management network subnet. The reserved IP addresses here will be used by system VMs that require access to the management network. &lt;br /&gt;
|[[File:CloudStack - New Zone 5.png|left|thumb]]&lt;br /&gt;
|-&lt;br /&gt;
|Specify the guest network VLAN range.&lt;br /&gt;
&lt;br /&gt;
Because we&#039;re using VLAN as an isolation method, this range specifies what VLANs the guest networks will use over the guest physical network.&lt;br /&gt;
|[[File:CloudStack - New Zone 6.png|left|thumb]]&lt;br /&gt;
|-&lt;br /&gt;
|Specify the storage network.&lt;br /&gt;
&lt;br /&gt;
The reserved start/end IPs will be used by system VMs that require access to the primary storage. &lt;br /&gt;
&lt;br /&gt;
If you are assigning static IPs on your bare metal hosts, ensure that the reserved addresses don&#039;t overlap with the IP range specified here (because I had CloudStack assign a VM with the same IP as a bare metal host)&lt;br /&gt;
|[[File:CloudStack - New Zone 7.png|left|thumb]]&lt;br /&gt;
|-&lt;br /&gt;
|Specify a cluster name.&lt;br /&gt;
|[[File:CloudStack - New Zone 8.png|left|thumb]]&lt;br /&gt;
|-&lt;br /&gt;
|Add your first bare metal host. &lt;br /&gt;
You must add one host now and can add additional ones later.&lt;br /&gt;
|[[File:CloudStack - New Zone 9.png|left|thumb]]&lt;br /&gt;
|-&lt;br /&gt;
|Specify your primary storage.&lt;br /&gt;
The server should be accessible from the storage network.&lt;br /&gt;
|[[File:CloudStack - New Zone 10.png|left|thumb]]&lt;br /&gt;
|-&lt;br /&gt;
|Specify your secondary storage.&lt;br /&gt;
&lt;br /&gt;
You need to have at least one NFS secondary storage that has been seeded with the system VM template. &lt;br /&gt;
&lt;br /&gt;
Secondary storage pools should be accessible from the management network (&#039;&#039;&#039;confirm&#039;&#039;&#039;?)&lt;br /&gt;
|[[File:CloudStack - New Zone 11.png|left|thumb]]&lt;br /&gt;
|-&lt;br /&gt;
|Launch the zone.&lt;br /&gt;
This step might take a few minutes. If all goes well, you can then enable the zone shortly after. If you run into any problems, check the logs on the management node at /var/log/cloudstack/management.&lt;br /&gt;
|[[File:CloudStack - New Zone 12.png|left|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
Once your zone has been enabled, it should automatically start a Console Proxy VM and secondary storage VM. You can find this under Infrastructure -&amp;gt; System VMs. If for some reason the System VMs are not starting, check that your systemvm template is available in your secondary storage and that the cloud0 bridge on each host is up. You should be able to ping the link local IP address (the 169.254.x.x address) from the hypervisor.&lt;br /&gt;
&lt;br /&gt;
Once the two system VMs are running, verify that you&#039;re able to create new guest networks or VPCs. These networks should create a virtual router. &lt;br /&gt;
&lt;br /&gt;
==Configuration==&lt;br /&gt;
&lt;br /&gt;
===Service offerings===&lt;br /&gt;
&lt;br /&gt;
====Deployment planner====&lt;br /&gt;
There are a few deployment techniques that can be used. These are set within a compute offering and cannot be changed after it&#039;s been created (&#039;&#039;&#039;really?&#039;&#039;&#039; can we change it via API?). The options are:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Deployment planner&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|First fit&lt;br /&gt;
|Placed on the first host that has sufficient capacity&lt;br /&gt;
|-&lt;br /&gt;
|User dispersing&lt;br /&gt;
|Evenly distributes VMs by account across clusters&lt;br /&gt;
|-&lt;br /&gt;
|User concentrated&lt;br /&gt;
|Opposite of the above.&lt;br /&gt;
|-&lt;br /&gt;
|Implicit dedication&lt;br /&gt;
|requires or prefers (depending on planner mode) a dedicated host&lt;br /&gt;
|-&lt;br /&gt;
|Bare metal&lt;br /&gt;
|requires a bare metal host&lt;br /&gt;
|}&lt;br /&gt;
More information from [https://docs.cloudstack.apache.org/en/4.15.2.0/adminguide/service_offerings.html#compute-and-disk-service-offerings CloudStack&#039;s documentation on Compute and Disk Service Offerings].&lt;br /&gt;
&lt;br /&gt;
===Enable SAML2 authentication===&lt;br /&gt;
Enable the SAML2 plugin by setting &amp;lt;code&amp;gt;saml2.enabled=true&amp;lt;/code&amp;gt; under Global Settings. &lt;br /&gt;
&lt;br /&gt;
Set up SAML authentication by specifying the following settings:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Setting&lt;br /&gt;
!Description&lt;br /&gt;
!Example value&lt;br /&gt;
|-&lt;br /&gt;
|saml2.default.idpid&lt;br /&gt;
|The URL of the identity provider. This is likely obtained from the metadata URL and set by the SAML2 plugin every time CloudStack starts.&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;https://sts.windows.net/c609a0ec-xxx-xxx-xxx-xxxxxxxxxxxx/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|saml2.idp.metadata.url&lt;br /&gt;
|The metadata XML URL&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;https://login.microsoftonline.com/609a0ec-xxx-xxx-xxx-xxxxxxxxxxxx/federationmetadata/2007-06/federationmetadata.xml?appid=c5b8df24-xxx-xxx-xxx-xxxxxxxxxxxx&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|saml2.sp.id&lt;br /&gt;
|The identifier string for this application&lt;br /&gt;
|cloudstack-test.my-organization.tld&lt;br /&gt;
|-&lt;br /&gt;
|saml2.redirect.url&lt;br /&gt;
|The redirect URL using your cloudstack domain.&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;https://cloudstack-test.my-organization.tld/client&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|saml2.user.attribute&lt;br /&gt;
|The attribute to use as the username. &lt;br /&gt;
If you&#039;re not sure what&#039;s available, look at the management logs after a login attempt.&lt;br /&gt;
|For Azure AD, use the email address attribute: &amp;lt;nowiki&amp;gt;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Restart the management server. To allow a user access, create the user and enable SSO. The user&#039;s username must match the value that&#039;s obtained from the saml2.user.attribute field.&lt;br /&gt;
&lt;br /&gt;
====Bugs====&lt;br /&gt;
&lt;br /&gt;
=====SAML Request being rejected by Azure AD=====&lt;br /&gt;
If you are using Azure AD, you may have issues authenticating because the SAML request ID that&#039;s generated might begin with a number. When this happens, you will get an error similar to: &amp;lt;code&amp;gt;AADSTS7500529: The value &#039;692rv91k6dgmdas33vr3b2keahr4lqjv&#039; is not a valid SAML ID. The ID must not begin with a number.&amp;lt;/code&amp;gt;. For more information, see: https://github.com/apache/cloudstack/issues/5548&lt;br /&gt;
&lt;br /&gt;
=====Users cannot login via SSO=====&lt;br /&gt;
Users that will be using SAML for authentication will need to have their CloudStack accounts created with SSO enabled. There seems to be a bug with the CloudStack web UI where a user&#039;s SAML IdPID isn&#039;t settable (it gets set to a &#039;0&#039;). A work-around would be to create and authorize users via CloudMonkey.&lt;br /&gt;
&lt;br /&gt;
The steps on adding a new user are:&lt;br /&gt;
&lt;br /&gt;
#Create the user:  &amp;lt;code&amp;gt;create user firstname=First lastname=User email=user1@ucalgary.ca username=user1@ucalgary.ca account=RCS state=enabled password=asdf&amp;lt;/code&amp;gt;&lt;br /&gt;
#Find the user&#039;s ID: &amp;lt;code&amp;gt;list users domainid=&amp;lt;tab&amp;gt; filter=username,id&amp;lt;/code&amp;gt;&lt;br /&gt;
#Authorize the user: &amp;lt;code&amp;gt;authorize samlsso enable=true entityid=&amp;lt;nowiki&amp;gt;https://sts.windows.net/c609a0ec-xxx-xxx-xxx-xxxxxxxxxxxx/&amp;lt;/nowiki&amp;gt; userid=user-id&amp;lt;/code&amp;gt;&lt;br /&gt;
#Verify that the user is enabled for SSO: &amp;lt;code&amp;gt;list samlauthorization filter=userid,idpid,status&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When authorizing a user, the entityid must be the URL of the identity provider. The end slash is also mandatory.&lt;br /&gt;
&lt;br /&gt;
===Enable SSL===&lt;br /&gt;
A few things to note about enabling SSL:&lt;br /&gt;
&lt;br /&gt;
*If you added hosts via IP address, enabling SSL would likely break the management-to-client connection. You might need to re-add the host so that the certificates all match up.&lt;br /&gt;
* On CloudStack 4.16, the button to upload a new certificate in the SSL dialog box does not work. This is fixed in 4.16.1.&lt;br /&gt;
&lt;br /&gt;
==== Preparing your SSL certificates ====&lt;br /&gt;
First, generate a private key and certificate signing request and then obtain your SSL certificate from a certificate authority. For a typical CloudStack installation, you should obtain SSL certificates for both your management server as well as your console proxy.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # openssl genrsa -out server.key 4096&lt;br /&gt;
# openssl req -new -sha256 \&lt;br /&gt;
         -key server.key \&lt;br /&gt;
         -subj &amp;quot;/C=CA/ST=Alberta/O=Steamr/CN=cloudstack-test.example.com&amp;quot; \&lt;br /&gt;
         -reqexts SAN \&lt;br /&gt;
         -extensions SAN \&lt;br /&gt;
         -config &amp;lt;(cat /etc/pki/tls/openssl.cnf &amp;lt;(printf &amp;quot;[SAN]\nsubjectAltName=DNS:cloudstack-test-console.example.com&amp;quot;)) \&lt;br /&gt;
         -out server.csr&lt;br /&gt;
## With the server.csr file, upload it to your Certificate Authority to obtained a signed certificate.&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
Your certificate authority should have given you your signed certificate as well as the root and any other intermediate certificates in a X.509 (.crt) format. If you need to self sign this certificate signing request, do the following:{{Highlight&lt;br /&gt;
| code = ## Run the following only if you want to self sign your certificate&lt;br /&gt;
## Make your root CA&lt;br /&gt;
# openssl genrsa -des3 -out rootCA.key 4096&lt;br /&gt;
# openssl req -x509 -new -subj &amp;quot;/C=CA/ST=Alberta/O=Steamr/CN=example.com&amp;quot; -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.crt&lt;br /&gt;
&lt;br /&gt;
## Sign the certificate&lt;br /&gt;
# openssl x509 -req -in server.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out server.crt -days 500 -sha256&lt;br /&gt;
&lt;br /&gt;
## Check the certificate&lt;br /&gt;
# openssl x509 -in server.crt -text -noout&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}Next, you need to convert your certificate into a PKCS12 format and your private key into a PKCS8 format. This is the only format that works with the CloudStack management server. We place the PKCS12 keystore file at &amp;lt;code&amp;gt;/etc/cloudstack/management/ssl_keystore.pkcs12&amp;lt;/code&amp;gt;.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = ## Combine Files&lt;br /&gt;
# cat server.key server.crt intermediate.crt root.crt &amp;gt; combined.crt&lt;br /&gt;
&lt;br /&gt;
## Create keystore&lt;br /&gt;
## You may use &#039;password&#039; as the password&lt;br /&gt;
# openssl pkcs12 -in combined.crt -export -out combined.pkcs12&lt;br /&gt;
&lt;br /&gt;
## Import keystore&lt;br /&gt;
## Provide the same password above. Eg. &#039;password&#039;&lt;br /&gt;
# keytool -importkeystore -srckeystore combined.pkcs12 -srcstoretype PKCS12 -destkeystore /etc/cloudstack/management/ssl_keystore.pkcs12 -deststoretype pkcs12&lt;br /&gt;
&lt;br /&gt;
## Convert the private key into PKCS8 format&lt;br /&gt;
## Provide the same password above. Eg. &#039;password&#039;&lt;br /&gt;
# openssl pkcs8 -topk8 -in server.key -out server.pkcs8.encrypted.key&lt;br /&gt;
# openssl pkcs8 -in server.pkcs8.encrypted.key -out server.pkcs8.key&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Upload SSL certificates ====&lt;br /&gt;
You can upload SSL certificates to CloudStack under Infrastructure -&amp;gt; Summary and then clicking on the &#039;SSL Certificates&amp;quot; button. Provide the root certificate authority, the certificate, the private key (in PKCS8 format), and the domain that the certificate applies to. Wildcard domains should be specified as &amp;lt;code&amp;gt;*.example.com&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Alternatively, you may use the CloudMonkey tool to upload certificates using the file parameter passing feature like so:&lt;br /&gt;
&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # cmk upload customcertificate domainsuffix=cloudstack.steamr.com id=1 name=root certificate=@root.crt&lt;br /&gt;
# cmk upload customcertificate domainsuffix=cloudstack.steamr.com id=2 name=intermediate1 certificate=@intermediate.crt&lt;br /&gt;
# cmk upload customcertificate domainsuffix=cloudstack.steamr.com id=3 privatekey=@server.pkcs8.key certificate=@domain.crt&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Enabling HTTPS ====&lt;br /&gt;
Next, you will need to enable HTTPS on both the management console and console proxy.&lt;br /&gt;
&lt;br /&gt;
Note that you may enable the HTTPS setting only after at least one certificate has been uploaded. If the server has no certificates, the option is ignored.&lt;br /&gt;
&lt;br /&gt;
===== Enable HTTPS on the management console =====&lt;br /&gt;
The management console can be configured by editing &amp;lt;code&amp;gt;/etc/cloudstack/management/server.properties&amp;lt;/code&amp;gt; with the following lines. Set the keystore password to the same password you used above to import it.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = https.enable=true&lt;br /&gt;
https.port=8443&lt;br /&gt;
https.keystore=/etc/cloudstack/management/ssl_keystore.pkcs12&lt;br /&gt;
https.keystore.password=password&lt;br /&gt;
| lang = text&lt;br /&gt;
}}Restart the management server for this to apply.&lt;br /&gt;
{{Info&lt;br /&gt;
| title = Why port 8443?&lt;br /&gt;
| message = Because CloudStack runs under a non-root account, it can only bind to high port (&amp;gt; 1024) numbers. &lt;br /&gt;
&lt;br /&gt;
You can still have CloudStack visible on port 443 if you use a [[IPTables#Mapping incoming traffic to a different internal port|IPTables rule]].&lt;br /&gt;
}}&lt;br /&gt;
Confirm that you are able to reach your management console via HTTPS.&lt;br /&gt;
&lt;br /&gt;
==== Enable HTTPS on the console proxy ====&lt;br /&gt;
If you enable SSL on the management console, you will also need to enable SSL for the console proxies for the VNC web sockets to work properly. If your management console certificate (from the previous sections) contain a Subject Alternative Name (SAN) or is a wildcard certificate that includes your console proxy&#039;s DNS name, SSL for the console proxy should be working. If your certificates do not include the console proxy&#039;s DNS name, you will need to obtain another SSL certificate and add it to the SSL keystore and upload it to CloudStack using the same instructions above.&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
===Re-add existing KVM bare metal host===&lt;br /&gt;
Once a host has been added to CloudStack, the CloudStack agent will have generated some public/private keys and configured itself to talk to the management node.  If you need to remove and re-add a host, you will need to clean up the agent before re-adding it back to CloudStack again. Based on my experience, I had to do the following:&lt;br /&gt;
&lt;br /&gt;
#Before removing the host from CloudStack, drain it of all VMs. &amp;lt;code&amp;gt;virsh list&amp;lt;/code&amp;gt; should be empty. If not and you&#039;ve removed the host from the management server already, manually kill each VM with &amp;lt;code&amp;gt;virsh destroy&amp;lt;/code&amp;gt;.&lt;br /&gt;
#&amp;lt;code&amp;gt;systemctl stop cloudstack-agent&amp;lt;/code&amp;gt;&lt;br /&gt;
#&amp;lt;code&amp;gt;rm -rf /etc/cloudstack/agent/cloud*&amp;lt;/code&amp;gt;&lt;br /&gt;
#unmount any primary storages with &amp;lt;code&amp;gt;umount /mnt/*&amp;lt;/code&amp;gt; and clean up with &amp;lt;code&amp;gt;rmdir /mnt/*&amp;lt;/code&amp;gt;&lt;br /&gt;
#&amp;lt;code&amp;gt;systemctl stop libvirtd&amp;lt;/code&amp;gt;&lt;br /&gt;
#&amp;lt;code&amp;gt;rm -rf /var/lib/libvirt/qemu&amp;lt;/code&amp;gt;&lt;br /&gt;
#You may need to edit &amp;lt;code&amp;gt;/etc/sysconfig/libvirtd&amp;lt;/code&amp;gt; to not use the listen flag. This might prevent libvirtd (and subsequently cloudstack-agent) from starting.&lt;br /&gt;
#Edit &amp;lt;code&amp;gt;/etc/cloudstack/agent/agent.properties&amp;lt;/code&amp;gt; and remove the keystore passphrase, any UUIDs and GUIDs, cluster/pod/zone, and the host.&lt;br /&gt;
#Restart with &amp;lt;code&amp;gt;systemctl start cloudstack-agent&amp;lt;/code&amp;gt; (libvirt should come up automatically as it&#039;s a dependency). Ensure that it comes up OK.&lt;br /&gt;
&lt;br /&gt;
You may then re-add the host back to CloudStack.&lt;br /&gt;
&lt;br /&gt;
===Building RPMs===&lt;br /&gt;
To build the RPM packages from scratch, you&#039;ll need to install a bunch of dependencies and then run the build script. For more information, see:&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;nowiki&amp;gt;https://docs.cloudstack.apache.org/en/4.15.2.0/installguide/building_from_source.html#building-rpms-from-source&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # yum groupinstall &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
# yum install java-11-openjdk-devel genisoimage mysql mysql-server createrepo&lt;br /&gt;
# yum install epel-release&lt;br /&gt;
&lt;br /&gt;
# curl -sL https://rpm.nodesource.com/setup_12.x {{!}} sudo bash -&lt;br /&gt;
# yum install nodejs&lt;br /&gt;
&lt;br /&gt;
# cat &amp;lt;&amp;lt;EOF &amp;gt; /etc/yum.repos.d/mysql.repo&lt;br /&gt;
[mysql-community]&lt;br /&gt;
name=MySQL Community connectors&lt;br /&gt;
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/$releasever/$basearch/&lt;br /&gt;
gpgkey=http://repo.mysql.com/RPM-GPG-KEY-mysql&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
EOF&lt;br /&gt;
# yum -y install mysql-connector-python&lt;br /&gt;
&lt;br /&gt;
enable powertools&lt;br /&gt;
&lt;br /&gt;
# yum install jpackage-utils maven&lt;br /&gt;
&lt;br /&gt;
# git clone https://github.com/apache/cloudstack.git&lt;br /&gt;
# cd cloudstack&lt;br /&gt;
# git checkout 4.15&lt;br /&gt;
&lt;br /&gt;
# cd packaging&lt;br /&gt;
# sh package.sh --distribution centos8&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Rebuilding UI ===&lt;br /&gt;
To rebuild the CloudStack management console UI (such as to test a new feature or bug fix), do the following:&lt;br /&gt;
&lt;br /&gt;
# On a server with npm installed, clone the CloudStack git repo and checkout the branch with the UI fix/feature&lt;br /&gt;
# Navigate to &amp;lt;code&amp;gt;cloudstack/ui/&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run &amp;lt;code&amp;gt;npm install&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run &amp;lt;code&amp;gt;npm run build&amp;lt;/code&amp;gt;&lt;br /&gt;
# Copy the &amp;lt;code&amp;gt;dist/&amp;lt;/code&amp;gt; directory to &amp;lt;code&amp;gt;/usr/share/cloudstack-management/webapp/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload the console page. Ensure that the vue app isn&#039;t cached.&lt;br /&gt;
&lt;br /&gt;
===Usage server===&lt;br /&gt;
Install &amp;lt;code&amp;gt;cloudstack-usage&amp;lt;/code&amp;gt;. Start it and restart the management server. Set &amp;lt;code&amp;gt;enable.usage.server=true&amp;lt;/code&amp;gt; in global settings.&lt;br /&gt;
&lt;br /&gt;
The usage data will be stored in the usage database on your management server. Metrics are gathered daily and can be viewed through Cloud Monkey. There is no option to view this data in the management console.&lt;br /&gt;
&lt;br /&gt;
The collected data is coarse in nature, but it should be sufficient enough for you to determine an account or VM&#039;s resource utilization over a time period of a day or more and should be good enough to implement a rough billing / showback amount.&lt;br /&gt;
&lt;br /&gt;
===Adding some Linux templates===&lt;br /&gt;
You can add the &amp;quot;Generic Cloud&amp;quot; qcow2 disk images as a system template to CloudStack. &lt;br /&gt;
&lt;br /&gt;
Because these cloud images uses cloud-init, you will need to provide some custom userdata when deploying these images. Userdata will only work when the VM is deployed on a network that offers the &amp;quot;User Data&amp;quot; service offering. If you can&#039;t use userdata or if you want the VMs to come up with a specific root password, you can use [[virt-customize]] to set the root password on the qcow2 file.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Distro&lt;br /&gt;
!Type&lt;br /&gt;
!URL&lt;br /&gt;
|-&lt;br /&gt;
|Rocky Linux 8.4&lt;br /&gt;
|CentOS 8&lt;br /&gt;
|https://download.rockylinux.org/pub/rocky/8.4/images/Rocky-8-GenericCloud-8.4-20210620.0.x86_64.qcow2&lt;br /&gt;
|-&lt;br /&gt;
|CentOS 8.4&lt;br /&gt;
|CentOS 8&lt;br /&gt;
|https://cloud.centos.org/centos/8/x86_64/images/CentOS-8-GenericCloud-8.4.2105-20210603.0.x86_64.qcow2&lt;br /&gt;
|-&lt;br /&gt;
|Fedora 34&lt;br /&gt;
|Fedora Linux (64 bit)&lt;br /&gt;
|https://download.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2&lt;br /&gt;
|-&lt;br /&gt;
|Ubuntu Server 21.04&lt;br /&gt;
|&lt;br /&gt;
|http://cloud-images.ubuntu.com/hirsute/current/hirsute-server-cloudimg-amd64.img&lt;br /&gt;
You need to convert img to qcow with qemu-img:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;qemu-img create -F qcow2 -b cloudimg-amd64.img -f qcow2 cloudimg-adm64.qcow2 10G&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Here&#039;s an example of a cloud-init configuration which you would put in the userdata field when deploying a VM:&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = #cloud-config&lt;br /&gt;
hostname: vm01&lt;br /&gt;
manage_etc_hosts: true&lt;br /&gt;
users:&lt;br /&gt;
  - name: vmadm&lt;br /&gt;
    sudo: ALL=(ALL) NOPASSWD:ALL&lt;br /&gt;
    groups: users, admin&lt;br /&gt;
    home: /home/vmadm&lt;br /&gt;
    shell: /bin/bash&lt;br /&gt;
    lock_passwd: false&lt;br /&gt;
ssh_pwauth: true&lt;br /&gt;
disable_root: false&lt;br /&gt;
chpasswd:&lt;br /&gt;
  list: {{!}}&lt;br /&gt;
    vmadm:vmadm&lt;br /&gt;
  expire: false&lt;br /&gt;
| lang = text&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Importing a VMware Virtual Machine ===&lt;br /&gt;
To import a VMware virtual machine:&lt;br /&gt;
&lt;br /&gt;
# Copy the virtual machine&#039;s .vmdk disk file to a CloudStack node&lt;br /&gt;
# Convert the .vmdk into a .qcow format using the qemu-img convert command. Eg. &amp;lt;code&amp;gt;qemu-img convert -f linux.vmdk -O linux.qcow2&amp;lt;/code&amp;gt;&lt;br /&gt;
# Run the file command on the qcow disk and make a note of its size (in bytes).&lt;br /&gt;
# Create a new virtual machine in CloudStack. Use an ISO and not a template. Set the size of the VM&#039;s ROOT disk to match the disk size noted from the previous step.&lt;br /&gt;
# Start and stop the VM to ensure the virtual disk is created. Make a note of the virtual disk&#039;s ID.&lt;br /&gt;
# Copy the converted qcow disk over the existing virtual disk image in the primary storage.&lt;br /&gt;
# Restart the VM in CloudStack.&lt;br /&gt;
&lt;br /&gt;
Some things to note with this process:&lt;br /&gt;
&lt;br /&gt;
* The disk subsystem might differ between KVM and VMware. As a result, you may need to [[Rebuilding the initial ramdisk|rebuild the initrd file]] so that it has the necessary drivers to boot properly.&lt;br /&gt;
&lt;br /&gt;
=== Increasing the management console&#039;s timeout ===&lt;br /&gt;
The default timeout is 30 minutes. You may adjust the number of minutes in the &amp;lt;code&amp;gt;session.timeout&amp;lt;/code&amp;gt; value stored in &amp;lt;code&amp;gt;/etc/cloudstack/management/server.properties&amp;lt;/code&amp;gt;.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = session.timeout=60&lt;br /&gt;
| lang = xml&lt;br /&gt;
}}&lt;br /&gt;
Restart the cloudstack-management service to apply.&lt;br /&gt;
&lt;br /&gt;
=== Upgrade CloudStack ===&lt;br /&gt;
To upgrade CloudStack to the next major release, you should first update the management server, then secondly the agents, and lastly, check if you need to upgrade any system VMs or virtual routers. Ideally, you should have the same CloudStack version across the entire cluster to avoid any weird issues due to mismatched versions. If you do have mismatched versions, you might find yourself being unable to start a virtual router properly because the virtual router version is higher than the underlying CloudStack agent doing the orchestration.&lt;br /&gt;
&lt;br /&gt;
==== Updating the management server ====&lt;br /&gt;
Here are the general steps to upgrade the management server. &lt;br /&gt;
&lt;br /&gt;
# Make sure you back up your CloudStack database before you begin. This is necessary if you wish to rollback the update because new versions typically also require a database migration which cannot be reverted easily and older CloudStack versions will refuse to start with an updated database.&lt;br /&gt;
# Stop the management server: &amp;lt;code&amp;gt;systemctl stop cloudstack-management&amp;lt;/code&amp;gt;&lt;br /&gt;
# Apply the update: &amp;lt;code&amp;gt;yum -y update cloudstack\*&amp;lt;/code&amp;gt;&lt;br /&gt;
# Manually unmount any CloudStack mounts. I had to do when I upgraded from 4.16 to 4.17 since it prevented CloudStack from starting: &amp;lt;code&amp;gt;umount /var/cloudstack/mnt/*&amp;lt;/code&amp;gt;&lt;br /&gt;
# Ensure that the appropriate system VM template exists. This is a problem if you built a custom RPM package and didn&#039;t include it. If it&#039;s missing, download the appropriate version from http://download.cloudstack.org/systemvm. &amp;lt;code&amp;gt;ls -al /usr/share/cloudstack-management/templates/systemvm/&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Restart the management server: &amp;lt;code&amp;gt;systemctl start cloudstack-management&amp;lt;/code&amp;gt;,&lt;br /&gt;
# Watch the CloudStack logs for any issues preventing a startup: &amp;lt;code&amp;gt;tail -f /var/log/cloud/management/*log&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Updating the CloudStack agents ====&lt;br /&gt;
Updating the agent is straight forward and shouldn&#039;t require you to drain VMs from the node.&lt;br /&gt;
&lt;br /&gt;
# Stop CloudStack agent: &amp;lt;code&amp;gt;systemctl stop cloudstack-agent&amp;lt;/code&amp;gt;&lt;br /&gt;
# Update the CloudStack agent: &amp;lt;code&amp;gt;yum -y update cloudstack-agent&amp;lt;/code&amp;gt;&lt;br /&gt;
# Restart the CloudStack agent: &amp;lt;code&amp;gt;systemctl restart cloudstack-agent&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Updating the system VMs ====&lt;br /&gt;
Check your list of virtual routers under Infrastructure -&amp;gt; Virtual routers. Update any VMs that are marked with &#039;requires upgrade&#039;. Do so by selecting the VM and clicking on the &#039;upgrade router to use newer template&#039; button.&lt;br /&gt;
&lt;br /&gt;
If the virtual router doesn&#039;t start up properly after performing an upgrade, make sure that the VM is running on a node with an appropriate CloudStack agent version. Virtual routers that land on a node with an older version of the agent won&#039;t start properly.&lt;br /&gt;
&lt;br /&gt;
==== Other upgrade notes ====&lt;br /&gt;
Things to watch out for:&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t upgrade CloudStack packages on a server until you stop the CloudStack services. For some reason, I&#039;ve had issues in the past where something with Java gets corrupted if you try to do an upgrade while the java processes are still running. This then results in some odd class loader issue which results in the service being unable to start after the upgrade.&lt;br /&gt;
* System VM template: I upgraded the CloudStack management server to 4.16.1 using a custom compiled RPM package. However, the management server didn&#039;t start and inspecting the logs show that it was expecting a system VM template at &amp;lt;code&amp;gt;/usr/share/cloudstack-management/templates/systemvm/systemvmtemplate-4.16.1-kvm.qcow2.bz2&amp;lt;/code&amp;gt;. This is easily fixed by downloading the template and restarting the management server.  &amp;lt;code&amp;gt;wget &amp;lt;nowiki&amp;gt;http://download.cloudstack.org/systemvm/4.16/systemvmtemplate-4.16.1-kvm.qcow2.bz2&amp;lt;/nowiki&amp;gt; -O /usr/share/cloudstack-management/templates/systemvm/systemvmtemplate-4.16.1-kvm.qcow2.bz2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Traefik ===&lt;br /&gt;
&lt;br /&gt;
==== Using Traefik for SSL termination ====&lt;br /&gt;
With the console proxy served using SSL, we could put a reverse proxy in front of both the management UI and the console proxy service VMs with a valid certificate. This allows us to &#039;mask&#039; the self-signed certificate with Traefik&#039;s ability to request for a proper certificate from Let&#039;s Encrypt.&lt;br /&gt;
&lt;br /&gt;
In my test version of CloudStack, I&#039;ve set up Traefik with the following configs. I updated the console proxy to use a dynamic URL by setting &amp;lt;code&amp;gt;consoleproxy.url.domain&amp;lt;/code&amp;gt; to something like &amp;lt;code&amp;gt;*.cloudstack-test.example.com&amp;lt;/code&amp;gt;. CloudStack&#039;s console proxy service will translate the &amp;lt;code&amp;gt;*&amp;lt;/code&amp;gt; by the system VM&#039;s IP address (Eg. 10.1.1.1 becomes 10-1-1-1). We&#039;ll tell Traefik to reverse proxy these domains for both HTTPS and WSS on ports 443 and 8080 respectively. My dynamic traefik configs to make this happen looks like the following:{{Highlight&lt;br /&gt;
| code = http:&lt;br /&gt;
  serversTransports:&lt;br /&gt;
    ignorecert:&lt;br /&gt;
      insecureSkipVerify: true&lt;br /&gt;
&lt;br /&gt;
  routers:&lt;br /&gt;
    cloudstack:&lt;br /&gt;
      rule: Host(`cloudstack-test.example.com`)&lt;br /&gt;
      service: cloudstack-poc&lt;br /&gt;
      entrypoints:&lt;br /&gt;
        - http&lt;br /&gt;
      middlewares:&lt;br /&gt;
        - https-redirect&lt;br /&gt;
&lt;br /&gt;
    cloudstack-https:&lt;br /&gt;
      rule: Host(`cloudstack-test.example.com`)&lt;br /&gt;
      service: cloudstack-poc&lt;br /&gt;
      entrypoints:&lt;br /&gt;
        - https&lt;br /&gt;
      tls:&lt;br /&gt;
        certresolver: letsencrypt&lt;br /&gt;
&lt;br /&gt;
    cloudstack-pub-ip-136-159-1-100:&lt;br /&gt;
      rule: Host(`136-159-1-1.cloudstack-test.example.com`)&lt;br /&gt;
      service: 136-159-1-100&lt;br /&gt;
      entrypoints:&lt;br /&gt;
        - https&lt;br /&gt;
      tls:&lt;br /&gt;
        certresolver: letsencrypt&lt;br /&gt;
&lt;br /&gt;
    cloudstack-pub-ip-136-159-1-100-ws:&lt;br /&gt;
      rule: Host(`136-159-1-1.cloudstack-test.example.com`)&lt;br /&gt;
      service: 136-159-1-100-ws&lt;br /&gt;
      entrypoints:&lt;br /&gt;
        - httpws&lt;br /&gt;
      tls:&lt;br /&gt;
        certresolver: letsencrypt&lt;br /&gt;
		&lt;br /&gt;
  services:&lt;br /&gt;
    cloudstack-poc:&lt;br /&gt;
      loadBalancer:&lt;br /&gt;
        servers:&lt;br /&gt;
          - url: &amp;quot;http://172.19.12.141:8080&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    136-159-1-100:&lt;br /&gt;
      loadBalancer:&lt;br /&gt;
        servers:&lt;br /&gt;
          - url: &amp;quot;https://136.159.1.100&amp;quot;&lt;br /&gt;
        serversTransport: ignorecert&lt;br /&gt;
&lt;br /&gt;
    136-159-1-100-ws:&lt;br /&gt;
      loadBalancer:&lt;br /&gt;
        servers:&lt;br /&gt;
          - url: &amp;quot;https://136.159.1.100:8080&amp;quot;&lt;br /&gt;
        serversTransport: ignorecert&lt;br /&gt;
&lt;br /&gt;
  middlewares:&lt;br /&gt;
    https-redirect:&lt;br /&gt;
      redirectscheme:&lt;br /&gt;
        scheme: https&lt;br /&gt;
| lang = yaml&lt;br /&gt;
}}And the following traefik configs:&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = entryPoints:&lt;br /&gt;
  http:&lt;br /&gt;
    address: &amp;quot;:80&amp;quot;&lt;br /&gt;
  https:&lt;br /&gt;
    address: &amp;quot;:443&amp;quot;&lt;br /&gt;
  httpws:&lt;br /&gt;
    address: &amp;quot;:8080&amp;quot;&lt;br /&gt;
&lt;br /&gt;
certificatesResolvers:&lt;br /&gt;
  letsencrypt:&lt;br /&gt;
    acme:&lt;br /&gt;
      email: user@example.com&lt;br /&gt;
      storage: &amp;quot;/config/acme.json&amp;quot;&lt;br /&gt;
      httpChallenge:&lt;br /&gt;
        entryPoint: http&lt;br /&gt;
| lang = yaml&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Change guest VM CPU flags ===&lt;br /&gt;
The default CPU flags that guest VMs sees are set to qemu64 compatible features. The qemu64 feature set covers a very small subset of the available features that modern CPUs have which makes the guest VM be compatible to nearly all available CPUs at the cost of reduced features. The feature flags in qemu64 are: &amp;lt;code&amp;gt;fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 ht syscall nx lm rep_good nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For virtualized workloads that require additional feature sets, you can edit the CloudStack agent to use a different guest CPU mode. Select one of:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;custom&#039;&#039;&#039;: This is the default and it defaults to the x86_qemu64 feature set defined in &amp;lt;code&amp;gt;/usr/share/libvirt/cpu_map/x86_qemu64.xml&amp;lt;/code&amp;gt;. You may select a different CPU map by specifying &amp;lt;code&amp;gt;guest.cpu.model&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &#039;&#039;&#039;host-model&#039;&#039;&#039;: Uses a CPU model compatible with your host. Most feature flags are available.&lt;br /&gt;
* &#039;&#039;&#039;host-passthrough&#039;&#039;&#039;: Use CPU passthrough; feature flags match exactly. Migrations only work with matching CPUs and may still fail when using this mode.&lt;br /&gt;
&lt;br /&gt;
For CloudStack clusters with identical CPUs, it&#039;s recommended to use host-model. I&#039;ve tried using host-passthrough on matching hosts using a Intel Xeon Silver 4316 and migrations sometimes fail and the VM requires a reset to be brought back up.&lt;br /&gt;
&lt;br /&gt;
For more information, see: http://docs.cloudstack.apache.org/en/4.15.0.0/installguide/hypervisor/kvm.html#install-and-configure-the-agent&lt;br /&gt;
&lt;br /&gt;
To change the CPU mode, you simply need to add the appropriate line into the agent properties file and restart the agent:&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = ## Matching host model&lt;br /&gt;
# echo &amp;quot;guest.cpu.mode=host-model&amp;quot; &amp;gt;&amp;gt; /etc/cloudstack/agent/agent.properties&lt;br /&gt;
# systemctl restart cloudstack-agent.service&lt;br /&gt;
&lt;br /&gt;
## Passthrough&lt;br /&gt;
# echo &amp;quot;guest.cpu.mode=host-passthrough&amp;quot; &amp;gt;&amp;gt; /etc/cloudstack/agent/agent.properties&lt;br /&gt;
# systemctl restart cloudstack-agent.service&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Using Open vSwitch and DPDK ===&lt;br /&gt;
Getting DPDK working with Open vSwitch is relatively straight forward. You need to install the DPDK packages, configure the kernel to use hugepages and IO passthrough, enable the vfio driver on your network interfaces for DPDK support, reconfigure Open vSwitch to use the DPDK device, and enable DPDK on the CloudStack agent.&lt;br /&gt;
&lt;br /&gt;
There are some existing resources that might help.&lt;br /&gt;
&lt;br /&gt;
*https://www.shapeblue.com/openvswitch-with-dpdk-support-on-cloudstack/&lt;br /&gt;
* https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/10/html/ovs-dpdk_end_to_end_troubleshooting_guide/configure_and_test_lacp_bonding_with_open_vswitch_dpdk&lt;br /&gt;
&lt;br /&gt;
Install DPDK tools:&lt;br /&gt;
&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # yum -y install dpdk dpdk-tools&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Reconfigure your kernel by editing &amp;lt;code&amp;gt;/etc/default/grub&amp;lt;/code&amp;gt;. Add the following. Adjust the &amp;lt;code&amp;gt;isolcpus&amp;lt;/code&amp;gt; depending on your CPUs available. I assigned 4 cores out of 80 vCPUs. I am also using 16 1GB huge pages. Adjust this according to how much memory your system has (and probably what performance you&#039;re seeing){{Highlight&lt;br /&gt;
| code = # vi /etc/default/grub&lt;br /&gt;
## default_hugepagesz=1GB hugepagesz=1G hugepages=16 iommu=pt intel_iommu=on isolcpus=1-19,21-39,41-59,61-79 intel_pstate=disable nosoftlockup&lt;br /&gt;
&lt;br /&gt;
# grub2-mkconfig -o /boot/grub2/grub.cfg&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}You can also configure huge pages by sysctl (optional if you set it in the kernel cmdline){{Highlight&lt;br /&gt;
| code = # echo &#039;vm.nr_hugepages=16&#039; &amp;gt; /etc/sysctl.d/hugepages.conf&lt;br /&gt;
# sysctl -w vm.nr_hugepages=16&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}Load the &amp;lt;code&amp;gt;vfio-pci&amp;lt;/code&amp;gt; kernel module on boot&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # echo vfio-pci &amp;gt; /etc/modules-load.d/vfio-pci.conf&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
Reboot the machine. When it comes back, verify that you have hugepages and vfio-pci loaded, and that IOMMU is working.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # cat /proc/cmdline {{!}} grep iommu=pt&lt;br /&gt;
# cat /proc/cmdline {{!}} grep intel_iommu=on&lt;br /&gt;
# dmesg {{!}} grep -e DMAR -e IOMMU&lt;br /&gt;
# grep HugePages_ /proc/meminfo&lt;br /&gt;
# lsmod {{!}} grep vfio-pci&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
Set the network interfaces you wish to use DPDK on to the vfio-pci driver. This is done using the &amp;lt;code&amp;gt;dpdk-devbind.py&amp;lt;/code&amp;gt; script that&#039;s provided by the DPDK tools package.{{Highlight&lt;br /&gt;
| code = # modprobe vfio-pci&lt;br /&gt;
# dpdk-devbind.py --bind=vfio-pci ens2f0&lt;br /&gt;
# dpdk-devbind.py --bind=vfio-pci ens2f1&lt;br /&gt;
## Verify&lt;br /&gt;
# dpdk-devbind.py --status&lt;br /&gt;
&lt;br /&gt;
Network devices using DPDK-compatible driver&lt;br /&gt;
============================================&lt;br /&gt;
0000:31:00.0 &#039;Ethernet Controller X710 for 10GBASE-T 15ff&#039; drv=vfio-pci unused=i40e&lt;br /&gt;
0000:31:00.1 &#039;Ethernet Controller X710 for 10GBASE-T 15ff&#039; drv=vfio-pci unused=i40e&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}Enable DPDK on Open vSwitch. pmd-cpu-mask defines what cores are used for data path packet processing. The dpdk-lcore-mask defines cores that non-datapath OVS-DPDK threads such as handler and revalidator threads run. These two masks should not overlap. For more information on these parameters, see: https://developers.redhat.com/blog/2017/06/28/ovs-dpdk-parameters-dealing-with-multi-numa&amp;lt;nowiki/&amp;gt;.{{Highlight&lt;br /&gt;
| code = &lt;br /&gt;
# ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true&lt;br /&gt;
# ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-lcore-mask=0x00000001  &lt;br /&gt;
# ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask=0x17c0017c                   &lt;br /&gt;
# ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem=&amp;quot;1024&amp;quot;&lt;br /&gt;
&lt;br /&gt;
## Verify&lt;br /&gt;
# ovs-vsctl get Open_vSwitch . dpdk_initialized&lt;br /&gt;
# ovs-vsctl get Open_vSwitch . dpdk_version&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}If Open vSwitch is already configured to use these interfaces by name, you will just need to change the interface type to dpdk and set its PCI address.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # ovs-vsctl set interface ens2f0 type=dpdk&lt;br /&gt;
# ovs-vsctl set interface ens2f0 options:dpdk-devargs=0000:31:00.0&lt;br /&gt;
# ovs-vsctl set interface ens2f1 type=dpdk&lt;br /&gt;
# ovs-vsctl set interface ens2f1 options:dpdk-devargs=0000:31:00.1&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
The bridge that these interfaces are connected to must also have its datapath_type updated:&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # ovs-vsctl set bridge nic0 datapath_type=netdev&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
Restart Open vSwitch for these to apply properly and confirm that it&#039;s working&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # systemctl restart openvswitch&lt;br /&gt;
# ovs-vsctl show&lt;br /&gt;
...&lt;br /&gt;
        Port bond0&lt;br /&gt;
            Interface ens2f1&lt;br /&gt;
                type: dpdk&lt;br /&gt;
                options: {dpdk-devargs=&amp;quot;0000:31:00.1&amp;quot;}&lt;br /&gt;
            Interface ens2f0&lt;br /&gt;
                type: dpdk&lt;br /&gt;
                options: {dpdk-devargs=&amp;quot;0000:31:00.0&amp;quot;}&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
Update the CloudStack agent so that this host has the DPDK capability. Edit &amp;lt;code&amp;gt;/etc/cloudstack/agent/agent.properties&amp;lt;/code&amp;gt;. Note that the keyword is &amp;lt;code&amp;gt;openvswitch.dpdk.enabled&amp;lt;/code&amp;gt; (enabled ending with -ed). The example from ShapeBlue&#039;s blog post is wrong.{{Highlight&lt;br /&gt;
| code = network.bridge.type=openvswitch&lt;br /&gt;
libvirt.vif.driver=com.cloud.hypervisor.kvm.resource.OvsVifDriver&lt;br /&gt;
openvswitch.dpdk.enabled=true&lt;br /&gt;
openvswitch.dpdk.ovs.path=/var/run/openvswitch/&lt;br /&gt;
| lang = text&lt;br /&gt;
}}Restart the CloudStack agent for this capability to be visible by the management server. You should be able to call &amp;lt;code&amp;gt;list hosts filter=capabilities,name&amp;lt;/code&amp;gt; and have the host list dpdk as a capability. Eg:&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = (localcloud) 🐱 &amp;gt; list hosts filter=capabilities,name&lt;br /&gt;
count = 22&lt;br /&gt;
host:&lt;br /&gt;
+-------------------+----------+&lt;br /&gt;
{{!}}   CAPABILITIES    {{!}}   NAME   {{!}}&lt;br /&gt;
+-------------------+----------+&lt;br /&gt;
{{!}} hvm,snapshot,dpdk {{!}} cs9      {{!}}&lt;br /&gt;
{{!}} hvm,snapshot,dpdk {{!}} cs10     {{!}}&lt;br /&gt;
{{!}} hvm,snapshot,dpdk {{!}} cs11     {{!}}&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
If you don&#039;t see this, double check your agent configs and restart it again.&lt;br /&gt;
&lt;br /&gt;
For VMs to take advantage of DPDK, you must either set extraconfig on the virtual machine or create a new compute service offering. Extraconfig might get overwritten whenever the VM is updated, so it&#039;s not a reliable solution. Extraconfig is a URL encoded config and you cannot use single quotes in it or else you will break the VM deployment. Eg:&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = (localcloud) 🐱 &amp;gt; update virtualmachine extraconfig=dpdk-hugepages:%0A%3CmemoryBacking%3E%0A%20%20%20%3Chugepages%3E%0A%20%20%20%20%3C/hugepages%3E%0A%3C/memoryBacking%3E%0A%0Adpdk-numa:%0A%3Ccpu%20mode=%22host-passthrough%22%3E%0A%20%20%20%3Cnuma%3E%0A%20%20%20%20%20%20%20%3Ccell%20id=%220%22%20cpus=%220%22%20memory=%229437184%22%20unit=%22KiB%22%20memAccess=%22shared%22/%3E%0A%20%20%20%3C/numa%3E%0A%3C/cpu%3E%0A%0Adpdk-interface-queue:%0A%3Cdriver%20name=%22vhost%22%20queues=%22128%22/%3E id=af64cc80-a4e4-4c17-9c7d-c34ed234dc6a&lt;br /&gt;
virtualmachine = map[account:RCS affinitygroup:[] cpunumber:2 cpuspeed:1000 cpuused:5.88% created:2022-05-03T13:16:02-0600 details:map[Message.ReservedCapacityFreed.Flag:false dpdk-hugepages:a extraconfig-dpdk-hugepages:&amp;lt;memoryBacking&amp;gt;&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting ====&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = 2022-05-05T22:35:28.312Z{{!}}281704{{!}}netdev_dpdk{{!}}INFO{{!}}vHost Device &#039;/var/run/openvswitch/csdpdk-1&#039; connection has been destroyed&lt;br /&gt;
2022-05-05T22:35:28.312Z{{!}}281705{{!}}netdev_dpdk{{!}}INFO{{!}}vHost Device &#039;/var/run/openvswitch/csdpdk-1&#039; connection has been destroyed&lt;br /&gt;
2022-05-05T22:35:28.313Z{{!}}281706{{!}}netdev_dpdk{{!}}INFO{{!}}vHost Device &#039;/var/run/openvswitch/csdpdk-1&#039; connection has been destroyed&lt;br /&gt;
2022-05-05T22:35:28.313Z{{!}}281707{{!}}netdev_dpdk{{!}}INFO{{!}}vHost Device &#039;/var/run/openvswitch/csdpdk-1&#039; connection has been destroyed&lt;br /&gt;
2022-05-05T22:35:28.313Z{{!}}281708{{!}}netdev_dpdk{{!}}INFO{{!}}vHost Device &#039;/var/run/openvswitch/csdpdk-1&#039; connection has been destroyed&lt;br /&gt;
| lang = text&lt;br /&gt;
}}&lt;br /&gt;
Check the agent logs for issues from qemu. I had defined an invalid property which prevented the VM from starting.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = [root@cs10 agent]# grep qemu agent.log&lt;br /&gt;
org.libvirt.LibvirtException: internal error: process exited while connecting to monitor: 2022-05-05T22:35:52.060450Z qemu-kvm: -netdev vhost-user,chardev=charnet0,queues=256,id=hostnet0: you are asking more queues than supported: 128&lt;br /&gt;
2022-05-05T22:35:52.060633Z qemu-kvm: -netdev vhost-user,chardev=charnet0,queues=256,id=hostnet0: you are asking more queues than supported: 128&lt;br /&gt;
2022-05-05T22:35:52.060817Z qemu-kvm: -netdev vhost-user,chardev=charnet0,queues=256,id=hostnet0: you are asking more queues than supported: 128&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Tools==&lt;br /&gt;
&lt;br /&gt;
===CloudMonkey===&lt;br /&gt;
Get started:&lt;br /&gt;
&lt;br /&gt;
*Download from: https://github.com/apache/cloudstack-cloudmonkey/releases/tag/6.1.0&lt;br /&gt;
*Documentation at: https://cwiki.apache.org/confluence/display/CLOUDSTACK/CloudStack+cloudmonkey+CLI&lt;br /&gt;
&lt;br /&gt;
When you first run CloudMonkey, you will need to set the CloudStack instance URL and credentials and then run sync.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = $ cmk&lt;br /&gt;
&amp;gt; set url http://172.19.12.141:8080/client/api&lt;br /&gt;
&amp;gt; set username admin&lt;br /&gt;
&amp;gt; set password password&lt;br /&gt;
&amp;gt; sync&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
The settings are then saved to &amp;lt;code&amp;gt;~/.cmk/config&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The sync command fetches all the available API calls that your account can use. Once that is done, you can then use tab completion while in the CloudMonkey CLI.&lt;br /&gt;
&lt;br /&gt;
====Cheat sheet====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!What&lt;br /&gt;
!Command&lt;br /&gt;
|-&lt;br /&gt;
|Change output format&lt;br /&gt;
|&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;set display table|json&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Create compute offering&lt;br /&gt;
|&amp;lt;code&amp;gt;create serviceoffering name=rcs.c2 displaytext=Medium cpunumber=2 cpuspeed=750 memory=2048 storagetype=shared provisioningtype=thin offerha=false limitcpuuse=false isvolatile=false issystem=false deploymentplanner=UserDispersingPlanner cachemode=none customized=false&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Add a new host&lt;br /&gt;
|&amp;lt;code&amp;gt;add host clusterid=XX podid=XX zoneid=XX hypervisor=KVM password=**** username=root url=&amp;lt;nowiki&amp;gt;http://bm01&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Automate zone deployments====&lt;br /&gt;
There is an example script on how to automate a basic zone deployment at: https://github.com/apache/cloudstack-cloudmonkey/wiki/Usage&lt;br /&gt;
&lt;br /&gt;
=== Terraform ===&lt;br /&gt;
The Terraform CloudStack provide works for the most part. However, for CloudStack 4.16, you&#039;ll need to recompile it from scratch because the distributed binaries don&#039;t work properly (resulting in deployments hanging indefinitely). To build the Terraform provider, I will use Docker:&lt;br /&gt;
&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = # git clone https://github.com/apache/cloudstack-terraform-provider.git&lt;br /&gt;
# cd cloudstack-terraform-provide&lt;br /&gt;
# git clone https://github.com/tetra12/cloudstack-go.git&lt;br /&gt;
# cat &amp;lt;&amp;lt;EOF &amp;gt;&amp;gt; go.mod&lt;br /&gt;
replace github.com/apache/cloudstack-go/v2 =&amp;gt; ./cloudstack-go&lt;br /&gt;
exclude github.com/apache/cloudstack-go/v2 v2.11.0&lt;br /&gt;
EOF&lt;br /&gt;
# docker run --rm -ti -v /home/me/cloudstack-terraform-provider/:/build golang bash &lt;br /&gt;
&amp;gt; cd /build&lt;br /&gt;
&amp;gt; go build&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Copy the resulting binary to your terraform plugins path. Because I ran terraform init, it placed it in my terraform directory under &amp;lt;code&amp;gt;.terraform/providers/registry.terraform.io/cloudstack/cloudstack/0.4.0/linux_amd64/terraform-provider-cloudstack_v0.4.0&amp;lt;/code&amp;gt;. Edit the metadata file in the same directory as the provider executable and remove the file hash so that terraform runs the provider.&lt;br /&gt;
&lt;br /&gt;
See also: [[Terraform#CloudStack]]&lt;br /&gt;
&lt;br /&gt;
=== Packer ===&lt;br /&gt;
The Packer CloudStack provider also works for the most part, but is limited in that it cannot enter keyboard inputs. Any OS deployments will require some sort of manual inputs or require that the ISO media you use is completely automated. I also had to compile the provider manually since the default plugin that&#039;s fetched by packer doesn&#039;t quite work due to API changes.&lt;br /&gt;
&lt;br /&gt;
See also: [[Packer#CloudStack]]&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
When you run into issues, check the logs in &amp;lt;code&amp;gt;/var/log/cloudstack/&amp;lt;/code&amp;gt;. There&#039;s typically a stacktrace which gets generated whenever you encounter an error.&lt;br /&gt;
&lt;br /&gt;
===Can&#039;t create shared network in a advanced zone using Open vSwitch===&lt;br /&gt;
Whenever I try creating a shared network in an advanced zone that is using OVS, the step fails with: &amp;quot;Unable to convert network offering with specified id to network profile&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Stack trace shows that the [https://github.com/apache/cloudstack/blob/bf6266188c89a5487383f216333ae10e878d2c10/plugins/network-elements/ovs/src/main/java/com/cloud/network/guru/OvsGuestNetworkGuru.java#L99 OVS guest network guru] isn&#039;t able at designing the network because the zone isn&#039;t capable of handling this network offering.&lt;br /&gt;
&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = 2021-09-28 16:36:26,416 DEBUG [c.c.a.ApiServer] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) CIDRs from which account &#039;Acct[76a1585d-1bf6-11ec-a3c5-8f3e88f01ab1-admin]&#039; is allowed to perform API calls: 0.0.0.0/0,::/0&lt;br /&gt;
2021-09-28 16:36:26,439 DEBUG [c.c.u.AccountManagerImpl] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) Access granted to Acct[76a1585d-1bf6-11ec-a3c5-8f3e88f01ab1-admin] to [Network Offering [7-Guest-DefaultSharedNetworkOffering] by AffinityGroupAccessChecker&lt;br /&gt;
2021-09-28 16:36:26,517 DEBUG [c.c.n.g.BigSwitchBcfGuestNetworkGuru] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) Refusing to design this network, the physical isolation type is not BCF_SEGMENT&lt;br /&gt;
2021-09-28 16:36:26,521 DEBUG [o.a.c.n.c.m.ContrailGuru] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) Refusing to design this network&lt;br /&gt;
2021-09-28 16:36:26,524 DEBUG [c.c.n.g.NiciraNvpGuestNetworkGuru] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) Refusing to design this network&lt;br /&gt;
2021-09-28 16:36:26,527 DEBUG [o.a.c.n.o.OpendaylightGuestNetworkGuru] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) Refusing to design this network&lt;br /&gt;
2021-09-28 16:36:26,530 DEBUG [c.c.n.g.OvsGuestNetworkGuru] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) Refusing to design this network&lt;br /&gt;
2021-09-28 16:36:26,536 DEBUG [c.c.n.g.DirectNetworkGuru] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) GRE: VLAN&lt;br /&gt;
2021-09-28 16:36:26,536 DEBUG [c.c.n.g.DirectNetworkGuru] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) GRE: VXLAN&lt;br /&gt;
2021-09-28 16:36:26,536 INFO  [c.c.n.g.DirectNetworkGuru] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) Refusing to design this network&lt;br /&gt;
2021-09-28 16:36:26,539 INFO  [c.c.n.g.DirectNetworkGuru] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) Refusing to design this network&lt;br /&gt;
2021-09-28 16:36:26,543 DEBUG [o.a.c.n.g.SspGuestNetworkGuru] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) SSP not configured to be active&lt;br /&gt;
2021-09-28 16:36:26,546 DEBUG [c.c.n.g.BrocadeVcsGuestNetworkGuru] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) Refusing to design this network&lt;br /&gt;
2021-09-28 16:36:26,549 DEBUG [o.a.c.e.o.NetworkOrchestrator] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) Releasing lock for Acct[76a0531f-1bf6-11ec-a3c5-8f3e88f01ab1-system]&lt;br /&gt;
2021-09-28 16:36:26,624 DEBUG [c.c.u.d.T.Transaction] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) Rolling back the transaction: Time = 172 Name =  qtp1816147548-400; called by -TransactionLegacy.rollback:888-TransactionLegacy.removeUpTo:831-TransactionLegacy.close:655-Transaction.execute:38-Transaction.execute:47-NetworkOrches&lt;br /&gt;
trator.createGuestNetwork:2572-NetworkOrchestrator.createGuestNetwork:2327-NetworkServiceImpl$4.doInTransaction:1502-NetworkServiceImpl$4.doInTransaction:1450-Transaction.execute:40-NetworkServiceImpl.commitNetwork:1450-NetworkServiceImpl.createGuestNetwork:1366&lt;br /&gt;
2021-09-28 16:36:26,667 ERROR [c.c.a.ApiServer] (qtp1816147548-400:ctx-291672d1 ctx-3f19296a) (logid:83c45c2a) unhandled exception executing api command: [Ljava.lang.String;@69a8823d&lt;br /&gt;
com.cloud.utils.exception.CloudRuntimeException: Unable to convert network offering with specified id to network profile&lt;br /&gt;
        at org.apache.cloudstack.engine.orchestration.NetworkOrchestrator.setupNetwork(NetworkOrchestrator.java:739)&lt;br /&gt;
        at org.apache.cloudstack.engine.orchestration.NetworkOrchestrator$10.doInTransaction(NetworkOrchestrator.java:2634)&lt;br /&gt;
        at org.apache.cloudstack.engine.orchestration.NetworkOrchestrator$10.doInTransaction(NetworkOrchestrator.java:2572)&lt;br /&gt;
        at com.cloud.utils.db.Transaction$2.doInTransaction(Transaction.java:50)&lt;br /&gt;
        at com.cloud.utils.db.Transaction.execute(Transaction.java:40)&lt;br /&gt;
        at com.cloud.utils.db.Transaction.execute(Transaction.java:47)&lt;br /&gt;
...&lt;br /&gt;
| lang = text&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Possible answer====&lt;br /&gt;
The guest network was set up with GRE isolation. This however isn&#039;t supported with KVM as the hypervisor (see [https://events.static.linuxfound.org/sites/events/files/slides/CloudStack%20Collab%20Hypervisor.pdf this presentation]). After re-creating the zone with the guest physical network set up with just VLAN isolation, I was able to create a regular shared guest network that all tenants within the zone can see and use.&lt;br /&gt;
&lt;br /&gt;
To make the shared network SNAT out, I created another shared network offering that also has SourceNat and StaticNat.&lt;br /&gt;
{{Highlight&lt;br /&gt;
| code = $ cmk list serviceofferings issystem=true name=&#039;System Offering For Software Router&#039;&lt;br /&gt;
$ cmk create networkoffering \&lt;br /&gt;
name=SharedNetworkOfferingWithSourceNatService displaytext=&amp;quot;Shared Network Offering with Source NAT Service&amp;quot; traffictype=GUEST guestiptype=shared conservemode=true specifyvlan=true specifyipranges=true \&lt;br /&gt;
serviceofferingid=307b14d8-afd1-43ea-948c-ffe882cd5926 \&lt;br /&gt;
supportedservices=Dhcp,Dns,Firewall,SourceNat,StaticNat,PortForwarding \&lt;br /&gt;
serviceProviderList[0].service=Dhcp serviceProviderList[0].provider=VirtualRouter \&lt;br /&gt;
serviceProviderList[1].service=Dns serviceProviderList[1].provider=VirtualRouter \&lt;br /&gt;
serviceProviderList[2].service=Firewall serviceProviderList[2].provider=VirtualRouter \&lt;br /&gt;
serviceProviderList[3].service=SourceNat serviceProviderList[3].provider=VirtualRouter \&lt;br /&gt;
serviceProviderList[4].service=StaticNat serviceProviderList[4].provider=VirtualRouter \&lt;br /&gt;
serviceProviderList[5].service=PortForwarding serviceProviderList[5].provider=VirtualRouter \&lt;br /&gt;
servicecapabilitylist[0].service=SourceNat servicecapabilitylist[0].capabilitytype=SupportedSourceNatTypes servicecapabilitylist[0].capabilityvalue=peraccount&lt;br /&gt;
| lang = terminal&lt;br /&gt;
}}&lt;br /&gt;
Using this network offering, I was able to create a shared network in the advanced networking zone that has a NAT service which is visible to all accounts. The only issue with this approach is that there isn&#039;t a way to create a port forwarding for a specific VM because the account that owns this network is &#039;system&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Open-ended questions==&lt;br /&gt;
===Compute offerings with &#039;unlimited&#039; CPU cycles?===&lt;br /&gt;
Compute offerings require a MHz value assigned. Why is this? Can we just assign a VM entire cores?&lt;br /&gt;
&lt;br /&gt;
- If you read the docs, CPU (in MHz) only has an effect if CPU cap is selected. In all other cases, the value here is something akin to &#039;cpu shares&#039;. &lt;br /&gt;
&lt;br /&gt;
- if you put in a huge number like 9999, deployment would fail though.&lt;br /&gt;
&lt;br /&gt;
===How to implement showback?===&lt;br /&gt;
Is there a way to implement showback based on resources consumed by account?&lt;br /&gt;
&lt;br /&gt;
===Monitoring resources?===&lt;br /&gt;
Is there a way to monitor resource usage by account, node? Any good way to push VMs into a CMDB like ServiceNow?&lt;br /&gt;
&lt;br /&gt;
===NetApp integration?===&lt;br /&gt;
Is it possible to do guest VM snapshots by leveraging NetApp?&lt;br /&gt;
&lt;br /&gt;
===Backups?===&lt;br /&gt;
The only backup plugins that are available are &#039;dummy&#039; which does nothing and &#039;veeam&#039; which only supports VMware + Veeam.  If you&#039;re using KVM, there doesn&#039;t seem to be any way to easily backup/restore VMs.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{{Navbox Linux}}&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:LinuxUtilities]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=LXR_Guide&amp;diff=2575</id>
		<title>LXR Guide</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=LXR_Guide&amp;diff=2575"/>
		<updated>2018-05-04T17:21:54Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Prerequisites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LXR, shortened for Linux Cross-Reference, is a perl web application that lets you read different versions of the Linux kernel source code with the added benefit of quickly searching the source and having static values and functions cross-referenced with each other.&lt;br /&gt;
&lt;br /&gt;
== Step by Step Guide ==&lt;br /&gt;
The installation of LXRng are detailed in this guide for a CentOS 7 server. We will be using:&lt;br /&gt;
* LXRng&lt;br /&gt;
* PostgreSQL (as a fulltext index)&lt;br /&gt;
* Apache 2.4 / mod_perl&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
On a clean install of CentOS 7, install the following dependencies. A few Perl modules must be installed outside of yum and I recommend using cpanm.&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# yum install postgresql postgresql-server \&lt;br /&gt;
perl-App-cpanminus \&lt;br /&gt;
xapian-core xapian-core-devel \&lt;br /&gt;
perl-DBI perl-DBD-Pg \&lt;br /&gt;
perl-Term-ProgressBar \&lt;br /&gt;
perl-Pod-POM \&lt;br /&gt;
perl-CGI \&lt;br /&gt;
perl-HTML-Template \&lt;br /&gt;
perl-XML-Parser \&lt;br /&gt;
perl-XML-NamespaceSupport \&lt;br /&gt;
perl-XML-LibXML \&lt;br /&gt;
perl-XML-SAX-Base \&lt;br /&gt;
perl-Image-Xbm \&lt;br /&gt;
perl-Image-Base \&lt;br /&gt;
perl-Template-Toolkit \&lt;br /&gt;
perl-Linux-Pid \&lt;br /&gt;
perl-BSD-Resource \&lt;br /&gt;
make gcc gcc-c++  \&lt;br /&gt;
ctags \&lt;br /&gt;
httpd \&lt;br /&gt;
mod_perl mod_ssl \&lt;br /&gt;
git \&lt;br /&gt;
screen&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
lxr expects it as {{code|ctag}} as {{code|ctags-exuberant}}.&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# ln -s /usr/bin/ctags /usr/bin/ctags-exuberant&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Install the missing dependencies through cpanm:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cpanm Search::Xapian&lt;br /&gt;
# cpanm Test::More&lt;br /&gt;
# cpanm Devel::Size&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Pull the lxrng source into {{code|/var/www}}. Apache will own everything since the web server will need to run the web application.&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cd /var/www&lt;br /&gt;
# chgrp apache .&lt;br /&gt;
# sudo -u apache git clone git://lxr.linux.no/git/lxrng.git&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If this repository is down, a copy is also available at https://git.steamr.com/leo/lxrng.git&lt;br /&gt;
&lt;br /&gt;
=== Setting up PostgreSQL ===&lt;br /&gt;
&lt;br /&gt;
With PostgreSQL installed, set it up with a lxrng database. You may want to set up permissions as well, but I will be using the root account.&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# postgresql-setup initdb&lt;br /&gt;
# systemctl start postgresql&lt;br /&gt;
# systemctl enable postgresql&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
By default, Postgres should be configured to use system accounts for authentication. Since we will have the Apache web server running as {{code|apache}}, we will create a Postgres account named {{code|apache}} that should have access to the lxrng database.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# su postgres&lt;br /&gt;
$ createuser -d apache&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== LXRng Setup ===&lt;br /&gt;
The {{code|lxrng.conf}} configuration file located at {{code|/var/www/lxrng/lxrng.conf}} should contain the following:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
# -*- mode: perl -*-&lt;br /&gt;
# Configuration file&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
use LXRng::Index::PgBatch;&lt;br /&gt;
use LXRng::Repo::Git;&lt;br /&gt;
use LXRng::Search::Xapian;&lt;br /&gt;
&lt;br /&gt;
my $gitrepo = LXRng::Repo::Git&lt;br /&gt;
    -&amp;gt;new(&#039;/var/www/lxrng/repos/linux-2.6/.git&#039;,&lt;br /&gt;
          release_re =&amp;gt; qr/^v[^-]*$/,&lt;br /&gt;
          author_timestamp =&amp;gt; 0);&lt;br /&gt;
&lt;br /&gt;
my $index   = LXRng::Index::PgBatch-&amp;gt;new(db_spec =&amp;gt; &#039;dbname=lxrng;port=5432&#039;,&lt;br /&gt;
                                         db_user =&amp;gt; &amp;quot;apache&amp;quot;, db_pass =&amp;gt; &amp;quot;&amp;quot;,&lt;br /&gt;
                                         # table_prefix =&amp;gt; &#039;lxr&#039;&lt;br /&gt;
                                         );&lt;br /&gt;
my $search  = LXRng::Search::Xapian-&amp;gt;new(&#039;/var/www/lxrng/text-db/linux-2.6&#039;);&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
    &#039;linux&#039; =&amp;gt; {&lt;br /&gt;
        &#039;repository&#039;  =&amp;gt; $gitrepo,&lt;br /&gt;
        &#039;index&#039;       =&amp;gt; $index,&lt;br /&gt;
        &#039;search&#039;      =&amp;gt; $search,&lt;br /&gt;
&lt;br /&gt;
        &#039;base_url&#039;    =&amp;gt; &#039;http://lxr.cpsc.ucalgary.ca/&#039;,&lt;br /&gt;
        # Must be writable by httpd user:&lt;br /&gt;
        &#039;cache&#039;       =&amp;gt; &#039;/var/www/lxrng/cache&#039;,&lt;br /&gt;
&lt;br /&gt;
        &#039;fs_charset&#039;  =&amp;gt; &#039;iso-8859-1&#039;,&lt;br /&gt;
        # Tried successively&lt;br /&gt;
        &#039;content_charset&#039; =&amp;gt; [&#039;utf-8&#039;, &#039;iso-8859-1&#039;],&lt;br /&gt;
&lt;br /&gt;
        &#039;languages&#039;   =&amp;gt; [&#039;C&#039;, &#039;GnuAsm&#039;, &#039;Kconfig&#039;],&lt;br /&gt;
        #&#039;ctags_flags&#039; =&amp;gt; [&amp;quot;-I\@$LXRng::ROOT/lxr-ctags-quirks&amp;quot;],&lt;br /&gt;
        &#039;ver_list&#039;    =&amp;gt; [$gitrepo-&amp;gt;allversions],&lt;br /&gt;
&lt;br /&gt;
        &#039;ver_default&#039; =&amp;gt; &#039;v4.9&#039;,&lt;br /&gt;
&lt;br /&gt;
        &#039;include_maps&#039; =&amp;gt;&lt;br /&gt;
            [&lt;br /&gt;
             [qr{{!}}^arch/(.*?)/{{!}}, qr{{!}}^asm/(.*){{!}},&lt;br /&gt;
              sub { &amp;quot;include/asm-$_[0]/$_[1]&amp;quot; }],&lt;br /&gt;
             [qr{{!}}^include/asm-(.*?)/{{!}}, qr{{!}}^asm/(.*){{!}},&lt;br /&gt;
              sub { &amp;quot;include/asm-$_[0]/$_[1]&amp;quot; }],&lt;br /&gt;
             [qr{{!}}^{{!}}, qr{{!}}^asm/(.*){{!}},&lt;br /&gt;
              sub { map { &amp;quot;include/asm-$_/$_[0]&amp;quot; }&lt;br /&gt;
                    qw(i386 alpha arm ia64 m68k mips mips64),&lt;br /&gt;
                    qw(ppc s390 sh sparc sparc64 x86_64) }],&lt;br /&gt;
             [qr{{!}}^{{!}}, qr{{!}}(.*){{!}},&lt;br /&gt;
              sub { &amp;quot;include/$_[0]&amp;quot; }],&lt;br /&gt;
             ],&lt;br /&gt;
    },&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
There are a few important values which you may want to change:&lt;br /&gt;
* {{code|$gitrepo}} defines where the source code (as a git repo) will be placed. In our case, {{code|/var/www/lxrng/repos}} should contain a directory called {{code|linux-2.6/.git}} containing the git repository.&lt;br /&gt;
* {{code|$search}} defines where the text index should reside&lt;br /&gt;
* {{code|base_url}} is the URL of the web application&lt;br /&gt;
* {{code|cache}} is the cache directory used by lxr.&lt;br /&gt;
&lt;br /&gt;
Create these directories, and ensure they are readable and writable by apache:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cd /var/www/lxrng&lt;br /&gt;
# mkdir repos&lt;br /&gt;
# mkdir -p text-db/linux-2.6&lt;br /&gt;
# mkdir cache&lt;br /&gt;
# chmod 777 cache&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Fetch the Kernel Source ===&lt;br /&gt;
Get the source code either via git or from an existing tarball.&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cd /var/www/lxrng/repos&lt;br /&gt;
# git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git&lt;br /&gt;
&lt;br /&gt;
## or for the newest post-2.6 kernels:&lt;br /&gt;
# git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Start the indexing process:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cd /var/www/lxrng/&lt;br /&gt;
# sudo -u apache sh&lt;br /&gt;
$ ./lxr-db-admin linux --init&lt;br /&gt;
$ ./lxr-genxref linux&lt;br /&gt;
## Or alternatively, run it in screen: screen -d -m ./lxr-genxref linux&lt;br /&gt;
##  and then view progress by running screen -r&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Setting up Apache ===&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cd /export/lxrng&lt;br /&gt;
# cp apache2-site.conf-dist-mod_perl /etc/httpd/conf.d/lxrng.conf&lt;br /&gt;
# sed -i &amp;quot;s/@@LXRROOT@@/\/export\/lxrng/g&amp;quot; /etc/httpd/conf.d/lxrng.conf&lt;br /&gt;
# sed -i &amp;quot;s/@@LXRURL@@/lxr/g&amp;quot; /etc/httpd/conf.d/lxrng.conf&lt;br /&gt;
# sed -i &amp;quot;s/^[\(^#\)]*/# /&amp;quot; /etc/httpd/conf.d/welcome.conf&lt;br /&gt;
# /etc/init.d/httpd start&lt;br /&gt;
# chkconfig httpd on --level 345&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating Kernel Source ==&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cd repos&lt;br /&gt;
# git pull git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git master&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then, rerun the xref to update.&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
$ ./lxr-genxref linux&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Systemd&amp;diff=2573</id>
		<title>Systemd</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Systemd&amp;diff=2573"/>
		<updated>2018-04-04T21:32:24Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Limiting Log Sizes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Journal ==&lt;br /&gt;
Systemd keeps tracks of service logs.&lt;br /&gt;
&lt;br /&gt;
=== Clearing Journal ===&lt;br /&gt;
&lt;br /&gt;
Clear all the entries by running:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# journalctl --vacuum-time=1seconds&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# journalctl --vacuum-size=1M&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Limiting Log Sizes ===&lt;br /&gt;
&lt;br /&gt;
Edit {{code|/etc/systemd/journald.conf}} and define a value for {{code|SystemMaxUse}}. Eg. {{code|1=SystemMaxUse=100M}}.&lt;br /&gt;
&lt;br /&gt;
== Creating a Service ==&lt;br /&gt;
Suppose you have a program that you want started when the system boots. To have systemd start the program as a service, create a new service file in {{code|/etc/systemd/system}} containing something like:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cat /etc/systemd/system/mag-read.service&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Mag card reader&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
ExecStart=/root/scripts/mag.sh&lt;br /&gt;
Restart=always&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This service file will execute {{code|mag.sh}} which will start a process that sits and waits for input from a mag-strip card reader and will automatically restart it if it stops.&lt;br /&gt;
&lt;br /&gt;
Once the file has been created, reload systemd and enable the service:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# systemctl daemon-reload  # Reloads the service files so systemd is aware of the new one&lt;br /&gt;
# systemctl enable mag-read&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SystemV-like Init Scripts ==&lt;br /&gt;
&lt;br /&gt;
If you have custom packages that make use of the old SystemV startup scripts, you can use the following files to make use of such scripts.&lt;br /&gt;
&lt;br /&gt;
In {{code|/usr/lib/systemd/system/startup.service}}&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Custom SystemV-like Startup&lt;br /&gt;
After=network.target&lt;br /&gt;
ConditionFileIsExecutable=/usr/local/sbin/custom-startup-initd&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=oneshot&lt;br /&gt;
ExecStart=/usr/local/sbin/custom-startup-initd&lt;br /&gt;
TimeoutSec=0&lt;br /&gt;
StandardOutput=tty&lt;br /&gt;
RemainAfterExit=yes&lt;br /&gt;
SysVStartPriority=99&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A few things of interest.&lt;br /&gt;
* The {{code|ConditionFileIsExecutable}} will only run the script if it&#039;s executable. It basically does a {{code|test -x}} on the file before this continues.&lt;br /&gt;
* {{code|RemainAfterExit}} will cause systemd to show the service as active even after the script has finished execution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In {{code|/usr/local/sbin/custom-startup-initd}}:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
StartupDir=&amp;quot;/usr/local/boot/startup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Run all scripts starting with &#039;S&#039;&lt;br /&gt;
for i in `ls $StartupDir/S*` ; do&lt;br /&gt;
        ScriptName=`basename $i`&lt;br /&gt;
        sh $StartupDir/$ScriptName&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
# Success exit code.&lt;br /&gt;
exit 0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Make the directory: &lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# mkdir -p /usr/local/boot/startup/&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then place your scripts in the startup directory starting with the letter &#039;S&#039;.&lt;br /&gt;
&lt;br /&gt;
Enable the new service by running:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# systemctl enable startup&lt;br /&gt;
# systemctl start startup&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Verify this:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# systemctl status startup.service&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
&lt;br /&gt;
{{Navbox Linux}}&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Systemd&amp;diff=2572</id>
		<title>Systemd</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Systemd&amp;diff=2572"/>
		<updated>2018-04-04T21:32:02Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Journal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Journal ==&lt;br /&gt;
Systemd keeps tracks of service logs.&lt;br /&gt;
&lt;br /&gt;
=== Clearing Journal ===&lt;br /&gt;
&lt;br /&gt;
Clear all the entries by running:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# journalctl --vacuum-time=1seconds&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# journalctl --vacuum-size=1M&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Limiting Log Sizes ===&lt;br /&gt;
&lt;br /&gt;
Edit {{code|/etc/systemd/journald.conf}} and define a value for {{code|SystemMaxUse}}. Eg. {{code|SystemMaxUse=100M}}.&lt;br /&gt;
&lt;br /&gt;
== Creating a Service ==&lt;br /&gt;
Suppose you have a program that you want started when the system boots. To have systemd start the program as a service, create a new service file in {{code|/etc/systemd/system}} containing something like:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cat /etc/systemd/system/mag-read.service&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Mag card reader&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
ExecStart=/root/scripts/mag.sh&lt;br /&gt;
Restart=always&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This service file will execute {{code|mag.sh}} which will start a process that sits and waits for input from a mag-strip card reader and will automatically restart it if it stops.&lt;br /&gt;
&lt;br /&gt;
Once the file has been created, reload systemd and enable the service:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# systemctl daemon-reload  # Reloads the service files so systemd is aware of the new one&lt;br /&gt;
# systemctl enable mag-read&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SystemV-like Init Scripts ==&lt;br /&gt;
&lt;br /&gt;
If you have custom packages that make use of the old SystemV startup scripts, you can use the following files to make use of such scripts.&lt;br /&gt;
&lt;br /&gt;
In {{code|/usr/lib/systemd/system/startup.service}}&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Custom SystemV-like Startup&lt;br /&gt;
After=network.target&lt;br /&gt;
ConditionFileIsExecutable=/usr/local/sbin/custom-startup-initd&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=oneshot&lt;br /&gt;
ExecStart=/usr/local/sbin/custom-startup-initd&lt;br /&gt;
TimeoutSec=0&lt;br /&gt;
StandardOutput=tty&lt;br /&gt;
RemainAfterExit=yes&lt;br /&gt;
SysVStartPriority=99&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A few things of interest.&lt;br /&gt;
* The {{code|ConditionFileIsExecutable}} will only run the script if it&#039;s executable. It basically does a {{code|test -x}} on the file before this continues.&lt;br /&gt;
* {{code|RemainAfterExit}} will cause systemd to show the service as active even after the script has finished execution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In {{code|/usr/local/sbin/custom-startup-initd}}:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
StartupDir=&amp;quot;/usr/local/boot/startup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Run all scripts starting with &#039;S&#039;&lt;br /&gt;
for i in `ls $StartupDir/S*` ; do&lt;br /&gt;
        ScriptName=`basename $i`&lt;br /&gt;
        sh $StartupDir/$ScriptName&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
# Success exit code.&lt;br /&gt;
exit 0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Make the directory: &lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# mkdir -p /usr/local/boot/startup/&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then place your scripts in the startup directory starting with the letter &#039;S&#039;.&lt;br /&gt;
&lt;br /&gt;
Enable the new service by running:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# systemctl enable startup&lt;br /&gt;
# systemctl start startup&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Verify this:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# systemctl status startup.service&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
&lt;br /&gt;
{{Navbox Linux}}&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Pacman&amp;diff=2571</id>
		<title>Pacman</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Pacman&amp;diff=2571"/>
		<updated>2018-04-03T16:41:40Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pacman is the package manager for arch linux.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Configuration files are stored in /etc/pacman&lt;br /&gt;
=== Updating Databases ===&lt;br /&gt;
&lt;br /&gt;
Similar to a {{code|yum clean all ; yum update}} you can update the repository information by running:&lt;br /&gt;
 pacman -Syy&lt;br /&gt;
&lt;br /&gt;
=== Searching ===&lt;br /&gt;
Search for a package&lt;br /&gt;
 pacman -Ss packageName&lt;br /&gt;
&lt;br /&gt;
=== Installing ===&lt;br /&gt;
 pacman -S packageName groupName&lt;br /&gt;
&lt;br /&gt;
=== Updating System ===&lt;br /&gt;
 pacman -Syu&lt;br /&gt;
&lt;br /&gt;
=== Removing a Package ===&lt;br /&gt;
 pacman -R packageName&lt;br /&gt;
&lt;br /&gt;
With dependencies&lt;br /&gt;
 pacman -Rsc packageName&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Searching for whatprovides ===&lt;br /&gt;
Install the pkgfile utilitiy&lt;br /&gt;
 pacman -S pkgfile&lt;br /&gt;
&lt;br /&gt;
Update the repo:&lt;br /&gt;
 pkgfile --update&lt;br /&gt;
&lt;br /&gt;
Then to search:&lt;br /&gt;
 pkgfile -s lspci&lt;br /&gt;
 core/pciutils&lt;br /&gt;
&lt;br /&gt;
=== Searching Package Ownership ===&lt;br /&gt;
When given a path (eg. /usr/bin/startx), you can find which package provided the file by using:&lt;br /&gt;
&lt;br /&gt;
 pacman -Qo /usr/bin/startx&lt;br /&gt;
&lt;br /&gt;
This is similar to RPM&#039;s {{code|rpm -qf /usr/bin/startx}}.&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:PackageManagement]]&lt;br /&gt;
{{Navbox Linux}}&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Raspberry_Pi&amp;diff=1928</id>
		<title>Raspberry Pi</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Raspberry_Pi&amp;diff=1928"/>
		<updated>2017-02-27T23:39:21Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Arch Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setup ==&lt;br /&gt;
=== Arch Linux ===&lt;br /&gt;
Download ArchLinux&#039;s Raspberry Pi tarball.&lt;br /&gt;
* Raspberry Pi:  http://archlinuxarm.org/os/ArchLinuxARM-rpi-latest.tar.gz&lt;br /&gt;
* Raspberry Pi 2:  http://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz&lt;br /&gt;
&lt;br /&gt;
Setup the SD card to contain two partitions using fdisk:&lt;br /&gt;
# 100MB (W95 FAT32 (LBA))&lt;br /&gt;
# Rest: OS / Data&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# fdisk /dev/sdcard&lt;br /&gt;
## Set up the SD card partitions&lt;br /&gt;
## Commands are: o, n, p, [enter], +100M, t, c, n, p, 2, [enter], [enter], w&lt;br /&gt;
# mkfs.vfat /dev/sdcard1&lt;br /&gt;
# mkfs.ext4 /dev/sdcard2&lt;br /&gt;
# cd /mnt&lt;br /&gt;
# mkdir root root/boot&lt;br /&gt;
# mount /dev/sdcard2 root&lt;br /&gt;
# mount /dev/sdcard1 root/boot&lt;br /&gt;
# tar -xpf ArchLinuxARM-rpi-latest.tar.gz -C root&lt;br /&gt;
# umount root/boot root&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Once the SD card is prepared, insert it to the Pi and power it on. Log in to ArchLinux using the default user {{code|alarm}} using password {{code|alarm}}. The default root password is {{code|root}}.&lt;br /&gt;
&lt;br /&gt;
For more information and to see the latest images see:&lt;br /&gt;
* http://archlinuxarm.org/platforms/armv6/raspberry-pi&lt;br /&gt;
* http://archlinuxarm.org/platforms/armv7/broadcom/raspberry-pi-2&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
=== Wifi ===&lt;br /&gt;
See [[Wifi]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
=== Control Status LEDs ===&lt;br /&gt;
The Raspberry Pi 2 LEDs are driven by the kernel&#039;s led-GPIO drivers. This allows for the LEDs to be controlled by software rather than hardware as is the case with the older first generation Pi&#039;s. The two LEDs on the Raspberry Pi 2 are the green status light (led0) and the red power light (led1).&lt;br /&gt;
&lt;br /&gt;
To see the available triggers that are in use and available for a particular LED:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cat /sys/class/leds/led1/trigger &lt;br /&gt;
none usb-gadget usb-host [mmc0] timer oneshot heartbeat backlight gpio cpu0 cpu1 cpu2 cpu3 default-on transient flash torch input &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The active trigger is in {{code|[ ]}} and can be changed by writing to the file. For example, to turn off the LED entirely:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# echo none &amp;gt;  /sys/class/leds/led1/trigger&lt;br /&gt;
# cat /sys/class/leds/led1/trigger &lt;br /&gt;
[none] usb-gadget usb-host mmc0 timer oneshot heartbeat backlight gpio cpu0 cpu1 cpu2 cpu3 default-on transient flash torch input &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You may also edit the {{code|config.txt}} file to change the behavior on startup.&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
# Disable the ACT LED.&lt;br /&gt;
dtparam=act_led_trigger=none&lt;br /&gt;
dtparam=act_led_activelow=off&lt;br /&gt;
&lt;br /&gt;
# Disable the PWR LED.&lt;br /&gt;
dtparam=pwr_led_trigger=none&lt;br /&gt;
dtparam=pwr_led_activelow=off&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See Also: http://www.armadeus.com/wiki/index.php?title=GPIO_LEDS&lt;br /&gt;
&lt;br /&gt;
=== Mounting {{code|/var/log}} as tmpfs ===&lt;br /&gt;
&lt;br /&gt;
Append to the {{code|/etc/fstab}} with the following line.&lt;br /&gt;
 tmpfs           /var/log tmpfs nodev,nosuid,mode=0755,size=50m  0 0&lt;br /&gt;
&lt;br /&gt;
This will mount {{code|/var/log}} as a 50MB ramdisk. If your system is using {{code|systemd}}, this will break {{code|systemd-journald}}. To fix it, you will need to [[Systemd|create a startup script]] after the mount has completed that creates the {{code|journald}}&#039;s directory in {{code|/var/log/journal/}}.&lt;br /&gt;
&lt;br /&gt;
Reboot the Pi for the changes to take affect, or run {{code|mount -a}} which will mount the ramdisk to /var/log immediately, though you&#039;ll need to restart any services that has handles to any files there.&lt;br /&gt;
&lt;br /&gt;
Why would you want to do this? To limit the amount of writes that is made to the SD card to prevent premature wearing.&lt;br /&gt;
&lt;br /&gt;
=== UART Serial ===&lt;br /&gt;
By default, ArchLinux on the Raspberry Pi will start a getty on the UART serial port. To make use of the port, you will have to disable the getty first.&lt;br /&gt;
&lt;br /&gt;
Edit {{code|/boot/cmdline.txt}} and remove all instances of {{code|ttyAMA0}}. Mine ended up looking like:&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
root=/dev/mmcblk0p2 rw rootwait console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 elevator=noop&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then, run: {{highlight|lang=terminal|code=&lt;br /&gt;
systemctl disable serial-getty@ttyAMA0.service&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Reboot.&lt;br /&gt;
&lt;br /&gt;
If everything is working, you should be able to talk with {{code|/dev/ttyAMA0}}.&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# stty &amp;lt; /dev/ttyAMA0&lt;br /&gt;
speed 9600 baud; line = 0;&lt;br /&gt;
kill = ^H; min = 100; time = 2;&lt;br /&gt;
-icrnl -imaxbel&lt;br /&gt;
-opost -onlcr&lt;br /&gt;
-isig -icanon -echo&lt;br /&gt;
&lt;br /&gt;
# cat /dev/ttyAMA0 &amp;amp;&lt;br /&gt;
# echo hello &amp;gt; /dev/ttyAMA0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Raspberry_Pi&amp;diff=1927</id>
		<title>Raspberry Pi</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Raspberry_Pi&amp;diff=1927"/>
		<updated>2017-02-27T23:36:49Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setup ==&lt;br /&gt;
=== Arch Linux ===&lt;br /&gt;
Setup the SD card to contain two partitions using fdisk:&lt;br /&gt;
# 100MB (W95 FAT32 (LBA))&lt;br /&gt;
# Data&lt;br /&gt;
&lt;br /&gt;
Download ArchLinux&#039;s Raspberry Pi tarball.&lt;br /&gt;
* Raspberry Pi:  http://archlinuxarm.org/os/ArchLinuxARM-rpi-latest.tar.gz&lt;br /&gt;
* Raspberry Pi 2:  http://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# fdisk /dev/sdcard&lt;br /&gt;
## Set up the SD card partitions&lt;br /&gt;
## Commands are: o, n, p, [enter], +100M, t, c, n, p, 2, [enter], [enter], w&lt;br /&gt;
# mkfs.vfat /dev/sdcard1&lt;br /&gt;
# mkfs.ext4 /dev/sdcard2&lt;br /&gt;
# cd /mnt&lt;br /&gt;
# mkdir root root/boot&lt;br /&gt;
# mount /dev/sdcard2 root&lt;br /&gt;
# mount /dev/sdcard1 root/boot&lt;br /&gt;
# tar -xpf ArchLinuxARM-rpi-latest.tar.gz -C root&lt;br /&gt;
# umount root/boot root&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For more information and to see the latest images see:&lt;br /&gt;
* http://archlinuxarm.org/platforms/armv6/raspberry-pi&lt;br /&gt;
* http://archlinuxarm.org/platforms/armv7/broadcom/raspberry-pi-2&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
=== Wifi ===&lt;br /&gt;
See [[Wifi]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
=== Control Status LEDs ===&lt;br /&gt;
The Raspberry Pi 2 LEDs are driven by the kernel&#039;s led-GPIO drivers. This allows for the LEDs to be controlled by software rather than hardware as is the case with the older first generation Pi&#039;s. The two LEDs on the Raspberry Pi 2 are the green status light (led0) and the red power light (led1).&lt;br /&gt;
&lt;br /&gt;
To see the available triggers that are in use and available for a particular LED:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cat /sys/class/leds/led1/trigger &lt;br /&gt;
none usb-gadget usb-host [mmc0] timer oneshot heartbeat backlight gpio cpu0 cpu1 cpu2 cpu3 default-on transient flash torch input &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The active trigger is in {{code|[ ]}} and can be changed by writing to the file. For example, to turn off the LED entirely:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# echo none &amp;gt;  /sys/class/leds/led1/trigger&lt;br /&gt;
# cat /sys/class/leds/led1/trigger &lt;br /&gt;
[none] usb-gadget usb-host mmc0 timer oneshot heartbeat backlight gpio cpu0 cpu1 cpu2 cpu3 default-on transient flash torch input &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You may also edit the {{code|config.txt}} file to change the behavior on startup.&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
# Disable the ACT LED.&lt;br /&gt;
dtparam=act_led_trigger=none&lt;br /&gt;
dtparam=act_led_activelow=off&lt;br /&gt;
&lt;br /&gt;
# Disable the PWR LED.&lt;br /&gt;
dtparam=pwr_led_trigger=none&lt;br /&gt;
dtparam=pwr_led_activelow=off&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See Also: http://www.armadeus.com/wiki/index.php?title=GPIO_LEDS&lt;br /&gt;
&lt;br /&gt;
=== Mounting {{code|/var/log}} as tmpfs ===&lt;br /&gt;
&lt;br /&gt;
Append to the {{code|/etc/fstab}} with the following line.&lt;br /&gt;
 tmpfs           /var/log tmpfs nodev,nosuid,mode=0755,size=50m  0 0&lt;br /&gt;
&lt;br /&gt;
This will mount {{code|/var/log}} as a 50MB ramdisk. If your system is using {{code|systemd}}, this will break {{code|systemd-journald}}. To fix it, you will need to [[Systemd|create a startup script]] after the mount has completed that creates the {{code|journald}}&#039;s directory in {{code|/var/log/journal/}}.&lt;br /&gt;
&lt;br /&gt;
Reboot the Pi for the changes to take affect, or run {{code|mount -a}} which will mount the ramdisk to /var/log immediately, though you&#039;ll need to restart any services that has handles to any files there.&lt;br /&gt;
&lt;br /&gt;
Why would you want to do this? To limit the amount of writes that is made to the SD card to prevent premature wearing.&lt;br /&gt;
&lt;br /&gt;
=== UART Serial ===&lt;br /&gt;
By default, ArchLinux on the Raspberry Pi will start a getty on the UART serial port. To make use of the port, you will have to disable the getty first.&lt;br /&gt;
&lt;br /&gt;
Edit {{code|/boot/cmdline.txt}} and remove all instances of {{code|ttyAMA0}}. Mine ended up looking like:&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
root=/dev/mmcblk0p2 rw rootwait console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 elevator=noop&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then, run: {{highlight|lang=terminal|code=&lt;br /&gt;
systemctl disable serial-getty@ttyAMA0.service&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Reboot.&lt;br /&gt;
&lt;br /&gt;
If everything is working, you should be able to talk with {{code|/dev/ttyAMA0}}.&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# stty &amp;lt; /dev/ttyAMA0&lt;br /&gt;
speed 9600 baud; line = 0;&lt;br /&gt;
kill = ^H; min = 100; time = 2;&lt;br /&gt;
-icrnl -imaxbel&lt;br /&gt;
-opost -onlcr&lt;br /&gt;
-isig -icanon -echo&lt;br /&gt;
&lt;br /&gt;
# cat /dev/ttyAMA0 &amp;amp;&lt;br /&gt;
# echo hello &amp;gt; /dev/ttyAMA0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=VMware_ESXi&amp;diff=1656</id>
		<title>VMware ESXi</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=VMware_ESXi&amp;diff=1656"/>
		<updated>2017-02-17T20:00:32Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Updating */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Updating ==&lt;br /&gt;
=== 6.0 to 6.5 ===&lt;br /&gt;
Download the offline depot package and apply the update:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# esxcli software profile update -p ESXi-6.5.0-4564106-standard -d /vmfs/volumes/vol/VMware-ESXi-6.5.0-4564106-depot.zip&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This package requires a subscription. If you&#039;re using the free license, either get the evaluation or install the update by booting with the ISO image.&lt;br /&gt;
&lt;br /&gt;
=== 5.5 to 6.0 ===&lt;br /&gt;
To update a ESXi install from 5.5 to 6.0, download the ESXi 6.0 offline bundle and upload it to a datastore on the server.&lt;br /&gt;
&lt;br /&gt;
Log in via SSH and execute&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# esxcli software vib update -d /vmfs/volumes/datastore1/ESXi600-201504001.zip&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then reboot to apply the changes.&lt;br /&gt;
&lt;br /&gt;
See Also:&lt;br /&gt;
* http://www.vladan.fr/patch-esxi-5-5-to-esxi-6-0/&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== IOMMU Hangs ===&lt;br /&gt;
If your ESXi server hangs while &amp;quot;Initializing IOV&amp;quot;, disable IOMMU by appending &#039;noIOMMU&#039; to the kernel immediately after the new kernel boots by hitting Shift-O (letter O, not zero)&lt;br /&gt;
&lt;br /&gt;
To make the changes persistent, add it to the boot arguments in &amp;lt;code&amp;gt;/bootbank/boot.cfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See Also:&lt;br /&gt;
* https://communities.vmware.com/message/2354177&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=VMware_ESXi&amp;diff=1655</id>
		<title>VMware ESXi</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=VMware_ESXi&amp;diff=1655"/>
		<updated>2017-02-17T19:37:24Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Updating */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Updating ==&lt;br /&gt;
=== 6.0 to 6.5 ===&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# esxcli software profile update -p ESXi-6.5.0-4564106-standard -d VMware-ESXi-6.5.0-4564106-depot.zip&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== 5.5 to 6.0 ===&lt;br /&gt;
To update a ESXi install from 5.5 to 6.0, download the ESXi 6.0 offline bundle and upload it to a datastore on the server.&lt;br /&gt;
&lt;br /&gt;
Log in via SSH and execute&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# esxcli software vib update -d /vmfs/volumes/datastore1/ESXi600-201504001.zip&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then reboot to apply the changes.&lt;br /&gt;
&lt;br /&gt;
See Also:&lt;br /&gt;
* http://www.vladan.fr/patch-esxi-5-5-to-esxi-6-0/&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== IOMMU Hangs ===&lt;br /&gt;
If your ESXi server hangs while &amp;quot;Initializing IOV&amp;quot;, disable IOMMU by appending &#039;noIOMMU&#039; to the kernel immediately after the new kernel boots by hitting Shift-O (letter O, not zero)&lt;br /&gt;
&lt;br /&gt;
To make the changes persistent, add it to the boot arguments in &amp;lt;code&amp;gt;/bootbank/boot.cfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See Also:&lt;br /&gt;
* https://communities.vmware.com/message/2354177&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Ruby_on_Rails_under_cPanel&amp;diff=1639</id>
		<title>Ruby on Rails under cPanel</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Ruby_on_Rails_under_cPanel&amp;diff=1639"/>
		<updated>2017-02-15T23:53:42Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Troubleshooting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide will get a modern Ruby on Rails application working on a cPanel account without using cPanel&#039;s outdated ruby support.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
To get a Ruby on Rails application running, we&#039;ll need to get a recent version of ruby installed. &lt;br /&gt;
&lt;br /&gt;
cPanel officially supports ruby version {{code|1.8.7}} and rails version {{code|2.3.18}}. This guide will install ruby {{code|2.2.0}} and rails {{code|4.2.5}} using RVM.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Install [[Ruby|Ruby using RVM]].&lt;br /&gt;
&lt;br /&gt;
As root, install all the prerequsites.&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# yum install gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make  bzip2 autoconf automake libtool bison iconv-devel sqlite-devel&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
As the user running the website, install ruby and rails.&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# curl -L get.rvm.io {{!}} bash -s stable --ruby&lt;br /&gt;
# rvm install 2.2.0&lt;br /&gt;
# source ~/.rvm/scripts/rvm&lt;br /&gt;
# gem install rails&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
At this point, you should have ruby and rails installed under your {{code|~/.rvm}} directory.&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# which ruby&lt;br /&gt;
/home/net/.rvm/rubies/ruby-2.0.0-p643/bin/ruby&lt;br /&gt;
# which rails&lt;br /&gt;
/home/net/.rvm/gems/ruby-2.0.0-p643/bin/rails&lt;br /&gt;
# ruby --version&lt;br /&gt;
ruby 2.0.0p643 (2015-02-25 revision 49749) [x86_64-linux]&lt;br /&gt;
# rails --version&lt;br /&gt;
Rails 4.2.5&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You may need to install additional gems depending on the rails application you&#039;re trying to run.&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cd $rails_application&lt;br /&gt;
# bundle install&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If everything went smoothly, you should now be able to start the rails application.&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# cd $rails_application&lt;br /&gt;
# rails s&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Ensure that your login profile sources the rvm script, or that your paths are set so that running ruby or rails runs the proper binary. If you want to invoke ruby in a shell script, you might need to adjust the {{code|PATH}} environment variable like so:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=bash|code=&lt;br /&gt;
export PATH=/home/fnet/.rvm/gems/ruby-2.0.0-p643/bin:/home/net/.rvm/gems/ruby-2.0.0-p643@global/bin:/home/net/.rvm/rubies/ruby-2.0.0-p643/bin:/home/net/.rvm/bin:$PATH&lt;br /&gt;
export GEM_PATH=/home/net/.rvm/gems/ruby-2.0.0-p643:/home/net/.rvm/gems/ruby-2.0.0-p643@global&lt;br /&gt;
export GEM_HOME=/home/net/.rvm/gems/ruby-2.0.0-p643&lt;br /&gt;
export RUBY_VERSION=ruby-2.0.0-p643&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Website Rewrite ==&lt;br /&gt;
Your rails application should be running on a high port such as {{code|3000}}. In order for your main domain to serve the rails application on port {{code|80}}, you will need to create a {{code|.htaccess}} file with the following contents.&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
RewriteEngine on&lt;br /&gt;
RewriteRule ^(.*)$ http://127.0.0.1:3000/$1 [P,L]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If you wish to serve the application in a sub directory, change the {{code|RewriteRule}} accordingly. Eg: To serve the site from {{code|/rails}}:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
RewriteEngine on&lt;br /&gt;
RewriteRule ^rails\/(.*)$ http://127.0.0.1:3000/$1 [P,L]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Starting the Application Automatically ==&lt;br /&gt;
A quick and dirty solution is to make use of a cronjob to start the website automatically in case the server goes down.&lt;br /&gt;
&lt;br /&gt;
Create a script with the following:&lt;br /&gt;
{{highlight|lang=bash|code=&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
ps ux {{!}} grep -v grep {{!}} grep -q ruby {{!}}{{!}} screen -S railsapp -dm rails s&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Set the script to execute every minute.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Installing Rails Hangs ===&lt;br /&gt;
When installing rails on version {{code|2.2.3}} of ruby, gem will hang on the line {{code|installing ri documentation for rail}}. Ruby will use up 100% of the CPU while doing nothing. The same thing happens when running {{code|gems install rails --no-ri --no-rdoc}}.&lt;br /&gt;
&lt;br /&gt;
This was fixed by using an older version of ruby ({{code|2.0}} worked for me}}.&lt;br /&gt;
&lt;br /&gt;
=== No route matches [GET] &amp;quot;/index.html.var&amp;quot; ===&lt;br /&gt;
When using Apache 2.4 and the solution above, you may get an error on the main page:&lt;br /&gt;
&lt;br /&gt;
 No route matches [GET] &amp;quot;/index.html.var&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This was fixed by adding this line to the {{code|.htaccess}} file:&lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex disabled&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding]]&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=PHP&amp;diff=1604</id>
		<title>PHP</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=PHP&amp;diff=1604"/>
		<updated>2016-11-04T20:25:31Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PHP is a server-side scripting library.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
The instructions here will compile the latest version of PHP as an apache module for a prepackaged apache installation under a RedHat based system (such as CentOS, Fedora, ScientificLinux). The steps below will make use of {{code|apxs2}} from the {{code|http-tools}} package. If you wish to install PHP with suPHP, see [[suPHP]].&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
## Install rpmforge repo&lt;br /&gt;
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm&lt;br /&gt;
# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt&lt;br /&gt;
# rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm&lt;br /&gt;
# rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm&lt;br /&gt;
&lt;br /&gt;
## Install all prerequisites.&lt;br /&gt;
# yum -y install make autoconf g++ gcc-c++ libtermcap-devel libgcc-c++ libtool gcc libpng-devel libjpeg-devel libxml1-devel libxml2-devel curl curl-devel libmcrypt libmcrypt-devel libtool-ltdl-devel libxml2.x86_64 libxml2-devel.x86_64 curl-devel.x86_64 openssl-devel httpd-devel &lt;br /&gt;
&lt;br /&gt;
# Compile PHP&lt;br /&gt;
# Go to the PHP source directory, then run:&lt;br /&gt;
# ./configure --with-apxs2 --with-config-file-path=/etc --with-gd --enable-shmop --enable-ftp --enable-sockets --enable-exif --enable-zip --enable-sysvsem --enable-sysvsem --enable-sysvshm --with-jpeg-dir --with-png-dir  --enable-mbstring --enable-embedded-mysqli=shared --with-curl --with-mcrypt --with-mysql --with-mysqli --with-openssl --with-zlib --with-pdo-mysql --with-libdir=lib64&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add {{code|1=--with-libdir=lib64}} if you  need to reference 64bit libraries. By default, configure will only search in /usr/lib rather than /usr/lib64.&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;. If you had enabled apache apxs2 above, then it should have enabled the PHP module in apache automatically in {{/etc/httpd/conf/httpd.conf}}. If that failed for whatever reason, you could create an included config at {{code|/etc/httpd/conf.d/php.conf}} with the following contents:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=apache|code=&lt;br /&gt;
#&lt;br /&gt;
# PHP is an HTML-embedded scripting language which attempts to make it&lt;br /&gt;
# easy for developers to write dynamically generated webpages.&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;IfModule prefork.c&amp;gt;&lt;br /&gt;
  LoadModule php5_module modules/libphp5.so&lt;br /&gt;
  # Of if you use PHP 7, use: LoadModule php7_module modules/libphp7.so&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&amp;lt;IfModule worker.c&amp;gt;&lt;br /&gt;
  LoadModule php5_module modules/libphp5-zts.so&lt;br /&gt;
&amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Cause the PHP interpreter to handle files with a .php extension.&lt;br /&gt;
&lt;br /&gt;
AddHandler php5-script .php&lt;br /&gt;
AddType text/html .php&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Add index.php to the list of files that will be served as directory&lt;br /&gt;
# indexes.&lt;br /&gt;
#&lt;br /&gt;
DirectoryIndex index.php&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Uncomment the following line to allow PHP to pretty-print .phps&lt;br /&gt;
# files as PHP source code:&lt;br /&gt;
#&lt;br /&gt;
AddType application/x-httpd-php-source .phps&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
==== PDOException : could not find driver ====&lt;br /&gt;
You need to have the pdo driver installed. In my case, I was trying to use the pdo-mysql connector which wasn&#039;t compiled with PHP. To fix this, install the PDO driver or compile it manually with:&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
 --with-pdo-&amp;lt;driver&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
In my case, I needed mysql:&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
 --with-pdo-mysql&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== UTF-8 to hex ====&lt;br /&gt;
There is basically NO good way.&lt;br /&gt;
&lt;br /&gt;
* http://www.tokyomuslim.com/2008/01/php-convert-utf-8-to-hex-codepoint-values-unicode-hexidecimal/&lt;br /&gt;
* http://hsivonen.iki.fi/php-utf8/&lt;br /&gt;
&lt;br /&gt;
==== Error Reporting ====&lt;br /&gt;
{{highlight|lang=php|code=&lt;br /&gt;
// Turn off all error reporting&lt;br /&gt;
error_reporting(0);&lt;br /&gt;
&lt;br /&gt;
// Report simple running errors&lt;br /&gt;
error_reporting(E_ERROR {{!}} E_WARNING {{!}} E_PARSE);&lt;br /&gt;
&lt;br /&gt;
// Reporting E_NOTICE can be good too (to report uninitialized&lt;br /&gt;
// variables or catch variable name misspellings ...)&lt;br /&gt;
error_reporting(E_ERROR {{!}} E_WARNING {{!}} E_PARSE {{!}} E_NOTICE);&lt;br /&gt;
&lt;br /&gt;
// Report all errors except E_NOTICE&lt;br /&gt;
// This is the default value set in php.ini&lt;br /&gt;
error_reporting(E_ALL ^ E_NOTICE);&lt;br /&gt;
&lt;br /&gt;
// Report all PHP errors (see changelog)&lt;br /&gt;
error_reporting(E_ALL);&lt;br /&gt;
&lt;br /&gt;
// Report all PHP errors&lt;br /&gt;
error_reporting(-1);&lt;br /&gt;
&lt;br /&gt;
// Same as error_reporting(E_ALL);&lt;br /&gt;
ini_set(&#039;error_reporting&#039;, E_ALL);&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:Code]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Udev_Rules&amp;diff=1603</id>
		<title>Udev Rules</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Udev_Rules&amp;diff=1603"/>
		<updated>2016-11-04T16:37:41Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Creating New udev rules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;udev&amp;lt;/code&amp;gt; is a device manager for the Linux kernel and handles device nodes in &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt;. Rules can be defined which governs how these device nodes are created and what attributes are set.&lt;br /&gt;
&lt;br /&gt;
== Creating New &amp;lt;code&amp;gt;udev&amp;lt;/code&amp;gt; rules ==&lt;br /&gt;
&lt;br /&gt;
Place new rules in &amp;lt;code&amp;gt;/etc/udev/rules.d&amp;lt;/code&amp;gt;. The filename should be numbered.&lt;br /&gt;
&lt;br /&gt;
If you are attempting to write a rule for a specific device, you should plug the device to your computer now and determine what the device path is. You must then list out all the udev properties of the device using the &amp;lt;code&amp;gt;udevadm&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
To see attributes of a device, run:&lt;br /&gt;
{{code|1=udevadm info --attribute-walk --name=/dev/ttyUSB0}}&lt;br /&gt;
&lt;br /&gt;
For example, to create a udev rule for a USB Webcam at &amp;lt;code&amp;gt;/etc/video0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# udevadm info -a -p `udevadm info -q path -n /dev/video0`&lt;br /&gt;
&lt;br /&gt;
Udevadm info starts with the device specified by the devpath and then&lt;br /&gt;
walks up the chain of parent devices. It prints for every device&lt;br /&gt;
found, all possible attributes in the udev rules key format.&lt;br /&gt;
A rule to match, can be composed by the attributes of the device&lt;br /&gt;
and the attributes from one single parent device.&lt;br /&gt;
&lt;br /&gt;
  looking at device &#039;/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0/video4linux/video0&#039;:&lt;br /&gt;
    KERNEL==&amp;quot;video0&amp;quot;&lt;br /&gt;
    SUBSYSTEM==&amp;quot;video4linux&amp;quot;&lt;br /&gt;
    DRIVER==&amp;quot;&amp;quot;&lt;br /&gt;
    ATTR{debug}==&amp;quot;0&amp;quot;&lt;br /&gt;
    ATTR{index}==&amp;quot;0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  looking at parent device &#039;/devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3:1.0&#039;:&lt;br /&gt;
    KERNELS==&amp;quot;1-1.3:1.0&amp;quot;&lt;br /&gt;
    SUBSYSTEMS==&amp;quot;usb&amp;quot;&lt;br /&gt;
    DRIVERS==&amp;quot;uvcvideo&amp;quot;&lt;br /&gt;
    ATTRS{bInterfaceClass}==&amp;quot;0e&amp;quot;&lt;br /&gt;
    ATTRS{iad_bFunctionClass}==&amp;quot;0e&amp;quot;&lt;br /&gt;
    ATTRS{iad_bFirstInterface}==&amp;quot;00&amp;quot;&lt;br /&gt;
    ATTRS{bInterfaceSubClass}==&amp;quot;01&amp;quot;&lt;br /&gt;
    ATTRS{bInterfaceProtocol}==&amp;quot;00&amp;quot;&lt;br /&gt;
    ATTRS{bNumEndpoints}==&amp;quot;01&amp;quot;&lt;br /&gt;
    ATTRS{iad_bFunctionSubClass}==&amp;quot;03&amp;quot;&lt;br /&gt;
    ATTRS{iad_bFunctionProtocol}==&amp;quot;00&amp;quot;&lt;br /&gt;
    ATTRS{supports_autosuspend}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{iad_bInterfaceCount}==&amp;quot;02&amp;quot;&lt;br /&gt;
    ATTRS{bAlternateSetting}==&amp;quot; 0&amp;quot;&lt;br /&gt;
    ATTRS{bInterfaceNumber}==&amp;quot;00&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  looking at parent device &#039;/devices/platform/bcm2708_usb/usb1/1-1/1-1.3&#039;:&lt;br /&gt;
    KERNELS==&amp;quot;1-1.3&amp;quot;&lt;br /&gt;
    SUBSYSTEMS==&amp;quot;usb&amp;quot;&lt;br /&gt;
    DRIVERS==&amp;quot;usb&amp;quot;&lt;br /&gt;
    ATTRS{bDeviceSubClass}==&amp;quot;02&amp;quot;&lt;br /&gt;
    ATTRS{bDeviceProtocol}==&amp;quot;01&amp;quot;&lt;br /&gt;
    ATTRS{devpath}==&amp;quot;1.3&amp;quot;&lt;br /&gt;
    ATTRS{idVendor}==&amp;quot;045e&amp;quot;&lt;br /&gt;
    ATTRS{speed}==&amp;quot;480&amp;quot;&lt;br /&gt;
    ATTRS{bNumInterfaces}==&amp;quot; 4&amp;quot;&lt;br /&gt;
    ATTRS{bConfigurationValue}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{bMaxPacketSize0}==&amp;quot;64&amp;quot;&lt;br /&gt;
    ATTRS{busnum}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{devnum}==&amp;quot;6&amp;quot;&lt;br /&gt;
    ATTRS{configuration}==&amp;quot;&amp;quot;&lt;br /&gt;
    ATTRS{bMaxPower}==&amp;quot;500mA&amp;quot;&lt;br /&gt;
    ATTRS{authorized}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{bmAttributes}==&amp;quot;80&amp;quot;&lt;br /&gt;
    ATTRS{bNumConfigurations}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{maxchild}==&amp;quot;0&amp;quot;&lt;br /&gt;
    ATTRS{bcdDevice}==&amp;quot;0100&amp;quot;&lt;br /&gt;
    ATTRS{avoid_reset_quirk}==&amp;quot;0&amp;quot;&lt;br /&gt;
    ATTRS{quirks}==&amp;quot;0x0&amp;quot;&lt;br /&gt;
    ATTRS{version}==&amp;quot; 2.00&amp;quot;&lt;br /&gt;
    ATTRS{urbnum}==&amp;quot;38&amp;quot;&lt;br /&gt;
    ATTRS{ltm_capable}==&amp;quot;no&amp;quot;&lt;br /&gt;
    ATTRS{manufacturer}==&amp;quot;Microsoft&amp;quot;&lt;br /&gt;
    ATTRS{removable}==&amp;quot;removable&amp;quot;&lt;br /&gt;
    ATTRS{idProduct}==&amp;quot;0761&amp;quot;&lt;br /&gt;
    ATTRS{bDeviceClass}==&amp;quot;ef&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  looking at parent device &#039;/devices/platform/bcm2708_usb/usb1/1-1&#039;:&lt;br /&gt;
    KERNELS==&amp;quot;1-1&amp;quot;&lt;br /&gt;
    SUBSYSTEMS==&amp;quot;usb&amp;quot;&lt;br /&gt;
    DRIVERS==&amp;quot;usb&amp;quot;&lt;br /&gt;
    ATTRS{bDeviceSubClass}==&amp;quot;00&amp;quot;&lt;br /&gt;
    ATTRS{bDeviceProtocol}==&amp;quot;02&amp;quot;&lt;br /&gt;
    ATTRS{devpath}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{idVendor}==&amp;quot;0424&amp;quot;&lt;br /&gt;
    ATTRS{speed}==&amp;quot;480&amp;quot;&lt;br /&gt;
    ATTRS{bNumInterfaces}==&amp;quot; 1&amp;quot;&lt;br /&gt;
    ATTRS{bConfigurationValue}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{bMaxPacketSize0}==&amp;quot;64&amp;quot;&lt;br /&gt;
    ATTRS{busnum}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{devnum}==&amp;quot;2&amp;quot;&lt;br /&gt;
    ATTRS{configuration}==&amp;quot;&amp;quot;&lt;br /&gt;
    ATTRS{bMaxPower}==&amp;quot;2mA&amp;quot;&lt;br /&gt;
    ATTRS{authorized}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{bmAttributes}==&amp;quot;e0&amp;quot;&lt;br /&gt;
    ATTRS{bNumConfigurations}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{maxchild}==&amp;quot;3&amp;quot;&lt;br /&gt;
    ATTRS{bcdDevice}==&amp;quot;0200&amp;quot;&lt;br /&gt;
    ATTRS{avoid_reset_quirk}==&amp;quot;0&amp;quot;&lt;br /&gt;
    ATTRS{quirks}==&amp;quot;0x0&amp;quot;&lt;br /&gt;
    ATTRS{version}==&amp;quot; 2.00&amp;quot;&lt;br /&gt;
    ATTRS{urbnum}==&amp;quot;80&amp;quot;&lt;br /&gt;
    ATTRS{ltm_capable}==&amp;quot;no&amp;quot;&lt;br /&gt;
    ATTRS{removable}==&amp;quot;unknown&amp;quot;&lt;br /&gt;
    ATTRS{idProduct}==&amp;quot;9512&amp;quot;&lt;br /&gt;
    ATTRS{bDeviceClass}==&amp;quot;09&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  looking at parent device &#039;/devices/platform/bcm2708_usb/usb1&#039;:&lt;br /&gt;
    KERNELS==&amp;quot;usb1&amp;quot;&lt;br /&gt;
    SUBSYSTEMS==&amp;quot;usb&amp;quot;&lt;br /&gt;
    DRIVERS==&amp;quot;usb&amp;quot;&lt;br /&gt;
    ATTRS{bDeviceSubClass}==&amp;quot;00&amp;quot;&lt;br /&gt;
    ATTRS{bDeviceProtocol}==&amp;quot;01&amp;quot;&lt;br /&gt;
    ATTRS{devpath}==&amp;quot;0&amp;quot;&lt;br /&gt;
    ATTRS{idVendor}==&amp;quot;1d6b&amp;quot;&lt;br /&gt;
    ATTRS{speed}==&amp;quot;480&amp;quot;&lt;br /&gt;
    ATTRS{bNumInterfaces}==&amp;quot; 1&amp;quot;&lt;br /&gt;
    ATTRS{bConfigurationValue}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{bMaxPacketSize0}==&amp;quot;64&amp;quot;&lt;br /&gt;
    ATTRS{authorized_default}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{busnum}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{devnum}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{configuration}==&amp;quot;&amp;quot;&lt;br /&gt;
    ATTRS{bMaxPower}==&amp;quot;0mA&amp;quot;&lt;br /&gt;
    ATTRS{authorized}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{bmAttributes}==&amp;quot;e0&amp;quot;&lt;br /&gt;
    ATTRS{bNumConfigurations}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{maxchild}==&amp;quot;1&amp;quot;&lt;br /&gt;
    ATTRS{bcdDevice}==&amp;quot;0318&amp;quot;&lt;br /&gt;
    ATTRS{avoid_reset_quirk}==&amp;quot;0&amp;quot;&lt;br /&gt;
    ATTRS{quirks}==&amp;quot;0x0&amp;quot;&lt;br /&gt;
    ATTRS{serial}==&amp;quot;bcm2708_usb&amp;quot;&lt;br /&gt;
    ATTRS{version}==&amp;quot; 2.00&amp;quot;&lt;br /&gt;
    ATTRS{urbnum}==&amp;quot;26&amp;quot;&lt;br /&gt;
    ATTRS{ltm_capable}==&amp;quot;no&amp;quot;&lt;br /&gt;
    ATTRS{manufacturer}==&amp;quot;Linux 3.18.9-3-ARCH dwc_otg_hcd&amp;quot;&lt;br /&gt;
    ATTRS{removable}==&amp;quot;unknown&amp;quot;&lt;br /&gt;
    ATTRS{idProduct}==&amp;quot;0002&amp;quot;&lt;br /&gt;
    ATTRS{bDeviceClass}==&amp;quot;09&amp;quot;&lt;br /&gt;
    ATTRS{product}==&amp;quot;DWC OTG Controller&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  looking at parent device &#039;/devices/platform/bcm2708_usb&#039;:&lt;br /&gt;
    KERNELS==&amp;quot;bcm2708_usb&amp;quot;&lt;br /&gt;
    SUBSYSTEMS==&amp;quot;platform&amp;quot;&lt;br /&gt;
    DRIVERS==&amp;quot;dwc_otg&amp;quot;&lt;br /&gt;
    ATTRS{hnp}==&amp;quot;HstNegScs = 0x0&amp;quot;&lt;br /&gt;
    ATTRS{srp}==&amp;quot;SesReqScs = 0x1&amp;quot;&lt;br /&gt;
    ATTRS{regvalue}==&amp;quot;invalid offset&amp;quot;&lt;br /&gt;
    ATTRS{hsic_connect}==&amp;quot;HSIC Connect = 0x1&amp;quot;&lt;br /&gt;
    ATTRS{guid}==&amp;quot;GUID = 0x2708a000&amp;quot;&lt;br /&gt;
    ATTRS{mode}==&amp;quot;Mode = 0x1&amp;quot;&lt;br /&gt;
    ATTRS{srpcapable}==&amp;quot;SRPCapable = 0x1&amp;quot;&lt;br /&gt;
    ATTRS{regdump}==&amp;quot;Register Dump&amp;quot;&lt;br /&gt;
    ATTRS{gpvndctl}==&amp;quot;GPVNDCTL = 0x00000000&amp;quot;&lt;br /&gt;
    ATTRS{ggpio}==&amp;quot;GGPIO = 0x00000000&amp;quot;&lt;br /&gt;
    ATTRS{hprt0}==&amp;quot;HPRT0 = 0x00001005&amp;quot;&lt;br /&gt;
    ATTRS{wr_reg_test}==&amp;quot;Time to write GNPTXFSIZ reg 10000000 times: 670 msecs (67 jiffies)&amp;quot;&lt;br /&gt;
    ATTRS{driver_override}==&amp;quot;(null)&amp;quot;&lt;br /&gt;
    ATTRS{hcd_frrem}==&amp;quot;HCD Dump Frame Remaining&amp;quot;&lt;br /&gt;
    ATTRS{mode_ch_tim_en}==&amp;quot;Mode Change Ready Timer Enable = 0x0&amp;quot;&lt;br /&gt;
    ATTRS{gnptxfsiz}==&amp;quot;GNPTXFSIZ = 0x01000306&amp;quot;&lt;br /&gt;
    ATTRS{remote_wakeup}==&amp;quot;Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0&amp;quot;&lt;br /&gt;
    ATTRS{busconnected}==&amp;quot;Bus Connected = 0x1&amp;quot;&lt;br /&gt;
    ATTRS{hcddump}==&amp;quot;HCD Dump&amp;quot;&lt;br /&gt;
    ATTRS{gotgctl}==&amp;quot;GOTGCTL = 0x001c0001&amp;quot;&lt;br /&gt;
    ATTRS{spramdump}==&amp;quot;SPRAM Dump&amp;quot;&lt;br /&gt;
    ATTRS{grxfsiz}==&amp;quot;GRXFSIZ = 0x00000306&amp;quot;&lt;br /&gt;
    ATTRS{gsnpsid}==&amp;quot;GSNPSID = 0x4f54280a&amp;quot;&lt;br /&gt;
    ATTRS{gusbcfg}==&amp;quot;GUSBCFG = 0x00001700&amp;quot;&lt;br /&gt;
    ATTRS{hptxfsiz}==&amp;quot;HPTXFSIZ = 0x02000406&amp;quot;&lt;br /&gt;
    ATTRS{devspeed}==&amp;quot;Device Speed = 0x0&amp;quot;&lt;br /&gt;
    ATTRS{fr_interval}==&amp;quot;Frame Interval = 0x1d4c&amp;quot;&lt;br /&gt;
    ATTRS{rem_wakeup_pwrdn}==&amp;quot;&amp;quot;&lt;br /&gt;
    ATTRS{bussuspend}==&amp;quot;Bus Suspend = 0x0&amp;quot;&lt;br /&gt;
    ATTRS{buspower}==&amp;quot;Bus Power = 0x1&amp;quot;&lt;br /&gt;
    ATTRS{hnpcapable}==&amp;quot;HNPCapable = 0x1&amp;quot;&lt;br /&gt;
    ATTRS{rd_reg_test}==&amp;quot;Time to read GNPTXFSIZ reg 10000000 times: 1510 msecs (151 jiffies)&amp;quot;&lt;br /&gt;
    ATTRS{enumspeed}==&amp;quot;Device Enumeration Speed = 0x1&amp;quot;&lt;br /&gt;
    ATTRS{inv_sel_hsic}==&amp;quot;Invert Select HSIC = 0x0&amp;quot;&lt;br /&gt;
    ATTRS{regoffset}==&amp;quot;0xffffffff&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  looking at parent device &#039;/devices/platform&#039;:&lt;br /&gt;
    KERNELS==&amp;quot;platform&amp;quot;&lt;br /&gt;
    SUBSYSTEMS==&amp;quot;&amp;quot;&lt;br /&gt;
    DRIVERS==&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the udev rules file, match all attributes that uniquely identify the device you&#039;re targetting. In the example above, using the &amp;lt;code&amp;gt;SUBSYSTEM&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ATTRS{idVendor}&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;ATTRS{idProduct}&amp;lt;/code&amp;gt; would be sufficient. Eg:&lt;br /&gt;
 SUBSYSTEM==&amp;quot;video4linux&amp;quot;, ATTRS{idVendor}==&amp;quot;045e&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In the second half of the line, you may define values for this device. If the webcam needs to be world read and writable, assign &amp;lt;code&amp;gt;0666&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;MODE&amp;lt;/code&amp;gt;  like so:&lt;br /&gt;
 SUBSYSTEM==&amp;quot;video4linux&amp;quot;, ATTRS{idVendor}==&amp;quot;045e&amp;quot;, ATTRS{idProduct}==&amp;quot;0761&amp;quot;, MODE=&amp;quot;0666&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Restart the udev daemon and check the logs for any errors. If the rules are correct, replugging the device should have have the affects defined in the rules.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* http://hackaday.com/2009/09/18/how-to-write-udev-rules/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
{{Navbox Linux}}&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Git&amp;diff=1578</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Git&amp;diff=1578"/>
		<updated>2016-01-19T19:42:47Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Reverting Changes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Quick Use Guide ==&lt;br /&gt;
As someone who used SVN for the last decade, switching over to git was slightly confusing since the terminology is different. Hopefully, this usage guide will help.&lt;br /&gt;
&lt;br /&gt;
=== Committing Files ===&lt;br /&gt;
A commit is like a snapshot and allows you to save the current state of the repository. Unlike in SVN where files are manually included/excluded when a commit is made, git allows files to be staged or unstaged prior to the commit being created. Staged files will always be added to the next commit made.&lt;br /&gt;
&lt;br /&gt;
Typically, you will want to stage all files for commit which can be done by running:&lt;br /&gt;
{{Highlight|lang=bash|code=&lt;br /&gt;
git add -A .&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Run {{code|git status}} to see all files that are staged as well as any changed but unstaged files.&lt;br /&gt;
{{Highlight|lang=bash|code=&lt;br /&gt;
git status&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To commit all the staged files with a message:&lt;br /&gt;
{{Highlight|lang=bash|code=&lt;br /&gt;
git commit -m &#039;message&#039;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Reverting Changes ===&lt;br /&gt;
To revert all changes in the current repository, use:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
## Fetch latest from remote&lt;br /&gt;
# git fetch --all&lt;br /&gt;
## Reset all changes fetched previously.&lt;br /&gt;
# git reset --hard HEAD&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To revert a specific file from a specific revision, use {{code|git checkout}}.&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# git checkout &amp;lt;revision&amp;gt; &amp;lt;filename&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Remote Origins ===&lt;br /&gt;
Git allows you to push/pull changes from other remote git repositories. Remote repositories can be in another path or hosted somewhere on the internet. &lt;br /&gt;
&lt;br /&gt;
To see your repository&#039;s remotes:&lt;br /&gt;
{{Highlight|lang=bash|code=&lt;br /&gt;
git remote -v&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To add a new remote:&lt;br /&gt;
{{Highlight|lang=bash|code=&lt;br /&gt;
git remote add origin git@gitlab-blah:user/repo.git&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
To remove a remote:&lt;br /&gt;
{{Highlight|lang=bash|code=&lt;br /&gt;
git remote rm origin&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If your remote uses SSH, you will most likely need to configure SSH in order to make use of SSH key based authentication. You can read more about this at [[SSH Configuration File]], but the basic idea is to create a SSH configuration file at &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; defining the remote&#039;s host.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Host gitlab-remote&lt;br /&gt;
    User git&lt;br /&gt;
    HostName git.example.com&lt;br /&gt;
    IdentityFile ~/.ssh/gitlab-remote&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Pushing / Pulling ====&lt;br /&gt;
After making a new change in your repository, you may want to push your changes out to other repositories. Do so by running:&lt;br /&gt;
{{Highlight|lang=bash|code=&lt;br /&gt;
git push&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You may also specify a specific remote and branch as well. Eg: {{code|git push remote-name branch-name}}.&lt;br /&gt;
&lt;br /&gt;
Conversely, to retrieve changes from another repository, run&lt;br /&gt;
{{Highlight|lang=bash|code=&lt;br /&gt;
git pull&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Ipset&amp;diff=1577</id>
		<title>Ipset</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Ipset&amp;diff=1577"/>
		<updated>2016-01-19T00:06:32Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: Created page with &amp;quot;You can use {{code|ipset}} to mass block a list of IP addresses with IPTables efficiently.   == Usage &amp;amp; Configuration == Install the {{code|ipset}} package.   In order to bloc...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can use {{code|ipset}} to mass block a list of IP addresses with IPTables efficiently. &lt;br /&gt;
&lt;br /&gt;
== Usage &amp;amp; Configuration ==&lt;br /&gt;
Install the {{code|ipset}} package. &lt;br /&gt;
&lt;br /&gt;
In order to block a list of IP addresses, create a new set hashed by the IP address that will contain all the banned IP addresses.&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# ipset create banlist hash:ip hashsize 4096&lt;br /&gt;
# ipset list&lt;br /&gt;
Name: banlist&lt;br /&gt;
Type: hash:ip&lt;br /&gt;
Header: family inet hashsize 4096 maxelem 65536&lt;br /&gt;
Size in memory: 65656&lt;br /&gt;
References: 1&lt;br /&gt;
Members:&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Use the {{code|ipset add}} command to add IP addresses to the set.&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# ipset add banlist 1.2.3.4&lt;br /&gt;
# ipset add banlist 1.2.3.4&lt;br /&gt;
ipset v6.11: Element cannot be added to the set: it&#039;s already added&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Duplicates will generate a warning. You can make {{code|ipset}} silently ignore duplicates this by passing the {{code|-exist}} flag.&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# ipset -exist add banlist 1.2.3.4&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
IPs can be removed by using the {{code|ipset remove}} command or wiped completely using the {{code|ipset flush}} command.&lt;br /&gt;
&lt;br /&gt;
=== Integrating with IPTables ===&lt;br /&gt;
To make use of a {{code|ipset}} set created above, create a new IPTables rule that uses the {{code|set}} module. Eg:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
$IPT -t mangle -N banned_ip_check&lt;br /&gt;
$IPT -t mangle -A banned_ip_check -m set --match-set banlist src -j banned_ip&lt;br /&gt;
$IPT -t mangle -A PREROUTING -j banned_ip_check&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In this case, we match source IP addresses to the {{code|ipset}} set named &#039;banlist&#039;.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* http://daemonkeeper.net/781/mass-blocking-ip-addresses-with-ipset/&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Gnome&amp;diff=1557</id>
		<title>Gnome</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Gnome&amp;diff=1557"/>
		<updated>2016-01-12T18:16:56Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Screensaver Timeout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== GSettings ==&lt;br /&gt;
The {{code|gsettings}} utility provides a way to get to GSettings which is more or less like a Windows registry containing key value pairs.&lt;br /&gt;
&lt;br /&gt;
GSetting values are different for each user. To modify or view values for a different user, launch a dbus session as the user via {{code|sudo}}:&lt;br /&gt;
{{highlight|lang=terminal|code=&lt;br /&gt;
# sudo -H -u lightdm dbus-launch --exit-with-session gsettings list-recursively&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Screensaver Timeout ==&lt;br /&gt;
The amount of idle time before the screensaver starts is set using:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
# gsettings get org.gnome.desktop.session idle-delay&lt;br /&gt;
uint32 60&lt;br /&gt;
# gsettings set org.gnome.desktop.session idle-delay 3600&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The amount of time before the screen is locked is set:&lt;br /&gt;
&lt;br /&gt;
{{highlight|lang=text|code=&lt;br /&gt;
## Instantly locks when the screensaver starts&lt;br /&gt;
# gsettings set org.gnome.desktop.screensaver lock-delay 0&lt;br /&gt;
## Or a delay in seconds. Eg: 1 minute&lt;br /&gt;
# gsettings set org.gnome.desktop.screensaver lock-delay 60&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* http://blog.tordeu.com/?p=292&lt;br /&gt;
* http://superuser.com/questions/727120/make-gnome-screen-lock-after-1-hour-not-15-minutes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=VMware_ESXi&amp;diff=1244</id>
		<title>VMware ESXi</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=VMware_ESXi&amp;diff=1244"/>
		<updated>2015-08-28T21:19:47Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Updating ==&lt;br /&gt;
To update a ESXi install from 5.5 to 6.0, download the ESXi 6.0 offline bundle and upload it to a datastore on the server.&lt;br /&gt;
&lt;br /&gt;
Log in via SSH and execute&lt;br /&gt;
 esxcli software vib update -d /vmfs/volumes/datastore1/ESXi600-201504001.zip&lt;br /&gt;
&lt;br /&gt;
Then reboot to apply the changes.&lt;br /&gt;
&lt;br /&gt;
See Also:&lt;br /&gt;
* http://www.vladan.fr/patch-esxi-5-5-to-esxi-6-0/&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== IOMMU Hangs ===&lt;br /&gt;
If your ESXi server hangs while &amp;quot;Initializing IOV&amp;quot;, disable IOMMU by appending &#039;noIOMMU&#039; to the kernel immediately after the new kernel boots by hitting Shift-O (letter O, not zero)&lt;br /&gt;
&lt;br /&gt;
To make the changes persistent, add it to the boot arguments in &amp;lt;code&amp;gt;/bootbank/boot.cfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See Also:&lt;br /&gt;
* https://communities.vmware.com/message/2354177&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=VMware_ESXi&amp;diff=1243</id>
		<title>VMware ESXi</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=VMware_ESXi&amp;diff=1243"/>
		<updated>2015-08-28T21:18:54Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Updating ==&lt;br /&gt;
To update a ESXi install from 5.5 to 6.0, download the ESXi 6.0 offline bundle and upload it to a datastore on the server.&lt;br /&gt;
&lt;br /&gt;
Log in via SSH and execute&lt;br /&gt;
 esxcli software vib update -d /vmfs/volumes/datastore1/ESXi600-201504001.zip&lt;br /&gt;
&lt;br /&gt;
Then reboot to apply the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== IOMMU Hangs ===&lt;br /&gt;
If your ESXi server hangs while &amp;quot;Initializing IOV&amp;quot;, disable IOMMU by appending &#039;noIOMMU&#039; to the kernel immediately after the new kernel boots by hitting Shift-O (letter O, not zero)&lt;br /&gt;
&lt;br /&gt;
To make the changes persistent, add it to the boot arguments in &amp;lt;code&amp;gt;/bootbank/boot.cfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See Also:&lt;br /&gt;
* https://communities.vmware.com/message/2354177&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=VMware_ESXi&amp;diff=1242</id>
		<title>VMware ESXi</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=VMware_ESXi&amp;diff=1242"/>
		<updated>2015-08-28T21:18:17Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: Created page with &amp;quot;  == Updating == To update a ESXi install from 5.5 to 6.0, download the ESXi 6.0 offline bundle and upload it to a datastore on the server.  Log in via SSH and execute  esxcli...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Updating ==&lt;br /&gt;
To update a ESXi install from 5.5 to 6.0, download the ESXi 6.0 offline bundle and upload it to a datastore on the server.&lt;br /&gt;
&lt;br /&gt;
Log in via SSH and execute&lt;br /&gt;
 esxcli software vib update -d /vmfs/volumes/datastore1/ESXi600-201504001.zip&lt;br /&gt;
&lt;br /&gt;
Then reboot to apply the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== IOMMU Hangs ===&lt;br /&gt;
If your ESXi server hangs while &amp;quot;Initializing IOV&amp;quot;, disable IOMMU by appending &#039;noiommu&#039; to the kernel immediately after the new kernel boots by hitting Shift-O (letter O, not zero)&lt;br /&gt;
&lt;br /&gt;
To make the changes persistent, add it to the boot arguments in &amp;lt;code&amp;gt;/bootbank/boot.cfg&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Converting_VMware_ESXi_Disk&amp;diff=1211</id>
		<title>Converting VMware ESXi Disk</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Converting_VMware_ESXi_Disk&amp;diff=1211"/>
		<updated>2015-07-23T20:29:53Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: Created page with &amp;quot; Convert the disks to the ESXi format using:  vmkfstools -i Workstation.vmdk Esxi.vmdk&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Convert the disks to the ESXi format using:&lt;br /&gt;
 vmkfstools -i Workstation.vmdk Esxi.vmdk&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Benchmark_for_APM_X-Gene&amp;diff=1205</id>
		<title>Benchmark for APM X-Gene</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Benchmark_for_APM_X-Gene&amp;diff=1205"/>
		<updated>2015-06-29T16:33:29Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Benchmark&lt;br /&gt;
 | hardware =   APM X-Gene&lt;br /&gt;
 | cpu =        APM X-Gene&lt;br /&gt;
 | memory =     16 GB DDR3 EEC&lt;br /&gt;
 | disk =       1x500 GB SATA &lt;br /&gt;
 | os =         Fedora 22 aarch64&lt;br /&gt;
 | type =       server&lt;br /&gt;
 | score =      708.7&lt;br /&gt;
 | raw = &lt;br /&gt;
========================================================================&lt;br /&gt;
   BYTE UNIX Benchmarks (Version 5.1.3)&lt;br /&gt;
&lt;br /&gt;
   System: localhost.localdomain: GNU/Linux&lt;br /&gt;
   OS: GNU/Linux -- 4.0.4-303.fc22.aarch64 -- #1 SMP Mon Jun 1 13:16:58 UTC 2015&lt;br /&gt;
   Machine: aarch64 (aarch64)&lt;br /&gt;
   Language: en_US.utf8 (charmap=&amp;quot;UTF-8&amp;quot;, collate=&amp;quot;UTF-8&amp;quot;)&lt;br /&gt;
   16:59:07 up 16 min,  2 users,  load average: 0.09, 0.09, 0.07; runlevel 3&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
Benchmark Run: Thu Jun 18 2015 16:59:07 - 17:27:03&lt;br /&gt;
0 CPUs in system; running 1 parallel copy of tests&lt;br /&gt;
&lt;br /&gt;
Dhrystone 2 using register variables       17729811.6 lps   (10.0 s, 7 samples)&lt;br /&gt;
Double-Precision Whetstone                     2115.3 MWIPS (9.6 s, 7 samples)&lt;br /&gt;
Execl Throughput                               2416.0 lps   (29.9 s, 2 samples)&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks        394596.4 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks          109161.3 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks       1069966.8 KBps  (30.0 s, 2 samples)&lt;br /&gt;
Pipe Throughput                              792063.6 lps   (10.0 s, 7 samples)&lt;br /&gt;
Pipe-based Context Switching                 152173.7 lps   (10.0 s, 7 samples)&lt;br /&gt;
Process Creation                               5261.0 lps   (30.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (1 concurrent)                   2384.2 lpm   (60.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (8 concurrent)                    426.0 lpm   (60.1 s, 2 samples)&lt;br /&gt;
System Call Overhead                        1497371.3 lps   (10.0 s, 7 samples)&lt;br /&gt;
&lt;br /&gt;
System Benchmarks Index Values               BASELINE       RESULT    INDEX&lt;br /&gt;
Dhrystone 2 using register variables         116700.0   17729811.6   1519.3&lt;br /&gt;
Double-Precision Whetstone                       55.0       2115.3    384.6&lt;br /&gt;
Execl Throughput                                 43.0       2416.0    561.9&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks          3960.0     394596.4    996.5&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks            1655.0     109161.3    659.6&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks          5800.0    1069966.8   1844.8&lt;br /&gt;
Pipe Throughput                               12440.0     792063.6    636.7&lt;br /&gt;
Pipe-based Context Switching                   4000.0     152173.7    380.4&lt;br /&gt;
Process Creation                                126.0       5261.0    417.5&lt;br /&gt;
Shell Scripts (1 concurrent)                     42.4       2384.2    562.3&lt;br /&gt;
Shell Scripts (8 concurrent)                      6.0        426.0    709.9&lt;br /&gt;
System Call Overhead                          15000.0    1497371.3    998.2&lt;br /&gt;
                                                                   ========&lt;br /&gt;
System Benchmarks Index Score                                         708.7&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The following benchmark was done on the original linux kernel that the box came with.&lt;br /&gt;
{{Benchmark&lt;br /&gt;
 | hardware =   APM X-Gene&lt;br /&gt;
 | cpu =        APM X-Gene&lt;br /&gt;
 | memory =     16 GB DDR3 EEC&lt;br /&gt;
 | disk =       1x500 GB SATA &lt;br /&gt;
 | os =         Fedora 22 aarch64&lt;br /&gt;
 | type =       server&lt;br /&gt;
 | score =      926.9 / 3402.7&lt;br /&gt;
 | raw = &lt;br /&gt;
========================================================================&lt;br /&gt;
   BYTE UNIX Benchmarks (Version 5.1.3)&lt;br /&gt;
&lt;br /&gt;
   System: csa.cpsc.ucalgary.ca: GNU/Linux&lt;br /&gt;
   OS: GNU/Linux -- 3.12.0-mustang_sw_1.12.09-beta -- #1 SMP Thu Jun 12 10:27:15 PDT 2014&lt;br /&gt;
   Machine: aarch64 (aarch64)&lt;br /&gt;
   Language: en_US.utf8 (charmap=&amp;quot;UTF-8&amp;quot;, collate=&amp;quot;UTF-8&amp;quot;)&lt;br /&gt;
   CPU 0: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 1: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 2: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 3: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 4: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 5: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 6: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 7: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   17:28:54 up 27 min,  3 users,  load average: 1.39, 0.87, 0.61; runlevel 3&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
Benchmark Run: Fri Jun 26 2015 17:28:54 - 17:56:56&lt;br /&gt;
8 CPUs in system; running 1 parallel copy of tests&lt;br /&gt;
&lt;br /&gt;
Dhrystone 2 using register variables       17763947.5 lps   (10.0 s, 7 samples)&lt;br /&gt;
Double-Precision Whetstone                     2114.7 MWIPS (9.6 s, 7 samples)&lt;br /&gt;
Execl Throughput                               2459.8 lps   (29.9 s, 2 samples)&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks        468331.1 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks          130247.8 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks       1151363.8 KBps  (30.0 s, 2 samples)&lt;br /&gt;
Pipe Throughput                             1067484.4 lps   (10.0 s, 7 samples)&lt;br /&gt;
Pipe-based Context Switching                 192167.1 lps   (10.0 s, 7 samples)&lt;br /&gt;
Process Creation                               7660.0 lps   (30.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (1 concurrent)                   4207.7 lpm   (60.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (8 concurrent)                   1634.0 lpm   (60.0 s, 2 samples)&lt;br /&gt;
System Call Overhead                        1438914.1 lps   (10.0 s, 7 samples)&lt;br /&gt;
&lt;br /&gt;
System Benchmarks Index Values               BASELINE       RESULT    INDEX&lt;br /&gt;
Dhrystone 2 using register variables         116700.0   17763947.5   1522.2&lt;br /&gt;
Double-Precision Whetstone                       55.0       2114.7    384.5&lt;br /&gt;
Execl Throughput                                 43.0       2459.8    572.0&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks          3960.0     468331.1   1182.7&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks            1655.0     130247.8    787.0&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks          5800.0    1151363.8   1985.1&lt;br /&gt;
Pipe Throughput                               12440.0    1067484.4    858.1&lt;br /&gt;
Pipe-based Context Switching                   4000.0     192167.1    480.4&lt;br /&gt;
Process Creation                                126.0       7660.0    607.9&lt;br /&gt;
Shell Scripts (1 concurrent)                     42.4       4207.7    992.4&lt;br /&gt;
Shell Scripts (8 concurrent)                      6.0       1634.0   2723.3&lt;br /&gt;
System Call Overhead                          15000.0    1438914.1    959.3&lt;br /&gt;
                                                                   ========&lt;br /&gt;
System Benchmarks Index Score                                         926.9&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
Benchmark Run: Fri Jun 26 2015 17:56:56 - 18:25:05&lt;br /&gt;
8 CPUs in system; running 8 parallel copies of tests&lt;br /&gt;
&lt;br /&gt;
Dhrystone 2 using register variables      141540380.6 lps   (10.0 s, 7 samples)&lt;br /&gt;
Double-Precision Whetstone                    16919.0 MWIPS (9.6 s, 7 samples)&lt;br /&gt;
Execl Throughput                              13012.0 lps   (29.8 s, 2 samples)&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks        579580.8 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks          155434.8 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks       1673229.9 KBps  (30.0 s, 2 samples)&lt;br /&gt;
Pipe Throughput                             8441190.9 lps   (10.0 s, 7 samples)&lt;br /&gt;
Pipe-based Context Switching                1463165.9 lps   (10.0 s, 7 samples)&lt;br /&gt;
Process Creation                              32854.4 lps   (30.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (1 concurrent)                  16740.8 lpm   (60.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (8 concurrent)                   2477.4 lpm   (60.1 s, 2 samples)&lt;br /&gt;
System Call Overhead                        7650246.7 lps   (10.0 s, 7 samples)&lt;br /&gt;
&lt;br /&gt;
System Benchmarks Index Values               BASELINE       RESULT    INDEX&lt;br /&gt;
Dhrystone 2 using register variables         116700.0  141540380.6  12128.6&lt;br /&gt;
Double-Precision Whetstone                       55.0      16919.0   3076.2&lt;br /&gt;
Execl Throughput                                 43.0      13012.0   3026.1&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks          3960.0     579580.8   1463.6&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks            1655.0     155434.8    939.2&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks          5800.0    1673229.9   2884.9&lt;br /&gt;
Pipe Throughput                               12440.0    8441190.9   6785.5&lt;br /&gt;
Pipe-based Context Switching                   4000.0    1463165.9   3657.9&lt;br /&gt;
Process Creation                                126.0      32854.4   2607.5&lt;br /&gt;
Shell Scripts (1 concurrent)                     42.4      16740.8   3948.3&lt;br /&gt;
Shell Scripts (8 concurrent)                      6.0       2477.4   4128.9&lt;br /&gt;
System Call Overhead                          15000.0    7650246.7   5100.2&lt;br /&gt;
                                                                   ========&lt;br /&gt;
System Benchmarks Index Score                                        3402.7&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other Information ==&lt;br /&gt;
This test was done only one one CPU.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[root@localhost UnixBench]# free -m&lt;br /&gt;
              total        used        free      shared  buff/cache   available&lt;br /&gt;
Mem:          16257         180       15195           4         881       15951&lt;br /&gt;
Swap:          8191           0        8191&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Benchmark_for_APM_X-Gene&amp;diff=1204</id>
		<title>Benchmark for APM X-Gene</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Benchmark_for_APM_X-Gene&amp;diff=1204"/>
		<updated>2015-06-29T16:32:58Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Benchmark&lt;br /&gt;
 | hardware =   APM X-Gene&lt;br /&gt;
 | cpu =        APM SOC&lt;br /&gt;
 | memory =     16 GB DDR3 EEC&lt;br /&gt;
 | disk =       1x500 GB SATA &lt;br /&gt;
 | os =         Fedora 22 aarch64&lt;br /&gt;
 | type =       server&lt;br /&gt;
 | score =      708.7&lt;br /&gt;
 | raw = &lt;br /&gt;
========================================================================&lt;br /&gt;
   BYTE UNIX Benchmarks (Version 5.1.3)&lt;br /&gt;
&lt;br /&gt;
   System: localhost.localdomain: GNU/Linux&lt;br /&gt;
   OS: GNU/Linux -- 4.0.4-303.fc22.aarch64 -- #1 SMP Mon Jun 1 13:16:58 UTC 2015&lt;br /&gt;
   Machine: aarch64 (aarch64)&lt;br /&gt;
   Language: en_US.utf8 (charmap=&amp;quot;UTF-8&amp;quot;, collate=&amp;quot;UTF-8&amp;quot;)&lt;br /&gt;
   16:59:07 up 16 min,  2 users,  load average: 0.09, 0.09, 0.07; runlevel 3&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
Benchmark Run: Thu Jun 18 2015 16:59:07 - 17:27:03&lt;br /&gt;
0 CPUs in system; running 1 parallel copy of tests&lt;br /&gt;
&lt;br /&gt;
Dhrystone 2 using register variables       17729811.6 lps   (10.0 s, 7 samples)&lt;br /&gt;
Double-Precision Whetstone                     2115.3 MWIPS (9.6 s, 7 samples)&lt;br /&gt;
Execl Throughput                               2416.0 lps   (29.9 s, 2 samples)&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks        394596.4 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks          109161.3 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks       1069966.8 KBps  (30.0 s, 2 samples)&lt;br /&gt;
Pipe Throughput                              792063.6 lps   (10.0 s, 7 samples)&lt;br /&gt;
Pipe-based Context Switching                 152173.7 lps   (10.0 s, 7 samples)&lt;br /&gt;
Process Creation                               5261.0 lps   (30.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (1 concurrent)                   2384.2 lpm   (60.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (8 concurrent)                    426.0 lpm   (60.1 s, 2 samples)&lt;br /&gt;
System Call Overhead                        1497371.3 lps   (10.0 s, 7 samples)&lt;br /&gt;
&lt;br /&gt;
System Benchmarks Index Values               BASELINE       RESULT    INDEX&lt;br /&gt;
Dhrystone 2 using register variables         116700.0   17729811.6   1519.3&lt;br /&gt;
Double-Precision Whetstone                       55.0       2115.3    384.6&lt;br /&gt;
Execl Throughput                                 43.0       2416.0    561.9&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks          3960.0     394596.4    996.5&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks            1655.0     109161.3    659.6&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks          5800.0    1069966.8   1844.8&lt;br /&gt;
Pipe Throughput                               12440.0     792063.6    636.7&lt;br /&gt;
Pipe-based Context Switching                   4000.0     152173.7    380.4&lt;br /&gt;
Process Creation                                126.0       5261.0    417.5&lt;br /&gt;
Shell Scripts (1 concurrent)                     42.4       2384.2    562.3&lt;br /&gt;
Shell Scripts (8 concurrent)                      6.0        426.0    709.9&lt;br /&gt;
System Call Overhead                          15000.0    1497371.3    998.2&lt;br /&gt;
                                                                   ========&lt;br /&gt;
System Benchmarks Index Score                                         708.7&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The following benchmark was done on the original linux kernel that the box came with.&lt;br /&gt;
{{Benchmark&lt;br /&gt;
 | hardware =   APM X-Gene&lt;br /&gt;
 | cpu =        APM SOC&lt;br /&gt;
 | memory =     16 GB DDR3 EEC&lt;br /&gt;
 | disk =       1x500 GB SATA &lt;br /&gt;
 | os =         Fedora 22 aarch64&lt;br /&gt;
 | type =       server&lt;br /&gt;
 | score =      926.9 / 3402.7&lt;br /&gt;
 | raw = &lt;br /&gt;
========================================================================&lt;br /&gt;
   BYTE UNIX Benchmarks (Version 5.1.3)&lt;br /&gt;
&lt;br /&gt;
   System: csa.cpsc.ucalgary.ca: GNU/Linux&lt;br /&gt;
   OS: GNU/Linux -- 3.12.0-mustang_sw_1.12.09-beta -- #1 SMP Thu Jun 12 10:27:15 PDT 2014&lt;br /&gt;
   Machine: aarch64 (aarch64)&lt;br /&gt;
   Language: en_US.utf8 (charmap=&amp;quot;UTF-8&amp;quot;, collate=&amp;quot;UTF-8&amp;quot;)&lt;br /&gt;
   CPU 0: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 1: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 2: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 3: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 4: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 5: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 6: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   CPU 7: APM X-Gene Mustang board @ 2.40GHz (0.0 bogomips)&lt;br /&gt;
          &lt;br /&gt;
   17:28:54 up 27 min,  3 users,  load average: 1.39, 0.87, 0.61; runlevel 3&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
Benchmark Run: Fri Jun 26 2015 17:28:54 - 17:56:56&lt;br /&gt;
8 CPUs in system; running 1 parallel copy of tests&lt;br /&gt;
&lt;br /&gt;
Dhrystone 2 using register variables       17763947.5 lps   (10.0 s, 7 samples)&lt;br /&gt;
Double-Precision Whetstone                     2114.7 MWIPS (9.6 s, 7 samples)&lt;br /&gt;
Execl Throughput                               2459.8 lps   (29.9 s, 2 samples)&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks        468331.1 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks          130247.8 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks       1151363.8 KBps  (30.0 s, 2 samples)&lt;br /&gt;
Pipe Throughput                             1067484.4 lps   (10.0 s, 7 samples)&lt;br /&gt;
Pipe-based Context Switching                 192167.1 lps   (10.0 s, 7 samples)&lt;br /&gt;
Process Creation                               7660.0 lps   (30.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (1 concurrent)                   4207.7 lpm   (60.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (8 concurrent)                   1634.0 lpm   (60.0 s, 2 samples)&lt;br /&gt;
System Call Overhead                        1438914.1 lps   (10.0 s, 7 samples)&lt;br /&gt;
&lt;br /&gt;
System Benchmarks Index Values               BASELINE       RESULT    INDEX&lt;br /&gt;
Dhrystone 2 using register variables         116700.0   17763947.5   1522.2&lt;br /&gt;
Double-Precision Whetstone                       55.0       2114.7    384.5&lt;br /&gt;
Execl Throughput                                 43.0       2459.8    572.0&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks          3960.0     468331.1   1182.7&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks            1655.0     130247.8    787.0&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks          5800.0    1151363.8   1985.1&lt;br /&gt;
Pipe Throughput                               12440.0    1067484.4    858.1&lt;br /&gt;
Pipe-based Context Switching                   4000.0     192167.1    480.4&lt;br /&gt;
Process Creation                                126.0       7660.0    607.9&lt;br /&gt;
Shell Scripts (1 concurrent)                     42.4       4207.7    992.4&lt;br /&gt;
Shell Scripts (8 concurrent)                      6.0       1634.0   2723.3&lt;br /&gt;
System Call Overhead                          15000.0    1438914.1    959.3&lt;br /&gt;
                                                                   ========&lt;br /&gt;
System Benchmarks Index Score                                         926.9&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
Benchmark Run: Fri Jun 26 2015 17:56:56 - 18:25:05&lt;br /&gt;
8 CPUs in system; running 8 parallel copies of tests&lt;br /&gt;
&lt;br /&gt;
Dhrystone 2 using register variables      141540380.6 lps   (10.0 s, 7 samples)&lt;br /&gt;
Double-Precision Whetstone                    16919.0 MWIPS (9.6 s, 7 samples)&lt;br /&gt;
Execl Throughput                              13012.0 lps   (29.8 s, 2 samples)&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks        579580.8 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks          155434.8 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks       1673229.9 KBps  (30.0 s, 2 samples)&lt;br /&gt;
Pipe Throughput                             8441190.9 lps   (10.0 s, 7 samples)&lt;br /&gt;
Pipe-based Context Switching                1463165.9 lps   (10.0 s, 7 samples)&lt;br /&gt;
Process Creation                              32854.4 lps   (30.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (1 concurrent)                  16740.8 lpm   (60.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (8 concurrent)                   2477.4 lpm   (60.1 s, 2 samples)&lt;br /&gt;
System Call Overhead                        7650246.7 lps   (10.0 s, 7 samples)&lt;br /&gt;
&lt;br /&gt;
System Benchmarks Index Values               BASELINE       RESULT    INDEX&lt;br /&gt;
Dhrystone 2 using register variables         116700.0  141540380.6  12128.6&lt;br /&gt;
Double-Precision Whetstone                       55.0      16919.0   3076.2&lt;br /&gt;
Execl Throughput                                 43.0      13012.0   3026.1&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks          3960.0     579580.8   1463.6&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks            1655.0     155434.8    939.2&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks          5800.0    1673229.9   2884.9&lt;br /&gt;
Pipe Throughput                               12440.0    8441190.9   6785.5&lt;br /&gt;
Pipe-based Context Switching                   4000.0    1463165.9   3657.9&lt;br /&gt;
Process Creation                                126.0      32854.4   2607.5&lt;br /&gt;
Shell Scripts (1 concurrent)                     42.4      16740.8   3948.3&lt;br /&gt;
Shell Scripts (8 concurrent)                      6.0       2477.4   4128.9&lt;br /&gt;
System Call Overhead                          15000.0    7650246.7   5100.2&lt;br /&gt;
                                                                   ========&lt;br /&gt;
System Benchmarks Index Score                                        3402.7&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other Information ==&lt;br /&gt;
This test was done only one one CPU.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[root@localhost UnixBench]# free -m&lt;br /&gt;
              total        used        free      shared  buff/cache   available&lt;br /&gt;
Mem:          16257         180       15195           4         881       15951&lt;br /&gt;
Swap:          8191           0        8191&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Benchmark_for_APM_X-Gene&amp;diff=1188</id>
		<title>Benchmark for APM X-Gene</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Benchmark_for_APM_X-Gene&amp;diff=1188"/>
		<updated>2015-06-18T23:31:00Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: Created page with &amp;quot;{{Benchmark  | hardware =   APM X-Gene  | cpu =        APM SOC  | memory =     16 GB DDR3 EEC  | disk =       1x500 GB SATA   | os =         Fedora 22 aarch64  | type =...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Benchmark&lt;br /&gt;
 | hardware =   APM X-Gene&lt;br /&gt;
 | cpu =        APM SOC&lt;br /&gt;
 | memory =     16 GB DDR3 EEC&lt;br /&gt;
 | disk =       1x500 GB SATA &lt;br /&gt;
 | os =         Fedora 22 aarch64&lt;br /&gt;
 | type =       server&lt;br /&gt;
 | score =      708.7&lt;br /&gt;
 | raw = &lt;br /&gt;
========================================================================&lt;br /&gt;
   BYTE UNIX Benchmarks (Version 5.1.3)&lt;br /&gt;
&lt;br /&gt;
   System: localhost.localdomain: GNU/Linux&lt;br /&gt;
   OS: GNU/Linux -- 4.0.4-303.fc22.aarch64 -- #1 SMP Mon Jun 1 13:16:58 UTC 2015&lt;br /&gt;
   Machine: aarch64 (aarch64)&lt;br /&gt;
   Language: en_US.utf8 (charmap=&amp;quot;UTF-8&amp;quot;, collate=&amp;quot;UTF-8&amp;quot;)&lt;br /&gt;
   16:59:07 up 16 min,  2 users,  load average: 0.09, 0.09, 0.07; runlevel 3&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------&lt;br /&gt;
Benchmark Run: Thu Jun 18 2015 16:59:07 - 17:27:03&lt;br /&gt;
0 CPUs in system; running 1 parallel copy of tests&lt;br /&gt;
&lt;br /&gt;
Dhrystone 2 using register variables       17729811.6 lps   (10.0 s, 7 samples)&lt;br /&gt;
Double-Precision Whetstone                     2115.3 MWIPS (9.6 s, 7 samples)&lt;br /&gt;
Execl Throughput                               2416.0 lps   (29.9 s, 2 samples)&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks        394596.4 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks          109161.3 KBps  (30.0 s, 2 samples)&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks       1069966.8 KBps  (30.0 s, 2 samples)&lt;br /&gt;
Pipe Throughput                              792063.6 lps   (10.0 s, 7 samples)&lt;br /&gt;
Pipe-based Context Switching                 152173.7 lps   (10.0 s, 7 samples)&lt;br /&gt;
Process Creation                               5261.0 lps   (30.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (1 concurrent)                   2384.2 lpm   (60.0 s, 2 samples)&lt;br /&gt;
Shell Scripts (8 concurrent)                    426.0 lpm   (60.1 s, 2 samples)&lt;br /&gt;
System Call Overhead                        1497371.3 lps   (10.0 s, 7 samples)&lt;br /&gt;
&lt;br /&gt;
System Benchmarks Index Values               BASELINE       RESULT    INDEX&lt;br /&gt;
Dhrystone 2 using register variables         116700.0   17729811.6   1519.3&lt;br /&gt;
Double-Precision Whetstone                       55.0       2115.3    384.6&lt;br /&gt;
Execl Throughput                                 43.0       2416.0    561.9&lt;br /&gt;
File Copy 1024 bufsize 2000 maxblocks          3960.0     394596.4    996.5&lt;br /&gt;
File Copy 256 bufsize 500 maxblocks            1655.0     109161.3    659.6&lt;br /&gt;
File Copy 4096 bufsize 8000 maxblocks          5800.0    1069966.8   1844.8&lt;br /&gt;
Pipe Throughput                               12440.0     792063.6    636.7&lt;br /&gt;
Pipe-based Context Switching                   4000.0     152173.7    380.4&lt;br /&gt;
Process Creation                                126.0       5261.0    417.5&lt;br /&gt;
Shell Scripts (1 concurrent)                     42.4       2384.2    562.3&lt;br /&gt;
Shell Scripts (8 concurrent)                      6.0        426.0    709.9&lt;br /&gt;
System Call Overhead                          15000.0    1497371.3    998.2&lt;br /&gt;
                                                                   ========&lt;br /&gt;
System Benchmarks Index Score                                         708.7&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[root@localhost UnixBench]# free -m&lt;br /&gt;
              total        used        free      shared  buff/cache   available&lt;br /&gt;
Mem:          16257         180       15195           4         881       15951&lt;br /&gt;
Swap:          8191           0        8191&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=APM_X-C1_(Mustang)&amp;diff=1187</id>
		<title>APM X-C1 (Mustang)</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=APM_X-C1_(Mustang)&amp;diff=1187"/>
		<updated>2015-06-18T20:58:17Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Updating UEFI from U-Boot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
U-Boot 2013.04-mustang_sw_1.12.09-beta (Jun 12 2014 - 10:48:45)&lt;br /&gt;
&lt;br /&gt;
CPU0: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Boot from SPI-NOR&lt;br /&gt;
Board: Mustang - AppliedMicro APM883208-xNA24SPT Reference Board&lt;br /&gt;
I2C:   ready&lt;br /&gt;
DRAM:  ECC 16 GiB @ 1600MHz&lt;br /&gt;
SF: Detected N25Q256 with page size 256 Bytes, total 32 MiB&lt;br /&gt;
MMC:   X-Gene SD/SDIO/eMMC: 0&lt;br /&gt;
PCIE0: (RC) link down&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
CPUs:  11111111&lt;br /&gt;
Net:   eth0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mustang# printenv&lt;br /&gt;
addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off panic=1&lt;br /&gt;
addmisc=setenv bootargs ${bootargs} earlyprintk=uart8250-32bit,0x1c020000 debug maxcpus=${num_cores} swiotlb=65536&lt;br /&gt;
addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}&lt;br /&gt;
baudrate=115200&lt;br /&gt;
bootcmd=run sata_self&lt;br /&gt;
bootdelay=5&lt;br /&gt;
bootfile=uImage&lt;br /&gt;
dnsip=10.66.18.10&lt;br /&gt;
enet=8&lt;br /&gt;
enet_mode=x:n&lt;br /&gt;
eth1addr=00:01:73:02:21:35&lt;br /&gt;
eth2addr=00:01:73:02:21:36&lt;br /&gt;
eth3addr=00:01:73:02:21:37&lt;br /&gt;
ethact=eth0&lt;br /&gt;
ethaddr=00:01:73:02:21:34&lt;br /&gt;
fdt_addr_f=0x1000000&lt;br /&gt;
fdt_addr_r=0x4003000000&lt;br /&gt;
fdt_file=apm-mustang.dtb&lt;br /&gt;
fdt_size=7285&lt;br /&gt;
flash_nfs=run nfsargs addip addtty addmisc; bootm ${kern_addr_f}&lt;br /&gt;
flash_self=run ramargs addip addtty addmisc; bootm ${kern_addr_f} ${ramdisk_addr_f} ${fdt_addr_f}&lt;br /&gt;
fw_addr_r=0x4003800000&lt;br /&gt;
gatewayip=10.66.19.1&lt;br /&gt;
hostname=dhcp-10-66-19-173&lt;br /&gt;
initrd_high=0x43e0000000&lt;br /&gt;
ipaddr=10.66.19.173&lt;br /&gt;
kern_addr_f=0x100000&lt;br /&gt;
kern_addr_r=0x4002000000&lt;br /&gt;
kern_size=a9a050&lt;br /&gt;
kernel_addr_r=0x4002000000&lt;br /&gt;
load=tftp ${uboot_addr_r} ${user_dir}/${u-boot}&lt;br /&gt;
load_fdt=tftp ${fdt_addr_r} ${user_dir}/${fdt_file}&lt;br /&gt;
load_kern=tftp ${kern_addr_r} ${user_dir}/${bootfile}&lt;br /&gt;
load_ramdisk=tftp ${ramdisk_addr_r} ${user_dir}/${ramdisk_file}&lt;br /&gt;
loadaddr=0x100000000&lt;br /&gt;
media_addr_r=0x4001000000&lt;br /&gt;
media_img=mustang_media.img&lt;br /&gt;
mgmt_enet=e&lt;br /&gt;
mslim_bootfile=uImage-mslim&lt;br /&gt;
mslim_fdt_addr_r=0x43f0600000&lt;br /&gt;
mslim_fdt_file=mslim-mustang.dtb&lt;br /&gt;
mslim_kern_addr_r=0x43f1000000&lt;br /&gt;
mslim_net_self=run net_load_mslim; startmslim&lt;br /&gt;
mslim_ramdisk_addr_r=0x43f2000000&lt;br /&gt;
mslim_ramdisk_file=uRamdisk-mslim&lt;br /&gt;
mslim_sd_self=run sd_load_mslim; startmslim&lt;br /&gt;
mslim_uboot_addr_r=0x43f0000000&lt;br /&gt;
mslim_uboot_file=u-boot-mslim.bin&lt;br /&gt;
mslim_user_dir=mslim&lt;br /&gt;
net_load_mslim=run nload_mslim_uboot nload_mslim_kern nload_mslim_ramdisk nload_mslim_fdt&lt;br /&gt;
net_nfs=run load_kern load_fdt; run nfsargs addip addtty addmisc; bootm ${kern_addr_r} - ${fdt_addr_r}&lt;br /&gt;
net_sata=run load_kern load_fdt; run sataargs addip addtty addmisc; bootm ${kern_addr_r} - ${fdt_addr_r}&lt;br /&gt;
net_self=run net_self_load; run ramargs addip addtty addmisc; bootm ${kern_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}&lt;br /&gt;
net_self_load=run load_kern load_ramdisk load_fdt&lt;br /&gt;
netdev=eth0&lt;br /&gt;
netmask=255.255.255.0&lt;br /&gt;
nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}&lt;br /&gt;
nload_mslim_fdt=tftp ${mslim_fdt_addr_r} ${mslim_user_dir}/${mslim_fdt_file}&lt;br /&gt;
nload_mslim_kern=tftp ${mslim_kern_addr_r} ${mslim_user_dir}/${mslim_bootfile}&lt;br /&gt;
nload_mslim_ramdisk=tftp ${mslim_ramdisk_addr_r} ${mslim_user_dir}/${mslim_ramdisk_file}&lt;br /&gt;
nload_mslim_uboot=tftp ${mslim_uboot_addr_r} ${mslim_user_dir}/${mslim_uboot_file}&lt;br /&gt;
num_cores=8&lt;br /&gt;
pcie_gen=3:3:3:3:3&lt;br /&gt;
pcie_mode=RP:NA:NA:NA:NA&lt;br /&gt;
pcie_reset=y:n:n:n:n&lt;br /&gt;
pxefile_addr_r=0x4001000000&lt;br /&gt;
ram_nfs=run nfsargs addip addtty addmisc; bootm ${kern_addr_r} - ${fdt_addr_r}&lt;br /&gt;
ram_self=run ramargs addip addtty addmisc; bootm ${kern_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}&lt;br /&gt;
ramargs=setenv bootargs root=/dev/ram rw&lt;br /&gt;
ramdisk_addr_f=0x1100000&lt;br /&gt;
ramdisk_addr_r=0x4004000000&lt;br /&gt;
ramdisk_file=uRamdisk_basic&lt;br /&gt;
ramdisk_size=344abe&lt;br /&gt;
rgmii_phyid=3&lt;br /&gt;
rootpath=/opt/nfsrootfs/arm64/release&lt;br /&gt;
sata=0x3c&lt;br /&gt;
sata_enet=e:e:n:n&lt;br /&gt;
sata_load_fdt=ext4load scsi 0:1 0x4003000000 apm-mustang.dtb&lt;br /&gt;
sata_load_kern=ext4load scsi 0:1 0x4002000000 uImage&lt;br /&gt;
sata_self=scsi init; run sata_load_kern sata_load_fdt; run sataargs addip addtty addmisc; bootm 0x4002000000 - 0x4003000000&lt;br /&gt;
sataargs=setenv bootargs root=/dev/sda1 rw&lt;br /&gt;
script_addr_r=0x4004000000&lt;br /&gt;
sd_load_mslim=mmc dev 0; run sdload_mslim_uboot sdload_mslim_kern sdload_mslim_ramdisk sdload_mslim_fdt&lt;br /&gt;
sd_self=mmc dev 0; ext2load mmc 0  ${kern_addr_r} ${bootfile}; ext2load mmc 0  ${fdt_addr_r} ${fdt_file}; ext2load mmc 0  ${ramdisk_addr_r} ${ramdisk_file}; run ram_self&lt;br /&gt;
sdload_mslim_fdt=ext2load mmc 0 ${mslim_fdt_addr_r} ${mslim_fdt_file}&lt;br /&gt;
sdload_mslim_kern=ext2load mmc 0 ${mslim_kern_addr_r} ${mslim_bootfile}&lt;br /&gt;
sdload_mslim_ramdisk=ext2load mmc 0 ${mslim_ramdisk_addr_r} ${mslim_ramdisk_file}&lt;br /&gt;
sdload_mslim_uboot=ext2load mmc 0 ${mslim_uboot_addr_r} ${mslim_uboot_file}&lt;br /&gt;
sdphy=1&lt;br /&gt;
serverip=10.66.19.133&lt;br /&gt;
sgmii_phyid=4:5::&lt;br /&gt;
spi_fdt_upd=run load_fdt; setenv fdt_size ${filesize}; save; run update_fdt&lt;br /&gt;
spi_fw_img=mustang_slimpro_ext_spi.bin&lt;br /&gt;
spi_fw_load=tftp ${fw_addr_r} ${user_dir}/${spi_fw_img}&lt;br /&gt;
spi_fw_upd=run spi_fw_load;run spi_fw_update&lt;br /&gt;
spi_fw_update=bmc stop; i2c dev 1; eeprom write ${fw_addr_r} 0x0 ${filesize}&lt;br /&gt;
spi_kern_upd=run load_kern; setenv kern_size ${filesize}; save; run update_kern&lt;br /&gt;
spi_load=tftp ${media_addr_r} ${user_dir}/${media_img}&lt;br /&gt;
spi_ramdisk_upd=run load_ramdisk; setenv ramdisk_size ${filesize}; save; run update_ramdisk&lt;br /&gt;
spi_self=sf probe 0; sf read ${kern_addr_r} ${kern_addr_f} ${kern_size}; sf read ${fdt_addr_r} ${fdt_addr_f} ${fdt_size}; sf read ${ramdisk_addr_r} ${ramdisk_addr_f} ${ramdisk_size}; run ram_self&lt;br /&gt;
spi_upd=run spi_load;run spi_update&lt;br /&gt;
spi_update=sf probe 0; sf erase 0x0 ${filesize}; sf write ${media_addr_r} 0x0 ${filesize}&lt;br /&gt;
stderr=serial&lt;br /&gt;
stdin=serial&lt;br /&gt;
stdout=serial&lt;br /&gt;
u-boot=u-boot.bin&lt;br /&gt;
uboot_addr_f=0x8100000000&lt;br /&gt;
uboot_addr_r=0x4001000000&lt;br /&gt;
uboot_size=0x80000&lt;br /&gt;
upd=run load; setenv uboot_size ${filesize};run update&lt;br /&gt;
updall=run spi_kern_upd; run spi_ramdisk_upd; run spi_fdt_upd&lt;br /&gt;
update=protect off ${uboot_addr_f} +${uboot_size}; erase ${uboot_addr_f} +${uboot_size}; cp.b ${uboot_addr_r} ${uboot_addr_f} ${uboot_size}&lt;br /&gt;
update_fdt=sf probe 0; sf erase ${fdt_addr_f} ${filesize}; sf write ${fdt_addr_r} ${fdt_addr_f} ${filesize}&lt;br /&gt;
update_kern=sf probe 0; sf erase ${kern_addr_f} ${filesize}; sf write ${kern_addr_r} ${kern_addr_f} ${filesize}&lt;br /&gt;
update_ramdisk=sf probe 0; sf erase ${ramdisk_addr_f} ${filesize}; sf write ${ramdisk_addr_r} ${ramdisk_addr_f} ${filesize}&lt;br /&gt;
user_dir=/1.12.09-Beta/BUILDS/potenza&lt;br /&gt;
xgmii_phyid=:&lt;br /&gt;
&lt;br /&gt;
Environment size: 5832/32764 bytes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     POWERED BY:&lt;br /&gt;
&lt;br /&gt;
     X     X             GGGG&lt;br /&gt;
      X   X             G    G&lt;br /&gt;
       X X             G         EEEEE   N NNNN    EEEEE&lt;br /&gt;
        X     #######  G   GGG  E     E  NN    N  E     E&lt;br /&gt;
       X X             G     G  EEEEEEE  N     N  EEEEEEE&lt;br /&gt;
      X   X             G    G  E        N     N  E&lt;br /&gt;
     X     X             GGGGG   EEEEE   N     N   EEEEE   (TM)&lt;br /&gt;
&lt;br /&gt;
     Welcome to Applied Micro X-Gene 64-bit ARM Server Platform&lt;br /&gt;
&lt;br /&gt;
Applied Micro Linux 3.12.0-mustang_sw_1.12.09-beta (aarch64) (ttyS0)&lt;br /&gt;
dhcp-10-66-19-173 login: root&lt;br /&gt;
Password:&lt;br /&gt;
[root@dhcp-10-66-19-173 ~]# cat /proc/cpuinfo&lt;br /&gt;
Processor       : AArch64 Processor rev 0 (aarch64)&lt;br /&gt;
processor       : 0&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 1&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 2&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 3&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 4&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 5&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 6&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 7&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
Features        : fp asimd&lt;br /&gt;
CPU implementer : 0x50&lt;br /&gt;
CPU architecture: AArch64&lt;br /&gt;
CPU variant     : 0x0&lt;br /&gt;
CPU part        : 0x000&lt;br /&gt;
CPU revision    : 0&lt;br /&gt;
&lt;br /&gt;
Hardware        : APM X-Gene Mustang board&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating UEFI from U-Boot ==&lt;br /&gt;
https://fedoraproject.org/wiki/Architectures/AArch64/Hardware/Mustang?rd=Architectures/ARM/AArch64/Mustang&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
U-Boot 2013.04-mustang_sw_1.12.09-beta (Jun 12 2014 - 10:48:45)&lt;br /&gt;
&lt;br /&gt;
CPU0: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Boot from SPI-NOR&lt;br /&gt;
Board: Mustang - AppliedMicro APM883208-xNA24SPT Reference Board&lt;br /&gt;
I2C:   ready&lt;br /&gt;
DRAM:  ECC 16 GiB @ 1600MHz&lt;br /&gt;
SF: Detected N25Q256 with page size 256 Bytes, total 32 MiB&lt;br /&gt;
MMC:   X-Gene SD/SDIO/eMMC: 0&lt;br /&gt;
PCIE0: (RC) link down&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
CPUs:  11111111&lt;br /&gt;
Net:   eth0&lt;br /&gt;
Hit any key to stop autoboot:  0&lt;br /&gt;
Mustang#&lt;br /&gt;
Mustang#&lt;br /&gt;
Mustang#&lt;br /&gt;
Mustang#&lt;br /&gt;
Mustang#&lt;br /&gt;
Mustang# setenv rh_sd_tiano_sec_ubt fatload mmc 0:1 0x1d000000 /mustang/mustang_tianocore_sec_ubt.fd&lt;br /&gt;
Mustang# setenv rh_sd_tiano_ubt fatload mmc 0:1 0x4002000000 /mustang/mustang_tianocore_ubt.fd&lt;br /&gt;
Mustang# setenv rh_run_tiano_ubt go 0x1d000000&lt;br /&gt;
Mustang# setenv bootcmd run rh_sd_tiano_ubt rh_sd_tiano_sec_ubt rh_run_tiano_ubt&lt;br /&gt;
Mustang# saveenv&lt;br /&gt;
Saving Environment to SPI Flash...&lt;br /&gt;
SF: Detected N25Q256 with page size 256 Bytes, total 32 MiB&lt;br /&gt;
.Erasing SPI flash.....SF: STMicro: Successfully erased 262144 bytes @ 0xc0000&lt;br /&gt;
Writing to SPI flash.......done&lt;br /&gt;
Mustang# reset&lt;br /&gt;
resetting ...&lt;br /&gt;
cold reset ...▒&lt;br /&gt;
&lt;br /&gt;
U-Boot 2013.04-mustang_sw_1.12.09-beta (Jun 12 2014 - 10:48:45)&lt;br /&gt;
&lt;br /&gt;
CPU0: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Boot from SPI-NOR&lt;br /&gt;
Board: Mustang - AppliedMicro APM883208-xNA24SPT Reference Board&lt;br /&gt;
I2C:   ready&lt;br /&gt;
DRAM:  ECC 16 GiB @ 1600MHz&lt;br /&gt;
SF: Detected N25Q256 with page size 256 Bytes, total 32 MiB&lt;br /&gt;
MMC:   X-Gene SD/SDIO/eMMC: 0&lt;br /&gt;
PCIE0: (RC) link down&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
CPUs:  11111111&lt;br /&gt;
Net:   eth0&lt;br /&gt;
Hit any key to stop autoboot:  0&lt;br /&gt;
Mustang# printenv bootcmd&lt;br /&gt;
bootcmd=run rh_sd_tiano_ubt rh_sd_tiano_sec_ubt rh_run_tiano_ubt&lt;br /&gt;
Mustang# printenv rh_&lt;br /&gt;
## Error: &amp;quot;rh_&amp;quot; not defined&lt;br /&gt;
Mustang# printenv rh_sd_tiano_ubt&lt;br /&gt;
rh_sd_tiano_ubt=fatload mmc 0:1 0x4002000000 /mustang/mustang_tianocore_ubt.fd&lt;br /&gt;
Mustang# reset&lt;br /&gt;
resetting ...&lt;br /&gt;
cold reset ...▒&lt;br /&gt;
&lt;br /&gt;
U-Boot 2013.04-mustang_sw_1.12.09-beta (Jun 12 2014 - 10:48:45)&lt;br /&gt;
&lt;br /&gt;
CPU0: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Boot from SPI-NOR&lt;br /&gt;
Board: Mustang - AppliedMicro APM883208-xNA24SPT Reference Board&lt;br /&gt;
I2C:   ready&lt;br /&gt;
DRAM:  ECC 16 GiB @ 1600MHz&lt;br /&gt;
SF: Detected N25Q256 with page size 256 Bytes, total 32 MiB&lt;br /&gt;
MMC:   X-Gene SD/SDIO/eMMC: 0&lt;br /&gt;
PCIE0: (RC) link down&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
CPUs:  11111111&lt;br /&gt;
Net:   eth0&lt;br /&gt;
Hit any key to stop autoboot:  0&lt;br /&gt;
Mustang# run rh_sd_tiano_ubt rh_sd_tiano_sec_ubt rh_run_tiano_ubt&lt;br /&gt;
reading /mustang/mustang_tianocore_ubt.fd&lt;br /&gt;
1835008 bytes read in 1426 ms (1.2 MiB/s)&lt;br /&gt;
reading /mustang/mustang_tianocore_sec_ubt.fd&lt;br /&gt;
262144 bytes read in 1295 ms (197.3 KiB/s)&lt;br /&gt;
## Starting application at 0x1D000000 ...&lt;br /&gt;
X-Gene Mustang Board&lt;br /&gt;
Boot firmware (version 1.1.0 built at 12:03:43 on Mar 23 2015)&lt;br /&gt;
PROGRESS CODE: V3020003 I0&lt;br /&gt;
PROGRESS CODE: V3020002 I0&lt;br /&gt;
PROGRESS CODE: V3020003 I0&lt;br /&gt;
PROGRESS CODE: V3020002 I0&lt;br /&gt;
PROGRESS CODE: V3020003 I0&lt;br /&gt;
PROGRESS CODE: V3020002 I0&lt;br /&gt;
PROGRESS CODE: V3020003 I0&lt;br /&gt;
PROGRESS CODE: V3021001 I0&lt;br /&gt;
TianoCore 1.1.0 UEFI 2.4.0 Mar 23 2015 12:03:18&lt;br /&gt;
CPU: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Board: X-Gene Mustang Board&lt;br /&gt;
Slimpro FW:&lt;br /&gt;
        Ver: 2.1&lt;br /&gt;
The default boot selection will start in   1 second&lt;br /&gt;
Attempting PXE boot on MAC: 00:11:22:33:44:55&lt;br /&gt;
..Attempting PXE boot on MAC: 00:11:22:33:44:55&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
TianoCore 1.1.0 UEFI 2.4.0 Mar 23 2015 12:03:18&lt;br /&gt;
CPU: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Board: X-Gene Mustang Board&lt;br /&gt;
Slimpro FW:&lt;br /&gt;
        Ver: 2.1&lt;br /&gt;
The default boot selection will start in   4 seconds&lt;br /&gt;
[1] Shell&lt;br /&gt;
[2] Boot Manager&lt;br /&gt;
[3] Reboot&lt;br /&gt;
[4] Shutdown&lt;br /&gt;
Start: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Hit 1 for the shell&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
UEFI Interactive Shell v2.0&lt;br /&gt;
EDK II&lt;br /&gt;
UEFI v2.40 (X-Gene Mustang Board EFI Mar 23 2015 12:04:07, 0x00000000)&lt;br /&gt;
Mapping table&lt;br /&gt;
      FS0: Alias(s):HD13b:;BLK5:&lt;br /&gt;
          VenHw(B225ED30-6DFD-43A9-BF6B-5753358F2F70)/HD(1,MBR,0x000F06A6,0x800,0x400000)&lt;br /&gt;
     BLK3: Alias(s):&lt;br /&gt;
          VenHw(6C9CEEF0-A406-11E3-A5E2-0800200C9A66)&lt;br /&gt;
     BLK2: Alias(s):&lt;br /&gt;
          VenHw(02118005-9DA7-443A-92D5-781F022AEDBB)&lt;br /&gt;
     BLK6: Alias(s):&lt;br /&gt;
          VenHw(F40A3869-92C4-4275-8501-4491A1A20C19)&lt;br /&gt;
     BLK4: Alias(s):&lt;br /&gt;
          VenHw(B225ED30-6DFD-43A9-BF6B-5753358F2F70)&lt;br /&gt;
     BLK0: Alias(s):&lt;br /&gt;
          PciRoot(0x6)/Pci(0x0,0x0)/Sata(0x0,0x0,0x0)&lt;br /&gt;
     BLK1: Alias(s):&lt;br /&gt;
          PciRoot(0x6)/Pci(0x0,0x0)/Sata(0x0,0x0,0x0)/HD(1,MBR,0xC63EB28B,0x800,0x3A385830)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=APM_X-C1_(Mustang)&amp;diff=1186</id>
		<title>APM X-C1 (Mustang)</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=APM_X-C1_(Mustang)&amp;diff=1186"/>
		<updated>2015-06-18T20:16:18Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
U-Boot 2013.04-mustang_sw_1.12.09-beta (Jun 12 2014 - 10:48:45)&lt;br /&gt;
&lt;br /&gt;
CPU0: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Boot from SPI-NOR&lt;br /&gt;
Board: Mustang - AppliedMicro APM883208-xNA24SPT Reference Board&lt;br /&gt;
I2C:   ready&lt;br /&gt;
DRAM:  ECC 16 GiB @ 1600MHz&lt;br /&gt;
SF: Detected N25Q256 with page size 256 Bytes, total 32 MiB&lt;br /&gt;
MMC:   X-Gene SD/SDIO/eMMC: 0&lt;br /&gt;
PCIE0: (RC) link down&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
CPUs:  11111111&lt;br /&gt;
Net:   eth0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mustang# printenv&lt;br /&gt;
addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off panic=1&lt;br /&gt;
addmisc=setenv bootargs ${bootargs} earlyprintk=uart8250-32bit,0x1c020000 debug maxcpus=${num_cores} swiotlb=65536&lt;br /&gt;
addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}&lt;br /&gt;
baudrate=115200&lt;br /&gt;
bootcmd=run sata_self&lt;br /&gt;
bootdelay=5&lt;br /&gt;
bootfile=uImage&lt;br /&gt;
dnsip=10.66.18.10&lt;br /&gt;
enet=8&lt;br /&gt;
enet_mode=x:n&lt;br /&gt;
eth1addr=00:01:73:02:21:35&lt;br /&gt;
eth2addr=00:01:73:02:21:36&lt;br /&gt;
eth3addr=00:01:73:02:21:37&lt;br /&gt;
ethact=eth0&lt;br /&gt;
ethaddr=00:01:73:02:21:34&lt;br /&gt;
fdt_addr_f=0x1000000&lt;br /&gt;
fdt_addr_r=0x4003000000&lt;br /&gt;
fdt_file=apm-mustang.dtb&lt;br /&gt;
fdt_size=7285&lt;br /&gt;
flash_nfs=run nfsargs addip addtty addmisc; bootm ${kern_addr_f}&lt;br /&gt;
flash_self=run ramargs addip addtty addmisc; bootm ${kern_addr_f} ${ramdisk_addr_f} ${fdt_addr_f}&lt;br /&gt;
fw_addr_r=0x4003800000&lt;br /&gt;
gatewayip=10.66.19.1&lt;br /&gt;
hostname=dhcp-10-66-19-173&lt;br /&gt;
initrd_high=0x43e0000000&lt;br /&gt;
ipaddr=10.66.19.173&lt;br /&gt;
kern_addr_f=0x100000&lt;br /&gt;
kern_addr_r=0x4002000000&lt;br /&gt;
kern_size=a9a050&lt;br /&gt;
kernel_addr_r=0x4002000000&lt;br /&gt;
load=tftp ${uboot_addr_r} ${user_dir}/${u-boot}&lt;br /&gt;
load_fdt=tftp ${fdt_addr_r} ${user_dir}/${fdt_file}&lt;br /&gt;
load_kern=tftp ${kern_addr_r} ${user_dir}/${bootfile}&lt;br /&gt;
load_ramdisk=tftp ${ramdisk_addr_r} ${user_dir}/${ramdisk_file}&lt;br /&gt;
loadaddr=0x100000000&lt;br /&gt;
media_addr_r=0x4001000000&lt;br /&gt;
media_img=mustang_media.img&lt;br /&gt;
mgmt_enet=e&lt;br /&gt;
mslim_bootfile=uImage-mslim&lt;br /&gt;
mslim_fdt_addr_r=0x43f0600000&lt;br /&gt;
mslim_fdt_file=mslim-mustang.dtb&lt;br /&gt;
mslim_kern_addr_r=0x43f1000000&lt;br /&gt;
mslim_net_self=run net_load_mslim; startmslim&lt;br /&gt;
mslim_ramdisk_addr_r=0x43f2000000&lt;br /&gt;
mslim_ramdisk_file=uRamdisk-mslim&lt;br /&gt;
mslim_sd_self=run sd_load_mslim; startmslim&lt;br /&gt;
mslim_uboot_addr_r=0x43f0000000&lt;br /&gt;
mslim_uboot_file=u-boot-mslim.bin&lt;br /&gt;
mslim_user_dir=mslim&lt;br /&gt;
net_load_mslim=run nload_mslim_uboot nload_mslim_kern nload_mslim_ramdisk nload_mslim_fdt&lt;br /&gt;
net_nfs=run load_kern load_fdt; run nfsargs addip addtty addmisc; bootm ${kern_addr_r} - ${fdt_addr_r}&lt;br /&gt;
net_sata=run load_kern load_fdt; run sataargs addip addtty addmisc; bootm ${kern_addr_r} - ${fdt_addr_r}&lt;br /&gt;
net_self=run net_self_load; run ramargs addip addtty addmisc; bootm ${kern_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}&lt;br /&gt;
net_self_load=run load_kern load_ramdisk load_fdt&lt;br /&gt;
netdev=eth0&lt;br /&gt;
netmask=255.255.255.0&lt;br /&gt;
nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}&lt;br /&gt;
nload_mslim_fdt=tftp ${mslim_fdt_addr_r} ${mslim_user_dir}/${mslim_fdt_file}&lt;br /&gt;
nload_mslim_kern=tftp ${mslim_kern_addr_r} ${mslim_user_dir}/${mslim_bootfile}&lt;br /&gt;
nload_mslim_ramdisk=tftp ${mslim_ramdisk_addr_r} ${mslim_user_dir}/${mslim_ramdisk_file}&lt;br /&gt;
nload_mslim_uboot=tftp ${mslim_uboot_addr_r} ${mslim_user_dir}/${mslim_uboot_file}&lt;br /&gt;
num_cores=8&lt;br /&gt;
pcie_gen=3:3:3:3:3&lt;br /&gt;
pcie_mode=RP:NA:NA:NA:NA&lt;br /&gt;
pcie_reset=y:n:n:n:n&lt;br /&gt;
pxefile_addr_r=0x4001000000&lt;br /&gt;
ram_nfs=run nfsargs addip addtty addmisc; bootm ${kern_addr_r} - ${fdt_addr_r}&lt;br /&gt;
ram_self=run ramargs addip addtty addmisc; bootm ${kern_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}&lt;br /&gt;
ramargs=setenv bootargs root=/dev/ram rw&lt;br /&gt;
ramdisk_addr_f=0x1100000&lt;br /&gt;
ramdisk_addr_r=0x4004000000&lt;br /&gt;
ramdisk_file=uRamdisk_basic&lt;br /&gt;
ramdisk_size=344abe&lt;br /&gt;
rgmii_phyid=3&lt;br /&gt;
rootpath=/opt/nfsrootfs/arm64/release&lt;br /&gt;
sata=0x3c&lt;br /&gt;
sata_enet=e:e:n:n&lt;br /&gt;
sata_load_fdt=ext4load scsi 0:1 0x4003000000 apm-mustang.dtb&lt;br /&gt;
sata_load_kern=ext4load scsi 0:1 0x4002000000 uImage&lt;br /&gt;
sata_self=scsi init; run sata_load_kern sata_load_fdt; run sataargs addip addtty addmisc; bootm 0x4002000000 - 0x4003000000&lt;br /&gt;
sataargs=setenv bootargs root=/dev/sda1 rw&lt;br /&gt;
script_addr_r=0x4004000000&lt;br /&gt;
sd_load_mslim=mmc dev 0; run sdload_mslim_uboot sdload_mslim_kern sdload_mslim_ramdisk sdload_mslim_fdt&lt;br /&gt;
sd_self=mmc dev 0; ext2load mmc 0  ${kern_addr_r} ${bootfile}; ext2load mmc 0  ${fdt_addr_r} ${fdt_file}; ext2load mmc 0  ${ramdisk_addr_r} ${ramdisk_file}; run ram_self&lt;br /&gt;
sdload_mslim_fdt=ext2load mmc 0 ${mslim_fdt_addr_r} ${mslim_fdt_file}&lt;br /&gt;
sdload_mslim_kern=ext2load mmc 0 ${mslim_kern_addr_r} ${mslim_bootfile}&lt;br /&gt;
sdload_mslim_ramdisk=ext2load mmc 0 ${mslim_ramdisk_addr_r} ${mslim_ramdisk_file}&lt;br /&gt;
sdload_mslim_uboot=ext2load mmc 0 ${mslim_uboot_addr_r} ${mslim_uboot_file}&lt;br /&gt;
sdphy=1&lt;br /&gt;
serverip=10.66.19.133&lt;br /&gt;
sgmii_phyid=4:5::&lt;br /&gt;
spi_fdt_upd=run load_fdt; setenv fdt_size ${filesize}; save; run update_fdt&lt;br /&gt;
spi_fw_img=mustang_slimpro_ext_spi.bin&lt;br /&gt;
spi_fw_load=tftp ${fw_addr_r} ${user_dir}/${spi_fw_img}&lt;br /&gt;
spi_fw_upd=run spi_fw_load;run spi_fw_update&lt;br /&gt;
spi_fw_update=bmc stop; i2c dev 1; eeprom write ${fw_addr_r} 0x0 ${filesize}&lt;br /&gt;
spi_kern_upd=run load_kern; setenv kern_size ${filesize}; save; run update_kern&lt;br /&gt;
spi_load=tftp ${media_addr_r} ${user_dir}/${media_img}&lt;br /&gt;
spi_ramdisk_upd=run load_ramdisk; setenv ramdisk_size ${filesize}; save; run update_ramdisk&lt;br /&gt;
spi_self=sf probe 0; sf read ${kern_addr_r} ${kern_addr_f} ${kern_size}; sf read ${fdt_addr_r} ${fdt_addr_f} ${fdt_size}; sf read ${ramdisk_addr_r} ${ramdisk_addr_f} ${ramdisk_size}; run ram_self&lt;br /&gt;
spi_upd=run spi_load;run spi_update&lt;br /&gt;
spi_update=sf probe 0; sf erase 0x0 ${filesize}; sf write ${media_addr_r} 0x0 ${filesize}&lt;br /&gt;
stderr=serial&lt;br /&gt;
stdin=serial&lt;br /&gt;
stdout=serial&lt;br /&gt;
u-boot=u-boot.bin&lt;br /&gt;
uboot_addr_f=0x8100000000&lt;br /&gt;
uboot_addr_r=0x4001000000&lt;br /&gt;
uboot_size=0x80000&lt;br /&gt;
upd=run load; setenv uboot_size ${filesize};run update&lt;br /&gt;
updall=run spi_kern_upd; run spi_ramdisk_upd; run spi_fdt_upd&lt;br /&gt;
update=protect off ${uboot_addr_f} +${uboot_size}; erase ${uboot_addr_f} +${uboot_size}; cp.b ${uboot_addr_r} ${uboot_addr_f} ${uboot_size}&lt;br /&gt;
update_fdt=sf probe 0; sf erase ${fdt_addr_f} ${filesize}; sf write ${fdt_addr_r} ${fdt_addr_f} ${filesize}&lt;br /&gt;
update_kern=sf probe 0; sf erase ${kern_addr_f} ${filesize}; sf write ${kern_addr_r} ${kern_addr_f} ${filesize}&lt;br /&gt;
update_ramdisk=sf probe 0; sf erase ${ramdisk_addr_f} ${filesize}; sf write ${ramdisk_addr_r} ${ramdisk_addr_f} ${filesize}&lt;br /&gt;
user_dir=/1.12.09-Beta/BUILDS/potenza&lt;br /&gt;
xgmii_phyid=:&lt;br /&gt;
&lt;br /&gt;
Environment size: 5832/32764 bytes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     POWERED BY:&lt;br /&gt;
&lt;br /&gt;
     X     X             GGGG&lt;br /&gt;
      X   X             G    G&lt;br /&gt;
       X X             G         EEEEE   N NNNN    EEEEE&lt;br /&gt;
        X     #######  G   GGG  E     E  NN    N  E     E&lt;br /&gt;
       X X             G     G  EEEEEEE  N     N  EEEEEEE&lt;br /&gt;
      X   X             G    G  E        N     N  E&lt;br /&gt;
     X     X             GGGGG   EEEEE   N     N   EEEEE   (TM)&lt;br /&gt;
&lt;br /&gt;
     Welcome to Applied Micro X-Gene 64-bit ARM Server Platform&lt;br /&gt;
&lt;br /&gt;
Applied Micro Linux 3.12.0-mustang_sw_1.12.09-beta (aarch64) (ttyS0)&lt;br /&gt;
dhcp-10-66-19-173 login: root&lt;br /&gt;
Password:&lt;br /&gt;
[root@dhcp-10-66-19-173 ~]# cat /proc/cpuinfo&lt;br /&gt;
Processor       : AArch64 Processor rev 0 (aarch64)&lt;br /&gt;
processor       : 0&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 1&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 2&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 3&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 4&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 5&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 6&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 7&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
Features        : fp asimd&lt;br /&gt;
CPU implementer : 0x50&lt;br /&gt;
CPU architecture: AArch64&lt;br /&gt;
CPU variant     : 0x0&lt;br /&gt;
CPU part        : 0x000&lt;br /&gt;
CPU revision    : 0&lt;br /&gt;
&lt;br /&gt;
Hardware        : APM X-Gene Mustang board&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Updating UEFI from U-Boot ==&lt;br /&gt;
https://fedoraproject.org/wiki/Architectures/AArch64/Hardware/Mustang?rd=Architectures/ARM/AArch64/Mustang&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
U-Boot 2013.04-mustang_sw_1.12.09-beta (Jun 12 2014 - 10:48:45)&lt;br /&gt;
&lt;br /&gt;
CPU0: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Boot from SPI-NOR&lt;br /&gt;
Board: Mustang - AppliedMicro APM883208-xNA24SPT Reference Board&lt;br /&gt;
I2C:   ready&lt;br /&gt;
DRAM:  ECC 16 GiB @ 1600MHz&lt;br /&gt;
SF: Detected N25Q256 with page size 256 Bytes, total 32 MiB&lt;br /&gt;
MMC:   X-Gene SD/SDIO/eMMC: 0&lt;br /&gt;
PCIE0: (RC) link down&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
CPUs:  11111111&lt;br /&gt;
Net:   eth0&lt;br /&gt;
Hit any key to stop autoboot:  0&lt;br /&gt;
Mustang#&lt;br /&gt;
Mustang#&lt;br /&gt;
Mustang#&lt;br /&gt;
Mustang#&lt;br /&gt;
Mustang#&lt;br /&gt;
Mustang# setenv rh_sd_tiano_sec_ubt fatload mmc 0:1 0x1d000000 /mustang/mustang_tianocore_sec_ubt.fd&lt;br /&gt;
Mustang# setenv rh_sd_tiano_ubt fatload mmc 0:1 0x4002000000 /mustang/mustang_tianocore_ubt.fd&lt;br /&gt;
Mustang# setenv rh_run_tiano_ubt go 0x1d000000&lt;br /&gt;
Mustang# setenv bootcmd run rh_sd_tiano_ubt rh_sd_tiano_sec_ubt rh_run_tiano_ubt&lt;br /&gt;
Mustang# saveenv&lt;br /&gt;
Saving Environment to SPI Flash...&lt;br /&gt;
SF: Detected N25Q256 with page size 256 Bytes, total 32 MiB&lt;br /&gt;
.Erasing SPI flash.....SF: STMicro: Successfully erased 262144 bytes @ 0xc0000&lt;br /&gt;
Writing to SPI flash.......done&lt;br /&gt;
Mustang# reset&lt;br /&gt;
resetting ...&lt;br /&gt;
cold reset ...▒&lt;br /&gt;
&lt;br /&gt;
U-Boot 2013.04-mustang_sw_1.12.09-beta (Jun 12 2014 - 10:48:45)&lt;br /&gt;
&lt;br /&gt;
CPU0: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Boot from SPI-NOR&lt;br /&gt;
Board: Mustang - AppliedMicro APM883208-xNA24SPT Reference Board&lt;br /&gt;
I2C:   ready&lt;br /&gt;
DRAM:  ECC 16 GiB @ 1600MHz&lt;br /&gt;
SF: Detected N25Q256 with page size 256 Bytes, total 32 MiB&lt;br /&gt;
MMC:   X-Gene SD/SDIO/eMMC: 0&lt;br /&gt;
PCIE0: (RC) link down&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
CPUs:  11111111&lt;br /&gt;
Net:   eth0&lt;br /&gt;
Hit any key to stop autoboot:  0&lt;br /&gt;
Mustang# printenv bootcmd&lt;br /&gt;
bootcmd=run rh_sd_tiano_ubt rh_sd_tiano_sec_ubt rh_run_tiano_ubt&lt;br /&gt;
Mustang# printenv rh_&lt;br /&gt;
## Error: &amp;quot;rh_&amp;quot; not defined&lt;br /&gt;
Mustang# printenv rh_sd_tiano_ubt&lt;br /&gt;
rh_sd_tiano_ubt=fatload mmc 0:1 0x4002000000 /mustang/mustang_tianocore_ubt.fd&lt;br /&gt;
Mustang# reset&lt;br /&gt;
resetting ...&lt;br /&gt;
cold reset ...▒&lt;br /&gt;
&lt;br /&gt;
U-Boot 2013.04-mustang_sw_1.12.09-beta (Jun 12 2014 - 10:48:45)&lt;br /&gt;
&lt;br /&gt;
CPU0: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Boot from SPI-NOR&lt;br /&gt;
Board: Mustang - AppliedMicro APM883208-xNA24SPT Reference Board&lt;br /&gt;
I2C:   ready&lt;br /&gt;
DRAM:  ECC 16 GiB @ 1600MHz&lt;br /&gt;
SF: Detected N25Q256 with page size 256 Bytes, total 32 MiB&lt;br /&gt;
MMC:   X-Gene SD/SDIO/eMMC: 0&lt;br /&gt;
PCIE0: (RC) link down&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
CPUs:  11111111&lt;br /&gt;
Net:   eth0&lt;br /&gt;
Hit any key to stop autoboot:  0&lt;br /&gt;
Mustang# run rh_sd_tiano_ubt rh_sd_tiano_sec_ubt rh_run_tiano_ubt&lt;br /&gt;
reading /mustang/mustang_tianocore_ubt.fd&lt;br /&gt;
1835008 bytes read in 1426 ms (1.2 MiB/s)&lt;br /&gt;
reading /mustang/mustang_tianocore_sec_ubt.fd&lt;br /&gt;
262144 bytes read in 1295 ms (197.3 KiB/s)&lt;br /&gt;
## Starting application at 0x1D000000 ...&lt;br /&gt;
X-Gene Mustang Board&lt;br /&gt;
Boot firmware (version 1.1.0 built at 12:03:43 on Mar 23 2015)&lt;br /&gt;
PROGRESS CODE: V3020003 I0&lt;br /&gt;
PROGRESS CODE: V3020002 I0&lt;br /&gt;
PROGRESS CODE: V3020003 I0&lt;br /&gt;
PROGRESS CODE: V3020002 I0&lt;br /&gt;
PROGRESS CODE: V3020003 I0&lt;br /&gt;
PROGRESS CODE: V3020002 I0&lt;br /&gt;
PROGRESS CODE: V3020003 I0&lt;br /&gt;
PROGRESS CODE: V3021001 I0&lt;br /&gt;
TianoCore 1.1.0 UEFI 2.4.0 Mar 23 2015 12:03:18&lt;br /&gt;
CPU: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Board: X-Gene Mustang Board&lt;br /&gt;
Slimpro FW:&lt;br /&gt;
        Ver: 2.1&lt;br /&gt;
The default boot selection will start in   1 second&lt;br /&gt;
Attempting PXE boot on MAC: 00:11:22:33:44:55&lt;br /&gt;
..Attempting PXE boot on MAC: 00:11:22:33:44:55&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=APM_X-C1_(Mustang)&amp;diff=1185</id>
		<title>APM X-C1 (Mustang)</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=APM_X-C1_(Mustang)&amp;diff=1185"/>
		<updated>2015-06-17T23:33:20Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
U-Boot 2013.04-mustang_sw_1.12.09-beta (Jun 12 2014 - 10:48:45)&lt;br /&gt;
&lt;br /&gt;
CPU0: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Boot from SPI-NOR&lt;br /&gt;
Board: Mustang - AppliedMicro APM883208-xNA24SPT Reference Board&lt;br /&gt;
I2C:   ready&lt;br /&gt;
DRAM:  ECC 16 GiB @ 1600MHz&lt;br /&gt;
SF: Detected N25Q256 with page size 256 Bytes, total 32 MiB&lt;br /&gt;
MMC:   X-Gene SD/SDIO/eMMC: 0&lt;br /&gt;
PCIE0: (RC) link down&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
CPUs:  11111111&lt;br /&gt;
Net:   eth0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mustang# printenv&lt;br /&gt;
addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off panic=1&lt;br /&gt;
addmisc=setenv bootargs ${bootargs} earlyprintk=uart8250-32bit,0x1c020000 debug maxcpus=${num_cores} swiotlb=65536&lt;br /&gt;
addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}&lt;br /&gt;
baudrate=115200&lt;br /&gt;
bootcmd=run sata_self&lt;br /&gt;
bootdelay=5&lt;br /&gt;
bootfile=uImage&lt;br /&gt;
dnsip=10.66.18.10&lt;br /&gt;
enet=8&lt;br /&gt;
enet_mode=x:n&lt;br /&gt;
eth1addr=00:01:73:02:21:35&lt;br /&gt;
eth2addr=00:01:73:02:21:36&lt;br /&gt;
eth3addr=00:01:73:02:21:37&lt;br /&gt;
ethact=eth0&lt;br /&gt;
ethaddr=00:01:73:02:21:34&lt;br /&gt;
fdt_addr_f=0x1000000&lt;br /&gt;
fdt_addr_r=0x4003000000&lt;br /&gt;
fdt_file=apm-mustang.dtb&lt;br /&gt;
fdt_size=7285&lt;br /&gt;
flash_nfs=run nfsargs addip addtty addmisc; bootm ${kern_addr_f}&lt;br /&gt;
flash_self=run ramargs addip addtty addmisc; bootm ${kern_addr_f} ${ramdisk_addr_f} ${fdt_addr_f}&lt;br /&gt;
fw_addr_r=0x4003800000&lt;br /&gt;
gatewayip=10.66.19.1&lt;br /&gt;
hostname=dhcp-10-66-19-173&lt;br /&gt;
initrd_high=0x43e0000000&lt;br /&gt;
ipaddr=10.66.19.173&lt;br /&gt;
kern_addr_f=0x100000&lt;br /&gt;
kern_addr_r=0x4002000000&lt;br /&gt;
kern_size=a9a050&lt;br /&gt;
kernel_addr_r=0x4002000000&lt;br /&gt;
load=tftp ${uboot_addr_r} ${user_dir}/${u-boot}&lt;br /&gt;
load_fdt=tftp ${fdt_addr_r} ${user_dir}/${fdt_file}&lt;br /&gt;
load_kern=tftp ${kern_addr_r} ${user_dir}/${bootfile}&lt;br /&gt;
load_ramdisk=tftp ${ramdisk_addr_r} ${user_dir}/${ramdisk_file}&lt;br /&gt;
loadaddr=0x100000000&lt;br /&gt;
media_addr_r=0x4001000000&lt;br /&gt;
media_img=mustang_media.img&lt;br /&gt;
mgmt_enet=e&lt;br /&gt;
mslim_bootfile=uImage-mslim&lt;br /&gt;
mslim_fdt_addr_r=0x43f0600000&lt;br /&gt;
mslim_fdt_file=mslim-mustang.dtb&lt;br /&gt;
mslim_kern_addr_r=0x43f1000000&lt;br /&gt;
mslim_net_self=run net_load_mslim; startmslim&lt;br /&gt;
mslim_ramdisk_addr_r=0x43f2000000&lt;br /&gt;
mslim_ramdisk_file=uRamdisk-mslim&lt;br /&gt;
mslim_sd_self=run sd_load_mslim; startmslim&lt;br /&gt;
mslim_uboot_addr_r=0x43f0000000&lt;br /&gt;
mslim_uboot_file=u-boot-mslim.bin&lt;br /&gt;
mslim_user_dir=mslim&lt;br /&gt;
net_load_mslim=run nload_mslim_uboot nload_mslim_kern nload_mslim_ramdisk nload_mslim_fdt&lt;br /&gt;
net_nfs=run load_kern load_fdt; run nfsargs addip addtty addmisc; bootm ${kern_addr_r} - ${fdt_addr_r}&lt;br /&gt;
net_sata=run load_kern load_fdt; run sataargs addip addtty addmisc; bootm ${kern_addr_r} - ${fdt_addr_r}&lt;br /&gt;
net_self=run net_self_load; run ramargs addip addtty addmisc; bootm ${kern_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}&lt;br /&gt;
net_self_load=run load_kern load_ramdisk load_fdt&lt;br /&gt;
netdev=eth0&lt;br /&gt;
netmask=255.255.255.0&lt;br /&gt;
nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${rootpath}&lt;br /&gt;
nload_mslim_fdt=tftp ${mslim_fdt_addr_r} ${mslim_user_dir}/${mslim_fdt_file}&lt;br /&gt;
nload_mslim_kern=tftp ${mslim_kern_addr_r} ${mslim_user_dir}/${mslim_bootfile}&lt;br /&gt;
nload_mslim_ramdisk=tftp ${mslim_ramdisk_addr_r} ${mslim_user_dir}/${mslim_ramdisk_file}&lt;br /&gt;
nload_mslim_uboot=tftp ${mslim_uboot_addr_r} ${mslim_user_dir}/${mslim_uboot_file}&lt;br /&gt;
num_cores=8&lt;br /&gt;
pcie_gen=3:3:3:3:3&lt;br /&gt;
pcie_mode=RP:NA:NA:NA:NA&lt;br /&gt;
pcie_reset=y:n:n:n:n&lt;br /&gt;
pxefile_addr_r=0x4001000000&lt;br /&gt;
ram_nfs=run nfsargs addip addtty addmisc; bootm ${kern_addr_r} - ${fdt_addr_r}&lt;br /&gt;
ram_self=run ramargs addip addtty addmisc; bootm ${kern_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}&lt;br /&gt;
ramargs=setenv bootargs root=/dev/ram rw&lt;br /&gt;
ramdisk_addr_f=0x1100000&lt;br /&gt;
ramdisk_addr_r=0x4004000000&lt;br /&gt;
ramdisk_file=uRamdisk_basic&lt;br /&gt;
ramdisk_size=344abe&lt;br /&gt;
rgmii_phyid=3&lt;br /&gt;
rootpath=/opt/nfsrootfs/arm64/release&lt;br /&gt;
sata=0x3c&lt;br /&gt;
sata_enet=e:e:n:n&lt;br /&gt;
sata_load_fdt=ext4load scsi 0:1 0x4003000000 apm-mustang.dtb&lt;br /&gt;
sata_load_kern=ext4load scsi 0:1 0x4002000000 uImage&lt;br /&gt;
sata_self=scsi init; run sata_load_kern sata_load_fdt; run sataargs addip addtty addmisc; bootm 0x4002000000 - 0x4003000000&lt;br /&gt;
sataargs=setenv bootargs root=/dev/sda1 rw&lt;br /&gt;
script_addr_r=0x4004000000&lt;br /&gt;
sd_load_mslim=mmc dev 0; run sdload_mslim_uboot sdload_mslim_kern sdload_mslim_ramdisk sdload_mslim_fdt&lt;br /&gt;
sd_self=mmc dev 0; ext2load mmc 0  ${kern_addr_r} ${bootfile}; ext2load mmc 0  ${fdt_addr_r} ${fdt_file}; ext2load mmc 0  ${ramdisk_addr_r} ${ramdisk_file}; run ram_self&lt;br /&gt;
sdload_mslim_fdt=ext2load mmc 0 ${mslim_fdt_addr_r} ${mslim_fdt_file}&lt;br /&gt;
sdload_mslim_kern=ext2load mmc 0 ${mslim_kern_addr_r} ${mslim_bootfile}&lt;br /&gt;
sdload_mslim_ramdisk=ext2load mmc 0 ${mslim_ramdisk_addr_r} ${mslim_ramdisk_file}&lt;br /&gt;
sdload_mslim_uboot=ext2load mmc 0 ${mslim_uboot_addr_r} ${mslim_uboot_file}&lt;br /&gt;
sdphy=1&lt;br /&gt;
serverip=10.66.19.133&lt;br /&gt;
sgmii_phyid=4:5::&lt;br /&gt;
spi_fdt_upd=run load_fdt; setenv fdt_size ${filesize}; save; run update_fdt&lt;br /&gt;
spi_fw_img=mustang_slimpro_ext_spi.bin&lt;br /&gt;
spi_fw_load=tftp ${fw_addr_r} ${user_dir}/${spi_fw_img}&lt;br /&gt;
spi_fw_upd=run spi_fw_load;run spi_fw_update&lt;br /&gt;
spi_fw_update=bmc stop; i2c dev 1; eeprom write ${fw_addr_r} 0x0 ${filesize}&lt;br /&gt;
spi_kern_upd=run load_kern; setenv kern_size ${filesize}; save; run update_kern&lt;br /&gt;
spi_load=tftp ${media_addr_r} ${user_dir}/${media_img}&lt;br /&gt;
spi_ramdisk_upd=run load_ramdisk; setenv ramdisk_size ${filesize}; save; run update_ramdisk&lt;br /&gt;
spi_self=sf probe 0; sf read ${kern_addr_r} ${kern_addr_f} ${kern_size}; sf read ${fdt_addr_r} ${fdt_addr_f} ${fdt_size}; sf read ${ramdisk_addr_r} ${ramdisk_addr_f} ${ramdisk_size}; run ram_self&lt;br /&gt;
spi_upd=run spi_load;run spi_update&lt;br /&gt;
spi_update=sf probe 0; sf erase 0x0 ${filesize}; sf write ${media_addr_r} 0x0 ${filesize}&lt;br /&gt;
stderr=serial&lt;br /&gt;
stdin=serial&lt;br /&gt;
stdout=serial&lt;br /&gt;
u-boot=u-boot.bin&lt;br /&gt;
uboot_addr_f=0x8100000000&lt;br /&gt;
uboot_addr_r=0x4001000000&lt;br /&gt;
uboot_size=0x80000&lt;br /&gt;
upd=run load; setenv uboot_size ${filesize};run update&lt;br /&gt;
updall=run spi_kern_upd; run spi_ramdisk_upd; run spi_fdt_upd&lt;br /&gt;
update=protect off ${uboot_addr_f} +${uboot_size}; erase ${uboot_addr_f} +${uboot_size}; cp.b ${uboot_addr_r} ${uboot_addr_f} ${uboot_size}&lt;br /&gt;
update_fdt=sf probe 0; sf erase ${fdt_addr_f} ${filesize}; sf write ${fdt_addr_r} ${fdt_addr_f} ${filesize}&lt;br /&gt;
update_kern=sf probe 0; sf erase ${kern_addr_f} ${filesize}; sf write ${kern_addr_r} ${kern_addr_f} ${filesize}&lt;br /&gt;
update_ramdisk=sf probe 0; sf erase ${ramdisk_addr_f} ${filesize}; sf write ${ramdisk_addr_r} ${ramdisk_addr_f} ${filesize}&lt;br /&gt;
user_dir=/1.12.09-Beta/BUILDS/potenza&lt;br /&gt;
xgmii_phyid=:&lt;br /&gt;
&lt;br /&gt;
Environment size: 5832/32764 bytes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     POWERED BY:&lt;br /&gt;
&lt;br /&gt;
     X     X             GGGG&lt;br /&gt;
      X   X             G    G&lt;br /&gt;
       X X             G         EEEEE   N NNNN    EEEEE&lt;br /&gt;
        X     #######  G   GGG  E     E  NN    N  E     E&lt;br /&gt;
       X X             G     G  EEEEEEE  N     N  EEEEEEE&lt;br /&gt;
      X   X             G    G  E        N     N  E&lt;br /&gt;
     X     X             GGGGG   EEEEE   N     N   EEEEE   (TM)&lt;br /&gt;
&lt;br /&gt;
     Welcome to Applied Micro X-Gene 64-bit ARM Server Platform&lt;br /&gt;
&lt;br /&gt;
Applied Micro Linux 3.12.0-mustang_sw_1.12.09-beta (aarch64) (ttyS0)&lt;br /&gt;
dhcp-10-66-19-173 login: root&lt;br /&gt;
Password:&lt;br /&gt;
[root@dhcp-10-66-19-173 ~]# cat /proc/cpuinfo&lt;br /&gt;
Processor       : AArch64 Processor rev 0 (aarch64)&lt;br /&gt;
processor       : 0&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 1&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 2&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 3&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 4&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 5&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 6&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 7&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
Features        : fp asimd&lt;br /&gt;
CPU implementer : 0x50&lt;br /&gt;
CPU architecture: AArch64&lt;br /&gt;
CPU variant     : 0x0&lt;br /&gt;
CPU part        : 0x000&lt;br /&gt;
CPU revision    : 0&lt;br /&gt;
&lt;br /&gt;
Hardware        : APM X-Gene Mustang board&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=APM_X-C1_(Mustang)&amp;diff=1184</id>
		<title>APM X-C1 (Mustang)</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=APM_X-C1_(Mustang)&amp;diff=1184"/>
		<updated>2015-06-17T23:28:29Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
U-Boot 2013.04-mustang_sw_1.12.09-beta (Jun 12 2014 - 10:48:45)&lt;br /&gt;
&lt;br /&gt;
CPU0: APM ARM 64-bit Potenza Rev A3 2400MHz PCP 2400MHz&lt;br /&gt;
     32 KB ICACHE, 32 KB DCACHE&lt;br /&gt;
     SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz&lt;br /&gt;
Boot from SPI-NOR&lt;br /&gt;
Board: Mustang - AppliedMicro APM883208-xNA24SPT Reference Board&lt;br /&gt;
I2C:   ready&lt;br /&gt;
DRAM:  ECC 16 GiB @ 1600MHz&lt;br /&gt;
SF: Detected N25Q256 with page size 256 Bytes, total 32 MiB&lt;br /&gt;
MMC:   X-Gene SD/SDIO/eMMC: 0&lt;br /&gt;
PCIE0: (RC) link down&lt;br /&gt;
In:    serial&lt;br /&gt;
Out:   serial&lt;br /&gt;
Err:   serial&lt;br /&gt;
CPUs:  11111111&lt;br /&gt;
Net:   eth0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     POWERED BY:&lt;br /&gt;
&lt;br /&gt;
     X     X             GGGG&lt;br /&gt;
      X   X             G    G&lt;br /&gt;
       X X             G         EEEEE   N NNNN    EEEEE&lt;br /&gt;
        X     #######  G   GGG  E     E  NN    N  E     E&lt;br /&gt;
       X X             G     G  EEEEEEE  N     N  EEEEEEE&lt;br /&gt;
      X   X             G    G  E        N     N  E&lt;br /&gt;
     X     X             GGGGG   EEEEE   N     N   EEEEE   (TM)&lt;br /&gt;
&lt;br /&gt;
     Welcome to Applied Micro X-Gene 64-bit ARM Server Platform&lt;br /&gt;
&lt;br /&gt;
Applied Micro Linux 3.12.0-mustang_sw_1.12.09-beta (aarch64) (ttyS0)&lt;br /&gt;
dhcp-10-66-19-173 login: root&lt;br /&gt;
Password:&lt;br /&gt;
[root@dhcp-10-66-19-173 ~]# cat /proc/cpuinfo&lt;br /&gt;
Processor       : AArch64 Processor rev 0 (aarch64)&lt;br /&gt;
processor       : 0&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 1&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 2&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 3&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 4&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 5&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 6&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 7&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
Features        : fp asimd&lt;br /&gt;
CPU implementer : 0x50&lt;br /&gt;
CPU architecture: AArch64&lt;br /&gt;
CPU variant     : 0x0&lt;br /&gt;
CPU part        : 0x000&lt;br /&gt;
CPU revision    : 0&lt;br /&gt;
&lt;br /&gt;
Hardware        : APM X-Gene Mustang board&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=APM_X-C1_(Mustang)&amp;diff=1183</id>
		<title>APM X-C1 (Mustang)</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=APM_X-C1_(Mustang)&amp;diff=1183"/>
		<updated>2015-06-17T23:26:20Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: Created page with &amp;quot;  &amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;       POWERED BY:       X     X             GGGG       X   X             G    G        X X             G         EEEEE   N NNNN    EEEEE...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     POWERED BY:&lt;br /&gt;
&lt;br /&gt;
     X     X             GGGG&lt;br /&gt;
      X   X             G    G&lt;br /&gt;
       X X             G         EEEEE   N NNNN    EEEEE&lt;br /&gt;
        X     #######  G   GGG  E     E  NN    N  E     E&lt;br /&gt;
       X X             G     G  EEEEEEE  N     N  EEEEEEE&lt;br /&gt;
      X   X             G    G  E        N     N  E&lt;br /&gt;
     X     X             GGGGG   EEEEE   N     N   EEEEE   (TM)&lt;br /&gt;
&lt;br /&gt;
     Welcome to Applied Micro X-Gene 64-bit ARM Server Platform&lt;br /&gt;
&lt;br /&gt;
Applied Micro Linux 3.12.0-mustang_sw_1.12.09-beta (aarch64) (ttyS0)&lt;br /&gt;
dhcp-10-66-19-173 login: root&lt;br /&gt;
Password:&lt;br /&gt;
[root@dhcp-10-66-19-173 ~]# cat /proc/cpuinfo&lt;br /&gt;
Processor       : AArch64 Processor rev 0 (aarch64)&lt;br /&gt;
processor       : 0&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 1&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 2&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 3&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 4&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 5&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 6&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
processor       : 7&lt;br /&gt;
model name      : APM X-Gene Mustang board @ 2.40GHz&lt;br /&gt;
cpu MHz         : 2400.00&lt;br /&gt;
fpu             : yes&lt;br /&gt;
&lt;br /&gt;
Features        : fp asimd&lt;br /&gt;
CPU implementer : 0x50&lt;br /&gt;
CPU architecture: AArch64&lt;br /&gt;
CPU variant     : 0x0&lt;br /&gt;
CPU part        : 0x000&lt;br /&gt;
CPU revision    : 0&lt;br /&gt;
&lt;br /&gt;
Hardware        : APM X-Gene Mustang board&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Git&amp;diff=1176</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Git&amp;diff=1176"/>
		<updated>2015-06-04T19:21:23Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: Created page with &amp;quot; == Quick Use Guide == === Adding/Removing remote origin ===  git remote add origin git@gitlab-blah:user/repo.git  git remote remove origin  To use public key authentication w...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Quick Use Guide ==&lt;br /&gt;
=== Adding/Removing remote origin ===&lt;br /&gt;
 git remote add origin git@gitlab-blah:user/repo.git&lt;br /&gt;
 git remote remove origin&lt;br /&gt;
&lt;br /&gt;
To use public key authentication with SSH, you must configure it inside &amp;lt;code&amp;gt;~/.ssh/config&amp;lt;/code&amp;gt; instead of passing the key as you would with SSH (ie: &amp;lt;code&amp;gt;ssh -i ~/.ssh/privkey&amp;lt;/code&amp;gt;) like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Host gitlab-blah&lt;br /&gt;
  HostName gitlab.cpsc.ucalgary.ca&lt;br /&gt;
  User git&lt;br /&gt;
  IdentityFile ~/.ssh/gitlab-leo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pushing to remote origin ===&lt;br /&gt;
 git push origin &#039;&#039;&#039;branch&#039;&#039;&#039;&lt;br /&gt;
Where branch can be the master.&lt;br /&gt;
&lt;br /&gt;
=== Committing Files ===&lt;br /&gt;
Ensure all files you want to commit are staged. To add all files:&lt;br /&gt;
 git add -A .&lt;br /&gt;
&lt;br /&gt;
See the status with:&lt;br /&gt;
 git status&lt;br /&gt;
&lt;br /&gt;
To commit:&lt;br /&gt;
 git commit -m &#039;message&#039;&lt;br /&gt;
&lt;br /&gt;
=== Reverting Changes ===&lt;br /&gt;
To revert any changes in the current repository, use (???)&lt;br /&gt;
 git reset &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Main_Page&amp;diff=1169</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Main_Page&amp;diff=1169"/>
		<updated>2015-05-20T16:54:18Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Special:Search|Search]]  |   [[Special:Upload|Upload]]  | [[Special:Version|Version]]&lt;br /&gt;
&lt;br /&gt;
== Linux ==&lt;br /&gt;
{{Navbox Linux}}&lt;br /&gt;
&lt;br /&gt;
== Benchmarks ==&lt;br /&gt;
{{Navbox Benchmarks}}&lt;br /&gt;
&lt;br /&gt;
== Others ==&lt;br /&gt;
Categories&lt;br /&gt;
* [[:Category:C-Sharp|C#]]&lt;br /&gt;
* [[:Category:FreeBSD|FreeBSD]]&lt;br /&gt;
* [[:Category:Solaris|Solaris]]&lt;br /&gt;
* [[:Category:VMWare ESXi|VMWare ESXi]]&lt;br /&gt;
* [[:Category:TipsnTricks|Tips &amp;amp;amp; Tricks]]&lt;br /&gt;
* [[:Category:Services|Services]]&lt;br /&gt;
* [[:Category:Code|Code]]&lt;br /&gt;
* [[:Category:Guides|Guides]]&lt;br /&gt;
* [[:Category:Todo|Todo]]&lt;br /&gt;
&lt;br /&gt;
Topics&lt;br /&gt;
* [[Cheat Sheet]]&lt;br /&gt;
* [[Troubleshoot]]&lt;br /&gt;
* [[ZFS]]&lt;br /&gt;
* [[BSD Jails]]&lt;br /&gt;
* [[Dying SSD]]&lt;br /&gt;
* [[Cobbler]]&lt;br /&gt;
* [[Salt]]&lt;br /&gt;
* [[Cdist]]&lt;br /&gt;
* [[Mail Server]]&lt;br /&gt;
* [[tcsh]]&lt;br /&gt;
* [[Elevator]]&lt;br /&gt;
&lt;br /&gt;
Personal&lt;br /&gt;
* [[Recipes]]&lt;br /&gt;
* [[Shopping List]]&lt;br /&gt;
&lt;br /&gt;
Other Sites&lt;br /&gt;
* [http://iplocation.truevue.org/ IP Lookup]&lt;br /&gt;
&lt;br /&gt;
* http://sipb.mit.edu/doc/safe-shell/&lt;br /&gt;
* http://blog.kihltech.com/&lt;br /&gt;
* http://tech.superhappykittymeow.com/&lt;br /&gt;
* http://info.michael-simons.eu&lt;br /&gt;
* http://crashmag.net&lt;br /&gt;
* http://mywiki.wooledge.org/BashFAQ&lt;br /&gt;
* http://www.iptables.info/en/structure-of-iptables.html&lt;br /&gt;
&lt;br /&gt;
Pirate Drops&lt;br /&gt;
* fredkodongo.ananke.feralhosting.com/index.html/&lt;br /&gt;
** ~200mbit. Some games and TV&lt;br /&gt;
* abdullah.stack.seedhost.eu/abdullah/downloads/?C=M;O=A&lt;br /&gt;
* ukuthemba.seedstuff.ca/?C=M;O=A&lt;br /&gt;
* dl.eveilmusical.ovh/Complete/?C=M;O=A&lt;br /&gt;
* beckwreck.hermes.feralhosting.com/links/deluge_data/&lt;br /&gt;
&lt;br /&gt;
To find more, search:&lt;br /&gt;
 inurl:feralhosting.com intitle:&amp;quot;Index of&amp;quot; &lt;br /&gt;
 inurl:seedhost.eu intitle:&amp;quot;Index of&amp;quot; &lt;br /&gt;
&lt;br /&gt;
* https://herbertmusoke.com&lt;br /&gt;
&lt;br /&gt;
Not updated:&lt;br /&gt;
* instance.hypnos.feralhosting.com/data&lt;br /&gt;
** random stuff&lt;br /&gt;
* djoendi.co.vu/dunlud/&lt;br /&gt;
** games&lt;br /&gt;
* ks3352402.kimsufi.com/dl&lt;br /&gt;
* https://lsd-25.ru/uploads&lt;br /&gt;
&lt;br /&gt;
* hxxp://ks3352402.kimsufi.com/dl/  ~70mbit, some movies, some tv, french&lt;br /&gt;
* hxxp://box.bob.sh/ misc stuff&lt;br /&gt;
* hxxp://blogs.hatrix.fr/download HD TV, french&lt;br /&gt;
* hxxp://87.252.164.6/Mof/ low quality TV&lt;br /&gt;
* hxxp://nivaldia.fr/torrent/Complete/Cloud%20Atlas/ - french stuff. tvs and movies.&lt;br /&gt;
* hxxp://metaldiamond.tk/private/Jeux/ some games, french stuff.&lt;br /&gt;
&lt;br /&gt;
* dl.imontou.ch&lt;br /&gt;
** Alles auf Deutsch: TV, Movies, Games&lt;br /&gt;
&lt;br /&gt;
* hxxp://xcloud.thib0704.net/thib/downloads some games, tv, movies&lt;br /&gt;
* hxxp://home.alexsoft-bg.com:8080/download/ misc&lt;br /&gt;
&lt;br /&gt;
php fcgi&lt;br /&gt;
* http://blog.giantchipmunk.com/2011/01/setting-up-php-with-fastcgi-and-suexec.html&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=ACL&amp;diff=1159</id>
		<title>ACL</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=ACL&amp;diff=1159"/>
		<updated>2015-04-30T18:49:57Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Linux ==&lt;br /&gt;
&lt;br /&gt;
To get ACL permissions&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line start=&amp;quot;1&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
getfacl&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To set ACL permissions for a user:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line start=&amp;quot;1&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
setfacl -m user:&amp;lt;user&amp;gt;:&amp;lt;perms&amp;gt; &amp;lt;path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# eg:&lt;br /&gt;
setfacl -m user:leo:wrx /home/leo&lt;br /&gt;
&lt;br /&gt;
# To do this recursively, pass the &amp;lt;code&amp;gt;-R&amp;lt;/code&amp;gt; flag. &lt;br /&gt;
setfacl -mR user:leo:wrx /home/leo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To remove ACL permissions for a user:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line start=&amp;quot;1&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
setfacl -x user:leo /home/leo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To clone ACL permissions from fileA to fileB:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line start=&amp;quot;1&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
getfacl fileA | setfacl -bnM - fileB&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Cisco&amp;diff=1149</id>
		<title>Cisco</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Cisco&amp;diff=1149"/>
		<updated>2015-04-13T18:05:09Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: Created page with &amp;quot; == Show Switchport ==  sola# &amp;#039;&amp;#039;&amp;#039;config&amp;#039;&amp;#039;&amp;#039;  Enter configuration commands, one per line.  End with CNTL/Z.  sola(config)# &amp;#039;&amp;#039;&amp;#039;interface ethernet 3/28&amp;#039;&amp;#039;&amp;#039;  sola(config-if)# &amp;#039;&amp;#039;&amp;#039;sho...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Show Switchport ==&lt;br /&gt;
 sola# &#039;&#039;&#039;config&#039;&#039;&#039;&lt;br /&gt;
 Enter configuration commands, one per line.  End with CNTL/Z.&lt;br /&gt;
 sola(config)# &#039;&#039;&#039;interface ethernet 3/28&#039;&#039;&#039;&lt;br /&gt;
 sola(config-if)# &#039;&#039;&#039;show interface ethernet 3/28 switchport&#039;&#039;&#039;&lt;br /&gt;
 Name: Ethernet3/28&lt;br /&gt;
   Switchport: Enabled&lt;br /&gt;
   Switchport Monitor: Not enabled &lt;br /&gt;
   Operational Mode: trunk&lt;br /&gt;
   Access Mode VLAN: 1 (default)&lt;br /&gt;
   Trunking Native Mode VLAN: 1 (default)&lt;br /&gt;
   Trunking VLANs Enabled: 1-12,14-3967,4048-4093&lt;br /&gt;
   Administrative private-vlan primary host-association: none&lt;br /&gt;
   Administrative private-vlan secondary host-association: none&lt;br /&gt;
   Administrative private-vlan primary mapping: none&lt;br /&gt;
   Administrative private-vlan secondary mapping: none&lt;br /&gt;
   Administrative private-vlan trunk native VLAN: none&lt;br /&gt;
   Administrative private-vlan trunk encapsulation: dot1q&lt;br /&gt;
   Administrative private-vlan trunk normal VLANs: none&lt;br /&gt;
   Administrative private-vlan trunk private VLANs: none&lt;br /&gt;
   Operational private-vlan: none&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Getting_Hardware_UUID&amp;diff=1145</id>
		<title>Getting Hardware UUID</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Getting_Hardware_UUID&amp;diff=1145"/>
		<updated>2015-04-09T17:10:47Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Linux / FreeBSD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
You may get the UUID value from PowerShell.&lt;br /&gt;
 get-wmiobject Win32_ComputerSystemProduct | Select-Object -ExpandProperty UUID&lt;br /&gt;
&lt;br /&gt;
[[Category:Windows]]&lt;br /&gt;
&lt;br /&gt;
== Linux / FreeBSD ==&lt;br /&gt;
&lt;br /&gt;
Use the dmidecode utility to get the UUID&lt;br /&gt;
 dmidecode -s system-uuid&lt;br /&gt;
&lt;br /&gt;
You may need to install dmidecode since it usually isn&#039;t bundled with the base OS. On FreeBSD, it&#039;s available in ports at &amp;lt;code&amp;gt;/usr/ports/sysutils/dmidecode&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:FreeBSD]]&lt;br /&gt;
&lt;br /&gt;
== VMWare ESXi ==&lt;br /&gt;
&lt;br /&gt;
To get the UUID of the physical machine that your ESXi server is running on, login via SSH and run:&lt;br /&gt;
&lt;br /&gt;
 esxcfg-info |grep -i uuid&lt;br /&gt;
&lt;br /&gt;
You will see a bunch of UUIDs, most of which pertain to disks/volumes. What you are looking for is:&lt;br /&gt;
 &lt;br /&gt;
 |----System UUID..............................................5178962d-2fcf-df50-536d-000423d9985a&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:VMWare ESXi]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Navbox Linux}}&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Awk&amp;diff=1144</id>
		<title>Awk</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Awk&amp;diff=1144"/>
		<updated>2015-04-08T19:06:35Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Counting Lines Until Match ==&lt;br /&gt;
&lt;br /&gt;
To print the number of lines before a match is found:&lt;br /&gt;
 awk &#039;BEGIN { n = 0 } /PATTERN/ { print n; next } { n++ }&#039;&lt;br /&gt;
&lt;br /&gt;
Eg: Suppose I have a file with the contents:&lt;br /&gt;
 leo&lt;br /&gt;
 spoon&lt;br /&gt;
 cake&lt;br /&gt;
 fork&lt;br /&gt;
&lt;br /&gt;
To find the number of lines up until &#039;cake&#039;, do:&lt;br /&gt;
 cat list.txt | awk &#039;BEGIN { n = 0 } /cake/ { print n; next } { n++ }&#039;&lt;br /&gt;
&lt;br /&gt;
== Convert Number as Bytes to Human Readable Value ==&lt;br /&gt;
I wanted to sort size in reverse order, but in order to do that properly, the value from du needs to be in kilobytes. I also didn&#039;t want to run this through du again just to get the human readable value. So, I did this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line start=&amp;quot;1&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
du -s ./*/ ./*/*/ ./*/*/*/ \ &lt;br /&gt;
   | sort -rn \ &lt;br /&gt;
   | awk &#039;BEGIN { \ &lt;br /&gt;
      split(&amp;quot;KB MB GB TB PB&amp;quot;, type) \ &lt;br /&gt;
   } \ &lt;br /&gt;
   { \ &lt;br /&gt;
      y = 0; \                                                                                                  &lt;br /&gt;
      x = $1; \ &lt;br /&gt;
      for (i = 4; y &amp;lt; 1 ; i--) \ &lt;br /&gt;
         y = x / (2 ** (10 * i)); \ &lt;br /&gt;
      print y type[i+2]&amp;quot; &amp;quot;$2 \ &lt;br /&gt;
   }&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to count using bytes instead of kilobytes, just add K to the split function and replace i=4 with i=5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Convert &amp;lt;code&amp;gt;ps&amp;lt;/code&amp;gt; Elapsed Time to Seconds ==&lt;br /&gt;
To convert the elapsed time (in [http://pubs.opengroup.org/onlinepubs/009696799/utilities/ps.html POSIX locale] formatted as &amp;lt;code&amp;gt;[[dd-]hh:]mm:ss&amp;lt;/code&amp;gt;) to seconds using awk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
Elapsed=`ps -p $Pid -o etime=`&lt;br /&gt;
Elapsed=`echo $Elapsed | tr - : | tr : &#039; &#039;` &lt;br /&gt;
Seconds=`echo $Elapsed | awk &#039; &lt;br /&gt;
	NF == 2 { print ($1 * 60) + $2 } &lt;br /&gt;
	NF == 3 { print ((($1 * 60) + $2) * 60) + $3 } &lt;br /&gt;
	NF == 4 { print ((((($1 * 24) + $2) * 60) + $3) * 60) + $4 } &lt;br /&gt;
	{}&#039;` &lt;br /&gt;
echo $Seconds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, a process running for &amp;lt;code&amp;gt;66-00:12:58&amp;lt;/code&amp;gt; has been running for 5703178 seconds. The Awk command will match how many columns were found and then do the proper calculation.&lt;br /&gt;
&lt;br /&gt;
== Get a Text Section ==&lt;br /&gt;
To grab a specific section from a .spec file (where sections begin with &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if [ $# -ne 2 ] ; then&lt;br /&gt;
	echo &amp;quot;Usage: $0 file.spec section&amp;quot;&lt;br /&gt;
	exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
Section=&amp;quot;$2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
cat $1 | awk -v Section=&amp;quot;$Section&amp;quot; &#039;&lt;br /&gt;
BEGIN {&lt;br /&gt;
	InSection=false&lt;br /&gt;
} &lt;br /&gt;
/^%.*/ { &lt;br /&gt;
	if ($0 ~ Section) {&lt;br /&gt;
		InSection=1&lt;br /&gt;
	} else {&lt;br /&gt;
		InSection=0&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	next&lt;br /&gt;
}&lt;br /&gt;
{&lt;br /&gt;
	if (InSection) {&lt;br /&gt;
		print $0&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:TipsnTricks]]&lt;br /&gt;
[[Category:LinuxUtilities]]&lt;br /&gt;
{{Navbox Linux}}&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Bash_Scripting&amp;diff=1143</id>
		<title>Bash Scripting</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Bash_Scripting&amp;diff=1143"/>
		<updated>2015-04-08T19:05:05Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Indent */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Common Functions ==&lt;br /&gt;
Here are some common functions I use in my scripts.&lt;br /&gt;
&lt;br /&gt;
=== Prompt ===&lt;br /&gt;
You can prompt the user for an yes or no answer using this function. An optional default values are accepted as the second argument.&lt;br /&gt;
&lt;br /&gt;
Example Usage:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 if prompt &amp;quot;Is this okay?&amp;quot; Y ; then&lt;br /&gt;
    echo &amp;quot;It&#039;s Okay!&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 if ! prompt &amp;quot;Is this okay?&amp;quot; N ; then&lt;br /&gt;
    echo &amp;quot;It&#039;s not okay!&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
function prompt() {&lt;br /&gt;
	# credit: http://djm.me/ask&lt;br /&gt;
	while true; do&lt;br /&gt;
		if [ &amp;quot;${2:-}&amp;quot; = &amp;quot;Y&amp;quot; ]; then&lt;br /&gt;
			prompt=&amp;quot;Y/n&amp;quot;&lt;br /&gt;
			default=Y&lt;br /&gt;
		elif [ &amp;quot;${2:-}&amp;quot; = &amp;quot;N&amp;quot; ]; then&lt;br /&gt;
			prompt=&amp;quot;y/N&amp;quot;&lt;br /&gt;
			default=N&lt;br /&gt;
		else&lt;br /&gt;
			prompt=&amp;quot;y/n&amp;quot;&lt;br /&gt;
			default=&lt;br /&gt;
		fi&lt;br /&gt;
&lt;br /&gt;
		# Ask the question&lt;br /&gt;
		read -p &amp;quot;$1 [$prompt] &amp;quot; REPLY&lt;br /&gt;
&lt;br /&gt;
		# Default?&lt;br /&gt;
		if [ -z &amp;quot;$REPLY&amp;quot; ]; then&lt;br /&gt;
			REPLY=$default&lt;br /&gt;
		fi&lt;br /&gt;
&lt;br /&gt;
		# Check if the reply is valid&lt;br /&gt;
		case &amp;quot;$REPLY&amp;quot; in&lt;br /&gt;
			Y*|y*) return 0 ;;&lt;br /&gt;
			N*|n*) return 1 ;;&lt;br /&gt;
		esac&lt;br /&gt;
	done&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== die ===&lt;br /&gt;
Similar to the &amp;lt;code&amp;gt;die&amp;lt;/code&amp;gt; command in PHP which prints out a message before stopping execution.&lt;br /&gt;
&lt;br /&gt;
Function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
function die {&lt;br /&gt;
	echo $@&lt;br /&gt;
	exit&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The caveat is that exit will kill the current shell - if running in a subshell, this will terminate the subshell and not the parent shell. To get around this, you may need to kill the parent PID instead.&lt;br /&gt;
&lt;br /&gt;
=== Indent ===&lt;br /&gt;
Indents text piped to the function.&lt;br /&gt;
&lt;br /&gt;
Function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
function Indent {                                                                                                    &lt;br /&gt;
	Prepend=&amp;quot;\t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	if [ $# -eq 1 ] ; then&lt;br /&gt;
		Indent=$1&lt;br /&gt;
&lt;br /&gt;
		while [ $Indent -ge 0 ] ; do &lt;br /&gt;
			Prepend=&amp;quot;\t$Prepend&amp;quot;&lt;br /&gt;
			Indent=$(($Indent - 1))&lt;br /&gt;
		done&lt;br /&gt;
	fi&lt;br /&gt;
&lt;br /&gt;
	IFS=&#039;&#039; # To preserve any existing spacing.&lt;br /&gt;
	while read i ; do echo -e &amp;quot;${Prepend}$i&amp;quot; ; done&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;test&amp;quot; | Indent&lt;br /&gt;
	test&lt;br /&gt;
echo &amp;quot;test&amp;quot; | Indent 2&lt;br /&gt;
		test&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Extracting / Parsing Filenames ==&lt;br /&gt;
Use the &amp;lt;code&amp;gt;basename&amp;lt;/code&amp;gt; to extract filenames from a path and and &amp;lt;code&amp;gt;dirname&amp;lt;/code&amp;gt; to extract the path of a filename.&lt;br /&gt;
&lt;br /&gt;
Eg:&lt;br /&gt;
 dirname /etc/hosts&lt;br /&gt;
 /etc&lt;br /&gt;
&lt;br /&gt;
 basename /etc/hosts&lt;br /&gt;
 hosts&lt;br /&gt;
&lt;br /&gt;
To extract only the extension or the filename without the extension, use bash&#039;s string matching:&lt;br /&gt;
 Filename=$(basename /etc/resolv.conf)&lt;br /&gt;
 Ext=&amp;quot;${Filename##*.}&amp;quot;&lt;br /&gt;
 Name=&amp;quot;${Filename%.*}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Arithmetic Operations ==&lt;br /&gt;
Do integer arithmetic operations on variables within double brackets. For example:&lt;br /&gt;
 Value=1&lt;br /&gt;
 ValuePlusOne=$((Value + 1))&lt;br /&gt;
 ValueTimes12=$((Value * 12))&lt;br /&gt;
&lt;br /&gt;
The operators that are supported are:&lt;br /&gt;
 + - / * % &lt;br /&gt;
Bitwise operators also work:&lt;br /&gt;
 ^ (XOR)   | (OR)   &amp;amp; (AND)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control Blocks ==&lt;br /&gt;
=== Switch ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
read -p &amp;quot;What do you want to do?: &amp;quot; Option&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$Option&amp;quot; in&lt;br /&gt;
	&amp;quot;K&amp;quot;)&lt;br /&gt;
		install_new_kernel&lt;br /&gt;
		die &amp;quot;Complete!&amp;quot;&lt;br /&gt;
		;;&lt;br /&gt;
	&amp;quot;H&amp;quot;)&lt;br /&gt;
		usage&lt;br /&gt;
		;;&lt;br /&gt;
	*)&lt;br /&gt;
		die &amp;quot;Stopping installation.&amp;quot;&lt;br /&gt;
		;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Snippets ==&lt;br /&gt;
=== Get First IP Address ===&lt;br /&gt;
 ip a | /bin/grep inet | grep -v inet6 | tail -n+2 | head -n 1 | awk &#039;{print $2}&#039; | cut -d&#039;/&#039; -f1&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
{{Navbox Linux}}&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Bash_Scripting&amp;diff=1142</id>
		<title>Bash Scripting</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Bash_Scripting&amp;diff=1142"/>
		<updated>2015-04-08T18:56:53Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Common Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Common Functions ==&lt;br /&gt;
Here are some common functions I use in my scripts.&lt;br /&gt;
&lt;br /&gt;
=== Prompt ===&lt;br /&gt;
You can prompt the user for an yes or no answer using this function. An optional default values are accepted as the second argument.&lt;br /&gt;
&lt;br /&gt;
Example Usage:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 if prompt &amp;quot;Is this okay?&amp;quot; Y ; then&lt;br /&gt;
    echo &amp;quot;It&#039;s Okay!&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
 if ! prompt &amp;quot;Is this okay?&amp;quot; N ; then&lt;br /&gt;
    echo &amp;quot;It&#039;s not okay!&amp;quot;&lt;br /&gt;
 fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
function prompt() {&lt;br /&gt;
	# credit: http://djm.me/ask&lt;br /&gt;
	while true; do&lt;br /&gt;
		if [ &amp;quot;${2:-}&amp;quot; = &amp;quot;Y&amp;quot; ]; then&lt;br /&gt;
			prompt=&amp;quot;Y/n&amp;quot;&lt;br /&gt;
			default=Y&lt;br /&gt;
		elif [ &amp;quot;${2:-}&amp;quot; = &amp;quot;N&amp;quot; ]; then&lt;br /&gt;
			prompt=&amp;quot;y/N&amp;quot;&lt;br /&gt;
			default=N&lt;br /&gt;
		else&lt;br /&gt;
			prompt=&amp;quot;y/n&amp;quot;&lt;br /&gt;
			default=&lt;br /&gt;
		fi&lt;br /&gt;
&lt;br /&gt;
		# Ask the question&lt;br /&gt;
		read -p &amp;quot;$1 [$prompt] &amp;quot; REPLY&lt;br /&gt;
&lt;br /&gt;
		# Default?&lt;br /&gt;
		if [ -z &amp;quot;$REPLY&amp;quot; ]; then&lt;br /&gt;
			REPLY=$default&lt;br /&gt;
		fi&lt;br /&gt;
&lt;br /&gt;
		# Check if the reply is valid&lt;br /&gt;
		case &amp;quot;$REPLY&amp;quot; in&lt;br /&gt;
			Y*|y*) return 0 ;;&lt;br /&gt;
			N*|n*) return 1 ;;&lt;br /&gt;
		esac&lt;br /&gt;
	done&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== die ===&lt;br /&gt;
Similar to the &amp;lt;code&amp;gt;die&amp;lt;/code&amp;gt; command in PHP which prints out a message before stopping execution.&lt;br /&gt;
&lt;br /&gt;
Function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
function die {&lt;br /&gt;
	echo $@&lt;br /&gt;
	exit&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The caveat is that exit will kill the current shell - if running in a subshell, this will terminate the subshell and not the parent shell. To get around this, you may need to kill the parent PID instead.&lt;br /&gt;
&lt;br /&gt;
=== Indent ===&lt;br /&gt;
Indents text piped to the function.&lt;br /&gt;
&lt;br /&gt;
Function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
function Indent {                                                                                                    &lt;br /&gt;
	Prepend=&amp;quot;\t&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	if [ $# -eq 1 ] ; then&lt;br /&gt;
		Indent=$1&lt;br /&gt;
&lt;br /&gt;
		while [ $Indent -ge 0 ] ; do &lt;br /&gt;
			Prepend=&amp;quot;\t$Prepend&amp;quot;&lt;br /&gt;
			Indent=$(($Indent - 1))&lt;br /&gt;
		done&lt;br /&gt;
	fi&lt;br /&gt;
&lt;br /&gt;
	while read i ; do echo -e &amp;quot;${Prepend}$i&amp;quot; ; done&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;test&amp;quot; | Indent&lt;br /&gt;
	test&lt;br /&gt;
echo &amp;quot;test&amp;quot; | Indent 2&lt;br /&gt;
		test&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Extracting / Parsing Filenames ==&lt;br /&gt;
Use the &amp;lt;code&amp;gt;basename&amp;lt;/code&amp;gt; to extract filenames from a path and and &amp;lt;code&amp;gt;dirname&amp;lt;/code&amp;gt; to extract the path of a filename.&lt;br /&gt;
&lt;br /&gt;
Eg:&lt;br /&gt;
 dirname /etc/hosts&lt;br /&gt;
 /etc&lt;br /&gt;
&lt;br /&gt;
 basename /etc/hosts&lt;br /&gt;
 hosts&lt;br /&gt;
&lt;br /&gt;
To extract only the extension or the filename without the extension, use bash&#039;s string matching:&lt;br /&gt;
 Filename=$(basename /etc/resolv.conf)&lt;br /&gt;
 Ext=&amp;quot;${Filename##*.}&amp;quot;&lt;br /&gt;
 Name=&amp;quot;${Filename%.*}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Arithmetic Operations ==&lt;br /&gt;
Do integer arithmetic operations on variables within double brackets. For example:&lt;br /&gt;
 Value=1&lt;br /&gt;
 ValuePlusOne=$((Value + 1))&lt;br /&gt;
 ValueTimes12=$((Value * 12))&lt;br /&gt;
&lt;br /&gt;
The operators that are supported are:&lt;br /&gt;
 + - / * % &lt;br /&gt;
Bitwise operators also work:&lt;br /&gt;
 ^ (XOR)   | (OR)   &amp;amp; (AND)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control Blocks ==&lt;br /&gt;
=== Switch ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
read -p &amp;quot;What do you want to do?: &amp;quot; Option&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$Option&amp;quot; in&lt;br /&gt;
	&amp;quot;K&amp;quot;)&lt;br /&gt;
		install_new_kernel&lt;br /&gt;
		die &amp;quot;Complete!&amp;quot;&lt;br /&gt;
		;;&lt;br /&gt;
	&amp;quot;H&amp;quot;)&lt;br /&gt;
		usage&lt;br /&gt;
		;;&lt;br /&gt;
	*)&lt;br /&gt;
		die &amp;quot;Stopping installation.&amp;quot;&lt;br /&gt;
		;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Snippets ==&lt;br /&gt;
=== Get First IP Address ===&lt;br /&gt;
 ip a | /bin/grep inet | grep -v inet6 | tail -n+2 | head -n 1 | awk &#039;{print $2}&#039; | cut -d&#039;/&#039; -f1&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
{{Navbox Linux}}&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Arch_Linux&amp;diff=1140</id>
		<title>Arch Linux</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Arch_Linux&amp;diff=1140"/>
		<updated>2015-04-06T21:27:59Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== PXE ==&lt;br /&gt;
If you already have a PXE server, create a new entry that boots their iPXE kernel:&lt;br /&gt;
 cd /tftpboot/images/ArchLinux/&lt;br /&gt;
 wget https://releng.archlinux.org/pxeboot/ipxe.lkrn&lt;br /&gt;
&lt;br /&gt;
The default config (or the config your computer boots off of) should contain:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
LABEL ArchLinux&lt;br /&gt;
	MENU LABEL ArchLinux&lt;br /&gt;
        kernel /images/ArchLinux/ipxe.lkrn&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can customize the kernel to automate installs.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The PXE rom that you can download from ArchLinux&#039;s website points iPXE to fetch PXE data from a remote HTTP server, http://releng.archlinux.org/pxeboot/boot/cfg/. The PXE configs will then boot the live image from one of the many available mirrors that is selected in the boot menu.&lt;br /&gt;
&lt;br /&gt;
=== Remastering ===&lt;br /&gt;
&#039;&#039;&#039;Side Note&#039;&#039;&#039;: You may alter the [[iPXE]] script to use a different server by recompiling the iPXE kernel and automate the install process by appending to the airoot customize script.&lt;br /&gt;
&lt;br /&gt;
 pacman -S archiso&lt;br /&gt;
 cp -r /usr/share/archiso/configs/releng /root&lt;br /&gt;
 # edit relang/airootfs/root/custom*&lt;br /&gt;
 ./build.sh -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 mkarchiso -w work/x86_64 -C work/pacman.conf -D arch init&lt;br /&gt;
 arch-chroot work/x86_64/airootfs mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux -g /boot/archiso.img&lt;br /&gt;
 mksquashfs work/airootfs.img work/iso/arch/x86_64/airootfs.sfs -noappend -comp xz -no-progress&lt;br /&gt;
&lt;br /&gt;
=== Steps ===&lt;br /&gt;
After booting into the live image, you need to:&lt;br /&gt;
# Read the install.txt file&lt;br /&gt;
# Create a file system&lt;br /&gt;
# Mount the file system to /mnt&lt;br /&gt;
# Run &amp;lt;code&amp;gt;pacstrap /mnt/base&amp;lt;/code&amp;gt;&lt;br /&gt;
# Generate fstab &amp;lt;code&amp;gt;genfstab -p /mnt &amp;gt;&amp;gt; /mnt/etc/fstab&amp;lt;/code&amp;gt;&lt;br /&gt;
# Chroot into the new system &amp;lt;code&amp;gt;arch-chroot /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
# Set the hostname &amp;lt;code&amp;gt;echo &amp;quot;hostname&amp;quot; &amp;gt;&amp;gt; /etc/hostname&amp;lt;/code&amp;gt;&lt;br /&gt;
# Set the timezone &amp;lt;code&amp;gt;ln -sf /usr/share/zoneinfo/America/Edmonton /etc/localtime&amp;lt;/code&amp;gt;&lt;br /&gt;
# Locales&lt;br /&gt;
#* Comment out any locales you want in &amp;lt;code&amp;gt;/etc/locale.gen&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Run &amp;lt;code&amp;gt;locale-gen&amp;lt;/code&amp;gt;&lt;br /&gt;
# Set the default locale &amp;lt;code&amp;gt;echo LANG=\&amp;quot;en_US.UTF-8\&amp;quot; &amp;gt; /etc/locale.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
# Set up networking configs ??&lt;br /&gt;
# Console font &amp;lt;code&amp;gt;/etc/vconsole.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
#* echo KEYMAP=\&amp;quot;us\&amp;quot; &amp;gt; /etc/vconsole.conf&lt;br /&gt;
#* echo FONT=\&amp;quot;latarcyrheb-sun16\&amp;quot; &amp;gt;&amp;gt; /etc/vconsole.conf&lt;br /&gt;
# Rebuild ram disk &amp;lt;code&amp;gt;mkinitcpio -p linux&amp;lt;/code&amp;gt;&lt;br /&gt;
# Set the root password &amp;lt;code&amp;gt;passwd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Install a bootloader&lt;br /&gt;
#* pacman -Sy grub&lt;br /&gt;
#* &amp;lt;code&amp;gt;grub-install --target=i386-pc --recheck /dev/sda&amp;lt;/code&amp;gt;&lt;br /&gt;
#* &amp;lt;code&amp;gt;grub-mkconfig -o /boot/grub/grub.cfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot and hope it works.&lt;br /&gt;
&lt;br /&gt;
=== Networking ===&lt;br /&gt;
You may use systemd to configure the network&lt;br /&gt;
 /etc/systemd/network&lt;br /&gt;
Create a file named &amp;lt;code&amp;gt;wired.network&amp;lt;/code&amp;gt; with:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[Match]&lt;br /&gt;
Name=eno1&lt;br /&gt;
&lt;br /&gt;
[Network]&lt;br /&gt;
DHCP=v4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may need to get a list of all network interfaces using:&lt;br /&gt;
 networkctl list | tail -n+2 | head -n+2 | grep -v loopback | awk &#039;{print $2}&#039;&lt;br /&gt;
&lt;br /&gt;
== Package List ==&lt;br /&gt;
 gnome-desktop nvidia-304xx-libgl &lt;br /&gt;
 lightdm lightdm-gtk-greeter &lt;br /&gt;
 &lt;br /&gt;
 qt&lt;br /&gt;
 &lt;br /&gt;
 dmidecode&lt;br /&gt;
 &lt;br /&gt;
 accountsservices&lt;br /&gt;
 &lt;br /&gt;
 salt-zmq&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mirroring ==&lt;br /&gt;
 rsync -rtlH --delete-after --exclude=&#039;*i686*&#039; --delay-updates --copy-links --safe-links --max-delete=1000 --progress rsync://mirror.csclub.uwaterloo.ca/archlinux/community .&lt;br /&gt;
&lt;br /&gt;
* https://www.archlinux.org/mirrors/status/&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Syslog&amp;diff=1139</id>
		<title>Syslog</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Syslog&amp;diff=1139"/>
		<updated>2015-04-06T19:59:10Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Log all kernel messages to the console.&lt;br /&gt;
# Logging much else clutters up the screen.&lt;br /&gt;
#kern.*                                                 /dev/console&lt;br /&gt;
&lt;br /&gt;
# Log anything (except mail) of level info or higher.&lt;br /&gt;
# Don&#039;t log private authentication messages!&lt;br /&gt;
*.info;mail.none;authpriv.none;cron.none                /var/log/messages&lt;br /&gt;
&lt;br /&gt;
# The authpriv file has restricted access.&lt;br /&gt;
authpriv.*                                              /var/log/secure&lt;br /&gt;
&lt;br /&gt;
# Log all the mail messages in one place.&lt;br /&gt;
mail.*                                                  -/var/log/maillog&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Log cron stuff&lt;br /&gt;
cron.*                                                  /var/log/cron&lt;br /&gt;
&lt;br /&gt;
# Everybody gets emergency messages&lt;br /&gt;
*.emerg                                                 *&lt;br /&gt;
&lt;br /&gt;
# Save news errors of level crit and higher in a special file.&lt;br /&gt;
uucp,news.crit                                          /var/log/spooler&lt;br /&gt;
&lt;br /&gt;
# Save boot messages also to boot.log&lt;br /&gt;
local7.*                                                /var/log/boot.log&lt;br /&gt;
&lt;br /&gt;
# Log to the logstash server&lt;br /&gt;
*.* @@logstash.cs.ucalgary.ca:5544&lt;br /&gt;
&lt;br /&gt;
# Log to the old loghost server&lt;br /&gt;
*.* @loghost&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[root@leo-archer log]# systemctl start rsyslog&lt;br /&gt;
A dependency job for rsyslog.service failed. See &#039;journalctl -xe&#039; for details.&lt;br /&gt;
&lt;br /&gt;
journalctl -xe&lt;br /&gt;
&lt;br /&gt;
-- The result is failed.&lt;br /&gt;
Apr 06 13:55:27 leo-archer systemd[1]: Dependency failed for System Logging Service.&lt;br /&gt;
-- Subject: Unit rsyslog.service has failed&lt;br /&gt;
-- Defined-By: systemd&lt;br /&gt;
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel&lt;br /&gt;
-- &lt;br /&gt;
-- Unit rsyslog.service has failed.&lt;br /&gt;
-- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
systemctl enable rsyslog&lt;br /&gt;
systemctl start rsyslog&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Syslog&amp;diff=1138</id>
		<title>Syslog</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Syslog&amp;diff=1138"/>
		<updated>2015-04-06T19:57:53Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: Created page with &amp;quot; &amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt; [root@leo-archer log]# systemctl start rsyslog A dependency job for rsyslog.service failed. See &amp;#039;journalctl -xe&amp;#039; for details.  journalctl -xe  -...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[root@leo-archer log]# systemctl start rsyslog&lt;br /&gt;
A dependency job for rsyslog.service failed. See &#039;journalctl -xe&#039; for details.&lt;br /&gt;
&lt;br /&gt;
journalctl -xe&lt;br /&gt;
&lt;br /&gt;
-- The result is failed.&lt;br /&gt;
Apr 06 13:55:27 leo-archer systemd[1]: Dependency failed for System Logging Service.&lt;br /&gt;
-- Subject: Unit rsyslog.service has failed&lt;br /&gt;
-- Defined-By: systemd&lt;br /&gt;
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel&lt;br /&gt;
-- &lt;br /&gt;
-- Unit rsyslog.service has failed.&lt;br /&gt;
-- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
systemctl enable rsyslog&lt;br /&gt;
systemctl start rsyslog&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Arch_Linux&amp;diff=1136</id>
		<title>Arch Linux</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Arch_Linux&amp;diff=1136"/>
		<updated>2015-04-06T17:32:02Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== PXE ==&lt;br /&gt;
If you already have a PXE server, create a new entry that boots their iPXE kernel:&lt;br /&gt;
 cd /tftpboot/images/ArchLinux/&lt;br /&gt;
 wget https://releng.archlinux.org/pxeboot/ipxe.lkrn&lt;br /&gt;
&lt;br /&gt;
The default config (or the config your computer boots off of) should contain:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
LABEL ArchLinux&lt;br /&gt;
	MENU LABEL ArchLinux&lt;br /&gt;
        kernel /images/ArchLinux/ipxe.lkrn&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can customize the kernel to automate installs.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
The PXE rom that you can download from ArchLinux&#039;s website points iPXE to fetch PXE data from a remote HTTP server, http://releng.archlinux.org/pxeboot/boot/cfg/. The PXE configs will then boot the live image from one of the many available mirrors that is selected in the boot menu.&lt;br /&gt;
&lt;br /&gt;
=== Remastering ===&lt;br /&gt;
&#039;&#039;&#039;Side Note&#039;&#039;&#039;: You may alter the [[iPXE]] script to use a different server by recompiling the iPXE kernel and automate the install process by appending to the airoot customize script.&lt;br /&gt;
&lt;br /&gt;
 pacman -S archiso&lt;br /&gt;
 cp -r /usr/share/archiso/configs/releng /root&lt;br /&gt;
 # edit relang/airootfs/root/custom*&lt;br /&gt;
 ./build.sh -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 mkarchiso -w work/x86_64 -C work/pacman.conf -D arch init&lt;br /&gt;
 arch-chroot work/x86_64/airootfs mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux -g /boot/archiso.img&lt;br /&gt;
 mksquashfs work/airootfs.img work/iso/arch/x86_64/airootfs.sfs -noappend -comp xz -no-progress&lt;br /&gt;
&lt;br /&gt;
=== Steps ===&lt;br /&gt;
After booting into the live image, you need to:&lt;br /&gt;
# Read the install.txt file&lt;br /&gt;
# Create a file system&lt;br /&gt;
# Mount the file system to /mnt&lt;br /&gt;
# Run &amp;lt;code&amp;gt;pacstrap /mnt/base&amp;lt;/code&amp;gt;&lt;br /&gt;
# Generate fstab &amp;lt;code&amp;gt;genfstab -p /mnt &amp;gt;&amp;gt; /mnt/etc/fstab&amp;lt;/code&amp;gt;&lt;br /&gt;
# Chroot into the new system &amp;lt;code&amp;gt;arch-chroot /mnt&amp;lt;/code&amp;gt;&lt;br /&gt;
# Set the hostname &amp;lt;code&amp;gt;echo &amp;quot;hostname&amp;quot; &amp;gt;&amp;gt; /etc/hostname&amp;lt;/code&amp;gt;&lt;br /&gt;
# Set the timezone &amp;lt;code&amp;gt;ln -sf /usr/share/zoneinfo/America/Edmonton /etc/localtime&amp;lt;/code&amp;gt;&lt;br /&gt;
# Locales&lt;br /&gt;
#* Comment out any locales you want in &amp;lt;code&amp;gt;/etc/locale.gen&amp;lt;/code&amp;gt;&lt;br /&gt;
#* Run &amp;lt;code&amp;gt;locale-gen&amp;lt;/code&amp;gt;&lt;br /&gt;
# Set the default locale &amp;lt;code&amp;gt;echo LANG=\&amp;quot;en_US.UTF-8\&amp;quot; &amp;gt; /etc/locale.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
# Set up networking configs ??&lt;br /&gt;
# Console font &amp;lt;code&amp;gt;/etc/vconsole.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
#* echo KEYMAP=\&amp;quot;us\&amp;quot; &amp;gt; /etc/vconsole.conf&lt;br /&gt;
#* echo FONT=\&amp;quot;latarcyrheb-sun16\&amp;quot; &amp;gt;&amp;gt; /etc/vconsole.conf&lt;br /&gt;
# Rebuild ram disk &amp;lt;code&amp;gt;mkinitcpio -p linux&amp;lt;/code&amp;gt;&lt;br /&gt;
# Set the root password &amp;lt;code&amp;gt;passwd&amp;lt;/code&amp;gt;&lt;br /&gt;
# Install a bootloader&lt;br /&gt;
#* pacman -Sy grub&lt;br /&gt;
#* &amp;lt;code&amp;gt;grub-install --target=i386-pc --recheck /dev/sda&amp;lt;/code&amp;gt;&lt;br /&gt;
#* &amp;lt;code&amp;gt;grub-mkconfig -o /boot/grub/grub.cfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reboot and hope it works.&lt;br /&gt;
&lt;br /&gt;
== Package List ==&lt;br /&gt;
 gnome-desktop nvidia-304xx-libgl &lt;br /&gt;
 lightdm lightdm-gtk-greeter &lt;br /&gt;
 &lt;br /&gt;
 qt&lt;br /&gt;
 &lt;br /&gt;
 dmidecode&lt;br /&gt;
 &lt;br /&gt;
 accountsservices&lt;br /&gt;
 &lt;br /&gt;
 salt-zmq&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mirroring ==&lt;br /&gt;
 rsync -rtlH --delete-after --exclude=&#039;*i686*&#039; --delay-updates --copy-links --safe-links --max-delete=1000 --progress rsync://mirror.csclub.uwaterloo.ca/archlinux/community .&lt;br /&gt;
&lt;br /&gt;
* https://www.archlinux.org/mirrors/status/&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Pacman&amp;diff=1135</id>
		<title>Pacman</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Pacman&amp;diff=1135"/>
		<updated>2015-04-06T17:29:49Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Pacman is the package manager for arch linux.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Configuration files are stored in /etc/pacman&lt;br /&gt;
=== Updating Databases ===&lt;br /&gt;
&lt;br /&gt;
Similar to a &amp;lt;code&amp;gt;yum clean all ; yum update&amp;lt;/code&amp;gt; you can update the repository information by running:&lt;br /&gt;
 pacman -Syy&lt;br /&gt;
&lt;br /&gt;
=== Searching ===&lt;br /&gt;
Search for a package&lt;br /&gt;
 pacman -Ss packageName&lt;br /&gt;
&lt;br /&gt;
=== Installing ===&lt;br /&gt;
 pacman -S packageName groupName&lt;br /&gt;
&lt;br /&gt;
=== Updating System ===&lt;br /&gt;
 pacman -Syu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:PackageManagement]]&lt;br /&gt;
{{Navbox Linux}}&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Bash_Scripting&amp;diff=1106</id>
		<title>Bash Scripting</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Bash_Scripting&amp;diff=1106"/>
		<updated>2015-03-31T18:09:50Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: Created page with &amp;quot; == Extracting / Parsing Filenames == Use the &amp;lt;code&amp;gt;basename&amp;lt;/code&amp;gt; to extract filenames from a path and and &amp;lt;code&amp;gt;dirname&amp;lt;/code&amp;gt; to extract the path of a filename.  Eg:  dirn...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Extracting / Parsing Filenames ==&lt;br /&gt;
Use the &amp;lt;code&amp;gt;basename&amp;lt;/code&amp;gt; to extract filenames from a path and and &amp;lt;code&amp;gt;dirname&amp;lt;/code&amp;gt; to extract the path of a filename.&lt;br /&gt;
&lt;br /&gt;
Eg:&lt;br /&gt;
 dirname /etc/hosts&lt;br /&gt;
 /etc&lt;br /&gt;
&lt;br /&gt;
 basename /etc/hosts&lt;br /&gt;
 hosts&lt;br /&gt;
&lt;br /&gt;
To extract only the extension or the filename without the extension, use bash&#039;s string matching:&lt;br /&gt;
 Filename=$(basename /etc/resolv.conf)&lt;br /&gt;
 Ext=&amp;quot;${Filename##*.}&amp;quot;&lt;br /&gt;
 Name=&amp;quot;${Filename%.*}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Arithmetic Operations ==&lt;br /&gt;
Do integer arithmetic operations on variables within double brackets. For example:&lt;br /&gt;
 Value=1&lt;br /&gt;
 ValuePlusOne=$((Value + 1))&lt;br /&gt;
 ValueTimes12=$((Value * 12))&lt;br /&gt;
&lt;br /&gt;
The operators that are supported are:&lt;br /&gt;
 + - / * % &lt;br /&gt;
Bitwise operators also work:&lt;br /&gt;
 ^ (XOR)   | (OR)   &amp;amp; (AND)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
{{Navbox Linux}}&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Self_Signed_SSL_Certificates&amp;diff=1089</id>
		<title>Self Signed SSL Certificates</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Self_Signed_SSL_Certificates&amp;diff=1089"/>
		<updated>2015-03-30T16:28:40Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Self-signed SSL certificates can be used to set up a temporary or personal SSL web server. It may be useful in cases where you don&#039;t want to spend money for security or if you distrust all certificate authorities&lt;br /&gt;
&lt;br /&gt;
To quickly generate a self-signed certificate, enter a domain name below and follow the instructions:&lt;br /&gt;
&amp;lt;htmlet nocache=&amp;quot;yes&amp;quot;&amp;gt;selfsignedssl-js&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the following commands on a *NIX machine with OpenSSL installed:&lt;br /&gt;
&amp;lt;htmlet nocache=&amp;quot;yes&amp;quot;&amp;gt;selfsignedssl-cmd&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To configure apache to use the newly created key and SSL certificate, create a new &amp;lt;code&amp;gt;VirtualHost&amp;lt;/code&amp;gt; with the configuration below:&lt;br /&gt;
&amp;lt;htmlet nocache=&amp;quot;yes&amp;quot;&amp;gt;selfsignedssl-apache&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Explaination ===&lt;br /&gt;
&lt;br /&gt;
== Renewing an Expired Self Signed Certificate ==&lt;br /&gt;
You can check the status of a certificate using:&lt;br /&gt;
 openssl x509 -in cert.crt -text -noout&lt;br /&gt;
&lt;br /&gt;
If it has expired, you can &#039;renew&#039; it by first regenerating a certificate signing request (CSR):&lt;br /&gt;
 openssl x509 -x509toreq -in expired_certificate.crt -out new_csr.csr -signkey domain_private.key&lt;br /&gt;
&lt;br /&gt;
Then signing the CSR with the private key to produce a new certificate:&lt;br /&gt;
 openssl x509 -req -days 3650 -in new_csr.csr -signkey domain_private.key -out new_certificate.crt&lt;br /&gt;
&lt;br /&gt;
Replace the expired certificate with the new certificate and reload any services that are using the certificate for it to be applied.&lt;br /&gt;
&lt;br /&gt;
== Trusting Your Self Signed SSL Certificates ==&lt;br /&gt;
The key and certificate generated with the steps above will not be signed by a trusted certificate authority and therefore cannot be verified by your browser, resulting in a security warning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other Notes ==&lt;br /&gt;
&lt;br /&gt;
Note: Ensure that all keys are not readable to others. chmod 700 the ssl directory and chmod 600 all the keys.&lt;br /&gt;
&lt;br /&gt;
openssl req -new -x509 -key www.example.com.key -out www.example.com.cert -days 3650 -subj /CN=www.example.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[OpenSSL]]&lt;br /&gt;
* https://www.sslshopper.com/article-most-common-openssl-commands.html&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Self_Signed_SSL_Certificates&amp;diff=1088</id>
		<title>Self Signed SSL Certificates</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Self_Signed_SSL_Certificates&amp;diff=1088"/>
		<updated>2015-03-30T16:28:14Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Self-signed SSL certificates can be used to set up a temporary or personal SSL web server. It may be useful in cases where you don&#039;t want to spend money for security or if you distrust all certificate authorities&lt;br /&gt;
&lt;br /&gt;
To quickly generate a self-signed certificate, enter a domain name below and follow the instructions:&lt;br /&gt;
&amp;lt;htmlet nocache=&amp;quot;yes&amp;quot;&amp;gt;selfsignedssl-js&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the following commands on a *NIX machine with OpenSSL installed:&lt;br /&gt;
&amp;lt;htmlet nocache=&amp;quot;yes&amp;quot;&amp;gt;selfsignedssl-cmd&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To configure apache to use the newly created key and SSL certificate, create a new &amp;lt;code&amp;gt;VirtualHost&amp;lt;/code&amp;gt; with the configuration below:&lt;br /&gt;
&amp;lt;htmlet nocache=&amp;quot;yes&amp;quot;&amp;gt;selfsignedssl-apache&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Explaination ===&lt;br /&gt;
&lt;br /&gt;
== Renewing an Expired Self Signed Certificate ==&lt;br /&gt;
You can check the status of a certificate using:&lt;br /&gt;
 openssl x509 -in cert.crt -text -noout&lt;br /&gt;
&lt;br /&gt;
If it has expired, you can &#039;renew&#039; it by first regenerating a certificate signing request (CSR):&lt;br /&gt;
 openssl x509 -x509toreq -in expired_certificate.crt -out new_csr.csr -signkey domain_private.key&lt;br /&gt;
&lt;br /&gt;
Then signing the CSR with the private key to produce a new certificate:&lt;br /&gt;
 openssl x509 -req -days 3650 -in new_csr.csr -signkey domain_private.key -out new_certificate.crt&lt;br /&gt;
&lt;br /&gt;
Replace the expired certificate with the new certificate and reload any services that are using the certificate for it to be applied.&lt;br /&gt;
&lt;br /&gt;
== Trusting Your Self Signed SSL Certificates ==&lt;br /&gt;
The key and certificate generated with the steps above will not be signed by a trusted certificate authority and therefore cannot be verified by your browser, resulting in a security warning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other Notes ==&lt;br /&gt;
&lt;br /&gt;
Note: Ensure that all keys are not readable to others. chmod 700 the ssl directory and chmod 600 all the keys.&lt;br /&gt;
&lt;br /&gt;
openssl req -new -x509 -key www.example.com.key -out www.example.com.cert -days 3650 -subj /CN=www.example.com&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Self_Signed_SSL_Certificates&amp;diff=1087</id>
		<title>Self Signed SSL Certificates</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Self_Signed_SSL_Certificates&amp;diff=1087"/>
		<updated>2015-03-30T16:27:53Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Self-signed SSL certificates can be used to set up a temporary or personal SSL web server. It may be useful in cases where you don&#039;t want to spend money for security or if you distrust all certificate authorities&lt;br /&gt;
&lt;br /&gt;
To quickly generate a self-signed certificate, enter a domain name below and follow the instructions:&lt;br /&gt;
&amp;lt;htmlet nocache=&amp;quot;yes&amp;quot;&amp;gt;selfsignedssl-js&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Run the following commands on a *NIX machine with OpenSSL installed:&lt;br /&gt;
&amp;lt;htmlet nocache=&amp;quot;yes&amp;quot;&amp;gt;selfsignedssl-cmd&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To configure apache to use the newly created key and SSL certificate, create a new &amp;lt;code&amp;gt;VirtualHost&amp;lt;/code&amp;gt; with the configuration below:&lt;br /&gt;
&amp;lt;htmlet nocache=&amp;quot;yes&amp;quot;&amp;gt;selfsignedssl-apache&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Explaination ===&lt;br /&gt;
&lt;br /&gt;
== Renewing an Expired Self Signed Certificate ==&lt;br /&gt;
You can check the status of a certificate using:&lt;br /&gt;
 openssl x509 -in cert.crt -text -noout&lt;br /&gt;
&lt;br /&gt;
If it has expired, you can &#039;renew&#039; it by first regenerating a certificate signing request (CSR):&lt;br /&gt;
 openssl x509 -x509toreq -in expired_certificate.crt -out new_csr.csr -signkey domain_private.key&lt;br /&gt;
&lt;br /&gt;
Then signing the CSR with the private key to produce a new certificate:&lt;br /&gt;
 openssl x509 -req -days 3650 -in new_csr.csr -signkey domain_private.key -out new_certificate.crt&lt;br /&gt;
&lt;br /&gt;
Replace the expired certificate with the new certificate and reload any services that are using the certificate for it to be applied.&lt;br /&gt;
&lt;br /&gt;
== Trusting Your Self Signed SSL Certificates ==&lt;br /&gt;
The key and certificate generated with the steps above will not be signed by a trusted certificate authority and therefore cannot be verified by your browser, resulting in a security warning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other Notes ==&lt;br /&gt;
&lt;br /&gt;
Note: Ensure that all keys are not readable to others. chmod 700 the ssl directory and chmod 600 all the keys.&lt;br /&gt;
&lt;br /&gt;
openssl req -new -x509 -key www.example.com.key -out www.example.com.cert -days 3650 -subj /CN=www.example.com&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Sed&amp;diff=923</id>
		<title>Sed</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Sed&amp;diff=923"/>
		<updated>2015-03-23T19:15:07Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Modifying a File Directly ==&lt;br /&gt;
&lt;br /&gt;
Using the above tips, you can modify a file directly by using the &amp;lt;code&amp;gt;-i&amp;lt;/code&amp;gt; parameter, with the filename as the second argument:&lt;br /&gt;
 sed -i &amp;quot;search&amp;quot; /path/to/file&lt;br /&gt;
&lt;br /&gt;
== Simple search / replace ==&lt;br /&gt;
Global search and replace:&lt;br /&gt;
 sed &#039;s/&amp;lt;search&amp;gt;/&amp;lt;replace&amp;gt;/g&#039;&lt;br /&gt;
&lt;br /&gt;
To replace only the first match:&lt;br /&gt;
 sed &#039;0,/&amp;lt;search&amp;gt;/s//&amp;lt;replace&amp;gt;/&#039;&lt;br /&gt;
&lt;br /&gt;
== Remove HTML tags ==&lt;br /&gt;
&lt;br /&gt;
 sed -e &#039;s/&amp;lt;[^&amp;gt;]*&amp;gt;//g&#039; &amp;lt;file&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Remove File Extensions ==&lt;br /&gt;
&lt;br /&gt;
 sed &#039;s/\(.*\)\..*/\1/&#039;&lt;br /&gt;
&lt;br /&gt;
eg:&lt;br /&gt;
 echo &amp;quot;house.txt&amp;quot; | sed &#039;s/\(.*\)\..*/\1/&#039;  # returns &#039;house&#039;&lt;br /&gt;
&lt;br /&gt;
== Delete Matching Line ==&lt;br /&gt;
&lt;br /&gt;
 sed &#039;/someline/d&#039;&lt;br /&gt;
&lt;br /&gt;
== Inserting a Line Before/After a Match ==&lt;br /&gt;
&lt;br /&gt;
Use: &amp;lt;code&amp;gt;0,/&amp;lt;regex&amp;gt;/s//&amp;lt;replacement text where \0 is the found line&amp;gt;/&amp;lt;/code&amp;gt;&lt;br /&gt;
 # Add a password line before the first title entry in the grub.conf file.&lt;br /&gt;
 sed -i &amp;quot;0,/^title/s//password --encrypted $Password\n\n\0/&amp;quot; $GrubConfig&lt;br /&gt;
&lt;br /&gt;
To append after, just put \0 before your replacement text.&lt;br /&gt;
&lt;br /&gt;
== Grap Specific Section using Regex ==&lt;br /&gt;
To grab a specific section of a string, for instance &#039;3&#039; in &#039;Server time offset: 3&#039;:&lt;br /&gt;
 echo &#039;Server time offset: 3&#039; | sed -n -e &#039;s/.*: \([0-9]*\)/\1/p&#039;&lt;br /&gt;
&lt;br /&gt;
This can also be done with grep, though it isn&#039;t regex:&lt;br /&gt;
 echo &#039;Server time offset: 3&#039; | /bin/grep -ohE &#039;[0-9]*&#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:TipsnTricks]]&lt;br /&gt;
[[Category:Code]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Awk&amp;diff=922</id>
		<title>Awk</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Awk&amp;diff=922"/>
		<updated>2015-03-23T18:00:58Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: /* Convert ps Elapsed Time to Seconds */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Counting Lines Until Match ==&lt;br /&gt;
&lt;br /&gt;
To print the number of lines before a match is found:&lt;br /&gt;
 awk &#039;BEGIN { n = 0 } /PATTERN/ { print n; next } { n++ }&#039;&lt;br /&gt;
&lt;br /&gt;
Eg: Suppose I have a file with the contents:&lt;br /&gt;
 leo&lt;br /&gt;
 spoon&lt;br /&gt;
 cake&lt;br /&gt;
 fork&lt;br /&gt;
&lt;br /&gt;
To find the number of lines up until &#039;cake&#039;, do:&lt;br /&gt;
 cat list.txt | awk &#039;BEGIN { n = 0 } /cake/ { print n; next } { n++ }&#039;&lt;br /&gt;
&lt;br /&gt;
== Convert Number as Bytes to Human Readable Value ==&lt;br /&gt;
I wanted to sort size in reverse order, but in order to do that properly, the value from du needs to be in kilobytes. I also didn&#039;t want to run this through du again just to get the human readable value. So, I did this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line start=&amp;quot;1&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
du -s ./*/ ./*/*/ ./*/*/*/ \ &lt;br /&gt;
   | sort -rn \ &lt;br /&gt;
   | awk &#039;BEGIN { \ &lt;br /&gt;
      split(&amp;quot;KB MB GB TB PB&amp;quot;, type) \ &lt;br /&gt;
   } \ &lt;br /&gt;
   { \ &lt;br /&gt;
      y = 0; \                                                                                                  &lt;br /&gt;
      x = $1; \ &lt;br /&gt;
      for (i = 4; y &amp;lt; 1 ; i--) \ &lt;br /&gt;
         y = x / (2 ** (10 * i)); \ &lt;br /&gt;
      print y type[i+2]&amp;quot; &amp;quot;$2 \ &lt;br /&gt;
   }&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to count using bytes instead of kilobytes, just add K to the split function and replace i=4 with i=5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Convert &amp;lt;code&amp;gt;ps&amp;lt;/code&amp;gt; Elapsed Time to Seconds ==&lt;br /&gt;
To convert the elapsed time (in [http://pubs.opengroup.org/onlinepubs/009696799/utilities/ps.html POSIX locale] formatted as &amp;lt;code&amp;gt;[[dd-]hh:]mm:ss&amp;lt;/code&amp;gt;) to seconds using awk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
Elapsed=`ps -p $Pid -o etime=`&lt;br /&gt;
Elapsed=`echo $Elapsed | tr - : | tr : &#039; &#039;` &lt;br /&gt;
Seconds=`echo $Elapsed | awk &#039; &lt;br /&gt;
	NF == 2 { print ($1 * 60) + $2 } &lt;br /&gt;
	NF == 3 { print ((($1 * 60) + $2) * 60) + $3 } &lt;br /&gt;
	NF == 4 { print ((((($1 * 24) + $2) * 60) + $3) * 60) + $4 } &lt;br /&gt;
	{}&#039;` &lt;br /&gt;
echo $Seconds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, a process running for &amp;lt;code&amp;gt;66-00:12:58&amp;lt;/code&amp;gt; has been running for 5703178 seconds. The Awk command will match how many columns were found and then do the proper calculation.&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:TipsnTricks]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Awk&amp;diff=921</id>
		<title>Awk</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Awk&amp;diff=921"/>
		<updated>2015-03-23T17:57:59Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Counting Lines Until Match ==&lt;br /&gt;
&lt;br /&gt;
To print the number of lines before a match is found:&lt;br /&gt;
 awk &#039;BEGIN { n = 0 } /PATTERN/ { print n; next } { n++ }&#039;&lt;br /&gt;
&lt;br /&gt;
Eg: Suppose I have a file with the contents:&lt;br /&gt;
 leo&lt;br /&gt;
 spoon&lt;br /&gt;
 cake&lt;br /&gt;
 fork&lt;br /&gt;
&lt;br /&gt;
To find the number of lines up until &#039;cake&#039;, do:&lt;br /&gt;
 cat list.txt | awk &#039;BEGIN { n = 0 } /cake/ { print n; next } { n++ }&#039;&lt;br /&gt;
&lt;br /&gt;
== Convert Number as Bytes to Human Readable Value ==&lt;br /&gt;
I wanted to sort size in reverse order, but in order to do that properly, the value from du needs to be in kilobytes. I also didn&#039;t want to run this through du again just to get the human readable value. So, I did this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line start=&amp;quot;1&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
du -s ./*/ ./*/*/ ./*/*/*/ \ &lt;br /&gt;
   | sort -rn \ &lt;br /&gt;
   | awk &#039;BEGIN { \ &lt;br /&gt;
      split(&amp;quot;KB MB GB TB PB&amp;quot;, type) \ &lt;br /&gt;
   } \ &lt;br /&gt;
   { \ &lt;br /&gt;
      y = 0; \                                                                                                  &lt;br /&gt;
      x = $1; \ &lt;br /&gt;
      for (i = 4; y &amp;lt; 1 ; i--) \ &lt;br /&gt;
         y = x / (2 ** (10 * i)); \ &lt;br /&gt;
      print y type[i+2]&amp;quot; &amp;quot;$2 \ &lt;br /&gt;
   }&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to count using bytes instead of kilobytes, just add K to the split function and replace i=4 with i=5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Convert &amp;lt;code&amp;gt;ps&amp;lt;/code&amp;gt; Elapsed Time to Seconds ==&lt;br /&gt;
To convert the elapsed time (in [[http://pubs.opengroup.org/onlinepubs/009696799/utilities/ps.html|POSIX locale]] formatted as &amp;lt;code&amp;gt;[[dd-]hh:]mm:ss&amp;lt;/code&amp;gt;) to seconds using awk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
Elapsed=`ps -p $Pid -o etime=`&lt;br /&gt;
Elapsed=`echo $Elapsed | tr - : | tr : &#039; &#039;` &lt;br /&gt;
Seconds=`echo $Elapsed | awk &#039; &lt;br /&gt;
	NF == 2 { print ($1 * 60) + $2 } &lt;br /&gt;
	NF == 3 { print ((($1 * 60) + $2) * 60) + $3 } &lt;br /&gt;
	NF == 4 { print ((((($1 * 24) + $2) * 60) + $3) * 60) + $4 } &lt;br /&gt;
	{}&#039;` &lt;br /&gt;
echo $Seconds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:TipsnTricks]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Awk&amp;diff=920</id>
		<title>Awk</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Awk&amp;diff=920"/>
		<updated>2015-03-23T17:56:52Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Counting Lines Until Match ==&lt;br /&gt;
&lt;br /&gt;
To print the number of lines before a match is found:&lt;br /&gt;
 awk &#039;BEGIN { n = 0 } /PATTERN/ { print n; next } { n++ }&#039;&lt;br /&gt;
&lt;br /&gt;
Eg: Suppose I have a file with the contents:&lt;br /&gt;
 leo&lt;br /&gt;
 spoon&lt;br /&gt;
 cake&lt;br /&gt;
 fork&lt;br /&gt;
&lt;br /&gt;
To find the number of lines up until &#039;cake&#039;, do:&lt;br /&gt;
 cat list.txt | awk &#039;BEGIN { n = 0 } /cake/ { print n; next } { n++ }&#039;&lt;br /&gt;
&lt;br /&gt;
== Convert Number as Bytes to Human Readable Value ==&lt;br /&gt;
I wanted to sort size in reverse order, but in order to do that properly, the value from du needs to be in kilobytes. I also didn&#039;t want to run this through du again just to get the human readable value. So, I did this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line start=&amp;quot;1&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
du -s ./*/ ./*/*/ ./*/*/*/ \ &lt;br /&gt;
   | sort -rn \ &lt;br /&gt;
   | awk &#039;BEGIN { \ &lt;br /&gt;
      split(&amp;quot;KB MB GB TB PB&amp;quot;, type) \ &lt;br /&gt;
   } \ &lt;br /&gt;
   { \ &lt;br /&gt;
      y = 0; \                                                                                                  &lt;br /&gt;
      x = $1; \ &lt;br /&gt;
      for (i = 4; y &amp;lt; 1 ; i--) \ &lt;br /&gt;
         y = x / (2 ** (10 * i)); \ &lt;br /&gt;
      print y type[i+2]&amp;quot; &amp;quot;$2 \ &lt;br /&gt;
   }&#039; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to count using bytes instead of kilobytes, just add K to the split function and replace i=4 with i=5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Convert &amp;lt;code&amp;gt;ps&amp;lt;/code&amp;gt; Elapsed Time to Seconds ==&lt;br /&gt;
To convert the elapsed time (in POSIX locale formatted as &amp;lt;code&amp;gt;[[dd-]hh:]mm:ss&amp;lt;/code&amp;gt;) to seconds using awk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
Elapsed=`ps -p $Pid -o etime=`&lt;br /&gt;
Elapsed=`echo $Elapsed | tr - : | tr : &#039; &#039;` &lt;br /&gt;
Seconds=`echo $Elapsed | awk &#039; &lt;br /&gt;
	NF == 2 { print ($1 * 60) + $2 } &lt;br /&gt;
	NF == 3 { print ((($1 * 60) + $2) * 60) + $3 } &lt;br /&gt;
	NF == 4 { print ((((($1 * 24) + $2) * 60) + $3) * 60) + $4 } &lt;br /&gt;
	{}&#039;` &lt;br /&gt;
echo $Seconds&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;br /&gt;
[[Category:TipsnTricks]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=Vnstat&amp;diff=919</id>
		<title>Vnstat</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=Vnstat&amp;diff=919"/>
		<updated>2015-03-23T17:00:47Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation ==&lt;br /&gt;
The following steps should work for CentOS/ScientificLinux/RHEL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line start=&amp;quot;1&amp;quot; enclose=&amp;quot;div&amp;quot;&amp;gt;&lt;br /&gt;
wget http://humdi.net/vnstat/vnstat-1.11.tar.gz&lt;br /&gt;
tar -xzf vnstat-1.11.tar.gz&lt;br /&gt;
cd vnstat-1.11&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
vnstat --testkernel&lt;br /&gt;
/bin/cp examples/init.d/centos/vnstat /etc/init.d/vnstat&lt;br /&gt;
chkconfig --levels 234 --add vnstat&lt;br /&gt;
vnstat -u -i eth0&lt;br /&gt;
/etc/init.d/vnstat start&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
You do not need to interface with vnstat directly since vnstat will create a cronjob in &amp;lt;code&amp;gt;/etc/cron.d/vnstat&amp;lt;/code&amp;gt; which will run &amp;lt;code&amp;gt;/usr/sbin/vnstat.cron&amp;lt;/code&amp;gt; as nobody every 5 minutes.&lt;br /&gt;
&lt;br /&gt;
However, you may need to fix or initialize the database.&lt;br /&gt;
&lt;br /&gt;
=== Initializing Database ===&lt;br /&gt;
To initialize a database for a specific device:&lt;br /&gt;
 vnstat -u -i $NetInterface&lt;br /&gt;
&lt;br /&gt;
=== Force Update ===&lt;br /&gt;
 sudo -u /usr/sbin/vnstat.cron --force&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
	<entry>
		<id>https://leo.leung.xyz/wiki/index.php?title=IPv6&amp;diff=897</id>
		<title>IPv6</title>
		<link rel="alternate" type="text/html" href="https://leo.leung.xyz/wiki/index.php?title=IPv6&amp;diff=897"/>
		<updated>2015-03-19T21:36:51Z</updated>

		<summary type="html">&lt;p&gt;136.159.16.240: Created page with &amp;quot; To disable IPv6 # sysctl net.ipv6.conf.all.disable_ipv6=1 # sysctl net.ipv6.conf.default.disable_ipv6=1 # sysctl net.ipv6.conf.lo.disable_ipv6=1   Category:Linux&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
To disable IPv6&lt;br /&gt;
# sysctl net.ipv6.conf.all.disable_ipv6=1&lt;br /&gt;
# sysctl net.ipv6.conf.default.disable_ipv6=1&lt;br /&gt;
# sysctl net.ipv6.conf.lo.disable_ipv6=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>136.159.16.240</name></author>
	</entry>
</feed>