Chromecast, how to run ftp, samba, httpd, symlink new busybox, usb - Google Chromecast

Some usefull comands to chromecast
You need to download the latest busybox (v1.21.1)
search for busybox binary, it's the first hit on google. Download busybox-armv71
cd /data
busybox wget <adress to file>
mv /data/busybox-arm71 /data/busybox
chmod 777 /data/busybox
always good to run /data/busybox ash first so we can use tab again =)
FTP:
/data/busybox tcpsvd -vE 0.0.0.0 21 /data/busybox ftpd / -w & > /dev/null
Samba:
mkdir /data/samba
/data/busybox mount -t cifs //<server ip>/<share> /data/samba/ -o username=<username>,password=<password>
httpd:
mkdir /data/www
echo "A:*" > /data/httpd.conf
echo "Hello World" > /data/www/index.html
chmod -R 755 /data/httpd.conf /data/www
/data/busybox httpd -p 8000 -h /data/www -c /data/httpd.conf
Symlink to new busybox commands:
mkdir /data/bin
busybox cp /data/busybox /data/busybox/bin
create the file "/data/create" with:
#!/bin/sh
for b in $(/data/bin/busybox --list); do
ln -s /data/bin/busybox "/data/bin/${b}"
done
chmod 755 /data/create
sh /data/create
Add path:
export PATH=$PATH:/data/bin
no need to run /data/busybox vi anymore =)
USB:
I have not figured this out yet. But if you connect a usb with ota cable and run
mkdir /data/usb
/data/busybox lsusb - shows a usb but there is no device file in /dev to mount.
Bus 001 Device 002: ID 090c:1000
Bus 001 Device 001: ID 1d6b:0002
Then I run:
/data/busybox makedevs -d /deb/block/sda1 /data/usb
I get this
/data# /data/busybox makedevs -d /dev/block/sda1 /data/usb/
rootdir=/data/usb/
table='/dev/block/sda1'
makedevs: invalid line 26: 'lost+found'
makedevs: invalid line 27: '▒X'
makedevs: invalid line 28: 'Ap▒N|B▒▒^
[...] and about 40 simular lines. It's a newly formated 8 gig usb (ex4) so it's only a lost+found dir on it, as it shows above.
then I run /data/busybox fdisk -lu /dev/block/sda - I get this
Disk /dev/block/sda: 8019 MB, 8019509248 bytes
246 heads, 40 sectors/track, 1591 cylinders, total 15663104 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/block/sda1 2048 15646719 7822336 83 Linux
Anyone got a clue whats wrong and how to fix this?
Have anyone found out how to autostart scripts on boot?
/mape

USB worked for me. Here's what I did:
1) Inserted USB drive (fat formated). /dev/block/sda and /dev/block/sda1 were auto created and the following lines were generated in dmesg:
Code:
<6>[ 211.880372] usb 1-1: new high-speed USB device number 2 using berlin-ehci
<6>[ 212.033411] usb 1-1: New USB device found, idVendor=13fe, idProduct=3100
<6>[ 212.033427] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 212.033436] usb 1-1: Product: Patriot Memory
<6>[ 212.033444] usb 1-1: Manufacturer:
<6>[ 212.033451] usb 1-1: SerialNumber: 079B09013A4D52A8
<6>[ 212.035169] scsi0 : usb-storage 1-1:1.0
<5>[ 213.055504] scsi 0:0:0:0: Direct-Access Patriot Memory PMAP PQ: 0 ANSI: 0 CCS
<5>[ 213.058011] sd 0:0:0:0: Attached scsi generic sg0 type 0
<5>[ 213.760828] sd 0:0:0:0: [sda] 15646720 512-byte logical blocks: (8.01 GB/7.46 GiB)
<5>[ 213.761302] sd 0:0:0:0: [sda] Write Protect is off
<7>[ 213.761317] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
<3>[ 213.761799] sd 0:0:0:0: [sda] No Caching mode page present
<3>[ 213.767645] sd 0:0:0:0: [sda] Assuming drive cache: write through
<3>[ 213.778932] sd 0:0:0:0: [sda] No Caching mode page present
<3>[ 213.784735] sd 0:0:0:0: [sda] Assuming drive cache: write through
<6>[ 213.811683] sda: sda1
<3>[ 213.814553] sd 0:0:0:0: [sda] No Caching mode page present
<3>[ 213.820769] sd 0:0:0:0: [sda] Assuming drive cache: write through
<5>[ 213.827234] sd 0:0:0:0: [sda] Attached SCSI removable disk
2) I was able to mount the drive with the following:
Code:
mkdir /data/mnt/
mount -t vfat /dev/block/sda1 /data/mnt/
I can't imagine that and ext4 formatted drive would prevent the block device from being created, but you can try to manually create it with:
Code:
mknod /dev/block/sda b 8 0
mknod /dev/block/sda1 b 8 1
and then try to mount. It may be worth trying a fat formatted drive if you have one.
---------- Post added at 08:57 PM ---------- Previous post was at 08:55 PM ----------
I'll toss out a useful command of my own. If you want to transfer files to and from the chromecast without enabling additional services, this can be done by pipelining data through the ssh command (since dropbear is minimized to exclude scp and sftp, this is the only way).
To send the local file tmp/bashrc to the chromecast's /data directory, run the following command:
Code:
cat tmp/bashrc | ssh [email protected] 'cat > /data/bashrc'
To download the /build.prop file from the chromecast to the local system, run the following command:
Code:
ssh [email protected] 'cat /build.prop' > build.prop
Permissions may need to be fixed on the transferred file.

