Sunday, March 20, 2016

3D print camera holder for quad copter on printbtot and uprint printers

Printed a draft orange, a high def orange on a printbot simple, and the white model is printed on a uPrint SE.

Pictures below illustrate the process from filament to real life utilization.

This project was done at TechShop.














Monday, March 7, 2016

Running Windows 10 on Ubuntu with support for 2D accelerated video, disk, network and touch support


How to run windows with acceleration support on Ubuntu 16.04.


This setup will accelerate the virtual VM for disk, network, video, random device and memory, it also adds support for touch screen for windows 10 running inside Ubuntu.

Download the iso for windows 10 from Microsoft web site, install the image using regular gnome-boxes interface.

Then download the virtio-win-XXX.iso from here, pick the latest version.
https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio

Goto the drives browser on windows 10 and click on all devices with problems, and point these to the where the cdrom is and select update.

Do the same for the display driver, the network driver and the disk driver.

This should pick the RedHat drivers, you need to trust Redhat since the drivers are not signed by Microsoft keys.











qemu-system-x86_64 -enable-kvm -cpu host -smp cores=2,threads=2 -boot order=c -drive file=/home/lafa/.local/share/gnome-boxes/images/boxes-unknown-4,index=0,media=disk,if=virtio,cache=none -balloon virtio -m 4096 -device virtio-serial-pci -usb -k en-us -localtime -net nic,model=virtio -device virtio-keyboard-pci -device virtio-mouse-pci -device virtio-tablet-pci -usbdevice tablet -device usb-mouse -cdrom /home/lafa/Downloads/isos/virtio-win-0.1.113.iso -device virtio-rng-pci,rng=rng0 -object rng-random,filename=/dev/random,id=rng0 -soundhw hda -display sdl -vga qxl

After all driver are installed you can change these settings with a permanent way using


sudo apt-get install virt-manager gnome-boxes

Use virt-manager to change the configs for the vms created by gnome-boxes, and set all the virtio devices, according to the command above. after you same if gnome-boxes will pick the settings, don't forget to create a qemu/kvm user session connection, to see the gnome-boxes vms.

Some device like the virtio-keyboard-pci virtio-mouse-pci and virtio-tablet-pci are still missing windows drivers, so the default ps2 mouse and keyboard are used in this example, and the -usbdevice tablet for mouse to lose focus when it touches the border of the windows, but also allowing the windows 10 to be used on a touch screen laptop inside Ubuntu. Also for all virtio disks setup the cache to none and the mode to native, that should make the VMs more reliable and faster if you are using and SSD disk, you can check the picture for the settings.


Opengl version 2 support


There is some work going on to support opengl in Linux and windows guests but this work is not yet support in Ubuntu 16.04, see references below.

The qemu command line will look something like this to enable the opengl on guest systems.

qemu-system-x86_64 ... -display sdl,gl=on -device virtio-vga -vga virtio

To my very naive knowledge qemu on Ubuntu needs to be compiled with gtk3 or sdl2 and this is not the case. Ubuntu qemu binaries do not support gtk3 or sdl2, only sdl1.
Everything else seems to be OK, mesa, kernel and qemu all are the versions that should support opengl initial versions, it should be possible to run a linux guest OS with opengl.


References


https://wiki.archlinux.org/index.php/QEMU
https://virgil3d.github.io/
http://www.spice-space.org/download.html
https://www.kraxel.org/blog/
https://www.kraxel.org/slides/qemu-gfx.pdf




Monday, February 15, 2016

Ubuntu GNOME 16.04 running on Yoga Pro 2 with HiDPI and touch screen support

Ubuntu GNOME 16.04 running on Yoga Pro 2 with HiDPI and touch screen support








See my previous post on how to install Ubuntu on Yoga Pro 2 for Ubuntu GNOME 15.10.

I think Ubuntu GNOME is the best flavor of Ubuntu if you are running in HiDPI mode 3200x1200. All screen captured images are at HiDPI resolution.

Ubuntu 16.04 is not released yet, the screen shoots are from a daily build, 16.04 it is scheduled to be released in Q2 2016.

Touch support

