Mostrando postagens com marcador linux. Mostrar todas as postagens
Mostrando postagens com marcador linux. Mostrar todas as postagens

quinta-feira, 24 de maio de 2012

ffmpeg - convertendo vídeos para webm

ffmpeg -i videofinal.mkv -codec:v libvpx -quality good -cpu-used 0 -b:v 1200k -threads 4 videofinal.webm

Agistech.com.br

ffmpeg - screencast

ffmpeg -f alsa -ac 2 -i pulse -f x11grab -s hd1080 -r 60 -i :0.0 -vcodec libx264 -preset ultrafast -an -y video.mkv -acodec pcm_s16le -b:a 48000k -loglevel quiet -vn -y audio.mkv
Agistech.com.br

segunda-feira, 16 de maio de 2011

Kernel Bug sync_supers acessa IO a cada 5 segundos

Desde as novas versões do kernel surgiu um problema que faz o sync_supers escrever alguma merda no seu HD a cada 5 segundos, é um bug muito irritante que não da pra ignorar, é geral em qualquer distro em que testei teve o mesmo bug, não se se é em casos especificos como o meu que estou usando raid 0 com 2 hds, pra contornar esse bug pra ficar menos chato existe uma opção

cat /proc/sys/vm/dirty_writeback_centisecs
vai retornar valor 500, que é o valor de 5 segundos

echo "3000" > /proc/sys/vm/dirty_writeback_centisecs
vai mudar o valor de acesso do sync_supers pra 30 segundos, porém,  existe outro problema onde jbd2 continua escrevendo algo no HD a não ser que vc desabilite o journaling e use um filesystem muito inseguro.

Agistech.com.br

quinta-feira, 17 de março de 2011

Realizando benchmark de servidores web

Você pode fazer benchmark do Apache, lighttpd, ngix, IIS e qualquer outro servidor utilizando a ferramenta AB

um exemplo de uso:

killown@Thiago-Desktop:~$ ab -n 50 -c 5 http://google.com/index.html


This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking google.com (be patient).....done


Server Software:        gws
Server Hostname:        google.com
Server Port:            80

Document Path:          /index.html
Document Length:        229 bytes

