Friday, July 26, 2013

Run arch linux on ODROID-X2 Step by Step

Get the image from Home

http://archlinuxarm.org/platforms/armv7/samsung/odroid-x2

To write the image to your SD card use the following command line
dd if=ArchLinuxARM-2013.07-odroid-x2.img  of=/dev/sdxxxx  bs=10M
Make sure /dev/sdxxxx is the correct dev for your SD card
Make sure to umount your SD card first...
Once dd is done writing the image to SD card use sync to flush any buffers


login using id and password  root/root
you will have to login first time using serial terminal or SSH.

If you can not find the IP address for the ODROID board, then you might want to setup static IP address;
  1. cd /etc/network.d   then type ls , you should see ethernet-eth0
  2. edit the file ethernet-eth0 using  sudo nano ethernet-eth0
  3. comment the dhcp configuration 
  4. un-comment and enter your correct ip address that you want to set and your dhcp address
  5. save and insert the sd card in your board and ping that address
  6. you should get echo back after 10-15 seconds
  7. for some reason it does not pickup the static by it self, I had to use netcfg-daemon start
Copy of my ethernet-eth0
## Change for static
CONNECTION='ethernet'
DESCRIPTION='A basic static ethernet connection using iproute'
INTERFACE='eth0'
IP='static'
ADDR='172.16.71.239'
NETMASK='255.255.0.0'
##ROUTES=('192.168.0.0/24 via 192.168.1.2')
GATEWAY='172.16.1.45'
DNS=('172.16.1225' '172.16.1.233')


OK, this time with "Linux alarm 3.8.13.12-2-ARCH #2 SMP PREEMPT Tue Nov 12 20:41:34 CST 2013 armv7l GNU/Linux" I had to go to /etc/netcfg/ and edit eth0  

escription='A basic static ethernet connection'
Interface=eth0
Connection=ethernet
IP=static
Address=('192.168.71.239/24')
#Routes=('192.168.0.0/24 via 192.168.1.2')
Gateway='192.168.1.1'
DNS=('192.168.1.1' '192.168.1.2')



If you need to change root password,
Type: passwd  after you login and you will be prompted to enter new password.



How to update System in archlinux
We use pacman to install/update the system packages
So, type pacman-key --init to create pacman key first
you might need to switch to another console and type
ls -R / && ls -R / && ls -R /
now, when it is done, type pacman -Syu to update the system
It will take some time and will download and update your system
To add/install packages use pacman -S package_name


How to add your username to suders
Install sudo, modify visudo

  1. Install adduser by using pacman -S adduser
  2. Install sudo to be able to use root privilege
  3. Type  adduser username

and follow/answer all questions, set defaults, set password...
Now we need to edit the visudo to allow new user to use the sudo command
Type
EDITOR=nano visudo
Edit/ uncomment the following line
# %sudo ALL=(ALL) ALL  ==>>   %sudo ALL=(ALL) ALL
save and then create sudo group
groupadd sudo
now add sudo group to your user name
usermod -a -G sudo username
reboot and test your sudo access.  you will need to logout and login again...

Getting the WiFi setup
Setting the WiFi I had to install wicd
sudo pacman -Su wicd
then I got to run ip add show  to see list of your network device eth0, lo, wlan0
I have WEP security so, I run
sudo iwconfig wlan0 essid "your essid here" key your_hex_Keysudo dhcpcd wlan0
Now, if you have different settings like WEP, WPA, WPA2,..  refer to the link here

So, I started investigating netcfg
it works with the profiles saved in /etc/network.d
and by default it has one profile for the ethernet-eth0
so, I copied wireless-wep from the examples folder
updated the parameters in wireless-wep to my wireless network and
type: sudo netcfg wireless-wep -u

Two things:
  1. my key is stored in the profile file in text --- not good
  2. it still does not start on boot .....
I found netcfg-menu that needs dialog..
The netcfg-menu will make it simple to start specific profile as long as you created a profile for it as I have above. but still no auto-start on boot!

What is the /etc/conf.d/netcfg ???
I did it..  in the netcfg file there is a line called NETWORKS that is by default is like this...
NETWORKS=(ethernet-eth0)
So, I added my second profile just like this
NETWORKS=(ethernet-eth0 wireless-wep)
and now, both network profiles are up and running on boot....
Now, I needed to install wicd-gtk to work on the GUI



How to get your HDMI Working:
To be able to login from Arch Linux on a monitor instead of serial port of SSH you need
pacman -Su linux-odroid-x2

Trying to install:
sudo pacman -S xorg-server lxde xf86-video-fbdev
you can add xorg-apps but it is not required
sudo pacman -S xorg lxde xorg-twm xorg-xclock xterm xorg-xinit
All this so far did not get me to boot from the HDMI monitor...??????
After installing an image for Ubuntu 13.04 I got the board to run on HDMI interface and I logged in.  so it is not a hardware issue, it is a configuration.