Ubuntu gnome support for touch screen is pretty good on the desktop shell.
Chrome browser supports touch screen very well and much better than Firefox without any plug-ins.
The windows key on the screen panel works as the windows key on the keyboard.
Screen rotation is supported on the new gnome and disables the keyboard when the yoga is used as a tablet, but sometimes screen does not rotate, I'm still trying to figure out what is wrong.

Yoga Keys boot key


F12 - Boot menu to select booting from usb drive
F2 - Bios Menu

Power down the computer. Push the “novo” button ounce or press F2 while booting, to force the computer to enter into BIOS menus. Disable “Security Boot” and disable “Lenovo Fast Boot”. Leave UEFI option turned on since Ubuntu supports UEFI out of the box.

I also enabled the Functions keys in the BIOS by default but this is a personal preference.

Create to boot USB disk


Format your flash drive with a single FAT32 partition.  Copy the contents of the Ubuntu ISO (use your favorite archiving tool - 7zip for example) or CD to it.  Use a recent 64-bit Ubuntu version.

That's all you need to do.  No need to install a boot loader or use special tool.

You can also use Ubuntu tool to create a UEFI bootable flash drive.

Note: Avoid using something like Unetbootin to create a UEFI-bootable flash drive, it does not work.


 

Install

Create a USB boot drive with another Ubuntu machine, plug the USB stick on it. Use the USB 2.0 port on the Yoga pro 2 to plug the usb key, I had problems with the usb 3 port using a usb 3 stick, seems to me it was un-mounted during the installation process, when installer was setting up the drives.

Select the partition size for Ubuntu let the Ubuntu Gnome installer re-size your windows partition. Grub will have an option to boot windows after the install is done and will setup Ubuntu as the default OS.

Note:
The default options will work fine, there is no need to setup custom partitions. But if you want to setup new partitions here is what I did. I deleted all windows partitions since I don't run windows and created efi 512 Mb partition (this is where the efi code looks for the kernel to be loaded on boot, the installer allows you to create this partition with a special type), I also created a swap partition of 9Gb since I have 8Gb of physical memory, a 15Gb partition for the OS "/" and a the rest for home "/home".

After installation

UbuntuGnome ships with gnome 3.18 and will boot with full resolution HiDPI and touch screen support enabled.

What works

Almost everything works great out of the box, there isn't many changes you need to do.

Screen HiDPI support

Everything works, brightness, resolution changes, even the option keys to turn off the screen and brightness. Video driver works great.

You can change the resolution in the settings to another resolution in case you don't want to use HiDPI, selecting 1920x1080 that should give you a good scale ratio on the Yoga Pro 2.

Reference for other applications on HiDPI:
archlinux HiDPI documentation

Camera, Sound, Keyboard, Sleep, Wifibluetooth, USB3 works

Camera, sleep, wifi, Bluetooth, USB3 and side sound button up/down worksKeyboard background light works, Special Fn key mute, volume up, volume down, turn off screen, refresh, brightness up and down, menu key, keyboard light, air-plane mode, all work as expected. The windows touch logo on the touchscreen works.

Fn key to show all screens works but it is a shortcut to Activities menu so you don't have to use the touch pad.

Does not work out of the box

The small side mute button, Fn key to disable track-pad function.

Tweaks to make some Apps work better with HiDPI 


Firefox, Google Chrome, Chromium, Cheese, totem, vlc work great in HiDPI.

sudo apt-get install google-chrome-stable

If you use a HiDPI monitor such as Yoga Pro 2 display together with another monitor, you can use AutoHiDPI add-on in order to automatically adjust layout.css.devPixelsPerPx setting for the active screen. Set Pixel Ratio to 2x and HiDPI screen with to 3200, on the plug-in settings page.

If you use the touch screen you should install Grab and Drag add-on to make Firefox more tablet friendly.

Chromium/Chrome  supports the touchscreen better than firefox if you wish to use it with the touchscreen Chromium is the better choice.

Run chromium at device scale in case it starts with big fonts.

chromium-browser --force-device-scale-factor=2

For Thunderbird see Firefox. To access about:config, go to Edit → Preferences → Advanced → Config editor.

Skype is a Qt program, and needs to be configured separately. You cannot change the DPI setting for it, but at least you can change font size. Install qt4 and run qtconfig-qt4 to do it.

Clementine still show interface with icons that are not scaled properly.

