Tuesday, November 23, 2010

A feature to move running apps between different graphical sessions

I would love to see a feature on Wayland or xorg, that would allow for a running application to move from one graphical server to another, if the user has permissions for that.

I know this is tricky. But it would be super useful.

Imagine is a user has his desktop running and fully loaded with apps, and then it uses ssh or nxclient to connect to that machine.
The user would be able to list all graphical apps running under his id in any display servers are running on that machine.
It would then be possible run some command to transfer the output of a certain app to your current display server.
When the user is done with the app, the app should return to the original display server.

All of this would work without ever having to close or restart the app.

Sweet dreams :)

Friday, November 12, 2010

Ubuntu 10.10 Desktop Video Players

I got some time to record a demo with the Video players in Ubuntu 10.10, playing HD Video.


Thursday, November 11, 2010

Bluetooth Headset on Ubuntu

Pulse audio device choser:
sudo apt-get install paprefs paman padevchooser
Switch to PulseAudio by going into System -> Preferences -> Sound. Go into the Devices tab and change the Sound playback option for everything from Autodetect to PulseAudio Sound Server.




Use the gnome Bluetooth device wizard to pair your headset to the desktop


When the device is in pair mode you can type to learn the device unique ID
$ hcitool scan
Scanning ...
00:1F:82:28:XX:XX DR-BT101

create the file in $HOME/.asoundrc with the correct device ID:

pcm.bluetooth {
type bluetooth
device 00:1F:82:28:XX:XX
profile "auto"
}

type to test if the it's working:
mplayer -ao alsa:device=bluetooth ANY_MP3_FILE.mp3

Ubuntu Jaunty 64 bit:

You need some extra 32 bit libraries to make skype bluetooth work on Ubuntu 64 bit.

getlibs:
http://ubuntuforums.org/showthread.php?t=474790

Skype:
getlibs -p bluez
getlibs -p bluez-alsa

A more sophisticated Bluetooth Manager (not needed):

Add this source
deb http://ppa.launchpad.net/blueman/ppa/ubuntu jaunty main

Do not update your system with the new version of bluez from this source.

type to replace default gnome bluetooth applet with blueman type:
sudo apt-get install blueman

Disable this source.

Saturday, October 16, 2010

G2 review, rooting and Wifi tether.



I got the new G2 from TMobile (full price), It sounded like a great device when I got it according to the specs and the standard android build.

But HTC and TMobile got together to remove some functionality from the hardware and software and deceive the their customers by never document these restrictions, in the store or the documentation that comes with the device.

The bad:
- The G2 has a anti root mechanism
- The 4Gb internal storage is consumer fraud, the device might have a 4G internal storage but the user is only allowed to use 1.3Gb from the 4GB. Terrible deal for the price and similar devices like the Samsung Vibrant has 16Gb built in storage available and visible to the user, except for OS binaries. The G2 is missing 2Gb, the OS reporting tools don't even display 4Gb anywhere.
- The G2 has built in apps that you can't remove, twitter, web2go, quickoffice and photobucket. It's ok to pre-install these, but blocking the customer from removing these apps is a terrible idea.
- Tmobile changed market to have a useless TMobile tab and make it more difficult to get to your downloads.

The G2 uses a standard android build without any UI changes and I love that, but TMobile went the extra mile to block the customers that own the device from installing a new version of OS on the device or removeing stock apps. Rooting the device and removing stock apps is disabled on the G2.

With the new OTA, Tmobile WIFI calling was added to standard android 2.2 OS, at least this is a positive change for owners of a G2.

The Hardware:
- The network speed is fast, see the image below.
- The device is Fast.
- I love the keyboard.
- Camera and video is good, but it is a little slow if you need a fast picture, but the camera button and the LED flash are very useful.
- The screen is great.
- Only has one microphone, does not have sounds cancelling with multi microphones as other devices on the market, but it works fine.
- Battery lasts a day, depend on the usage some times not even a full day, but compared to my G1 is similar.
- The power button is not that great, difficult to press and seems like it might break easily, and since you have to press it multiple times per day, does not look like is going to last. It is very similar to the Nexus One.
- I love the volume button, big and usefull.
- I like the camera button.
- I like the 3 configurable buttons on the keyboard, I associated the gtalk, maps and browser to these, but you can associate any apps.
- I love the phone look and the metal back.

