Category Archives: Uncategorized

Xubuntu 16.04.x 64bit – Install Tightvncserver for Multiple Users (Systemd)

Last Modified 2016.09.08

Xubuntu 16.04.x 64bit – Install Tightvncserver for Multiple Users (Systemd)

!!!The following steps assume you are logged in as root!!!

01. Install tightvncserver:
$ apt-get install xfce4-goodies tightvncserver

02. Create .service file for user and set vnc to start for the user on system startup. The format for the service name is “vncserver-USERNAME@:10.service”. Where the “USERNAME” is oddly enough, the user’s name and the “10” in this example designates that the display number is 10, each user should have his own display number; I usually start at 10 to avoid any conflicts with any local system needs:
$ nano /lib/systemd/system/vncserver-USERNAME@:10.service

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c ‘/usr/bin/vncserver -kill :10 > /dev/null 2>&1 || :’
ExecStart=/sbin/runuser -l USERNAME -c “/usr/bin/vncserver -geometry 1920×1080 :10”
PIDFile=/home/USERNAME/.vnc/%H%i.pid
ExecStop=/bin/sh -c ‘/usr/bin/vncserver -kill :10 > /dev/null 2>&1 || :’

[Install]
WantedBy=multi-user.target

03. Setup user. You need to log​ ​into each user’s account and execute the commands below. (Important. The stored password is not encrypted; anyone who has access to the password file can find the plain-text password.):
$ su – USERNAME
$ vncserver ## Would you like to enter a view-only password (y/n)? n
$ exit

04. Start and Enable in Systemd:
$ systemctl daemon-reload
$ systemctl start vncserver-USERNAME@:10.service
$ systemctl enable vncserver-USERNAME@:10.service
$ reboot​​

Notes:

N01. To change a user’s password:
Login to user’s account first
$ vncpasswd

N02. To see all users:
$ cd to “/etc/systemd/system/multi-user.target.wants”

N03. If TAB complete is not working:
$ nano ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml

Find the line:

And change it to:

$ sudo reboot

N04. Environment Variable. Any user specific environment variables you want your VNC session to use, must be put in you ~/.vnc/xstartup. To set them globally, put environment variables in /etc/bash.bashrc:
$ nano ~/.vnc/xstartup

You also might need to change #!/bin/sh to #!/bin/bash in your xstartup file.

Relocating modules and starting up the kernel – Lenovo TD350

Thinkserver systems hang while installing or booting VMWARE ESXI with following message “Relocating modules and starting up the kernel”.

As a workaround, enable Intel(R) Trusted Execution Technology in BIOS setting as follows also make sure to have first upgraded to the latest firmware:

– Power on or restart the system
– Press F1 to enter BIOS Setup utility when prompted
– Navigate to System Security -> TPM Settings
– Change “Intel(R) Trusted Execution Technology” item to “Enabled”
– Select F10 to save and exit
– VMware ESXi can now be installed or booted.

Ref: https://support.lenovo.com/us/en/products/servers/thinkserver-tower-servers/thinkserver-td350/solutions/HT500295

Ubuntu 14.04.x Bugzilla 5.0.x – Cannot determine local time zone

01. Upgrade List::Util:
$ cd /var/www/html/bugzilla
$ cpan install List::Util

02. Edit Local.pm to change “TimeZone” subroutine to return the fixed time zone:
$ nano /var/www/html/bugzilla/lib/DateTime/TimeZone/Local.pm

Make the following changes

From:

sub TimeZone {
my $class = shift;
my $subclass = $class->_load_subclass();
for my $meth ( $subclass->Methods() ) {
my $tz = $subclass->$meth();
return $tz if $tz;
}
die “Cannot determine local time zone\n”;
}

To:

sub TimeZone {
return DateTime::TimeZone->new(name => ‘America/Phoenix’);
# my $class = shift;
# my $subclass = $class->_load_subclass();
# for my $meth ( $subclass->Methods() ) {
# my $tz = $subclass->$meth();
# return $tz if $tz;
# }
# die “Cannot determine local time zone\n”;
}

03. Restart Apache2:
$ service apache2 restart

Ubuntu 14.04.x x64 – Install ViewVC with LDAP Authentication

Last Modified 2015.10.16
01. Download and extract ViewVC stable release http://viewvc.tigris.org/servlets/ProjectDocumentList?folderID=6004:
$ cd /root
$ wget http://viewvc.tigris.org/files/documents/3330/49471/viewvc-1.1.24.tar.gz
$ tar xvfz viewvc-1.1.24.tar.gz