Got it working, with both fat and fat32, Strange it did't work with any of the ext systems. Learnt many things, like not post late at night
Nice command there, handy to always have the abiliy to send files.

Hi all
How woud I execute the following command in [email protected] /usr/share/eureka-apps/configs/apps.conf
I am trying to locate the Team Eureka whitelist. As well what is the root password for the rom, Is it my WiFi pass phrase/password?
Regards
fs1023

fs1023 said:
Hi all
How woud I execute the following command in [email protected] /usr/share/eureka-apps/configs/apps.conf
I am trying to locate the Team Eureka whitelist. As well what is the root password for the rom, Is it my WiFi pass phrase/password?
Regards
fs1023
Click to expand...
Click to collapse
If you just want to view the file, you can establish an ssh connection to execute a single command:
Code:
ssh [email protected] cat /usr/share/eureka-apps/configs/apps.conf
Otherwise you can view the file from an already established interactive session by running:
Code:
cat /usr/share/eureka-apps/configs/apps.conf
The root password is blank as there is no passwd file. I doesn't look like google built this with user management in mind.

bobcat987 said:
If you just want to view the file, you can establish an ssh connection to execute a single command:
Code:
ssh [email protected] cat /usr/share/eureka-apps/configs/apps.conf
Otherwise you can view the file from an already established interactive session by running:
Code:
cat /usr/share/eureka-apps/configs/apps.conf
The root password is blank as there is no passwd file. I doesn't look like google built this with user management in mind.
Click to expand...
Click to collapse
Thanks for the reply bobcat987. I am struggling. Tried to ssh connection with commands you gave me but putty is asking for a password.
Can you please help once again?
Regards
fs1023

fs1023 said:
Thanks for the reply bobcat987. I am struggling. Tried to ssh connection with commands you gave me but putty is asking for a password.
Can you please help once again?
Regards
fs1023
Click to expand...
Click to collapse
Just push enter and you should be good.

Related

get-a-robot-vpnc help