Concurrency Level:      5
Time taken for tests:   6.225 seconds
Complete requests:      50
Failed requests:        0
Write errors:           0
Non-2xx responses:      50
Total transferred:      26550 bytes
HTML transferred:       11450 bytes
Requests per second:    8.03 [#/sec] (mean)
Time per request:       622.464 [ms] (mean)
Time per request:       124.493 [ms] (mean, across all concurrent requests)
Transfer rate:          4.17 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      182  298 114.9    220     459
Processing:   204  307 109.1    251     474
Waiting:      203  306 109.4    251     474
Total:        396  605 101.0    665     725

Percentage of the requests served within a certain time (ms)
  50%    665
  66%    671
  75%    671
  80%    673
  90%    677
  95%    687
  98%    725
  99%    725
 100%    725 (longest request)



  • -n número de requisições para realizar uma sessão de benchmark
  • -c número de requisições por vez a ser enviado

Agistech.com.br

como montar a memória ram

 mount -t tmpfs none  /pastaquevaimontar -o rw,size=512m  isso montara 512MB de memória na pasta de destino pastaquevaimontar.
Agistech.com.br

sábado, 17 de julho de 2010

Criando screencasts no linux com ffmpeg

uma forma simples e eficaz de criar screencast utilizando ffmpeg.


o screencast será criado no formato mkv.

ffmpeg -f alsa -i pulse -f x11grab -r 30 -s 1024x768 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 $1.mkv


caso queira postar o vídeo no youtube precisamos encoda-lo para um formato em que o youtube aceite.

ffmpeg -i $1.mkv -acodec libmp3lame -ab 128k -ac 2 -vcodec libxvid -qscale 8 -me_method full -mbd rd -flags +gmc+qpel+mv4 -trellis 1 -threads 0 $1.avi

terça-feira, 27 de abril de 2010

liferea - resolvendo o problema lentidão para navegar nas noticias.

recentemente me deparei com um problema em um grande leitor de notícias para linux
"liferea".. eu sempre fui um usuário assiduo do google reader,
mas por detalhes insignificates, eu decidi testar um leitor de notícias do linux,
o liferea sempre foi uma das minha opções, quando esse era o assunto.
porem o motivo de eu nunca ter usado o liferea era óbivio, problema com performance.
antigamente o liferea costumava ser bastante lento
e consumia muito hd deixando o sistema lento.
mas de uns tempos pra ca, vários bugs foram eliminados
deixando-o com uma performance aceitável.
mas ainda existe um problema na versão 1.6.2
se você utiliza ext4 como filesystem para seu home, com certeza,
é um dos que tem problemas sérios de performance com liferea,
porém descobri aonde está o problema e sei como concerta-lo.


ext4 tem uma opção chamada barrier que é uma opção que reduz o risco de perda de dados
em casosde crash no seu sistema.
o liferea utiliza sqlite, sqlite possui um problema sério de performance com ext4
devido a opção barrier habilitada, nota: ext3 vem com barrier desabilitado por padrão.
se é uma boa idéia desabilitar essa opção, somente para obter performance com liferea,
fica a seu critério.

existe duas opções para resolver esse problema:

primeira:
desabilitar o barrier do ext4, é bem simples, em /etc/fstab coloque o parametro nobarrier na
linha de montagem da sua partição ext4
pronto, agora vc terá ext4 e sqlite funcionando normalmente.


segunda:
se vc estiver utilizando reiserfs ou ext3 como filesystem para a raiz do seu sistema
então:

mkdir /usr/local/$USER
chown $USER /usr/local/$USER
mv /home/$USER/.liferea_1.6   /usr/local/$USER
ln -s /usr/local/$USER/.liferea_1.6 /home/$USER/.liferea_1.6


pronto, agora o liferea vai estar funcionando corretamente.

quinta-feira, 11 de fevereiro de 2010

command line calculator

bc

$ x=$(echo “358358*5824825″ | bc)

$ echo $x
2087372637350

Recording with a microphone

Recording with a microphone

arecord -vv -f S16_LE -c1 -r48000 -d 120 test.wav

* Run this command: alsamixer -V all
Highlight all controls with the word ‘IEC958′ in them and mute them with the m key.
Use arrow keys to highlight the ‘Mic’ control in alsamixer.
* Unmute the ‘Mic’ control with the ‘m’ key.
* Set ‘Mic’ control volume to 70 to test,
after successful test set volume to 30 or less for best quality.
* Set ‘Mic’ control to capture by pressing the ’spacebar’ key on keyboard;
the word ‘capture’ will appear at the bottom of the ‘Mic’ control when capture is set.
Use arrow keys to highlight ‘Mic Boost’ control.
* Unmute ‘Mic Boost’ control with ‘m’ key.
Use arrow keys to highlight ‘Mic Select’ control.
* Select ‘Mic1′ with up/down arrow keys.
Use arrow keys to highlight ‘Capture’ control.
* Unmute ‘Capture’ control with ‘m’ key.
* Set ‘Capture’ control volume to 70 to test,
after successful test set volume to 30 or less for best quality.
* If you have a ‘Channel Mode’ control in alsamixer set it to 2 channel (2ch).
* Watch the volume meter in the terminal for movement when you run this command:
arecord -vv -f S16_LE -c1 -r48000 -d 5 test.wav
talk into Mic for 5 seconds.
* Run this command: aplay -test.wav
Do you hear your voice when test.wav is playing?
If you do NOT hear your voice when test.wav is playing then
* Run this command: ls -l test.wav
Is test.wav’s size larger than zero bytes?
Run alsamixer and change the ‘Channel Mode’ control to 2ch and
retry: arecord -vv -f S16_LE -c1 -r48000 -d 5 test.wav
and then run: aplay test.wav
Recording what the sound card is currently playing:
Read: man alsamixer for info about keys and commands used on this page.
* Run this command: alsamixer -V all
Use arrow keys to highlight the ‘Mix’ or ‘Aux’ or ‘Mux’ control in alsamixer;
You must have one of these three controls
to record what the sound card is playing: ‘Mix’ ‘Aux’ ‘Mux’.
* Set ‘Mix’ or ‘Aux’ or ‘Mux’ control volume to 70 to test,
after successful test set volume to 30 or less for best quality.
* Set ‘Mix’ or ‘Aux’ or ‘Mux’ control to
capture by pressing the ’spacebar’ key on keyboard;
the word ‘capture’ will appear at the bottom
of the ‘Mix’ or ‘Aux’ or ‘Mux’ control when capture is set.
* Unmute ‘Mix’ or ‘Aux’ or ‘Mux’ control with ‘m’ key.
Use arrow keys to highlight ‘Capture’ control.
* Unmute ‘Capture’ control with ‘m’ key.
* Set ‘Capture’ control volume to 70 to test,
after successful test set volume to 30 or less for best quality.
* If you have a ‘Channel Mode’ control in alsamixer set it to 2 channel (2ch).
* Run this command:
speaker-test -c2 -Ddefault -t wav
Allow this command to run until after you run this next command.
* Watch the volume meter in the terminal for movement when you run this command:
arecord -vv -f S16_LE -c2 -r48000 -d 5 test.wav # command records for only 5 seconds.
* Run this command: aplay -test.wav
Do you hear any sounds when test.wav is playing?
If you do NOT hear any sounds when test.wav is playing then
* Run this command: ls -l test.wav
Is test.wav’s size larger than zero bytes?
Download tsalsa using the link listed at the bottom of this page.
Run this command: bash ./tsalsa
Post the tsalsa URL in #alsa and ask for help.

Recording IEC958 (digital) output:
* Run this command:
arecord -Dplug:iec958 -d 5 test.wav
* Run this command:
spdif in to analog out: arecord -D opticalIN -f dat | aplay -D playback_device

add a new partition in fstab with UUID

add a new partition in fstab with UUID

/lib/udev/vol_id -u /dev/hdaX >> /etc/fstab