Creation: 14/07/2009 18:18
Last Modification: 18/07/2009 17:56
In a website, it is sometimes usefull to set the opacity of an element.
Problem is, Internet explorer and firefox don't handle this the same way.
Here is a solution to have both firefox and Internet explorer setting the opacity of an element.
Firefox has a standard option name opacity.
You can use this one to set and element opacity
(from 0 to 1, 1 meaning full opacity).
Internet explorer does not handle the opacity option.
To set the opacity you will have to use the alpha filter.
This will give alpha(opacity=20) where the value is an
integer between 0 and 100.
You can add the following to an html page:
<style>
a.opac {
filter: "alpha(opacity=100)";
opacity: 1;
}
a.opac:hover {
filter: "alpha(opacity=20)";
opacity: 0.2;
}
</style>
<a href="http://www.netbertrand.com" class=opac>Opacity link</a>
And you will have the following result:
This will create a link and change the opacity when mouse is over.
Creation: 14/07/2009 17:59
Last Modification: 18/07/2009 17:58
VLC is a very powerfull Video on Demand server.
i will show you how to set up a VLC server and give
the right playlist to the local network computers so
they can view your videos.
This procedure could be used to share videos over internet
but you would have to use live streaming to unless you have
a very large capacity on your connection.
1- Create the vlc vod configuration:
Create a vlc.conf file with one entry for each of your videos:
(works with windows but you have to put windows style paths)
new myvid1 vod
setup myvid1 input "/path/to/myideo1.mpg"
setup myvid1 enabled
new myvid2 vod
setup myvid2 input "/path/to/myvideo2.avi"
setup myvid2 enabled
Then vlc must be started with the command:
vlc --rtsp-host 0.0.0.0:5554 --vlm-conf vlc.conf -I dummy
2: Create the vlc.m3u playlist
(here myserver must be replaced by the ip adress of the computer
on which vlc has been started earlier):
#EXTM3U
#EXTINF:0,0 - myvideo1
rtsp://myserver:5554/myvid1
#EXTINF:0,0 - myvideo2
rtsp://myserver:5554/myvid2
Just start this playlist in vlc on any computer of your network and
you will be able to watch the videos, with pause and fast forward
support.
Enjoy !!!
Creation: 14/07/2009 17:22
Last Modification: 18/07/2009 17:59
With MAC OS X, a wonderfull command line program named "osascript"
is avaiable.
Using osascript you can command almost every graphical program in
command line and i will show you how to use it to command itunes
(which will make it possible to run those commands in an ssh session).
To start itunes:
osascript -e 'tell application "iTunes" to activate'
To jump to next track:
osascript -e 'tell application "iTunes" to next track'
Replacing "next track" in the last command you can:
- pause : pause playing
- play : start playing
- previous track : return to previous track.
Using this i made a small script to start itunes if needed and execute
the wanting command:
#!/bin/bash
mycmd=$(basename $0)
isStarted=$(osascript -e 'tell application "System Events" to (name of processes) contains "iTunes"')
if [ "$isStarted" = "false" ]; then
osascript -e 'tell application "iTunes" to activate'
fi
case $mycmd in
itunes_next)
osascript -e 'tell application "iTunes" to next track'
;;
itunes_pause)
osascript -e 'tell application "iTunes" to pause'
;;
itunes_play)
osascript -e 'tell application "iTunes" to play'
;;
itunes_prev)
osascript -e 'tell application "iTunes" to previous track'
;;
esac
You then need to link this script to the itunes_next, itunes_pause,
itunes_play and itunes_prev and you are good to go.
Creation: 14/07/2009 16:12
Last Modification: 14/07/2009 16:12
This is a small tip but that i found usefull if you want to spare some
energy.
On my multimedia server, i need to force screen to shutdown when
i quit the xserver and not wait for timeout and in the other way i need
to start it before starting X.
To do this you can simply use the "vbetool" command:
- "vbetool dpms off" will stop your screen.
- "vbetool dpms on" will start it back.
Using this i force my LCD screen to shutdown when i am done looking
TV but my computers continue to run (to host my website or record TV
shows later for example).
Creation: 14/07/2009 15:53
Last Modification: 18/07/2009 18:00
Here is a sum up of how i created my blog.
It is based on 2 sql tables:
- one for the categories with an integer indentifier and a name
CREATE TABLE blog_cat (
id int(11) NOT NULL auto_increment,
name char(255) default NULL,
PRIMARY KEY (id)
)
- one for the entries with an integer identifier, a title, contents,
date of last mofication and date of creation, identifier of the
category corresponding.
CREATE TABLE blog_entry (
id int(11) NOT NULL auto_increment,
title text,
category int(11) default NULL,
creation datetime default NULL,
lastmod datetime default NULL,
content longtext,
PRIMARY KEY (id)
)
An article is then created and attached to one category. Once an article
exists only the last mofication time will be shown.
This blog is still missing some features:
- add a list of links to an article
- add some files possible to download
- perhaps make it possible to have a better presentation
Each article is only displayed using a "pre" html category so i don't have
to care about new lines and others.
Don't forget to use addslashes/stripslashes when modifying/reading entries
from the database otherwise you will get problems with special characters.