I have been trying to get the get-a-robot-vpnc (http://code.google.com/p/get-a-robot-vpnc/) package to work on my HTC Vogue for some time. I am currently running the eclair 2.1 mssmision build.
I have gotten pretty far I think.. but need some help. Here are the steps that I have followed up until now.
1. Compile tun.ko module for Vogue
I followed these instructions to get the vogue kernel locally: http://www.androidonhtc.com/get_involved
After step 5 in that list, make sure to select the "Device Drivers->Network Device Support->Universal TUN/TAP device driver support" (select as M for kernel module)
After step 6, build the kernel modules: "make modules ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-"
2. Put tun.ko onto the vogue permanently
Set the /system partition writable
Code:
adb -d shell
#su
#mount -o remount,rw /system
In a different terminal, push the tun.ko over to the /system/lib/modules dir
Code:
adb -d push ~/android-kernel/kernel/drivers/net/tun.ko /system/lib/modules
Back in the first terminal, set the system volume to read only again.
Code:
#mount -o remount,ro /system
3. Install the latest get-a-robot-vpnc package
Download from website and push to device:
Code:
adb -d install VPN_Connections_v097.apk
It is installed to /data/data/org.codeandroid.vpnc_frontend directory.
I put in the correct settings to connect to my companies vpn. (These same settings work perfectly on my ubuntu machine)
When I run the program I see on logcat:
Code:
D/VPN_Connections( 658): Password is numeric
D/VPN_Connections( 658): password **********
D/VPN_Connections( 658): done interacting with vpnc
D/VPN_Connections( 658): process stderr:
D/VPN_Connections( 658):
D/VPN_Connections( 658): Attempt to read vpnc process id did not return anything
D/VPN_Connections( 658): process had died, return as failed connection
But when i shell into the phone I see the process running:
Code:
/ # ps | grep vpnc
658 10049 107m S org.codeandroid.vpnc_frontend
710 0 1300 S /data/data/org.codeandroid.vpnc_frontend/files/vpnc -
At this point the network is hosed and in order to get it back I have to reboot.
Trying it manually
In order to see what is happening with vpnc, I shell into the phone and run the program manually.
First I need to ensure the tun.ko is loaded:
Code:
#su
#insmod /system/lib/modules/tun.ko
You can see the command string for vpnc in the /data/data/org.codeandroid.vpnc_frontend/files/lastConnection.txt file.
I run this command:
Code:
/data/data/org.codeandroid.vpnc_frontend/files/vpnc --script /data/data/org.codeandroid.vpnc_frontend/files/vpnc-script --no-detach --debug 1
Enter the correct vpn data and see this output: (i cut out my company specific info and ip addresses)
Code:
vpnc version ERSION
IKE SA selected psk+xauth-3des-md5
NAT status: NAT-T VID seen, no NAT device detected
IKE SA selected psk+xauth-3des-md5
NAT status: NAT-T VID seen, no NAT device detected
Enter Username and Password.
Banner: Welcome <cut> Remote Access User.
got address <xxx.xxx.xxx.xxx>
Connect Banner:
| Welcome <cut> Remote Access User.
backing up dns and resolve.conf
vpnc-script ran to completion
IPSEC SA selected aes128-sha1
VPNC started in foreground...
vpnc[582]: can't open pidfile /var/run/vpnc/pid for writing
At this point I seem to be connected.. but can't actually ping anything on my company network, or get to any websites.
I am not very strong with networking.. so I feel that maybe the routes are not being setup properly.. but I don't know:
Here is my routing table after the connection (took out company ip)
Code:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
68.28.145.85 * 255.255.255.255 UH 0 0 0 ppp0
xxx.xxx.xxx.xx 68.28.145.85 255.255.255.255 UGH 0 0 0 ppp0
default * 0.0.0.0 U 0 0 0 tun0
Any help would be appreciated.
Hey - I posted a response in the vpnc thread:
http://forum.xda-developers.com/showpost.php?p=5625056&postcount=109
Also, to amend - if you try it manually again, try this:
/data/data/org.codeandroid.vpnc_frontend/files/vpnc --script /data/data/org.codeandroid.vpnc_frontend/files/vpnc-script --no-detach --natt-mode cisco-udp --debug 1

[P3110] UMS for extSdCard [12.08.: CM10 Edition]

So, I'm currently investigating UMS on Galaxy Tab 2 and I got it somewhat working (for extSdCard).
If you feel brave enough, here's how I did it (ONLY tested on GNU/Linux!):
Q: What prerequisites do I need?
A: You need:
human brain
CWM
root access (aka 'su')
some knowledge about Linux in general won't hurt
After you sucessfully booted into your newly rooted, init.d ready P3110, do this:
Code:
adb root
adb shell
su
mount -o rw,remount /
mount -o rw,remount /system
chmod 0777 /¹
¹ = only if you're on stock rom. on cyanogen this is not needed.
locally, create a file called 'ums', with the following content:
STOCK ROM
Code:
#!/system/bin/busybox sh
if [ "$1" = "enable" ]; then
/system/bin/setprop sys.usb.config mass_storage,adb
/system/bin/setprop persist.sys.usb.config mass_storage,adb
/system/bin/setprop sys.usb.state mass_storage,adb
echo 0 > /sys/devices/virtual/android_usb/android0/enable
umount /mnt/extSdCard
echo "mass_storage,adb" > /sys/class/android_usb/android0/functions
echo "/dev/block/vold/179:25" > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun1/file
echo 1 > /sys/devices/virtual/android_usb/android0/enable
fi
if [ "$1" = "disable" ]; then
/system/bin/setprop sys.usb.config mtp,adb
/system/bin/setprop persist.sys.usb.config mtp,adb
/system/bin/setprop sys.usb.state mtp,adb
echo "" > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun1/file
echo 0 > /sys/devices/virtual/android_usb/android0/enable
echo "mtp,adb" > /sys/class/android_usb/android0/functions
echo 1 > /sys/devices/virtual/android_usb/android0/enable
vold
fi
Code:
adb push ums /ums
adb shell
su
busybox mv /ums /system/bin/ums
chmod 0777 /system/bin/ums
CYANOGEN MOD 10
May work with CM9 aswell, but I didn't test it.
Code:
#!/system/xbin/busybox sh
if [ "$1" = "enable" ]; then
/system/bin/setprop sys.usb.config mass_storage,adb
/system/bin/setprop persist.sys.usb.config mass_storage,adb
/system/bin/setprop sys.usb.state mass_storage,adb
umount /storage/sdcard1
echo 0 > /sys/devices/virtual/android_usb/android0/enable
echo "mass_storage,adb" > /sys/class/android_usb/android0/functions
echo "/dev/block/vold/179:25" > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file
echo 1 > /sys/devices/virtual/android_usb/android0/enable
fi
if [ "$1" = "disable" ]; then
/system/bin/setprop sys.usb.config mtp,adb
/system/bin/setprop persist.sys.usb.config mtp,adb
/system/bin/setprop sys.usb.state mtp,adb
echo 0 > /sys/devices/virtual/android_usb/android0/enable
echo "mtp,adb" > /sys/class/android_usb/android0/functions
echo "" > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file
echo 1 > /sys/devices/virtual/android_usb/android0/enable
vold
fi
Code:
adb push ums /system/bin/ums
adb shell
su
chmod 0777 /system/bin/ums
STEP B
Install some terminal emulator from Market. Open that app and issue
su (when SuperUser asks, give it permission).
next, to enable UMS:
Code:
ums enable
to disable UMS
Code:
ums disable
NOTE: there are two different options: calling 'ums enable' prior to connecting with USB or while connected. Different ROMs behave differently, try what works best for you.
If everyhing is fine (and you're running Linux), dmesg should show something like:
Code:
[ 1680.264023] usb 1-6: new high-speed USB device number 29 using ehci_hcd
[ 1680.356086] hub 1-0:1.0: unable to enumerate USB device on port 6
[ 1680.636060] usb 1-6: new high-speed USB device number 30 using ehci_hcd
[ 1680.769829] usb 1-6: New USB device found, idVendor=04e8, idProduct=685e
[ 1680.769832] usb 1-6: New USB device strings: Mfr=2, Product=3, SerialNumber=4
[ 1680.769835] usb 1-6: Product: GT-P3110
[ 1680.769837] usb 1-6: Manufacturer: samsung
[ 1680.769838] usb 1-6: SerialNumber: c1607c00051963f
[ 1680.771433] scsi26 : usb-storage 1-6:1.0
[ 1681.769047] scsi 26:0:0:0: Direct-Access SAMSUNG File-Stor Gadget 0001 PQ: 0 ANSI: 2
[ 1681.770784] scsi 26:0:0:1: Direct-Access SAMSUNG File-Stor Gadget 0001 PQ: 0 ANSI: 2
[ 1681.779155] sd 26:0:0:0: [sdc] 8052736 512-byte logical blocks: (4.12 GB/3.83 GiB)
[ 1681.782898] sd 26:0:0:0: [sdc] Write Protect is off
[ 1681.782901] sd 26:0:0:0: [sdc] Mode Sense: 0f 00 00 00
[ 1681.787146] sd 26:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1681.794399] sd 26:0:0:1: [sdd] Attached SCSI removable disk
[ 1681.804415] sdc:
[ 1681.809590] sd 26:0:0:0: [sdc] Attached SCSI removable disk
And now you can access extSdCard as ordinary UMS.
TODO:
some button/widget to easily en/disable UMS
make it work with internal storage, too
Suggestions welcome :]
Credits:
Commands for ums derived from: http://forum.xda-developers.com/showthread.php?t=1785243
Tried this on my P3113 running today's build of CM10. Changed /mnt/extSdCard/ to /storage/sdcard1/ in accordance with the ROM's setup. Got the following error:
Code:
can't create /sys/devices/virtual/android_usb/android0/f_mass_storage/lun1/file: No such file or directory
I don't use CM, only stock rom. I guess it's simply a different virtual device, you should investigate in /sys/devices/virtual/
Meanwhile I'm currently trying to improve the script, it does not always work for me, I need to check why.
Edit:
improved 'ums' script:
- better handling of returning to MTP
- better handling of entering UMS
I noticed, that it does not always work, when running 'ums enable' from within 'adb shell'.
But when doing from a terminal emulator on the tablet - disconnected from PC - it always works.
Setialpha said:
I don't use CM, only stock rom. I guess it's simply a different virtual device, you should investigate in /sys/devices/virtual/
Meanwhile I'm currently trying to improve the script, it does not always work for me, I need to check why. Next version atleast properly does returning to MTP.
Click to expand...
Click to collapse
I think it needs to run a little later during boot.
Sent from my ADR6425LVW using xda premium
See my edited post above.
Ah and it's not running from init.d (that's not called late enough, as vold is one of the last in the boot process) - it's run manually, right before you want to acces your stuff.
Setialpha said:
See my edited post above.
Ah and it's not running from init.d (that's not called late enough, as vold is one of the last in the boot process) - it's run manually, right before you want to acces your stuff.
Click to expand...
Click to collapse
Gotcha
Sent from my ADR6425LVW using xda premium
Yeah, when I was screwing around with remapping the mount points of sdcard and extSdCard, I found that vold runs really late in the boot-up process. The only easy way I found to get shell scripts to run that late is an app (like Script Manager), since apps can register an event handler and then they do stuff "at boot time", which runs after init.d, userinit.sh, and vold.
So wait, does this access for the external micro SD card from MTP over to UMS? And by 'UMS' do you mean regular-style USB mass storage device? As in "hey you can just read/write files instead of having to wait for the slow ass MTP server!"?
Because that's AWESOME!
DivinityCycle said:
Yeah, when I was screwing around with remapping the mount points of sdcard and extSdCard, I found that vold runs really late in the boot-up process. The only easy way I found to get shell scripts to run that late is an app (like Script Manager), since apps can register an event handler and then they do stuff "at boot time", which runs after init.d, userinit.sh, and vold.
So wait, does this access for the external micro SD card from MTP over to UMS? And by 'UMS' do you mean regular-style USB mass storage device? As in "hey you can just read/write files instead of having to wait for the slow ass MTP server!"?
Because that's AWESOME!
Click to expand...
Click to collapse
Yes, regular USB as in 'plug in an USB-Stick'. It's a hack so it may not always work (especially not when plugged in with ADB active) but hey - better than nothing. I will try to improve that thingy, though.
does stock rom have ums?
despine said:
does stock rom have ums?
Click to expand...
Click to collapse
No
Sent from my ADR6425LVW using xda premium
Update: additional script/steps for CM10 added - have fun
This works flawlessly on Linux, but not Windows. Any idea what the difference is (besides the obvious)?
Macadamia Daze said:
This works flawlessly on Linux, but not Windows. Any idea what the difference is (besides the obvious)?
Click to expand...
Click to collapse
I don't know. I may use my old XP installation (it's totally dusty - not used for long time) to test this week.