02. Go to viewvc-1.1.24 directory and start the installation:
$ cd viewvc-1.1.24
$ ./viewvc-install –prefix=/usr/share/viewvc

DESTDIR path (generally only used by package maintainers) []: Leave blank and press enter.
03. Configure ViewVC by editing the viewvc.conf file:
$ nano /usr/share/viewvc/viewvc.conf

Change from:
# root_parents =

To:
root_parents = /svn : svn

04. Add ViewVC to your virtualhost:
$ nano /etc/apache2/sites-enabled/default-ssl.conf

Add the lines below to the bottom of the file.
## ViewVC
ScriptAlias /viewvc /usr/share/viewvc/bin/cgi/viewvc.cgi
ScriptAlias /query /usr/share/viewvc/bin/cgi/query.cgi
<Directory /usr/share/viewvc/bin/cgi>
Order allow,deny
Allow from all
</Directory>

05. Enable the cgi module:
$ a2enmod cgid

06. Create a user permission config in conf-available and then create link to conf-enabled:
$ touch /etc/apache2/conf-available/viewvc.conf
$ ln -s /etc/apache2/conf-available/viewvc.conf /etc/apache2/conf-enabled/viewvc.conf

07. Add project specific permissions, per project:
$ nano /etc/apache2/conf-enabled/viewvc.conf

<Location /viewvc/Repo1>
SSLRequireSSL
AuthType Basic
AuthName “Secure Area”
AuthBasicProvider ldap
AuthLDAPURL “ldap://myserver.server.net:389/ou=People,dc=server,dc=net” TLS
AuthLDAPBindDN “cn=manager,dc=server,dc=net”
AuthLDAPBindPassword “SOMEPASSWORD”

Require ldap-attribute gidNumber=12
Require ldap-attribute gidNumber=13
Require ldap-attribute gidNumber=14
</Location>

08. Restart Apache2:
$ service apache2 restart
Now open the browser and type: https://myserver.server.net/viewvc

Ubuntu 14.04.2 – Beagle Bone Black (BBB) Building a Custom Kernel

Last Modified 2015.05.06

Ubuntu 14.04.2 – Beagle Bone Black (BBB) Building a Custom Kernel – https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.4.tar.gz

01. Install prerequisite software on BBB Ubuntu build system (Virtualbox VM install of Ubuntu 14.04.2 32bit Desktop):
$ sudo apt-get update
$ sudo apt-get install aptitude ssh
$ sudo aptitude full-upgrade –full-resolver
$ sudo aptitude install automake autoconf binfmt-support bridge-utils build-essential cpu-checker curl debootstrap fakeroot fuseext2 gawk gcc-arm-linux-gnueabi genext2fs gettext gnome-shell sshfs ubuntu-gnome-desktop gnome-tweak-tool elementary-icon-theme gnome-system-tools gobjc++-arm-linux-gnueabi hwdata kvm-ipxe libaio1 libfdt1 libglib2.0-dev libltdl-dev libncurses5-dev librados2 librbd1 libsdl1.2debian libssl-dev libtool libvde0 libvdeplug2 libwrap0-dev lzop make module-assistant msr-tools pkg-config python python-software-properties qemu-common qemu-keymaps qemu-kvm qemu-system qemu-user qemu-user-static qemu-utils seabios software-properties-common subversion sysfsutils u-boot-tools vde2 vgabios xmlto xmltoman
$ reboot
$ sudo apt-get install –install-recommends linux-generic-lts-utopic xserver-xorg-lts-utopic libgl1-mesa-glx-lts-utopic libegl1-mesa-drivers-lts-utopic
$ reboot

After reboot install virtualbox guest additions.

02. Install latest GIT:
$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git git-core
$ git config –global user.email “rbianchi@kuttatech.com”
03. U-Boot:
$ cd /root
$ mkdir /root/beaglebone/ && mkdir /root/beaglebone/u-boot/
$ cd /root/beaglebone/u-boot/
$ wget ftp://ftp.denx.de/pub/u-boot/u-boot-latest.tar.bz2
$ tar -xjf u-boot-latest.tar.bz2
$ cd /root/beaglebone/u-boot/u-boot-2015.04
$ make sandbox_defconfig tools-only
$ sudo install tools/mkimage /usr/local/bin
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- am335x_boneblack_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
04. Compiling the BeagleBone Black Kernel:
$ cd /root/beaglebone/
$ wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.4.tar.gz
$ tar -zxvf linux-3.14.4.tar.gz
$ cd linux-3.14.4
$ cp /root/beaglebone/config-3.14.4.1-bone-armhf.com /root/beaglebone/linux-3.14.4/arch/arm/configs/beaglebone_defconfig
$ wget http://arago-project.org/git/projects/?p=am33x-cm3.git\;a=blob_plain\;f=bin/am335x-pm-firmware.bin\;hb=HEAD -O firmware/am335x-pm-firmware.bin

