Passion : logiciel
mars 24th, 2011

How to capture sound with recordmydesktop

sudo apt-get install pavucontrol
sudo apt-get install recordmydesktop gtk-recordmydesktop
advanced/audio/device = pulse

To add the loopback for microphone:
pactl load-module module-loopback

From:
http://ubuntuforums.org/showthread.php?p=9265486
and

mars 22nd, 2011

Compare 2 folders with python and linux

#!/bin/python

import subprocess as sp
import os

def call(arg):
  proc = sp.Popen([arg],shell=True, stdout=sp.PIPE)
  ret = proc.stdout.readlines()
  return ret

dir1 = "recup_dir.1"
dir2 = "recup_dir.2"

rc1 = call("ls "+dir1)
rc2 = call("ls "+dir2)

existList = list()
dontexistList = list()

print dir1 + " against " + dir2
for file in rc1:
  path = "./"+dir2+"/"+file.strip()
  if os.path.isfile(path):
    existList.append(file.strip())
  else:
    dontexistList.append(file.strip())

for exist in existList:
  sumdir1 = call("md5sum ./"+dir1+"/"+exist+"| cut -d\" \" -f1")
  sumdir2 = call("md5sum ./"+dir2+"/"+exist+"| cut -d\" \" -f1")
  if sumdir1 != sumdir2:
    print "different", exist, sumdir1[0].strip(), sumdir2[0].strip()

for dontexist in dontexistList:
  print "dontexist in ./"+dir2+"/"+dontexist

print dir2 + " against " + dir1
for file in rc2:
  path = "./"+dir1+"/"+file.strip()
  if os.path.isfile(path):
    existList.append(file.strip())
  else:
    dontexistList.append(file.strip())

for exist in existList:
  sumdir1 = call("md5sum ./"+dir1+"/"+exist+"| cut -d\" \" -f1")
  sumdir2 = call("md5sum ./"+dir2+"/"+exist+"| cut -d\" \" -f1")
  if sumdir1 != sumdir2:
    print "different", exist, sumdir1[0].strip(), sumdir2[0].strip()

for dontexist in dontexistList:
  print "dontexist in ./"+dir1+"/"+dontexist
This work is licensed under GPL - 2009 | Powered by Wordpress using the theme aav1