BMX Bicycle freestyle
BMX Bicycle freestyle

Tuesday, July 21, 2009

start and play seamless video with script

video that can be played for entertainment similar to visualisations and screensavers
digital juice and art beats are known producers of seamless video


-------------------------------------------------------------------------------------------------------------------------------------------------
killall xfmedia
sudo xfmedia -loop  -f './media/seamless/seamlessvideo.mov'&
sleep 4
#window name is Xfmedia: seamlessvideo
b=$(xwininfo -name Xfmedia:\ seamlessvideo | grep Window\ id:\ | awk '{print $4}') 
#commands to restart playback to get picture #on my pc (using virtual keyboard)
xvkbd -xsendevent -window $b -text "\t"
xvkbd -xsendevent -window $b -text "\t"
xvkbd -xsendevent -window $b -text "\t"
xvkbd -xsendevent -window $b -text "\t"
#stop
xvkbd -xsendevent -window $b -text "\r"
xvkbd -xsendevent -window $b -text "\t"
xvkbd -xsendevent -window $b -text "\t"
xvkbd -xsendevent -window $b -text "\t"
xvkbd -xsendevent -window $b -text "\t"
xvkbd -xsendevent -window $b -text "\t"
xvkbd -xsendevent -window $b -text "\t"
#play
xvkbd -xsendevent -window $b -text "\r"
#fullscr
xvkbd -xsendevent -window $b -text "\f"
echo done
-------------------------------------------------------------------------------------------------------------------------------------------------


must be done:
install xfmedia
install xvkbd
get your file into form /media/seamless/seamlessvideo.mov or mod script

keywords:backdrops loops drops ambient atmospheric loopable

Saturday, July 18, 2009

xubuntu install psyco to speed up nicotine (and other python programs)


1.download
http://sourceforge.net/projects/psyco/files/psyco/psyco-1.6-linux.i386-2.5.tar.gz/download

extract tar file

2.locate your python packages directory

python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
(mine was:   cd /usr/lib/python2.6/dist-packages)


3. copy psyco directory (inside extracted directory) to packages directory

sudo cp -r psyco /usr/lib/python2.6/dist-packages

and your python code should run much much much faster

Sunday, June 14, 2009

power off from terminal

script is not perfect and may need your customization. It was written so you can end programs and power off your system from terminal

requrements:xvkbd ~6mb
code (add programs running on your system):

(ps ax | grep -v grep | grep transmission) #check if transmission is running if [ "$?" -eq 0 ]; then b=$(xwininfo -name Transmission | grep Window\ id:\ | awk '{print $4}') #get programs window id xvkbd -xsendevent -window $b -text "\Cq" #send keystroke to quit program fi sleep 1 #set firefox title to normal firefox about:blank sleep 1 (ps ax | grep -v grep | grep gnumeric) if [ "$?" -eq 0 ]; then b=$(xwininfo -name Book1.gnumeric\ :\ Gnumeric | grep Window\ id:\ | awk '{print $4}') xvkbd -xsendevent -window $b -text "\Cq" fi (ps ax | grep -v grep | grep nicotine) if [ "$?" -eq 0 ]; then b=$(xwininfo -name Nicotine+\ 1.2.9 | grep Window\ id:\ | awk '{print $4}') xvkbd -xsendevent -window $b -text "\Cq" fi sleep 1 (ps ax | grep -v grep | grep firefox) if [ "$?" -eq 0 ]; then echo firefox running, now trying to end #(using different character c) c=$(xwininfo -name Mozilla\ Firefox | grep Window\ id:\ | awk '{print $4}') xvkbd -xsendevent -window $c -text "\Cw"; sleep 1 xvkbd -xsendevent -window $c -text "\Cq"; fi df xvkbd -xsendevent -window $c -text "\Av"; (ps ax | grep -v grep | grep linuxdcpp) if [ "$?" -eq 0 ]; then b=$(xwininfo -name LinuxDC++ | grep Window\ id:\ | awk '{print $4}') xvkbd -xsendevent -window $b -text "\Cq" fi (ps ax | grep -v grep | grep vlc) if [ "$?" -eq 0 ]; then b=$(xwininfo -name VLC\ media\ player | grep Window\ id:\ | awk '{print $4}') xvkbd -xsendevent -window $b -text "\Cq" fi #send once again commands to firefox in case it wasnt running xvkbd -xsendevent -window $c -text "\Cw"; xvkbd -xsendevent -window $c -text "\Cq"; (ps ax | grep -v grep | grep transmission) if [ "$?" -eq 1 ]; then echo transmission now off, poweroff? #last resort to end firefox killall firefox sudo shutdown -P now fi