What would I change if I could:
- I would install a standard vanilla android build with 2.1, with root access so I can do whatever I want with my device.
- HTC should send a CD or USBKey with a software to restore the phone to the standard android OS image to save user from bloat-ware, spy-ware etc.

How to get root on the G2.
- Paul O’Brien has created an application that will provide quick one-click rooting for users. Get VISONary Paul's website.
- You might need to shut-down the G2 and remove the battery and restart to make VISIONary work, but after this it works great, and you can start blue-tooth tether.
- You can also use my backup pro or titanium backup to backup your device now that you have root on the device.

References:
http://phandroid.com/2010/10/14/visionary-gives-t-mobile-g2-users-a-one-click-root-solution/
http://code.google.com/p/android-wifi-tether/

Detailed review with pics:

http://www.phonescoop.com/articles/article.php?a=425

My speed test on the G2:



Updates after the OTA:
- I got the OTA, I've been running it for 2 weeks now. The phone is more stable, I don't have a freeze or reboot for 2 weeks.
- USB and WIFI tethering is enabled in this new OTA.
- There is also a WIFI calling feature from tmobile and it works.

The 2 things that stills annoys me is after the OTA are:
- that I can't remove the bloatware that tmobile injected in the OS. (So I might change it to another ROM later because of this, I always have to get all the updates for the bloatware to avoid the android notifications for those.
- The phone has some ROM write protection, to disallow the owners that payed the full price of the phone, to install a new version of the OS, this makes no sense and should be not be legal. But this is the mobile market we have today.

- I just wish that HTC or TMobile learned that I am the customer and the phone I payed full price is mine and I should be able do whatever I want with the phone, without having to find hacks and exploits. Give me a clean standard OS image without mods or bloatware that I can install, put it on HTC website or on TMobile web site and allow me to remove the bloatware from the phone, and only support that in case I call for support.


- The 4GB I payed for are still not available with the OTA, I can only see 1.8GB of internal storage, sad so sad :(


All that said:
This phone is amazing. Super fast, lasts me all day with WIFI/Bluetooth/GPS on. I use it to play podcasts for 6 hours or more per day and play these with stereo blue-tooth headsets. I also do normal usage of calling and web-browsing. Somehow the battery seems to last longer with the new OTA update. :)

Thursday, September 16, 2010

How to use vpnc with a cisco vpn server

Build vpnc with Hybrid support need by the cisco vpn.

sudo apt-get build-dep vpnc

sudo apt-get install libssl-dev

mkdir -p ~/tmp/vpnc

cd ~/tmp/vpnc

apt-get source vpnc

cd vpnc-0.5.3r449

# Edit the file Makefile and uncomment line
#OPENSSL_GPL_VIOLATION=yes

dpkg-buildpackage

# Remove existing vpnc
sudo apt-get remove vpnc
sudo dpkg -i ../vpnc_0.5.3r449-2_i386.deb
Verify the hybrid mode by executing
vpnc --version| grep -i auth
Supported Auth-Methods: psk psk+xauth hybrid(rsa)
Extract/Convert Root Cert and Profiles

Download MacOS Cisco VPN client your_company_cisco_client.dmg

Mount HFS Archive to copy the files needed

sudo mkdir /tmp/cisco
sudo mount -t hfsplus your_company_cisco_client.dmg /tmp/cisco -o loop
cd /tmp/cisco
cp -r Profiles/ rootcert
cd
sudo umount /tmp/cisco
sudo rmdir /tmp/cisco

Use pcf2vpn to convert files.

mkdir ~/vpnc

