Chrooting to Arch Linux ARM from Arch Linux

Yesterday, after updating my Arch Linux ARM on my raspberry pi 2, I could not no longer log in to the OS.
The culprit was libtirpc-1.0.1-2-armv7h.pkg.tar.xz. After downgrading it to libtirpc-0.3.2-2-armv7h.pkg.tar.xz, I could log in again.
However, to downgrade the package I had to chroot to my microsd card in which Arch Linux ARM is saved, from my Arch Linux.
Chrooting to a machine of different architecture required extra steps.
Here’s how I have done it.

1. Install qemu-user-static and binfmt-support from AUR
yaourt qemu-user-static
yaourt binfmt-support

2. Copy qemu-arm to the sdcard.
cp -p /usr/bin/qemu-arm-static /mnt/usr/bin/

3. Chroot!
chroot /mnt qemu-arm-static /bin/bash

4. Downgrade the package.
qemu-arm-static /usr/bin/pacman -U /var/cache/pacman/pkg/libtirpc-0.3.2-2-armv7h.pkg.tar.xz

Basic configuration by command on BIGIP 11

Big IP command notes. Some of the commands might be mistaken, you should check the configuration from GUI or show command after applying a command.

###### For resetting bigip config.

load sys config default

###### Disable dhcp on mgmt interface.

modify sys global-settings mgmt-dhcp disabled

###### Set IP address on management interface.

create sys management-ip 192.168.200.245/24

###### Set hostname

modify sys global-settings hostname bigip01.local

###### Set timezone

modify sys ntp timezone "Your location"

###### Specify a NTP server to synchronise to.

modify sys ntp servers add { 192.168.200.1 }

###### Set snmp trap

modify sys snmp traps add { MyCommunity { community MyCommunity port 162 version 2c host 192.168.200.1 } }

###### Set syslog

I forgot.

###### Create vlan interface.

create net vlan external interfaces add { 1.1 }

###### Assign IP address to a vlan interface.
###### Specify which protocol to allow at the same time (I am allowing big ip defualt protocols in the following)
###### Also specify with traffic group to participate.

create net self 10.0.0.1/24 allow-service default traffic-group traffic-group-local-only vlan external description external

###### Create a node which will be participated to pool
###### Also specify how to monitor the node.

create ltm node web-server01 address 192.168.0.1 monitor icmp

###### Create monitor profile for a pool

create ltm monitor http MyHttp send "GET /test.html HTTP/1.1\\r\\nHost: \\r\\nConnection: Close\\r\\n\\r\\n"

###### Create a pool and add a member
###### You can specify multiple members inside bracket separated by white space.
###### Also specify load-balancing method.
###### Also specify monitor profile

create ltm pool MyPool members add { web-server01:http } load-balancing-mode least-connections-member monitor MyHttp

###### Create a virtual server
###### Specify ip address or network range to listen for the virtual server.
# Specify a pool to load balance to.

create ltm virtual virtual-server01 destination 10.0.0.10:80 mask 255.255.255.255 ip-protocol tcp pool MyPool

###### Create cookie persistence profile

create ltm persistence cookie MyCookie cookie-name MyCookie expiration 30:00

###### Modify existing virtual server enable cookie persistence with the profile above.
modify ltm virtual virtual-server01 persist replace-all-with { cookie MyCookie }

###### If you encounter error saying that the virtual server must be associated with http profile.

modify ltm virtual vs01 persist replace-all-with { cookie MyCookie } profiles replace-all-with { tcp http }

###### Create a iRule

create ltm rule MyiRule

###### Associate the irule to the existing virtual server

modify ltm virtual virtual-server01 rules { MyiRule }

###### Create self signed ssl certificate and private key.
###### You have to get out of tmsh.

cd /root
openssl req -new -sha256 -newkey rsa:2048 -days 365 -nodes -x509 -keyout MySSL.key -out MySSL.crt

#### If you want to create csr and new private key. sha256 fingerprint

openssl req -new -sha256 -newkey rsa:2048 -nodes -keyout MySSL.key -out MySSL.csr

#### If you want to create csr from a existing private key.

openssl req -new -sha256 -key "YOUR KEY" -out MySSL.csr

###### Installing a SSL private key and a certificate from local volume.

install sys crypto key MySSL.key from-local-file /root/MySSL.key
install sys crypto cert MySSL.crt from-local-file /root/MySSL.crt

###### Create SSL profile (client side and insecure ssl such as self-signed cert allowed)

create ltm profile client-ssl MySSL key MySSL.key cert MySSL.crt defaults-from clientssl-insecure-compatible

###### Associate SSL profile with a existing virtual-server.
###### Note that virtual server service port must be set to https.

modify ltm virtual virtual-server01 profiles add { MySSL }

# Save config

save sys config

Windows 10 font on Arch

Japanese font for Linux is quite limited. It is always easier to just install windows font to have all the font needed to view websites pretty. Here is how to install windows font on Linux.
# Please note, that usage of Microsoft fonts outside running Windows
# system is prohibited by EULA (although in certain countries EULA is invalid).
# Please consult Microsoft license before using fonts.

1. Install following necessary packages for building
sudo pacman -S fontconfig xorg-fonts-encodings xorg-mkfontscale xorg-mkfontdir

2. Get the font from windows. In my case, I make a tar ball of C:\Windows\Fonts directory and send to Linux and untar by “tar xf Fonts.tar” command.

3. Run “ls -1 | grep -e ttf -e ttc” command in the font directory and copy the output.

2. Get ttf-ms-win10 tar.gz from AUR, and extract it and copy all font files to the extracted directory.

3. Edit PKGBUILD
i. Commend out _package() section’s second install command.

ii. Remeve all the font variables and pasted the previously copied clipboard.
_ttf_ms_win10=(
)

iii. Remove all functions excluding package_ttf-ms-win10() and _package()

iv. pkgname variable should be changed to the following.
pkgname=$pkgbase

4. Edited PKGBUILD looks like the following snippet .
pkgbase=ttf-ms-win10
pkgname=$pkgbase
pkgver=10.0.10240
pkgrel=3
arch=(any)
url='http://www.microsoft.com/typography/fonts/product.aspx?PID=164'
license=(custom)
depends=(fontconfig xorg-fonts-encodings xorg-mkfontscale xorg-mkfontdir)
provides=(ttf-font)
conflicts=(ttf-{vista,win7}-fonts)
install=$pkgbase.install

_ttf_ms_win10=(
arialbd.ttf
.
.
)

source=(${_ttf_ms_win10[@]/#/file://}

sha256sums=(…
)

_package() {
conflicts+=(${pkgname/10/8})

for font in $@; do
install -Dm644 $font -t “$pkgdir/usr/share/fonts/TTF”
done
}

package_ttf-ms-win10() {
pkgdesc=’Microsoft Windows 10 TrueType fonts’
provides+=(ttf-tahoma ttf-ms-fonts)
conflicts+=(ttf-tahoma ttf-ms-fonts)
_package ${_ttf_ms_win10[@]}
}

# vim: ts=4 sw=4 et

5. Leave .install file as it is.
post_install() {
fc-cache -s
mkfontscale usr/share/fonts/TTF
mkfontdir usr/share/fonts/TTF
}

post_upgrade() {
post_install
}

post_remove() {
post_install
}

5. Build the package by running the command below.
makepkg --skipinteg

6. Install the package.
sudo pacman -U *.pkg.tar.xz

7. Run fc-cache
fc-cache -vf /usr/share/fonts