Recording Desktop activity with ffmpeg
Posted by hvera1981 in Uncategorized on February 17, 2012
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq out.mpg 2> /dev/null
Edit incorrect commit
git commit --amend
Changing old commits:
git rebase --interactive $HASH
Compile OpenCV
Install packages:
sudo apt-get install build-essential libgtk2.0-dev libjpeg62-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev
Download FFmpeg:
cd /usr/local/src
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xvfj ffmpeg-snapshot.tar.bz2
cd ffmpeg
./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libxvid --enable-x11grab --enable-swscale --enable-shared
make
make install
ldconfig
cd /usr/local/src
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.3.1/OpenCV-2.3.1a.tar.bz2/
tar xvfj OpenCV-2.3.1a.tar.bz2
cd OpenCV-2.3.1
cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=OFF -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON .
make
make install
Enabling any user to run an X session
Posted by hvera1981 in Uncategorized on December 8, 2011
/etc/X11/Xwrapper.config – This file has as setting called “allowed_users”. It can accept three values:
1. root
2. anybody
3. console
The above values are self explanatory. You can edit this value to set as anybody for normal user to start X server. If normal user starts X server from console, console can also be set. It can be like this.
Using scratchbox2 and Ubuntu 11.10
Local machine environment:
- Ubuntu 11.10 64bits
Emulated environment:
- Debian Squeeze armel
Install in local machine:
sudo apt-get install scratchbox2 fakeroot
sudo apt-get install qemu-user qemu
sudo apt-get install gcc-arm-linux-gnueabi
sudo apt-get install cpp-4.4-arm-linux-gnueabi gcc-4.4-arm-linux-gnueabi gcc-4.4-arm-linux-gnueabi-base
sudo apt-get install cpp-4.5-arm-linux-gnueabi g++-4.5-arm-linux-gnueabi gcc-4.5-arm-linux-gnueabi
Init scratchbox configuration:
fakeroot debootstrap --variant=scratchbox --foreign --arch armel squeeze /path/root_fs http://ftp.br.debian.org/debian
sb2-init -n -c /usr/bin/qemu-arm MACHINE_NAME "arm-linux-gnueabi-gcc"
Install into emulated system:
apt-get install g++ rpm zlib1g-dev m4 bison libncurses5-dev gettext build-essential intltool libxml2-dev libtool
Compile outside the box:
cd source
sb2 ./configure
sb2 make -jN
sb2 make install DESTDIR=/path/root_fs
To change the crosscompiler toolchain install the script /usr/local/bin/switch_arm-linux-gnueabi.sh:
#!/bin/bash
if [ -z $1 ]; then
echo -e "\n Error: you need to define the arm-linux-gnueabi version"
echo -e " Usage: switch_arm-linux-gnueabi.sh \n"
exit
fi
if [ ! -f /usr/bin/arm-linux-gnueabi-cpp-$1 ]; then
echo -e "\n Error: arm-linux-gnueabi version $1 do not exist\n"
exit
fi
# Unlink symbolic links
sudo unlink /usr/bin/arm-linux-gnueabi-cpp
sudo unlink /usr/bin/arm-linux-gnueabi-gcc
sudo unlink /usr/bin/arm-linux-gnueabi-gcov
#Define new links for arm-linux-gnueabi
sudo ln -s /usr/bin/arm-linux-gnueabi-cpp-$1 /usr/bin/arm-linux-gnueabi-cpp
sudo ln -s /usr/bin/arm-linux-gnueabi-gcc-$1 /usr/bin/arm-linux-gnueabi-gcc
sudo ln -s /usr/bin/arm-linux-gnueabi-gcov-$1 /usr/bin/arm-linux-gnueabi-gcov
#EOF
Fixing problem The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY
gpg –keyserver pgpkeys.mit.edu –recv-key KEY
gpg -a –export KEY | sudo apt-key add -
Example:
gpg –keyserver pgpkeys.mit.edu –recv-key B5B7720097BB3B58
gpg -a –export B5B7720097BB3B58 | sudo apt-key add -
Emulate ARM in Qemu
#Download Kernel and initrd
wget http://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/versatile/netboot/vmlinuz-2.6.32-5-versatile
wget http://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/versatile/netboot/initrd.gz
#Create disk
qemu-img create -f raw debian.img 5G
#Start qemu
qemu-system-arm -m 256 -M versatilepb -kernel vmlinuz-2.6.32-5-versatile -initrd initrd.gz -hda debian.img -append “root=/dev/rasudo kpartx -av debian.img
#Mount filesystem after install and copy kernel and initrd
sudo mount /dev/mapper/loop1p1 ./mnt/ -o loopm”
sudo kpartx -av debian.img
sudo mount /dev/mapper/loop1p1 ./mnt/ -o loop
#Start qemu again
qemu-system-arm -m 256 -M versatilepb -kernel vmlinuz-2.6.32-5-versatile -initrd initrd.img -hda debian.img -append “root=/dev/sda1″
More reliable information at
http://richizo.wordpress.com/2010/11/15/installing-debian-arm-under-qemu
Changing 2G mode to 3G mode
Posted by hvera1981 in Networking on November 23, 2011
This command is based on Huawei spec:
AT^SYSCFG Huawey command reference
To see the supported values, you can query your own modem sending the “AT^SYSCFG=?” command.
AT^SYSCFG=$mode,$acqOrder,$band,$roam,$srvDomain
$mode
2=Auto-Select
13=GSM only
14=WCDMA only
16=no Change
$acqOrder
0=Automatic
1=GSM prefered
2=WCDMA prefered
3=no Change
$band
3fffffff = All
other (query list with “AT^SYSCFG=?”)
$roam
0=Not Supported
1=Supported
2=no Change
$srvDomain
0=Circuit-Switched only
1=Packet-Switched only
2=Circuit- & Packet-Switched
3=Any
4=no Change
^SYSCFG:(2,13,14,16),(0-3),((80000,”GSM850″),(200000,”GSM1900″),(400380,”GSM900/GSM1800/WCDMA2100″),(4a80000,”GSM850/GSM1900/WCDMA850/WCDMA1900″),(3fffffff,”All Bands”)),(0-2),(0-4)
You can find more at:
https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd#AT.5ESYSCFG_Huawey_command_reference
Creating n repositories at same time
for i in kernel filesystem bootloader application
do
mkdir /tmp/$i
cd /tmp/$i
git init
git remote add origin git@$SERVER:$i.git
touch README.$i
git add README.$i
git commit -a -m "First commit submodule $i"
git push origin master:refs/heads/master
done
Generating “random” passwords
dd if=/dev/random bs=2 count=6 | base64 -