curious onloooker

A few things, mostly technical notes...

Thursday, March 22, 2018

create_zombie.c


Yep, it is time to spit out some C code.

create_zombie.c - when compiled this would create a zombie process.


$ ./create_zombie 
Parent at pid: 19240 and ppid: 20225
Our child 19241 will be the zombie, watch below:
S   PID COMMAND
Z 19241 [create_zombie] 



Below is the C code behind this:


/*
 * Author: evuraan
 *
 * when the child has exited, and the parent has not 
 * yet collected the child's death certificate, 
 * the child process becomes a zombie
 *
*/

#include 
char *cmd[300];

int main(){
 int pid;
 pid = vfork();
 if (pid == 0){
  /* child */
  exit(0);
 } else { 
  /* parent */
  printf("Parent at pid: %d and ppid: %d\n", getpid(), getppid() );
  printf("Our child %d will be the zombie, watch below:\n", pid);
  sprintf(&cmd, "%s %d", "ps  -o state,pid,command  -p ", pid);
  sleep(1);
  system(cmd);
 }

 return 0;
}
 
(Also available at : https://evuraan.info/evuraan/stuff/create_zombie.c.txt)

Sunday, December 31, 2017

chan_mobile on raspberry pi3, Asterisk 15.1.5


I wanted to route calls from my Asterisk 15.1.5 on my pi3 over Bluetooth from my cellphone.

Wasted a few days trying to get chan_mobile working. Followed this guide and this post. I could get the phones to dial out etc, but there was something missing - audio! 

I could not hear audio in either direction - dialing in our dialing out.

Turns out the pi3's Bluetooth controller is useless in this context, since it seems to use eSCO (Extended Synchronous Connection Oriented) link. There are no SCO packets passed during the phone call. These are the two posts that gave me the clue, although on the 3rd day.

I could not get eSCO disabled either:

root@jungle:~# modinfo bluetooth -p
disable_esco:Disable eSCO connection creation (bool)
disable_ertm:Disable enhanced retransmission mode (bool)
root@jungle:~# 

Luckily I had an old usb bluetooth adapter lying around in my spares collection:

root@jungle:~# lsusb |grep -i blue
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
root@jungle:~#

I am happy to report this adapter ended up working perfectly for me.

jungle*CLI> mobile show devices
ID              Address           Group Adapter         Connected State      SMS
nexus5x         XX:YY:ZZ:AA:BB:CC 1     dlink           Yes       Free       No 
jungle*CLI>; 


You may also find this post useful when dealing with multiple BT adapters, and if one of those require a pairing challenge.

Free Tip:

Did you know, 19252590082 is a publicly available Echo Test Number?

Saturday, December 30, 2017

Compiling g.729 on raspberry pi3 for asterisk 15.1.5

saving my bash history so it may be useful for others. Below is how I configured g729 on my pi3:
  601  mkdir ~/somefolder; cd ~/somefolder
  602  git clone git://git.linphone.org/bcg729.git
  603  cd bcg729/
  604  ./configure --libdir=/lib
  605  make
  606  sudo make install
  607  cd ..; wget http://asterisk.hosting.lv/src/asterisk-g72x-1.2.tar.bz2
  608  ls -ltr
  609  tar -xvjf asterisk-g72x-1.4.2.tar.bz2
  610  cd asterisk-g72x-1.4.2/; ./autogen.sh
  614  ./configure CFLAGS='-march=native'  --with-bcg729  --with-asterisk-includes=/usr/include
  615  make
  616  sudo make install

Added allow=g729 into my sip.conf, restarted asterisk .
In action:

jungle*CLI> core show version
Asterisk 15.1.5 built by root @ jungle on a armv7l running Linux on 2017-12-29 21:50:04 UTC
       > Saved useragent "LinphoneAndroid/3.3.1 (belle-sip/1.6.3)" for peer 300_test
jungle*CLI> core show translation recalc 10
         Recalculating Codec Translation (number of sample seconds: 10)

         Translation times between formats (in microseconds) for one second of data
          Source Format (Rows) Destination Format (Columns)

           ulaw  alaw   gsm  g726 g726aal2 adpcm  slin  slin  slin  slin  slin  slin  slin  slin  slin lpc10  g729 speex speex speex  ilbc  g722 testlaw
     ulaw     -  9150 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250   15000
     alaw  9150     - 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250   15000
      gsm 15000 15000     - 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250   15000
     g726 15000 15000 15000     -    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250   15000
 g726aal2 15000 15000 15000 15000        - 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250   15000
    adpcm 15000 15000 15000 15000    15000     -  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250   15000
     slin  6000  6000  6000  6000     6000  6000     -  8000  8000  8000  8000  8000  8000  8000  8000  6000  6000  6000 14000 14000  6000  8250    6000
     slin 14500 14500 14500 14500    14500 14500  8500     -  8000  8000  8000  8000  8000  8000  8000 14500 14500 14500 14000 14000 14500 14000   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500     -  8000  8000  8000  8000  8000  8000 14500 14500 14500  6000 14000 14500  6000   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500  8500     -  8000  8000  8000  8000  8000 14500 14500 14500 14500 14000 14500 14500   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500  8500  8500     -  8000  8000  8000  8000 14500 14500 14500 14500  6000 14500 14500   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500  8500  8500  8500     -  8000  8000  8000 14500 14500 14500 14500 14500 14500 14500   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500  8500  8500  8500  8500     -  8000  8000 14500 14500 14500 14500 14500 14500 14500   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500  8500  8500  8500  8500  8500     -  8000 14500 14500 14500 14500 14500 14500 14500   14500
     slin 14500 14500 14500 14500    14500 14500  8500  8500  8500  8500  8500  8500  8500  8500     - 14500 14500 14500 14500 14500 14500 14500   14500
    lpc10 15000 15000 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000     - 15000 15000 23000 23000 15000 17250   15000
     g729 15000 15000 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000     - 15000 23000 23000 15000 17250   15000
    speex 15000 15000 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000     - 23000 23000 15000 17250   15000
    speex 23500 23500 23500 23500    23500 23500 17500 17500  9000 17000 17000 17000 17000 17000 17000 23500 23500 23500     - 23000 23500 15000   23500
    speex 23500 23500 23500 23500    23500 23500 17500 17500 17500 17500  9000 17000 17000 17000 17000 23500 23500 23500 23500     - 23500 23500   23500
     ilbc 15000 15000 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000     - 17250   15000
     g722 15600 15600 15600 15600    15600 15600  9600 17500  9000 17000 17000 17000 17000 17000 17000 15600 15600 15600 15000 23000 15600     -   15600
  testlaw 15000 15000 15000 15000    15000 15000  9000 17000 17000 17000 17000 17000 17000 17000 17000 15000 15000 15000 23000 23000 15000 17250       -
jungle*CLI> 


Friday, August 07, 2015

gps.conf (motox 2013 5.1 build)

gps.conf
# XTRA_SERVER_QUERY (1=on, 0=off)
# If XTRA_SERVER_QUERY is on, the XTRA_SERVERs listed
# below will be ignored, and instead the servers will
# be queried from the modem.
XTRA_SERVER_QUERY=0
# XTRA_SERVERs below are used only if XTRA_SERVER_QUERY
# is off.
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra2.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra2.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra2.bin

# Error Estimate
# _SET = 1
# _CLEAR = 0
ERR_ESTIMATE=0

#Test
#NTP_SERVER=time.gpsonextra.net
#Asia
# NTP_SERVER=asia.pool.ntp.org
#Europe
# NTP_SERVER=europe.pool.ntp.org
#North America
NTP_SERVER=north-america.pool.ntp.org

# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info
#               4 - Debug, 5 - Verbose
# If DEBUG_LEVEL is commented, Android's logging levels will be used
DEBUG_LEVEL = 2

# Intermediate position report, 1=enable, 0=disable
INTERMEDIATE_POS=0

# supl version 1.0
SUPL_VER=0x10000

# GPS Capabilities bit mask
# SCHEDULING = 0x01
# MSB = 0x02
# MSA = 0x04
# ON_DEMAND_TIME = 0x10
# GEOFENCE = 0x20
# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING | GEOFENCE
CAPABILITIES=0x37

# Accuracy threshold for intermediate positions
# less accurate positions are ignored, 0 for passing all positions
# ACCURACY_THRES=5000

################################
##### AGPS server settings #####
################################

# FOR SUPL SUPPORT, set the following
SUPL_HOST=supl.google.com
SUPL_PORT=7276

# FOR C2K PDE SUPPORT, set the following
# C2K_HOST=c2k.pde.com or IP
# C2K_PORT=1234

####################################
#  LTE Positioning Profile Settings
####################################
# 0: Enable RRLP on LTE(Default)
# 1: Enable LPP_User_Plane on LTE
# 2: Enable LPP_Control_Plane
# 3: Enable both LPP_User_Plane and LPP_Control_Plane
LPP_PROFILE = 0

################################
# EXTRA SETTINGS
################################
# NMEA provider (1=Modem Processor, 0=Application Processor)
NMEA_PROVIDER=0

##################################################
# Select Positioning Protocol on A-GLONASS system
##################################################
# 0x1: RRC CPlane
# 0x2: RRLP UPlane
# 0x4: LLP Uplane
A_GLONASS_POS_PROTOCOL_SELECT = 0

Saturday, July 11, 2015

dnsmasq cache flags

for my reference, dnsmasq cache flags:



# pkill -USR1 dnsmasq

Tuesday, July 07, 2015

dotted quad to decimal and back, in bash




bash snippet to convert IP address to decimal:

$ cat ip2d.sh
#!/bin/bash

IFS=.
set -- $*
echo $(( ($1*256**3) + ($2*256**2) + ($3*256) + ($4) ))


Conversely, to convert from decimal to dotted quad address:



$ cat d2ip.sh
#!/bin/bash

IFS=" " read -r a b c d  <<< $(echo  "obase=256 ; $1" |bc)
echo ${a#0}.${b#0}.${c#0}.${d#0}

Here they are in action:

google.com has address 216.58.216.142
$ ./ip2d.sh 216.58.216.142
3627735182
$ ./d2ip.sh 3627735182
216.58.216.142

Sunday, March 15, 2015

samsung Galaxy S3 UMTS to unlock

nvram rebuild:

just flash a TW rom. (example)

Once you are in stock ROM and gotten through all the annoying pop-ups, open your dialer and type in *#197328640#
it should open up a menu, you want to go to Mainmenu > UMTS > Common > NVREBUILD > NVREBUILD > Once you select to rebuild the NVRAM and it finishes don't exit the menu wait about 30 seconds long press power button and select Resta.

 To unlock your Galaxy S3 OR NOTE 2:

To unlock your Galaxy S3 OR NOTE 2:
Attention S3 users, you need to update your S3 to 4.1.1 Jelly Bean which was released today December 3 by Samsung in order to be able to unlock your phone.
Just dial the following keys *#197328640#

Main Menu > [1] UMTS > [1] Debug Screen > [8] Phone Control > [6] Network Lock > Options [3]Perso SHA256 OFF > (after choosing this option, wait about 30 seconds, then go back one step by pressing the Menu button then select Back, now you are in [6] Network Lock then choose [4] NW Lock NV Data INITIALLIZ ..... wait for a minute then reboot your phone

Monday, January 27, 2014

lockfile in python

Alternate Link to this article

lockfile in python

lockfile is one of my must haves, as it is a very useful semaphore lock file creator.
# lockfile --help
Usage: lockfile -v | -nnn | -r nnn | -l nnn | -s nnn | -! | -ml | -mu | file ...
# rpm -qf `which lockfile`
procmail-3.22-25.1.el6.x86_64
As can be seen above, /usr/bin/lockfile is part of procmail, which comes with its own dependencies (usually sendmail or postfix etc.). I did not like having to install those MTA type dependencies to setup procmail for locking purposes. This is the reason why I wrote lockfile.py.

lockfile.py

#!/usr/bin/python

# Author Evuraan Gmail dot com

import optparse,sys,os,time

def usage():
 print """
Usage   : lockfile.py 
Usage   : lockfile.py -l  
Example : lockfile.py -l 1300 /tmp/my.lockfile.txt
Example : lockfile.py /tmp/my.lockfile.txt

"""


def remove_lockfile(lock_file):
 os.remove(lock_file)


def set_lockfile(lock_file):
 write_file = open(lock_file,"w",)
 write_file.write(str(time.time()))
 write_file.close()
 if os.path.isfile(lock_file):
  # file exists, good enough for us.
  return 0
 else:
  return 1



#if the lockfile exists, check for locktimeout
def checklock(lock_file):
 if os.path.isfile(lock_file):
  # lock file exists. check how old etc.
  mtime = float(os.path.getmtime(lock_file))
  delta = time.time() - mtime
  if float(delta) >= float(locktimeout):
   # file is stale, over write it
   if set_lockfile(lock_file) != 0:
    sys.exit(1)
  else:
   #file is not stale. new. spanking new.
   sys.exit(1)
 else:
  # no lock file.
  if set_lockfile(lock_file) != 0:
   sys.exit(1)



if __name__ == "__main__":

 parser = optparse.OptionParser()
 parser.add_option('-l', '--locktimeout',
  dest="locktimeout",
  type="int",
  default="3489999999",
  help="""If you specify a locktimeout then a lockfile will be
removed by force after locktimeout seconds have passed since the lockfile was last
modified/created (most likely by some other program that unexpectedly
died a long time ago, and hence could not clean up any leftover lockfiles)."""
  )

 options,remainder = parser.parse_args()

 #print "locktimeout       :", options.locktimeout
 #print "remainder         :", remainder

 global locktimeout
 locktimeout = options.locktimeout

 try:
  if len(remainder) == 0:
   print "Invalid usage"
   usage()
   sys.exit(2)
  else:
   global lock_file
   lock_file = remainder[0]
 except:
  sys.exit(2)


 #print "Ahem", lock_file
 checklock(lock_file)


Usage:

$ ./lockfile.py
Invalid usage

Usage   : lockfile.py 
Usage   : lockfile.py -l  
Example : lockfile.py -l 1300 /tmp/my.lockfile.txt
Example : lockfile.py /tmp/my.lockfile.txt


$ ./lockfile.py --help
Usage: lockfile.py [options]

Options:
  -h, --help            show this help message and exit
  -l LOCKTIMEOUT, --locktimeout=LOCKTIMEOUT
                        If you specify a locktimeout then a lockfile will be
                        removed by force after locktimeout seconds have passed
                        since the lockfile was last modified/created (most
                        likely by some other program that unexpectedly  died a
                        long time ago, and hence could not clean up any
                        leftover lockfiles).


$ ./lockfile.py  /tmp/mylockfile ; echo $?
0

$ ./lockfile.py  /tmp/mylockfile ; echo $?
1

Download

lockfile.py can be downloaded as:
$ wget https://evuraan.info/evuraan/stuff/lockfile.py.txt --no-check-certificate -O lock.py

License

Software License:

Copyright (c) 2013, evuraan All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of evuraan nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Sunday, December 22, 2013

mythtv - Auto-delete duplicate recordings with myth-remove-duplicates.sh


Question:

I have a large archive of recordings on a well-used mythbox and I know I have accumulated a lot of duplicates. I need to free some space, but going through and manually getting rid of the duplicates would be a monumental task.

Is there any mechanism or script available to track down these duplicates, and preferably delete all but the newest recording? I've searched the web and poked at my interface with no luck.

Answer:

You're welcome to use the script I wrote; I've been running it regularly to remove the duplicates.

$ wget http://evuraan.info/evuraan/stuff/myth-remove-duplicates.sh.txt -O myth-remove-duplicates.sh
$ chmod +x myth-remove-duplicates.sh 

Edit to replace RECORDINGDIR, user_name and pass_word with what's applicable to your setup and run myth-remove-duplicates.sh.

Running it :

$ ./myth-remove-duplicates.sh
1091_20131221090100.mpg is duplicate
removed `/var/lib/mythtv/recordings/1091_20131221090100.mpg'
1091_20131221070100.mpg is duplicate
removed `/var/lib/mythtv/recordings/1091_20131221070100.mpg'

Here's the script, myth-remove-duplicates.sh:

#!/bin/bash 
# Authored by Evuraan_AT_gmail_DOT_com
# ABSOLUTELY NO WARRANTY, to the extent permitted by
# applicable law.
# YMMV.
# Use at your own risk.

user_name="mythtv"
pass_word="yourpassword" 
RECORDINGDIR="/var/lib/mythtv/recordings"
list="/tmp/recordings.txt-$RANDOM-$RANDOM"
SQLSCRIPT="/tmp/recordings.sql-txt-$RANDOM-$RANDOM"

gen_lists(){
mysql -u "$user_name" -p"$pass_word" -e "select starttime,basename,title,description from recorded order by starttime" mythconverg | tac > $list
}

verify_duplicate(){
# if verbatim repeats..
sum_a=$(egrep "${a:0:16}" $list | awk -F".mpg\t" 'NR>1 {print $NF}' |md5sum) 
[ ! -z "$sum_a" ] && egrep "${a:0:16}" $list | awk -F".mpg\t" 'END {print $NF}' | md5sum |egrep -q  ${sum_a//-}
}

remove_duplicates(){
[ -s "${RECORDINGDIR}/${a}" ] && ( rm -v "${RECORDINGDIR}/${a}" ; 
	echo "DELETE FROM mythconverg.recorded WHERE basename = '$a';" > $SQLSCRIPT
	)
[ -s $SQLSCRIPT ] && mysql -u "$user_name" -p"$pass_word"   mythconverg < $SQLSCRIPT
}




gen_lists
awk {'print $3'} $list  |grep mpg$ | while read a ; do 
	[[ $(egrep -c ${a:0:16} $list ) -ge 2 ]]  && verify_duplicate && sed -i /"${a:0:16}"/d $list && echo $a is duplicate && remove_duplicates
done

rm $SQLSCRIPT $list 1>/dev/null 2>&1 || : 

Tuesday, July 30, 2013

mplayer - Cannot find codec for audio format 0x6134706D

mplayer is awesome!

 
I've been happily living with mplayer leveraging vdpau on my Ubuntu Lucid 10.04 LTS. Until today that is, when I tried to play videos from my SLR, and there was no audio. Upon close look, mplayer was complaining thusly:

FAAD: Failed to initialize the decoder!
ADecoder init failed :(
[aac @ 0x4442a60]Audio object type 0 is not supported.
Could not open codec.
ADecoder init failed :(
Cannot find codec for audio format 0x6134706D.
I did STFW, and tried a couple of things, none of those worked for me. That's when I decided to give mplayer2 a try. mplayer2 is a fork of mplayer, I had read elsewhere that it contains a number of features not available in the original MPlayer.

Since I use vdpau, the mplayer2 website indicated that it'd be a better bet for me:

Much better support for VDPAU functionality

  • Removed limitations that prevented switching frames more than once per monitor refresh. With MPlayer2 you can play high-FPS content or use fast forward on a 60 Hz monitor without breaking playback.
  • Added support for the frame timing functionality of VDPAU.
  • Improved performance by better buffer handling and smarter subtitle texture uploads (both VDPAU hardware decoding and displaying software decoded video with VDPAU perform better).
  • Added logic to reduce frame timing jitter in some situations.
  • Handle frames added by deinterlacing properly.
  • Several bugfixes.
  • Various minor improvements (studio level output support, set default deinterlace mode, ...)

Installing mplayer2 on  Ubuntu 10.04 LTS 

Here's how I found to install mplayer2 on ubuntu 10.04 LTS:

$ sudo add-apt-repository ppa:ripps818/coreavc
$  sudo apt-get update 
$  sudo apt-get install mplayer2 
 
For reference, here's my ~/.mplayer2/config file. (See archlinux wiki on more about these entries..)

$ cat ~/.mplayer2/config  
# Write your default config options here!
vo=vdpau,
vc=ffh264vdpau,ffmpeg12vdpau,ffodivxvdpau,ffwmv3vdpau,ffvc1vdpau,
 

mplayer2 and 0x6134706D

mplayer2 seem to be able to play all those files mplayer was complaining about. I think I like the vdpau quality better with mplayer2, or it could just be a phsycological placebo effect!

Either way, I love mplayer, and mplayer2!


 

Saturday, April 06, 2013

Comparing Calling Rates : Skype vs Fring Vs Rebtel

Comparing Calling Rates : Skype vs Fring Vs Rebtel

Rebtel wins hands down. (Best quality too!) (i use their android app) 



9.2c/min, 3.4c/min and 1.69c/min @Rebtel Wins!


http://evuraan.info/screenshots/images/skype_vs_fring_vs_rebtel.jpg

Saturday, March 09, 2013

install xbmc frodo on ubuntu 10.04 (Lucid)

xbmc does not seem to provide PPAs for Ubuntu Lucid at the moment. Like many others, I am not upgrading from Lucid LTS for another 2 years until its LTS span runs out, if I can help it.

Here's how to install xbmc 12.0 (aka Frodo) on Ubuntu Lucid:



sudo add-apt-repository ppa:nathan-renniewaldock/xbmc-nightly 
sudo apt-get update 
sudo apt-get install xbmc 
sudo apt-get install libtag1-dev 


Enjoy!

(reference)


Saturday, October 13, 2012

mplayer and vdpau



So I was just using mplayer -vo vdpau... and here's my cpu util:

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 6172 XXX      20   0  155m  50m  14m R 22.9  2.5   0:06.86 mplayer
 
Thats when I stumbled upon this ArchLinux Wiki post, and added these to my ~/.mplayer/config file:

vo=vdpau,
vc=ffh264vdpau,ffmpeg12vdpau,ffodivxvdpau,ffwmv3vdpau,ffvc1vdpau, 
 
And now,
  
PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
6397 XXX      20   0  157m  51m  15m S  2.3  2.6   0:03.73 mplayer
 
my %cpu dropped from 22.9% to 2.3%..! Amazing, isn't it?


Alternate link

Saturday, June 23, 2012

script to download latest firefox aurora

script to download latest firefox aurora and extract to mydir
wget -q "https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora/?C=M;O=A" -O - | awk '/en-US.linux-i686.tar.bz2">/ {gsub(/href="/,"",$6)+gsub(/">.*/,"",$6); print "https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora/"$6}' | while read a 
do  
 wget -c "$a" -q -O /tmp/firefox-aurora-en-US.linux-i686.tar.bz2 && cd mydir  && tar -xvjf /tmp/firefox-aurora-en-US.linux-i686.tar.bz2 
done

script to download latest firefox nightly build




script to download latest firefox nightly build and extract to mydir

wget http://nightly.mozilla.org/ -q -O - |awk '/en-US.linux-i686/ {gsub(/href="/,"",$2)+gsub(/">/,"",$2);print $2}' | while read a 
do   
   wget -c "$a" -q -O /tmp/firefox-nightly-en-US.linux-i686.tar.bz2  && cd mydir && tar -xvjf /tmp/firefox-nightly-en-US.linux-i686.tar.bz2 
done 

Followers


Creative Commons License
This work is licensed under a Creative Commons License.