[chroot] Ubuntu or BT5 chroot script

What is a note without the use of a Desktop Environment?
I love the Resolution of this screen 1280x800 (same size as my laptop) why not put it to good use and get Ubuntu running on this thing.
Root is Required with Busybox
Your device needs to be rooted
you can follow this guide http://forum.xda-developers.com/showthread.php?t=1837907
What did I do?
Not much, credit goes mostly to mSullivan and edounn (from I717). I just modified the script and the ubuntu.img file to work for T-Mobile Galaxy Note devices and uploaded the modified IMG to my own web server.
Instructions
Download the Ubuntu.zip Img from here (1.6gb)
extract ubuntu.zip to /sdcard/ubuntu
you should see
ubuntu.sh
mountonly
unionfs
fsrw
ubuntu.img
now from the terminal type
Code:
su
to gain access to root
then type
Code:
sh /sdcard/ubuntu/ubuntu.sh
to start the script
a few questions should pop up about screen resolution and desktop environment
I used
Code:
1280x800
2 - gnome
for my selections
Download Android VNC program and use these as the credentials
Nickname: Ubuntu (or anything you want)
Password: ubuntu (lower case)
IP: 127.0.0.1
Port: 5900
Color: 24bit
Links and what not
this is the original ubuntu.img I modified
http://ubuntuone.com/1Ew1232e3D51PCjYOkkQU7
for backtrack 5 (i have not tested bt5 yet on the note)
you can go directly to the backtrack 5 website and download using
http://www.backtrack-linux.org/downloads/
these options.
Choose: BT5
ARCH: ARM
IMAGE: IMG
I believe it's about 1gb download and 5gb uncompressed and might need to resize the IMG file to use on our fat32 storage. Follow mSullivan post to see how to resize the IMG. (If and when I get BT5 on our devices i will post another howto).
If you already have your own IMG file and don't want to download 1.6gb from my web server. here is the code
Code:
##########################################
#Ubuntu boot script V1 for Tmo Note #
#Built by Donald Hui (x3maniac) #
#Thanks to everyone at XDA! #
##########################################
perm=$(id|cut -b 5)
if [ "$perm" != "0" ];then echo "This script requires root! Type: su"; exit; fi
mount -o remount,rw /dev/block/mmcblk0p24 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export USER=root
mkdir $mnt
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root
if [ -b /dev/block/loop255 ]; then
echo "Loop device exists"
else
busybox mknod /dev/block/loop255 b 7 255
fi
#mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
losetup /dev/block/loop255 $kit/ubuntu.img
mount -t ext2 /dev/block/loop255 $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox mount -o bind /sdcard $mnt/sdcard
busybox mount -o bind /sdcard/external_sd $mnt/external_sd
busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo " "
busybox chroot $mnt /root/init.sh
echo "Shutting down Ubuntu ARM"
umount $mnt/sdcard
umount $mnt/external_sd
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
losetup -d /dev/block/loop255
screenshot Dual Core =)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
[reserved]
this space is reserved. i'm working on making ubuntu more functional and will be posting the how-to's here as i go
Changing root password for ssh login
remember to change the root password. type
Code:
sudo passwd root
Speeding up VNC
this helps but i can't be too sure. i tried streaming video but still a bit choppy.
using nano to edit the init.sh script in the root folder
Code:
nano /root/init.sh
look for the line that says
Code:
vncserver :0 -geometry $REZ
and add -deferupdate 10 to the end like this
Code:
vncserver :0 -geometry $REZ -deferupdate 10
(Explanation)
-deferupdate time
Time in milliseconds, to defer screen updates (default 40).
Deferring updates helps to coalesce many small desktop changes
into a few larger updates thus saving network bandwidth.
lowering this should help with updates since network bandwidth isn't a problem. I tried lowering this to 0 or 5 but it seems it makes the screen try to refresh faster then it can draw causing weird choppiness when on youtube.
compressing local vnc connection with ssh
this command below compresses the traffic from port 5900(vnc) to port 5901. should help speed up vnc
Code:
ssh -C -L 5901:127.0.0.1:5900 -N -f -l root localhost
I'm not sure if in this case this helps or not. Reason: what this does is compress the information going from one place to another, which requires more CPU. besides on a local environment i don't think it helps but i gave it a try anyway.
(Explanation)
-L 5901:localhost:5900 : Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. Here you are using port 5900 on the localhost to be forward to localhost on the 5901 port.
-N : Do not execute a remote command i.e. just forward ports.
-f : Requests ssh to go to background just before command execution. Requests ssh to go to background just before command execution. Once password supplied it will go to background and you can use prompt for type commands on local system.
-l root : root is the user to log in as on the remote machine (localhost).
localhost (127.0.0.1): Remote system with VNC server
Running Ubuntu on the Note is pretty awesome.
A few things I noticed:
- For some reason the d key in gnome was set as a shortcut to minimize all windows. (I tried to typed sudo but realizing now you are already root because the shell prompt has a # symbol - old Ubuntu habbits)
- apt-get doesn't work "out of the box" you need to add /sbin to your path something like:
Code:
PATH=$PATH:/sbin
Throw that in your ~/.bash_profile
This is because it's trying to run a program in /sbin but since it's not in your path it crashes.
Also I noticed that many VNC clients don't work well with an external mouse. Jump Desktop seems to work very good with an external mouse (non-free).
Also - since I have a 32GB class 10 SD card I put this on there instead of the main memory. If you want to do this you have to edit this line in the script:
Code:
export kit=/sdcard/ubuntu
to
Code:
export kit=/sdcard/external_sd/ubuntu
nadams said:
Running Ubuntu on the Note is pretty awesome.
A few things I noticed:
- For some reason the d key in gnome was set as a shortcut to minimize all windows. (I tried to typed sudo but realizing now you are already root because the shell prompt has a # symbol - old Ubuntu habbits)
- apt-get doesn't work "out of the box" you need to add /sbin to your path something like:
Code:
PATH=$PATH:/sbin
Throw that in your ~/.bash_profile
This is because it's trying to run a program in /sbin but since it's not in your path it crashes.
Also I noticed that many VNC clients don't work well with an external mouse. Jump Desktop seems to work very good with an external mouse (non-free).
Also - since I have a 32GB class 10 SD card I put this on there instead of the main memory. If you want to do this you have to edit this line in the script:
Code:
export kit=/sdcard/ubuntu
to
Code:
export kit=/sdcard/external_sd/ubuntu
Click to expand...
Click to collapse
thank you for your input to get ubuntu working on internal sd card and path.
as for the "D" key. i remember having to change a shortcut using dconf-tools.
unfortunately i bricked my note by flashing something to the wrong partition. (seriously typo) and havn't been doing anything more with this ubuntu.img. but i will continue to host the file for anyone who needs.
x3maniac said:
thank you for your input to get ubuntu working on internal sd card and path.
as for the "D" key. i remember having to change a shortcut using dconf-tools.
unfortunately i bricked my note by flashing something to the wrong partition. (seriously typo) and havn't been doing anything more with this ubuntu.img. but i will continue to host the file for anyone who needs.
Click to expand...
Click to collapse
Do you think you could post some instructions on how to resize the img disk? I looked in the linked thread and he talks about how to set it up but I don't see anything about resizing it. One of the reasons why I am asking is because there doesn't seem to be enough room for a release upgrade:
Code:
The upgrade has aborted. The upgrade needs a total of 869M free space
on disk '/'. Please free at least an additional 69.2M of disk space
on '/'. Empty your trash and remove temporary packages of former
I tried to run fdisk -l on ubuntu.img just to check out the partition table and I get this error:
Code:
Disk ubuntu.img doesn't contain a valid partition table
Edit: doh - I should of realized that a raw image file wouldn't have a partition table. So to resize:
Code:
dd if=/dev/zero bs=1M count=7168 >> data.img
yes | e2fsck -f data.img
resize2fs data.img
yes | e2fsck -f data.img
Though if you are paranoid you can leave off the yes.
Please note - there are tutorials out there that talk about using cp - this is a bad approach not only because you have to copy the files (this is slow) but some of them don't use the parameter to copy the attributes!
However, this presents a problem of why these Linux images are usually only 3.5GB. Fat32 can only have a file up to 4GB. So if you resize - you will need to format your SD card to ext3. Though exFAT should work - I don't know if Android supports that. I suppose that we could separate the image into different mount points - but eventually I think you will hit the 4GB limit.
Edit 2:
This is more frustrating than it needs to be. So I attempted to format the SD card as ext3/4 - Android refused to automatically mount it (even though it mounts system partitions with ext4). So I'm pretty sure in the Android subsystem it has a
Code:
mount -t vfat /dev/mmcblk1p1 /mnt/sdcard/external_sd
. In any case I tried several applications from the app store to add compatibility - with little success. I managed to get NTFS auto mounted at boot - but Android refuses to read the apps from an NTFS sd card (which I have a feeling would be the same with ext4 if I could get it mounted).
So at this point I am trying 2 partitions: most of the SD card is FAT32, and the second chunk will be ext2 for Ubuntu.
Edit 3:
2 partitions are working great. Just altered the script to mount the partition instead of mounting the file. To be honest I think it's a little faster on a separate partition.
Edit 4:
After upgrading System Monitor no longer sees two cores. I am looking into it.

Chroot. Running Debian 7.8 on Chromecast

How to install chrooted Debian 7.8 on a Chromecast (Debcast?)
English are not my native language but I will try answer any questions
Step 1 – 5 was made on a Debian 7.8 computer (raspbian)
Step 6 – 12 was made in Chromecast shell
1. Install debootstrap
Code:
su
apt-get install debootstrap
2. Download mini-installation for armhf with debootstrap, this will take a while.
Code:
debootstrap --arch=armhf --variant=minbase --foreign wheezy debian http://http.debian.net/debian
3. Tar the downloaded
Code:
tar -cvf debian.tar debian/
4. Send debian.tar to CC,data dir is writable
Code:
cat debian.tar | ssh [email protected][chromecast-ip] 'cat > /data/debian.tar'
5. ssh to chromecast
Code:
ssh [email protected](chromecast-ip)
6. Untar
Code:
cd /data
tar -xvf debian.tar
7. Create a start file for Chroot
Code:
vi /data/chroot.sh
#!/bin/sh
# Fix all PATH for Debian
export ROOT=/data/debian
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export HOME=/root
# remount /data. Got an error first time I loged into chroot. remount is a fix for this
# not sure if we need to do this every reboot
echo "Remounting /data"
mount -o remount,defaults /data
# Mount dev for Debian if needed
mountpoint $ROOT/dev –q
if [ ! $? -eq 0 ] ; then
echo "Mounting dev"
mount -o bind /dev $ROOT/dev
fi
# Mount pts for Debian if needed
# It's a fix for direct ssh login to chroot
mountpoint $ROOT/dev/pts –q
if [ ! $? -eq 0 ]; then
echo "Mounting ptst"
chroot $ROOT /bin/mount -t devpts -o OPTIONS devpts /dev/pts
fi
# Mount proc for Debian if needed
mountpoint $ROOT/proc –q
if [ ! $? -eq 0 ]; then
echo "Mounting proc"
mount -o bind /proc $ROOT/proc
fi
# Mount proc for Debian if needed
mountpoint $ROOT/sys –q
if [ ! $? -eq 0 ]; then
echo "Mounting sys"
mount -o bind /sys $ROOT/sys
fi
# start chroot
chroot $ROOT /bin/bash -l
8. run chroot.sh and continue with the installation, this will take a while
Code:
chmod +x chroot.sh
./chroot.sh
debootstrap/debootstrap --second-stage
9. We now got a working minimal chroot jail, almost no programs are installed, before we can install anything we need to update sources.list and add some repositories. Use http://debgen.simplylinux.ch/ to create a sources.list. I use debian mirrors for Sweden.
Code:
echo ”deb http://ftp.se.debian.org/debian stable main” > /etc/apt/sources.list
echo ”deb http://security.debian.org/ wheezy/updates main” >> /etc/apt/sources.list
apt-get update
10. Install vim and ssh
Code:
apt-get install vim ssh
11. change port from 22 to 2222 and restart ssh
Code:
vi /etc/ssh/sshd_config
/etc/init.d/ssh restart
12. Set a password
Code:
passwd
OPTIONAL
1. Install desctop and vnc server, this will take a while and our installation will rise with 400-450M (mine using about 800M total), we only got 1.1G total to play with so be carefull which program you install. A fix to this would be to create a Yaffs2 image for loop mount and then store it on a USB drive.
Code:
apt-get install xfce4 tightvncserver
2. Create a loginpassword to vnc, and choose if you need a guest login
Code:
tightvncserver
3. Start vnc server, 800x600 res.
Code:
vncserver :0 -geometry 800x600 -depth 24
4. Log into chromecast, I used a standalone RealVNC in windows and [chromecast-ip]:0 to login
5. More info at http://elinux.org/RPi_VNC_Server
INFO
- To exit root jail, just type exit
- If you started sshd in root jail you can connect to it with ssh on port 2222.
- No need to start chroot to load a program in chroot, you can start it from outside
Code:
chroot with chroot /data/debian /etc/init.d/ssh start
- you can also kill program from outside, run ps to find out ID and use kill [id]
- Chromecast does support loop mount, but not very many filesystems
o To mount a supported filesystem use
Code:
mount myImage.img /mnt/myImage –o loop=/dev/block/loop0
o does not support ext, ext2, ext3 or ext4
o Does support yaffs2, vfat…
o supported filetypes can be found in cat /proc/filesystems
o yaffs2utils can be compiled in debian (on CC), this program can make same filesystem type as /data, and this file can be loop mounted
o Install git, gcc and make. Then git clone https://github.com/justsoso8/yaffs2utils
Errors:
- stdin is not a tty. Run inside chroot jail:
Code:
/bin/mount -t devpts -o OPTIONS devpts /dev/pts
or outside chroot run
Code:
chroot /data/debian /bin/mount -t devpts -o OPTIONS devpts /dev/pts
. Then try to connect to port 2222 again.
- do this: mount -t proc proc /proc.
Run (outside chroot)
Code:
mount -t proc /proc /data/debian/proc
- Chroot and vi can be found in busybox (busybox chroot, busybox vi) you can create a symlink to it.
Code:
mkdir /data/bin & cd /data/bin
ln /bin/busybox –s vi
ln /bin/busybox –s chroot
export PATH=/data/bin:$PATH
o If you need Busybox it can be downloaded from: http://www.busybox.net/downloads/binaries/latest/busybox-armv7l
TODO:
- Autostart chroot on boot
- Does anyone know how to view shell via HDMI?
- Can keyboards and mouse be connected via a USB hub so we can use CC as a minimal computer?
LINKS:
http://www.hjackson.org/blog/archives/2008/10/18/ssh-stdin-is-not-a-tty
https://wiki.debian.org/ChrootOnAndroid
http://www.cyberciti.biz/faq/how-do-i-compress-a-whole-linux-or-unix-directory/
http://elinux.org/RPi_VNC_Server
http://debgen.simplylinux.ch/
https://bitbucket.org/inkubux/cubox-i/wiki/Plex Wheezy
https://help.ubuntu.com/community/BasicChroot
https://github.com/justsoso8/yaffs2utils
http://www.busybox.net/downloads/binaries/latest/busybox-armv7l
Screenshot:
g
Click for large
How are you using a mouse and keyboard, powered otg
Sent from my iPad using Tapatalk
it's a minimum installation of Debian, but I guess you can install xfce and use X-forwarding with sshd. They got it working on a transcend wifi sd-card so it can be made, not sure how fast it will run.
http://dmitry.gr/index.php?r=05.Projects&proj=15. Transcend WiFiSD
Cool
Ok, I tried X-forwarding, it's not a GUI, it's more like you run a program from a host, and "stream" it to some other computer using a client program and ssh.
Also installed xcfe-desctop and tightvncserver. No problem connecting to chromecast and run programs in vnc.
Is it possible to post a little 'how to' and some screenshots?
sure, give me a few days =)
Pietplezier said:
Is it possible to post a little 'how to' and some screenshots?
Click to expand...
Click to collapse
First post is updated with new information
Mape0661 said:
sure, give me a few days =)
Click to expand...
Click to collapse
Screenshots looks wicked!
Pietplezier said:
Screenshots looks wicked!
Click to expand...
Click to collapse
Thanks! It worked better then I thought it would, it's working like a small computer.
I have tryed to view shell over HDMI, would be fun, but I haven't got it to work yet, only crashed the chromecast.

