ssh otp 
Install oathtool.
sudo apt-get install oathtool libpam-oath

Generate a secret.
export HEX_SECRET=$(head -10 /dev/urandom | md5sum | cut -b 1-30)

Generate the TOTP details, 6 digits long.
oathtool --verbose --totp $HEX_SECRET

Enter the base32 secret in Android FreeOTP.

Create and populate the /etc/security/users.oath file.
sudo bash -c "echo HOTP/T30 $USER - $HEX_SECRET >> /etc/security/users.oath"
sudo chmod 0600 /etc/security/users.oath

Forget the secret!
unset HEX_SECRET

prefix /etc/pam.d/sshd with
auth sufficient pam_oath.so usersfile=/etc/security/users.oath window=10 digits=6

Allow this in sshd and restart.
sudo sed -Ei -e 's/(ChallengeResponseAuthentication) no/\1 yes/' /etc/ssh/sshd_config
sudo service ssh restart

Test with
ssh localhost

You should see:
One-time password (OATH) for `USER':

To avoid otp for some users prefix /etc/pam.d/sshd with
auth [success=1 default=ignore] pam_succeed_if.so user in user1:user2


[ view entry ] ( 2052 views )   |  print article
convert to mp4 
ffmpeg -i input.mp4 -pix_fmt yuv420p -vcodec libx264 -acodec aac output.mp4


[ view entry ] ( 1499 views )   |  print article
mtp mount Galaxy S3 with jmtpfs or simple-mtpfs 
kio-mtp and mtp-detect stopped working :-(

But jmtpfs seams to work - i decided to mount on usb plug in with an udev rule
#> apt-get install jmtpfs
#> mkdir -p /media/mtp
/etc/udev/rules.d/99-jmtpfs.rules
ACTION=="add", ENV{ID_MTP_DEVICE}=="1", RUN="/usr/bin/jmtpfs -o allow_other /media/mtp"
ACTION=="remove", ENV{ID_MTP_DEVICE}=="1", RUN="/bin/fusermount -u /media/mtp""


A little bit faster is simple-mtpfs, but you have to compile

apt-get install libusb-dev libmtp-dev

git clone https://github.com/phatina/simple-mtpfs.git
cd imple-mtpfs
./autogen.sh
mkdir build && cd build
../configure --prefix=/usr
make
sudo make install

/etc/udev/rules.d/99-simple-mtpfs.rules
ACTION=="add",ENV{ID_MTP_DEVICE}=="1",RUN="/usr/bin/simple-mtpfs -o allow_other /media/mtp"
ACTION=="remove", ENV{ID_MTP_DEVICE}=="1", RUN="/bin/fusermount -u /media/mtp""



[ view entry ] ( 4959 views )   |  print article
sound conversion 

decode to wav


avconv -i input.m4a output.wav
for f in *.m4a; do avconv -i "$f" "${f/%m4a/wav}"; done
faad -o output.wav input.aac
sox -t raw -r 8000 -A -b 8 -c 1 file.alaw file.wav
sox -t raw -r 8000 -U -b 8 -c 1 file.mulaw test.wav

decode from wav


sox file.wav -t raw -r 8000 -c 1 -b 8 -U file.mulaw
sox file.wav -t raw -r 8000 -c 1 -b 8 -A file.alaw

cut


sox test.wav 60secs.wav --show-progress trim 0 01:00


[ view entry ] ( 1918 views )   |  print article
android tvheadend compile 
build standalone toolchain from Android NDK.

cd WORKINGDIR
wget http://dl.google.com/android/ndk/androi ... 64.tar.bz2
tar -xjv android-ndk-r8e-linux-x86_64.tar.bz2

run this script ( make-standalone-toolchain.sh )
#!/bin/bash

export ANDROID_NDK=android-ndk-r8e
export ANDROID_NDK_TOOLCHAIN_ROOT=android-toolchain-14
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh \
--system=linux-x86_64 \
--toolchain=arm-linux-androideabi-4.4.3 \
--platform=android-14 \
--install-dir=$ANDROID_NDK_TOOLCHAIN_ROOT

remove "--system=linux-x86_64" for 32 Bit Linux

build openssl for android

git clone https://github.com/guardianproject/openssl-android.git
cd openssl-android
../android-ndk-r8e/ndk-build
cd ..

link missing header and copy libs into android toolchain
ln -s ../../../../../rockchip-rk30xx-mk808/include/linux/dvb android-toolchain-14/sysroot/usr/include/linux/dvb
ln -s ../../../../openssl-android/include/openssl android-toolchain-14/sysroot/usr/include/openssl
cp openssl-android/libs/armeabi/libssl.so android-toolchain-14/lib
cp openssl-android/libs/armeabi/libcrypto.so android-toolchain-14/lib

build tvheadend for android
wget https://github.com/innbox/tvheadend/archive/tvheadend-android.zip
unzip tvheadend-tvheadend-android.zip
cd tvheadend-tvheadend-android
./configure --disable-avahi \
--disable-libav \
--enable-bundle \
--enable-android \
--arch=armeabi-v7a \
--cc=../android-toolchain-14/bin/arm-linux-androideabi-gcc \
--android_toolchain=../android-toolchain-14
make
adb push build.linux/tvheadend /data/dvb
adb push ../android-toolchain-14/lib/libssl.so /data/dvb
adb push ../android-toolchain-14/lib/libcrypto.so /data/dvb
adb shell
root@android:/data/dvb # ./tvheadend -C

Because of bad signal i applied and modified a patch for tvheadend git master
git clone https://github.com/tvheadend/tvheadend.git
cd tvheadend
git checkout e343bfdcca877d4a19a2d86d1713fb0f46ab0b50
patch -p1 <tvheadend-android.patch


[ view entry ] ( 5632 views )   |  print article

<<First <Back | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Next> Last>>