BBB Kernel 3.14 .config file:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- beaglebone_defconfig -j4

Edit the .config file to reflect your changes, if any:
$ nano /root/beaglebone/linux-3.14.4/.config

or

You could also use menuconfig to edit the .config file:
$ cd /root/beaglebone/linux-3.14.4
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig

This step builds the kernel and may take 15-20 minutes or longer:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage dtbs LOADADDR=0x80008000 -j4

This step builds the kernel for the BBB:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage am335x-boneblack.dtb LOADADDR=0x80008000 -j4

This builds the kernel modules and may take 20 minutes or longer:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules -j4
The following steps assume you already have a working Ubuntu 14.04.2 MicroSD with boot and rootfs partitions.
http://www.armhf.com/boards/beaglebone-black/bbb-sd-install/

05. Update u-boot:
$ su
$ cd /root
$ mkdir boot
$ fdisk -l
$ mount /dev/sdX1 boot
$ cp /root/beaglebone/u-boot/u-boot-2015.04/MLO /root/boot
$ cp /root/beaglebone/u-boot/u-boot-2015.04/u-boot.img /root/boot
$ sync
$ cd /root
$ umount boot
06a. Update rootfs and zImage (kernel):
$ su
$ cd /root
$ mkdir rootfs
$ fdisk -l
$ mount /dev/sdX2 rootfs
$ cd /root/beaglebone/linux-3.14.4
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=/root/rootfs modules_install
$ cp /root/beaglebone/linux-3.14.4/arch/arm/boot/zImage /root/rootfs/boot/vmlinuz-3.14.4.1-bone-armhf.com
$ cp /root/beaglebone/linux-3.14.4/.config /root/rootfs/boot/config-3.14.4.1-bone-armhf.com
$ sync
$ cd /root
$ umount rootfs

Remove the MicroSD card from your adapter and boot into your custom kernel.
06b. Update rootfs and zImage (kernel) via SSH:
$ cd /root
$ mkdir sftpBBB
$ sshfs root@192.168.1.10:/ /root/sftpBBB
$ cd /root/beaglebone/linux-3.14.4
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=/root/sftpBBB modules_install
$ cp /root/beaglebone/linux-3.14.4/arch/arm/boot/zImage /root/sftpBBB/boot/vmlinuz-3.14.4.1-bone-armhf.com
$ cp /root/beaglebone/linux-3.14.4/.config /root/sftpBBB/boot/config-3.14.4.1-bone-armhf.com
Notes:

N01. Check current running kernel .config:
$ cat /proc/config.gz | gunzip > running.config
$ cat running.config | grep IPIP
$ cat running.config | grep NOWAY
$ cat running.config | grep DS1307

N02. Check UARTs:
$ ls -l /dev/ttyO*

N03. Set Hardware Clock:
$ aptitude install i2c-tools
$ i2cdetect -y -r 2
$ date -s “6 MAY 2015 18:43:00”
$ echo ds3231 0x68 >/sys/bus/i2c/devices/i2c-2/new_device
$ hwclock -f /dev/rtc1 -w
$ hwclock

N04. Enable UARTs 00, 01, and 02:
$ cd /boot/dtbs/
$ cp /boot/dtbs/am335x-boneblack.dtb /boot/dtbs/am335x-boneblack.dtb.org
$ cp /boot/dtbs/am335x-boneblack-ttyO2.dtb /boot/dtbs/am335x-boneblack.dtb

N05. References:
https://github.com/beagleboard/kernel
http://dev.ardupilot.com/wiki/building-the-code/building-for-beaglebone-black-on-linux/#making_the_rt_kernel
http://wiki.beyondlogic.org/index.php/BeagleBoneBlack_Building_Kernel
http://elinux.org/Building_BBB_Kernel

Beagle Bone Black (BBB) Building a Custom Kernel – Active – git://github.com/beagleboard/linux.git

Last Modified 2015.04.07

Ubuntu 14.04.2 – Beagle Bone Black (BBB) Building a Custom Kernel – Active but no UARTs – git://github.com/beagleboard/linux.git

