user@local~$ vim ftp://hostip/file.py
OK thats it. Told you it was quick. Save and quit (:wq) and your file is updated and published.
There is a huge learning curve to Vim but I think that with time, you will find yourself being more efficient.
user@local~$ vim ftp://hostip/file.py
This is accomplished by combining a python script with the conky variable scroll. The python script will get the data, parse it and put it into a acceptable format for conky to handle the display. I've talked about conky earlier and using displaying the last instant message.#!/usr/bin/python
import urllib
# Open html page
fweb = urllib.urlopen("http://scores.espn.go.com/ncb/bottomline/scores")
gamestr=''
score=''
# Manipulate str for unneccessary chars
raw=str(fweb.readline())
raw=raw.replace('%20',' ');
raw=raw.replace('^','');
raw=raw.replace('&','\n')
# Open data storage
f=open('bottom.dat', 'w')
f.write(raw)
f.close()
f=open('bottom.dat', 'r')
# Parse each line, get game, create str, append str
for line in f:
if line.find('_left')>1:
gamestr=line[line.find('=')+1:-1]
score= score + gamestr + ' | '
f.close()
print score
#avoid flicker
double_buffer yes
#own window to run simultanious 2 or more conkys
own_window yes
own_window_transparent no
own_window_type normal
own_window_hints undecorate,sticky,skip_taskbar,skip_pager, above
#borders
draw_borders no
border_margin 0
#shades
draw_shades no
#position
gap_x 0
gap_y 0
alignment bottom_middle
#behaviour
update_interval 1
#colour
default_color 8f8f8f
#default_shade_color 000000
own_window_colour 262626
text_buffer_size 1400
#font
use_xft yes
xftfont bauhaus:pixelsize=10
#to prevent window from moving
use_spacer none
minimum_size 1400
TEXT
${color e0e0e0} ${scroll 2847 ${execpi 60 python ~/scripts/bottomscore.py}}
% startup.m
% Set Production Directory
prod='~/MATLAB/Production/';
% Prompt user for module name
module=input('What module do you want to work on? ','s');
% If module is set, add to top of path. Otherwise don't add
if ~isempty(module)
path([prod,module],path);
end
Place the startup.m in your MATLAB work directory.
k = int(int(B'*D*B,r,-0.5,0.5),s,-0.5,0.5)B is a 3xn matrix of shape functions and D a 3x3 relationship of Modulus of Elasticity and Poisson's ratio. There is obviously more to this code, including the calculations of stress and strain and the writing of an output file.
k = int(int(transpose(B)*D*B,r,-0.5,0.5),s,-0.5,0.5)This took only 19.735 seconds to run. So digging a little further, the operator ', also checks for complex conjugates of the matrix as well.
#!/usr/bin/python
# ----- GETIM.PY // LISTEN FOR AN RECEIVED MESSAGE ------------#
################################################################
# MOST OF THIS SCRIPT WAS TAKEN FROM THE PIDGIN DEVELOPER WIKI#
# PLEASE VISIT http://developer.pidgin.im/ FOR MORE INFORMATION#
################################################################
def conky_im(account, sender, message, conversation, flags):
reg = '<(.|\n)+?>' # REGEX FOR HTML TAGS
message = re.sub(reg,'',message) # REMOVE HTML TAGS
sender = sender.split("@")[0] # GET GCHAT NAME
message = message[0:24] # LIMIT TO 25 CHARS
file = ' ' # LOCATION OF DATA FILE
fim = open(file,"w")
IM = sender + " said: " + message
fim.write(IM)
fim.close()
import dbus, gobject, re
from dbus.mainloop.glib import DBusGMainLoop
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
bus.add_signal_receiver(conky_im,
dbus_interface="im.pidgin.purple.PurpleInterface",
signal_name="ReceivedImMsg")
loop = gobject.MainLoop()
loop.run()
#!/usr/bin/python
# SHOW LAST IM
f=" " # REPLACE WITH YOUR DATA FILE. ie.CONKYIM.DAT
fim = open(f,'r')
im = fim.read()
print im
fim.close
${execi 1 python ~/scripts/lastim.py}sudo apt-get install ecasound mpg123 lame ffmpeg
#!/bin/bash
# FLV to MP3
#flv2mp3.sh
FLV_FILE=/home/ditto/Videos/
cd $FLV_FILE
for vid in *.flv
do
ffmpeg -i $vid -f mp3 -vn -acodec copy /tmp/temp.mp3
ecasound -i /tmp/temp.mp3 -etf:8 -o ${vid/.flv}.mp3
rm -f /tmp/temp.mp3
done
exit 0
chmod u+x flv2mp3.sh
user@home:/scripts~$ ./flv2mp3
FLV_FILE=/home/ditto/Videos/
cd $FLV_FILE
for vid in *.flvNext we will convert the video to mono audio and create a temporary mp3 called temp.mp3
ffmpeg -i $vid -f mp3 -vn -acodec copy /tmp/temp.mp3Since the audio by default is mono, we will then convert it to stereo, output it into the current directory, and save it as an mp3, while keeping the basename. The file is renamed by ${vid/.flv}.mp3
ecasound -i /tmp/temp.mp3 -etf:8 -o ${vid/.flv}.mp3That is pretty much it. Any comments or ways to make it better, please let me know.
rm -f /tmp/temp.mp3
dcop kopete KopeteIface setAway "away message" false
#!/usr/local/bin/python
import twitter, os, time
while True:
api = twitter.Api()
user = ""
statuses = api.GetUserTimeline(user)
stat = [s.text for s in statuses]
stat = str(stat[0])
os.system("dcop kopete KopeteIface ...
... setAway \"" + stat + "\" false")
time.sleep(60)