$ for file in Profiles/*.pcf; \
do basename=`basename "$file"`; \
/usr/share/vpnc/pcf2vpnc Profiles/"$basename" ~/vpnc/"${basename%pcf}vpnc"; \
done

use openssl to convert your root cert to PEM format
openssl x509 -inform DER <> root_certificate.pem
to connect to bayarea (for example)
sudo vpnc --ca-file root_certificate.pem vpnc/bayarea.vpnc

Example vpnc file:

## generated by pcf2vpnc
# CA-File /etc/vpnc/root_certificate.pem
IPSec ID GeneralHybrid
IPSec gateway vpn.company.com
IPSec secret XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

IKE Authmode hybrid
IKE DH Group dh2

## To add your username and password,
## use the following lines:
# Xauth username
# Xauth password

Using a socks proxy

#ssh to a machine on the network you need access and start
# a local socks server
ssh -D 9999 httpserver.blah.com

# setweb browser proxy to
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 httpserver.blah.com

# eclipse to a machine
tsocks eclipse

reference:
using tsocks for tunneling cmds lines and everything else
http://www.plenz.com/tunnel-everything

Sunday, July 4, 2010

Ubuntu 10.10 Maverick on Lenovo Q150



New related post Ubuntu 12.04 on Lenovo Q150 with OCZ SSD and 4Gb of Memory.

The Lenovo Q150 comes Atom D510 and the nvidia Ion gfx, 2GB of ram and a 250 GB HD.
I decided to install the 32 bit version of Ubuntu since flash more stable under 32 bit linux. I also installed:
  • ubuntu tweak
  • xbmc
  • miro
  • minitube (youtube player, faster than flash)
  • huludesktop
  • boxee
  • skype
  • cooliris
  • chromium
  • shotwell

The latest version of Ubuntu contains updates to the kernel, alsa and nouveau nvidia drivers. The new opensource drivers seems as fast as the proprietary drivers when playing video and this is great. It also detects the nvidia HDMI sound card out of the box.
So the biggest difference compared to 10.04 is that using the opensource drivers you can play video at 1080p full-screen without problems and HDMI sound card works.

- Basic installation from a USB key works fine.
- HDMI/VGA and sound out, little USB keyboard/mouse works fine.
- Dual boot with Windows 7 works fine.
- Detects the nvidia HDMI sound card.
- The open source nvidia ubuntu drivers, NVidia proprietary drivers, and the new drivers from nvidia web site work fine.
- Video acceleration at 1080p works great for Miro, mplayer, minitube, vlc, xbmc with the opensource drivers. You don't need to install nvidia proprietary drivers, unless you want 3D and HDMI sound. Flash is as fast with opensource drivers as the nvidia proprietary drivers.



- Hulu desktop plays fullscreen in high quality, with the opensource drivers and the proprietary drivers but you need to right click and select quality low on the context menu of hulu desktop. I thinks this use a decompress routine that is less CPU intensive (see the picture).
- When playing hulu, boxee, cooliris, youtube in full-screen it uses 100% of all CPUs. You can play youtube videos up to 720p without full screen with a good frame rate, but youtube 1080p is slow even in a small window.

Problems I found:

- Wireless card works, but requires compiling some code for now.
- Flash video acceleration does not work as fast as in windows, it uses more CPU, I think this is because flash on linuc does not have gfx acceleration.
- HDMI sound card requires nvidia video drivers and some tweaking see below.

XBMC install:


Add key on command line:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0x6d975c4791e7ee5e
Adding the XBMC Repo

  • Adding the XBMC Repo tells your system where to look for xbmc for installation and future updates
  • From the Desktop, click System -> Administration -> Software Sources.
  • Click the "Third Party Sofware" tab.
  • Click "Add" for each of the following. For the Apt line type the following:
deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu lucid main
deb-src http://ppa.launchpad.net/team-xbmc/ppa/ubuntu lucid main

HDMI sound instructions

sudo apt-get install alsa-utils
on alsamixer press F6 to select the nvidia card enable all s/PDIF devices
# list the devices
aplay -l
# my sound gets enabled when I play on device speaker-test -D plughw:1,9 -r 44100, after that the sounds starts to work. It's important to use the -r 44100 since the drivers are not setting up the correct frequency.
speaker-test -D plughw:1,3 -r 44100
speaker-test -D plughw:1,7 -r 44100
speaker-test -D plughw:1,8 -r 44100
speaker-test -D plughw:1,9 -r 44100


In case you want to make a permanent change for the hdmi sound as the deafult card you can update /usr/share/alsa/alsa.conf and change these lines:

defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0

to this:

defaults.ctl.card NVidia
defaults.pcm.card Nvidia
defaults.pcm.device 9

Wireless driver

Q150 uses a Realtek USB RTL8191SU 802.11n USB 2.0 wireless card.

There are 2 drivers for the wireless card, instructions described below:
Download the RTL8191SU driver from Realtek:
http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=21&PFid=48&Level=5&Conn=4&DownTypeID=3&GetDown=false

The one I got was dated 2010/6/30. Unzip the file.
Go into the "driver" sub directory:

cd rtl8712_8188_8191_8192SU_usb_linux_v2.6.0006.20100625/driver

Extract the driver:

tar -zxf rtl8712_8188_8191_8192SU_usb_linux_v2.6.6.0.20100625.tar.gz

Add this line:

{USB_DEVICE(0x13D3, 0x3323)},
to rtl8712_8188_8191_8192SU_usb_linux_v2.6.0006.20100625/os_intf/linux/usb_intf.c at line 96 or so.

This adds the vendor / product ID for the adapter the Q150 uses. I found out the correct numbers by doing a sudo lsusb -v and looking for the network device.

# download compiler and kernel source
sudo apt-get install build-essential linux-source linux-headers-generic
cd /usr/src
sudo tar -xvjf linux-source-2.6.35.tar.bz2
sudo ln -s /usr/src/linux-source-2.6.35 /usr/src/linux

# get a root shell
sudo bash
./clean
make
make install
modprobe 8712u
/etc/init.d/NetworkManager restart
exit
Note: these instructions where provided by Doug S.

Another driver you can use is r8192s_usb non stable driver, instructions below:
# get the realtek firmware
sudo apt-get install linux-firmware
wget http://svn.debian.org/wsvn/kernel/dists/trunk/firmware-nonfree/realtek/RTL8192SU/rtl8192sfw.bin
sudo mkdir /lib/firmware/RTL8192SU
sudo cp rtl8192sfw.bin /lib/firmware/RTL8192SU
# load the driver
sudo modprobe -v r8192s_usb
# the device should show up on network applet
# you can run dmesg|less and look for r8192s_usb to see if the driver loaded correctly.

Some other references for the wireless card:


http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=21&PFid=48&Level=5&Conn=4&DownTypeID=3&GetDown=false

Dlink DWA-131 usb wireless chipset use a similar chipset as the Q150, some guides on the DWA-131 available here:

Wake up from usb wireless keyboard

You need to enabled USB wake up, in /proc/acpi/wakeup
# cat /proc/acpi/wakeup
sudo -s
echo USB0 > /proc/acpi/wakeup
echo USB1 > /proc/acpi/wakeup
echo USB2 > /proc/acpi/wakeup
echo USB3 > /proc/acpi/wakeup
echo EUSB > /proc/acpi/wakeup

This will allow you to suspend the machine use the wireless usb keyboard to wake up.

Wake up from at certain time
# Check alarm is not step
cat /proc/driver/rtc
# clear alarm, is need before setting
sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"
# Set alarm
sudo sh -c "echo `date -u --date "Aug 9, 2010 00:05:00" +%s` > /sys/class/rtc/rtc0/wakealarm"

# Check alarm time
cat /sys/class/rtc/rtc0/wakealarm
cat /proc/driver/rtc

Reference for timed wake:


Setting dns over TLS on ubuntu 26.04 using quad9 and

With this change future dns queries should got to Quad9 and fallback Cloudflare if Quad9 has a outage, and should go over TLS.  Change /etc/...