Console

Configure larger font on tty console, leave all settings as they are, but for font select Terminus, and on the last one, where you can chose the size 16x32, and then reboot.

sudo dpkg-reconfigure console-setup

Reference: https://wiki.archlinux.org/index.php/HiDPI

Ubuntu extras and tools

sudo apt-get install flashplugin-installer

sudo apt-get install ubuntu-restricted-extras

### media players, gnome,vpn and compression tools [lots of packages for these]
sudo apt-get install gstreamer0.10-plugins-ugly gxine libdvdread4 icedax tagtool easytag id3tool lame nautilus-script-audio-convert libmad0 mpg321 libavcodec-extra openconnect network-manager-openconnect-gnome openvpn easy-rsa network-manager-openvpn-gnome

### DVD support
sudo /usr/share/doc/libdvdread4/install-css.sh

### Gnome utilities
sudo apt-get install adwaita-icon-theme-full vlc clementine minitube bijiben polari gnome-weather epiphany-browser p7zip-rar p7zip-full unace unrar zip unzip sharutils rar uudeview mpack arj cabextract file-roller htop dconf-editor gnome-backgrounds gnome-bluetooth gnome-boxes gnome-calculator gnome-calendar gnome-clocks gnome-color-manager gnome-contacts gnome-control-center gnome-dictionary gnome-disk-utility gnome-documents gnome-logs gnome-maps gnome-music gnome-online-accounts gnome-photos gnome-session gnome-settings-daemon gnome-shell gnome-shell-extensions gnome-sound-recorder gnome-sushi gnome-system-monitor gnome-terminal gnome-themes-standard gnome-tweak-tool gnome-weather frogr vinagre ghex chromium-browser picard gnome-todo

### Simple Games
sudo apt-get install gnome-chess five-or-more four-in-a-row gnome-klotski gnome-nibbles gnome-robots gnome-sudoku gnome-mahjongg gnome-tetravex iagno lightsoff quadrapassel swell-foop



### Run windows or other linux versions inside Ubuntu 

sudo apt-get install virtualbox

### Gnome Tools
sudo apt-get install gnome-characters

### Gnome development tools
sudo apt-get install gnome-builder glade gitg ghex


USB 3 ethernet adapter


I got a USB 3 Ethernet adapter at frys, it works great. I'm also using a SIIG USB 3 hub with power adapter to plug a logitech USB sound bar, the USB 3 Ethernet adapter, a wireless mouse dongle and a external disk 60 Gb SSD.

Links to the hardware:

http://www.amazon.com/Diamond-Multimedia-Gigabit-Ethernet-UE3000/dp/B00DWXV4SY

http://www.amazon.com/SIIG-7-Port-USB-3-0-Adapter/dp/B00AAHLWA0/ref=sr_1_1?ie=UTF8&qid=1404719193&sr=8-1&keywords=siig+usb+3+hub

Intel Video drivers [not recommended]

Follow the link https://01.org/linuxgraphics/downloads.

Wifi network card upgrade [not recommended, only do it if you need dual band wifi]


I also upgraded the wifi network card to a intel dual band, link to amazon and Youtube video.

Spec: 7260NGW Intel® Dual Band Wireless-AC 7260 802.11ac, Dual Band, 2x2 Wi-Fi + Bluetooth 4.0

sudo lspci -v
01:00.0 Network controller: Intel Corporation Wireless 7260 (rev 6b)    Subsystem: Intel Corporation Dual Band Wireless-AC 7260
    Capabilities: [154] Vendor Specific Information: ID=cafe Rev=1 Len=014
    Kernel driver in use: iwlwifi

Works great.

References

Ubuntu GNOME 15.10 running on Yoga Pro 2 with HiDPI support
Ubuntu GNOME 15.04 running on Yoga Pro 2 with HiDPI support


Sunday, February 14, 2016

Ubuntu GNOME 15.10 running on Yoga Pro 2 with HiDPI support

Ubuntu GNOME 15.10 running on Yoga Pro 2 with HiDPI and touch screen support








See my previous post on how to install Ubuntu on Yoga Pro 2 for Ubuntu GNOME 15.04.

I think Ubuntu GNOME is the best flavor of Ubuntu if you are running HiDPI mode 3200x1200. All screen captured images are at HiDPI resolution.