01. Install prerequisite software on BBB Ubuntu build system (Virtualbox VM install of Ubuntu 14.04.2 32bit Desktop):
$ sudo apt-get update
$ sudo apt-get install aptitude ssh
$ sudo aptitude full-upgrade –full-resolver
$ sudo aptitude install automake autoconf binfmt-support bridge-utils build-essential cpu-checker curl debootstrap fakeroot fuseext2 gawk gcc-arm-linux-gnueabi genext2fs gettext gnome-shell ubuntu-gnome-desktop gnome-tweak-tool elementary-icon-theme gnome-system-tools gobjc++-arm-linux-gnueabi hwdata kvm-ipxe libaio1 libfdt1 libglib2.0-dev libltdl-dev libncurses5-dev librados2 librbd1 libsdl1.2debian libssl-dev libtool libvde0 libvdeplug2 libwrap0-dev lzop make module-assistant msr-tools pkg-config python python-software-properties qemu-common qemu-keymaps qemu-kvm qemu-system qemu-user qemu-user-static qemu-utils seabios software-properties-common subversion sysfsutils u-boot-tools vde2 vgabios xmlto xmltoman
$ reboot
$ sudo apt-get install –install-recommends linux-generic-lts-utopic xserver-xorg-lts-utopic libgl1-mesa-glx-lts-utopic libegl1-mesa-drivers-lts-utopic
$ reboot

After reboot install Virtualbox guest additions.

02. Install latest GIT:
$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git git-core
$ git config –global user.email “rbianchi@kuttatech.com”

03. U-Boot:
$ cd /root
$ mkdir /root/beaglebone/ && mkdir /root/beaglebone/u-boot/
$ cd /root/beaglebone/u-boot/
$ wget ftp://ftp.denx.de/pub/u-boot/u-boot-latest.tar.bz2
$ tar -xjf u-boot-latest.tar.bz2
$ cd /root/beaglebone/u-boot/u-boot-2015.01
$ make sandbox_defconfig tools-only
$ sudo install tools/mkimage /usr/local/bin
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- am335x_boneblack_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

04. Compiling the BeagleBone Black (BBB) Kernel:
$ cd /root/beaglebone/
$ git clone git://github.com/beagleboard/linux.git
$ linux/scripts/patch-kernel linux #If you see, “cannot find patch file: patch-3.14.xx” no patch is needed, you have the current source.
$ cd /root/beaglebone/linux
$ git checkout 3.14
$ wget http://arago-project.org/git/projects/?p=am33x-cm3.git\;a=blob_plain\;f=bin/am335x-pm-firmware.bin\;hb=HEAD -O firmware/am335x-pm-firmware.bin
$ cp /root/beaglebone/linux/arch/arm/configs/bb.org_defconfig /root/beaglebone/linux/.config

Steps 04a through 04c are done in the “/root/beaglebone/linux” directory.

04a. Edit the .config file to reflect your changes, if any:
$ nano /root/beaglebone/linux/.config

or

04a. You could also use menuconfig to edit the .config file:
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig

04b. Build the kernel for the BBB. Takes 20 minutes or more:

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage am335x-boneblack.dtb LOADADDR=0x80008000 -j4

04c. Build the kernel modules. Takes 45 minutes or more:

$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules -j4

The following steps assume you already have a working Ubuntu 14.04.2 MicroSD with boot and rootfs partitions.
http://www.armhf.com/boards/beaglebone-black/bbb-sd-install/

05. Update u-boot:
$ su
$ cd /root
$ mkdir boot
$ fdisk -l
$ mount /dev/sdX1 boot
$ cp /root/beaglebone/u-boot/u-boot-2015.01/MLO /root/boot
$ cp /root/beaglebone/u-boot/u-boot-2015.01/u-boot.img /root/boot
$ sync
$ cd /root
$ umount boot

06. Update rootfs and zImage (kernel):
$ su
$ cd /root
$ mkdir rootfs
$ fdisk -l
$ mount /dev/sdX2 rootfs
$ cd /root/beaglebone/linux
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=/root/rootfs modules_install
$ cp /root/beaglebone/linux/arch/arm/boot/zImage /root/rootfs/boot/vmlinuz-3.14.4.1-bone-armhf.com
$ cp /root/beaglebone/linux/.config /root/rootfs/boot/config-3.14.4.1-bone-armhf.com
$ sync
$ cd /root
$ umount rootfs

Remove the MicroSD card from your adapter, and then boot into your custom kernel.

Notes:

N01. Check current running kernel .config:
$ cat /proc/config.gz | gunzip > running.config

N02. References:
https://github.com/beagleboard/linux
http://dev.ardupilot.com/wiki/building-the-code/building-for-beaglebone-black-on-linux/#making_the_rt_kernel
http://wiki.beyondlogic.org/index.php/BeagleBoneBlack_Building_Kernel
http://elinux.org/Building_BBB_Kernel