article will be updated as donation recieved

Wednesday, June 10, 2009

Low disk space notifications

linux low disk space notifications

Pre-requisite

In order for the pop-up message to appear, you would need to install “libnotify-bin”.

Code:
sudo apt-get install libnotify-bin


Script

The script will check the free disk space in “/dev/sda1″. It will show a pop-up message for 30 seconds when the free space is below 100MB. If the free space is below 50MB, it will show a pop-up message for 5 minutes. You should modify these parameters to your own requirement.

Copy and paste the script below to a file called “checklowdisk”.

Code:
#!/bin/sh

DISKSPACE=`df | grep "/dev/sda1" | awk '{ print $4 }'`

if [ "$DISKSPACE" -lt "51200" ] ; then
/usr/bin/notify-send -u critical -t 300000 \
'Check low disk' '/dev/sda1 is less than 50MB.'
exit
fi

if [ "$DISKSPACE" -lt "102400" ] ; then
/usr/bin/notify-send -u normal -t 30000 \
'Check low disk' '/dev/sda1 is less than 100MB.'
fi



Setting up the script

Make the script executable:

Code:
chmod +x checklowdisk


Change file ownership to root:

Code:
sudo chown root:root checklowdisk


Move file to “/usr/bin”:

Code:
sudo mv checklowdisk /usr/bin/


Set-up crontab

I chose to run the script hourly using crontab.

Edit crontab:

Code:
crontab -e


Add this line in the editor:

Code:
00 * * * * env DISPLAY=:0 /usr/bin/checklowdisk


Save and close the editor. The crontab is now configured, and the script will run at the hour.
thanx:Chewearn

to free up disk space more effectively click here

Sunday, May 31, 2009

end program from terminal without loosing data

to end process softly run:

(ps ax | grep -v grep | grep transmission)
if [ "$?" -eq 0 ];
then
b=$(xwininfo -name Transmission | grep Window\ id:\ | awk '{print $4}')
xvkbd -xsendevent -window $b -text "\Cq"
fi


explanation and what to replace:

(ps ax | grep -v grep | grep transmission)
if [ "$?" -eq 0 ];

then
b=$(xwininfo -name Transmission | grep Window\ id:\ | awk '{print $4}') xvkbd -xsendevent -window $b -text "\Cq"
fi




legend:
will check if process is running (othwerwise virtual keyboard will hang)
will get programs window id and send keystroke \Cq = Ctrl + q stands for quit
Transmission to get window name do: 1. xwininfo in console 2. click on window 3.read window name in console (if ti names uses spaces use \ before each space )
transmission this can be found when running ps ax in terminal

special note: install xvkbd about 6Mb space lovely app

Thursday, May 28, 2009

hide windows by moving to another desktop (like hideit program)

hide windows we do not use and do no want to see (i.e peer2peer and other background programs)

1.
sudo apt-get install wmctrl

<100kb in size


wmctrl -l
list your windows
wmctrl -d
list your desktops
wmctrl -r <WIN> -t <DESK>  
Move the window to the specified desktop.

2.
let's start:
wmctrl -n 2
set numer of desktops to 2



wmctrl -r LinuxDC++ -t 1
wmctrl -r Transmission -t 1
wmctrl -r Nicotine+ 1.2.9 -t 1


to unhide windows:
wmctrl -r LinuxDC++ -t 0
wmctrl -r Transmission -t 0
wmctrl -r Nicotine+ 1.2.9 -t 0


Monday, May 25, 2009

solved: split mp3 to smaller files

1 instal small program mp3splt

sudo apt-get install mp3splt



2 than

mp3splt Snow_Crash_Part_2.mp3 -t 100.00 -f

to split your file to 100 minutes intervals
this way uset to split long audiobook for more frendly usage on mp3player