Touch support

Ubuntu gnome 2.16 support for touch screen is pretty good on the desktop shell.
Chrome browser version 48 and up support touch screen better than Firefox without any plugins.
The windows key on the screen panel works as the windows key on the keyboard.
Screen rotation does not work on 15.10 by default, but if you install gnome 2.18 on ubuntu 15.10 you can use screen rotation since is now supported by default.

Yoga Keys boot key


F12 - Boot menu to select booting from usb drive
F2 - Bios Menu

Power down the computer. Push the “novo” button ounce or press F2 while booting, to force the computer to enter into BIOS menus. Disable “Security Boot” and disable “Lenovo Fast Boot”. Leave UEFI option turned on since Ubuntu supports UEFI out of the box.

I also enabled the Functions keys in the BIOS by default but this is a personal preference.

Create to boot USB disk


Format your flash drive with a single FAT32 partition.  Copy the contents of the Ubuntu ISO (use your favorite archiving tool - 7zip for example) or CD to it.  Use a recent 64-bit Ubuntu version.

That's all you need to do.  No need to install a boot loader or use special tool.

You can also use Ubuntu tool to create a UEFI bootable flash drive.

Note: Avoid using something like Unetbootin to create a UEFI-bootable flash drive, it does not work.


 

Install

Create a USB boot drive with another Ubuntu machine, plug the USB stick on it. Use the USB 2.0 port on the Yoga pro 2 to plug the usb key, I had problems with the usb 3 port using a usb 3 stick, seems to me it was un-mounted during the installation process, when installer was setting up the drives.

Select the partition size for Ubuntu let the UbuntuGnome installer resize your windows partition. Grub will have an option to boot windows after the install is done and will setup Ubuntu as the default OS.

Note:
The default options will work fine, there is no need to setup custom partitions. But if you want to setup new partitions here is what I did. I deleted all windows partitions since I don't run windows and created efi 512 Mb partition (this is where the efi code looks for the kernel to be loaded on boot, the installer allows you to create this partition with a special type), I also created a swap partition of 9Gb since I have 8Gb of physical memory, a 15Gb partition for the OS "/" and a the rest for home "/home".

After installation


UbuntuGnome ships with gnome 3.16 and will boot with full resolution HiDPI, support enabled.

You can change the resolution in the settings to another resolution, in case you don't want to use HiDPI, select 1920x1080 that should give you a good scale ratio on the Yoga Pro 2.

What works


Almost everything works great out of the box, there isn't many changes you need to do.

Sound works

Options keys for sound work, side sound button up/down works.

Screen

Everything works, brightness, resolution changes, even the option keys to turn off the screen and brightness. Video driver work great

Camera

Works fine.

Sleep

No issues.

Keyboard

Keyboard background light works, menu key works, Special Fn key mute, volume up, volume down, turn off screen, refresh, brightness up and down, menu key, keyboard light, side buttons for up and down volume, air-plane mode, work as expected.

Fn key to show all screens works but it is a shortcut to Activities menu so you don't have to use the touch pad.

Wifi, bluetooth, USB3 works

No issues.

Does not work out of the box

The side mute button, Fn key to disable track-pad function.

HiDPI support

UbuntuGnome supports HiDPI since version 14.10.

Tweaks to make some Apps work better with HiDPI 


Firefox, Google Chrome, Chromium, Cheese, totem, vlc work great in HiDPI.

sudo apt-get install google-chrome-stable

If you use a HiDPI monitor such as Yoga Pro 2 display together with another monitor, you can use AutoHiDPI add-on in order to automatically adjust layout.css.devPixelsPerPx setting for the active screen. Set Pixel Ratio to 2x and HiDPI screen with to 3200, on the plug-in settings page.

If you use the touch screen you should install Grab and Drag add-on to make Firefox more tablet friendly.

Chromium supports the touchscreen better than firefox if you wish to use it with the touchscreen Chromium is the better choice.

Run chromium at device scale in case it starts with big fonts.

chromium-browser --force-device-scale-factor=2

For Thunderbird see Firefox. To access about:config, go to Edit → Preferences → Advanced → Config editor.

Skype