> create file ~/.xinitrc in your home directory and add this line to it
exec startlxde
> there was an error not finding a cache file and I had to create it manually
OK, the file name was cookie and this is what I did
cd .config/pulse
echo > cookie
The echo command created a file cookie then I had to use nano and add the line I mentioned above
Now you should be able to use startx and get your LXDE desktop

Had to install fbset and run sudo fbset -fb /dev/fb1
Edited /etc/X11/xorg.conf

Section "Device"
        Identifier "HDMI"
        Driver  "fbdev"
        Option  "fbdev"           "/dev/fb1"
EndSection
Section "Screen"
        Identifier   "Default Screen"
        Device       "HDMI"
        DefaultDepth 24
EndSection
Section "DRI"
        Mode 0666
EndSection

after I added these settings to xorg.conf file it worked and I logged to LXDE finally....


To be able to forward X11 windows I had to do:
I am not sure yet which one did the trick but I will have to do this again on my other board...

  • Enable the AllowTcpForwarding option in sshd_config on the server.
  • Enable the X11Forwarding option in sshd_config on the server.
  • Set the X11DisplayOffset option in sshd_config on the server to 10.
  • Enable the X11UseLocalhost option in sshd_config on the server.
Also:
  • Enable the ForwardX11 option in ssh_config on the client.
  • Enable the ForwardX11Trusted if gui is drawing badly.
You need to restart the ssh daemon on the server for these changes to take effect, of course.
To use the forwarding, log on to your server through ssh:


Time-Date set and check
sudo timedatectl set-time "2013-08-14 14:52:00"
timedatectl status
timedatectl set-timezone America/New_York



Scratch Pad:
Do not use this method use adduser better
If you need to add new user so you do not login with the root
Type:     useradd user_name
Then change password:  passwd user_name
where user_name is the new user name you want to create

You will need to install sudo to be able to use root privilege with your new user id





Commands you might need:
Check CPU usage    top
Check SD usage       df  -h
systemctl start sshd
systemctl enable sshd.service
systemctl restart sshd.service



List to Do:
sudo root access
WiFi
HDMI
GPIO
SPI
Bluetooth
ssh -X ip-address




References:
https://wiki.archlinux.org/index.php/Wireless_Setup
https://wiki.archlinux.org/index.php/Bluetooth
https://wiki.archlinux.org/index.php/Ssh#X11_Forwarding
https://wiki.archlinux.org/index.php/Running_X_apps_as_root  Running X apps as root



list of stuff I did on new ArchLinuxARM-2013.11:

  1. login as root/root
  2. pacman -Syu
  3. pacman -S sudo adduser
  4. adduser username
  5. EDITOR=nano visudo
  6. Created new sudo group and added to new username
  7. Log in with new username
  8. Tested new username sudo
  9. If you do too much sudo, you can use sudo -s
  10. I kept the IP to DHCP, and on my second board, I changed it to Static
  11. change IP to static follow steps above...
  12. trying to install lxde
  13. sudo pacman -S xorg lxde xorg-twm xorg-xclock xterm xorg-xinit
  14. created .xinitrc and added exec startlxde
  15. Added pulse folder in .config and then created empty cookie file
  16. Install fbset then run sudo fbset -fb /dev/fb1
  17. created file /etc/X11/xorg.conf then copied the data above to it





Saturday, July 6, 2013

How to get Ubuntu to play Amazon instant Movies

I finally got to try Amazon Prime membership and started to use the futures including free shipping on some of the items listed, and play the instant movies that will work only on some of the Operator Systems.

What a disappointment, it does not work on all the Android devices that I have, however, it works on
Amazon Kindle!!!  I thought that that runs a version of Android too, so why not the rest of Android devices?

I found a fix on here though...
you will need to download the Free flash player APK from here


Now, my Ubuntu can not stream these movies, Why?
Here is fix:

sudo mkdir /etc/hal/fdi/preprobe

sudo mkdir /etc/hal/fdi/information

/usr/sbin/hald --daemon=yes --verbose=yes

rm -rf ~/.adobe



References:
http://askubuntu.com/questions/286297/is-there-a-work-around-to-get-protected-hulu-or-amazon-prime-instant-videos-work

http://forum.xda-developers.com/showthread.php?t=1774336

Monday, July 1, 2013

How tos in MS Windows to develop your application peacefully

I wanted to capture all the tools and tricks that I was able to find after a long research and reading.  This way I can come back here and reuse it or someone else can find it.

Command Line Commands that solved my problems:

To Enable Remote Desktop:
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

To Disable Remote Desktop:
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f


Task List / Kill:
taskkill -pid 4104
taskkill -im iexplore.exe
tasklist -m
tasklist -svc





Some references: