set permissions to open a file in our private home directory by an external app 
try
{
openFileOutput(pdfFile.getName(), MODE_WORLD_READABLE | MODE_WORLD_WRITEABLE).close();
}
catch (Exception logOrIgnore) { }


[ view entry ] ( 898 views )   |  print article
LogCat: ClipboardServiceEx Had failed to obtaining clipboardEx service. 
Something went wrong with the clipboard of my Galaxy S3.

The solution was http://forum.xda-developers.com/showthr ... ?t=1655619
su
mv /data/clipboard /data/oldclipboard
mkdir /data/clipboard
chmod 775 /data/clipboard
chown system.system /data/clipboard
reboot


[ view entry ] ( 1444 views )   |  print article
Ubuntu 12.10 upgrade / install eclipse and ADT 
After upgrade from 12.04 to 12.10 eclips wont work anymore :-(

Only deleting ~/.eclipse and ยจ/workspace and reinstalling ADT did not work i got:
An error occurred while collecting items to be installed
session context was:(profile=epp.package.jee,
phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=,
action=).
No repository found containing: osgi.bundle,com.jcraft.jsch,0.1.42
No repository found containing: ...

My solution was to reinstall eclipse:
dpkg -P eclipse eclipse-jdt eclipse-pde eclipse-platform \
eclipse-platform-data eclipse-rcp eclipse-rcp
apt-get install eclipse eclipse-jdt eclipse-pde eclipse-platform \
eclipse-platform-data eclipse-rcp eclipse-rcp
apt-get --reinstall install libequinox-osgi-java

eclipse: Help > Install New Software > Add...

juno - http://download.eclipse.org/releases/juno
ADT - https://dl-ssl.google.com/android/eclipse/

[ view entry ] ( 1319 views )   |  print article
hostap with a wifi usb stick on demand 
After plug in of a wifi usb stick linux act's as a hostap.

apt-get install isc-dhcp-server hostapd

changes in /etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
ssid=MYSSID
country_code=AT
ieee80211d=1
hw_mode=g
channel=11
beacon_int=1000
dtim_period=20
ieee80211n=1
wpa=2
wpa_passphrase=MYPASSPHRASE
wpa_pairwise=TKIP CCMP

/etc/network/interfaces
iface wlan0 inet static
address 192.168.9.1
netmask 255.255.255.0
hostapd /etc/hostapd/hostapd.conf
up iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
up /etc/init.d/isc-dhcp-server restart
down iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
down killall hostapd

first check vendor and product id with lsusb:

/etc/udev/rules.d/local.rules
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="148f", ATTRS{idProduct}=="3070", \
RUN+="/sbin/ifup wlan0"
ACTION=="remove", SUBSYSTEM=="net", KERNEL=="wlan0", RUN+="/sbin/ifdown wlan0"

On booting this does not work for me so i started the hostap by

/etc/rc.local
lsusb | grep -q "148f:3070" && /sbin/ifup wlan0



[ view entry ] ( 1291 views )   |  print article
transcode a mjpeg ip cam on demand with a cgi script using ffmpeg 
To minimize bandwidth for video streaming i have to transcode mjpeg to h264.
To do this on demand ffserver is no option for me.
Therefore a small cgi script on the webserver with ffmpeg did the trick:

#!/bin/bash

echo -e "Content-type: video/avi\n"

#ffmpeg -an -analyzeduration 0 -f mjpeg -r 8 -i http://IP_CAM:PORT \
# -c:v libx264 -preset ultrafast -r 8 -threads 2 -b:v 150k -f avi - 2>/dev/null &

avconv -an -analyzeduration 0 -f mjpeg -r 8 -i http://IP_CAM:PORT \
-c:v libx264 -pre ultrafast -r 8 -threads 2 -b:v 150k -f avi - 2>/dev/null &
pid=$!
trap "kill $pid" SIGTERM SIGPIPE
wait


[ view entry ] ( 2279 views )   |  print article

<<First <Back | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Next> Last>>