Skype is a Qt program, and needs to be configured separately. You cannot change the DPI setting for it, but at least you can change font size. Install qt4 and run qtconfig-qt4 to do it.

Clementine still show interface with icons that are not scaled properly.

Console

Configure larger font on tty console, leave all settings as they are, but for font select Terminus, and on the last one, where you can chose the size 16x32, and then reboot.

sudo dpkg-reconfigure console-setup

Reference: https://wiki.archlinux.org/index.php/HiDPI

Ubuntu extras and tools

sudo apt-get install flashplugin-installer

sudo apt-get install ubuntu-restricted-extras

### media players, gnome and compression tools [lots of packages for these]
sudo apt-get install gstreamer0.10-plugins-ugly gxine libdvdread4 icedax tagtool easytag id3tool lame nautilus-script-audio-convert libmad0 mpg321 libavcodec-extra

### DVD support
sudo /usr/share/doc/libdvdread4/install-css.sh

### Gnome utilities
sudo apt-get install adwaita-icon-theme-full vlc clementine minitube bijiben polari gnome-weather epiphany-browser p7zip-rar p7zip-full unace unrar zip unzip sharutils rar uudeview mpack arj cabextract file-roller htop dconf-editor gnome-backgrounds gnome-bluetooth gnome-boxes gnome-calculator gnome-calendar gnome-clocks gnome-color-manager gnome-contacts gnome-control-center gnome-dictionary gnome-disk-utility gnome-documents gnome-logs gnome-maps gnome-music gnome-online-accounts gnome-photos gnome-session gnome-settings-daemon gnome-shell gnome-shell-extensions gnome-sound-recorder gnome-sushi gnome-system-monitor gnome-terminal gnome-themes-standard gnome-tweak-tool gnome-weather frogr vinagre ghex

### Simple Games
sudo apt-get install gnome-chess five-or-more four-in-a-row gnome-klotski gnome-nibbles gnome-robots gnome-sudoku gnome-mahjongg gnome-tetravex iagno lightsoff quadrapassel swell-foop

### Gnome Tools
sudo apt-get install gnome-characters

### Gnome development tools
sudo apt-get install gnome-builder glade gitg ghex

Gnome 2.18 [not recomended]

Adds support for built-in screen rotation and small increments for touch screen support, but breaks bluetooth on ubuntu 15.10. Everything else seems to work fine.

sudo add-apt-repository ppa:gnome3-team/gnome3
sudo add-apt-repository ppa:gnome3-team/gnome3-staging
sudo apt-get update
sudo apt-get dist-upgrade

USB 3 ethernet adapter


I got a USB 3 Ethernet adapter at frys, it works great. I'm also using a SIIG USB 3 hub with power adapter to plug a logitech USB sound bar, the USB 3 Ethernet adapter, a wireless mouse dongle and a external disk 60 Gb SSD.

Links to the hardware:

http://www.amazon.com/Diamond-Multimedia-Gigabit-Ethernet-UE3000/dp/B00DWXV4SY

http://www.amazon.com/SIIG-7-Port-USB-3-0-Adapter/dp/B00AAHLWA0/ref=sr_1_1?ie=UTF8&qid=1404719193&sr=8-1&keywords=siig+usb+3+hub

Intel Video drivers [not recommended]

Follow the link https://01.org/linuxgraphics/downloads.

Wifi network card upgrade [not recommended, only do it if you need dual band wifi]


I also upgraded the wifi network card to a intel dual band, link to amazon and Youtube video.

Spec: 7260NGW Intel® Dual Band Wireless-AC 7260 802.11ac, Dual Band, 2x2 Wi-Fi + Bluetooth 4.0

sudo lspci -v
01:00.0 Network controller: Intel Corporation Wireless 7260 (rev 6b)    Subsystem: Intel Corporation Dual Band Wireless-AC 7260
    Capabilities: [154] Vendor Specific Information: ID=cafe Rev=1 Len=014
    Kernel driver in use: iwlwifi

Works great.

References

Ubuntu GNOME 15.04 running on Yoga Pro 2 with HiDPI support
Ubuntu, Kubuntu, UbunutGnome 14.04 support for HiRes in Yoga Pro 2
Ubuntu 14.04 running in yoga pro 2
UbuntuGnome 14.04 running on yoga pro 2 
Kubuntu14.04 running in yoga pro 2