Ho to back up of the whole memory block (via adb)

Dears maybe now I can make double post but I hang on that step from guide from this site.
Phone is after wipe data and I need rescue data from it for that I want to make RAW image to recover data.
What I do until now:
adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0
but in results get:
1|ASUS_I001_1:/ # /system/xbin/busybox nc -1 -p 5555 -e /system/xbin/busybox dd
5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0 <
nc: invalid option -- 1
BusyBox v1.32.0-Stericson (2020-07-18 18:33:24 EDT) multi-call binary.
Usage: nc [OPTIONS] HOST PORT - connect
nc [OPTIONS] -l -p PORT [HOST] [PORT] - listen
-e PROG Run PROG after connect (must be last)
-l Listen mode, for inbound connects
-lk With -e, provides persistent server
-p PORT Local port
-s ADDR Local address
-w SEC Timeout for connects and final net reads
-i SEC Delay interval for lines sent
-n Don't do DNS resolution
-u UDP mode
-v Verbose
-o FILE Hex dump traffic
-z Zero-I/O mode (scanning)
1|ASUS_I001_1:/ #
Why I get that this parameter is invalid:
nc: invalid option -- 1
And to the end, if that don't work to me, next step also don't work.
Open another Cygwin terminal and type:
Code:
adb forward tcp:5555 tcp:5555
cd /path/to/store/the/backup ---> this is correct, should I creat some folder on HHD and insert here his name?
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw --> that means I should have ftp serwer?

Categories

Resources