Saturday, January 30, 2016

Ubuntu how to setup a vpn connection, tsocks, corporate wifi with openconnect and openvpn or socks

These are just notes.

Cisco vpn setup [corporate setup]


# install
sudo apt-get install openconnect network-manager-openconnect-gnome

VPN GUI setup
# select dynamic updates
sudo dpkg-reconfigure resolvconf


#restart network-manager or reboot the laptop


#  create a new VPN openconnect connection, set only the gateway
nm-connection-editor

Gnome network manager GUI configuration

[This is not needed for Ubuntu 15.04]. The default routing rules are missing in ubuntu openconnect 15.10. After the network manager establishes the connection, the work around is to add a default route as specified below after the connection is established. Start a console and type the command below with the correct arguments.

sudo route add default netmask 255.255.255.0 gw 10.87.154.223 dev vpn0

run ifconfig to figure out the vpn device name, the gateway ip of the vpn device normally tun0 or vpn0.

Execute the command above and the default route should make the openconnect vpn work.

Command line without network manager

# open a connection, use --background to run as daemon
sudo openconnect --user=USERID server/group/

# to stop the connection you can ctrl-c the terminal running openconnect or

sudo killall openconnect*

Troubleshooting

Default routing rules are missing in ubuntu openconnect 15.10 here is a work around:

Edit the /usr/share/vpnc-scripts/vpnc-script file and change the method set_default_route()

set_default_route() {
    $IPROUTE route | grep '^default' | fix_ip_get_output > "$DEFAULT_ROUTE_FILE"
    # $IPROUTE route replace default dev "$TUNDEV"
    $IPROUTE route replace default via "$INTERNAL_IP4_ADDRESS" dev "$TUNDEV"
    $IPROUTE route add 0.0.0.0 via "$INTERNAL_IP4_ADDRESS" dev "$TUNDEV"
    $IPROUTE route flush cache

}

Reference:http://askubuntu.com/questions/681687/openconnect-vpn-setup-is-failing-in-ubuntu-15-10

Setup openvpn using ibvpn.com provider and openvpn

sudo apt-get install openvpn easy-rsa network-manager-openvpn-gnome

goto http://www.ibvpn.com

setup a free account

extract openvpn.tgz where you want

On UbuntuGnome goto settings->network->add
select vpn->Import from file

Select ibVPN-US-Dallas.ovpn


Type your email
Get the password from the ibvpn website, this is not you ibvpn account password.




Select Add.
And try it out.

Using  a socks proxy instead of VPN


# run a local socks server
ssh -D 9999 proxy.server

# setweb browser proxy or gnome network proxy in gnome network settings.
proxy: localhost:9999

# To use other apps with socks install
sudo apt-get install tsocks

# Change config file to (remove everything else)
/etc/tsocks.conf
server = 127.0.0.1
server_port = 9999

# ssh to a machine
tsocks ssh -X bla.corp.com

# eclipse to a machine
tsocks eclipse

Friday, July 3, 2015

Setup openvpn in Ubuntu 15.10 tested using ibvpn.com and openvpn

sudo apt-get install openvpn easy-rsa network-manager-openvpn-gnome

goto http://www.ibvpn.com

setup a free account

extract openvpn.tgz where you want

On UbuntuGnome goto settings->network->add
select vpn->Import from file

Select ibVPN-US-Dallas.ovpn


Type your email
Get the password from the ibvpn website, this is not you ibvpn account password.




Select Add.
And try it out.

Saturday, May 2, 2015

Download and Install GNOME 3.16 on Ubuntu 15.04


Execute the following commands:

sudo add-apt-repository ppa:gnome3-team/gnome3-staging
sudo add-apt-repository ppa:gnome3-team/gnome3
sudo apt-get update
sudo apt-get dist-upgrade

sudo reboot

Resources:

New Features
http://www.omgubuntu.co.uk/2015/03/gnome-3-16-released-new-features-screenshots
http://www.webupd8.org/2015/03/gnome-316-released-with-new.html

Instructions for Ubuntu 14.10
http://sourcedigit.com/15453-download-and-install-gnome-3-16-on-ubuntu-14-1014-04-systems/