Media Player release, alternative

Post your thoughts and ideas on safety here.
dreamsorcerer
*
Posts: 2
Joined: 23 Dec 2007, 00:30

Media Player release, alternative

Post by dreamsorcerer »

I just saw the Windows Media player release, and to save money on CDs, thought it would be a lot easier to use a program to eject the disk tray at a random time.

In about 5 mins I managed to create a small Python program that would work in Linux. It will ask you for the minimum and maximum time, then after a random time (between the time you gave) it will eject the disk tray.

If there is anyone more familiar with Python than myself, then they could improve the program and make it compatible with Windows, and also have the option to close the tray instead of opening it. If not, then maybe I'll do it myself when I learn more on how to do this.

If your running Linux then just copy the code below into a text editor and save it as 'eject.py', then you can run it in Python.

One way of running this is to type in a terminal 'python /home/spam/Desktop/eject.py' Change the path name as appropriate, the example assumes that the program is called 'eject.py', is located on the Desktop, and the user is called 'spam'.

I've only tested this once, so make sure that you test this before using.
eject.py wrote:import random
import time
import subprocess


#The number of minimum and maximum minutes for the program to run.
low = input("Enter minimum time (minutes): ")
high = input("Enter maximum time (minutes): ")

#Converts minutes into seconds for delay
low = low * 60
high = high * 60

#Assign the random time for the delay, from the parameters given
delay = random.randint(low, high)

#Delay the program till eject
time.sleep(delay)

#Eject the disk
subprocess.call("eject", shell=False)
Last edited by dreamsorcerer on 19 Jan 2008, 15:06, edited 1 time in total.
User avatar
curious_sb
Retired Moderator
Posts: 1147
Joined: 24 Mar 2006, 00:38
Location: United Kingdom

Post by curious_sb »

Not sure if I missed anything but what has this got to do with bondage and safety??

Have you been posting bondage things in technical forums by mistake??? LOL
Curious_SB
Retired Forum Moderator
countdown321
*
Posts: 49
Joined: 07 Nov 2007, 22:45
Location: England

Post by countdown321 »

CD drives can be used as a release.

When it opens it can relase a key that can swing to you.

And thanks for the script, I will try it out the next time I boot into linux.
dreamsorcerer
*
Posts: 2
Joined: 23 Dec 2007, 00:30

Post by dreamsorcerer »

curious_sb wrote:Not sure if I missed anything but what has this got to do with bondage and safety??
I posted here, as this is an alternative to the Media Player key release, in the safety section of the main website.
curious_sb wrote:Have you been posting bondage things in technical forums by mistake??? LOL
lol, damn, that's why they were all giving me strange looks :wink:
User avatar
curious_sb
Retired Moderator
Posts: 1147
Joined: 24 Mar 2006, 00:38
Location: United Kingdom

Post by curious_sb »

hahaha cheers for the info
Curious_SB
Retired Forum Moderator
User avatar
Mc_ntk
**
Posts: 159
Joined: 21 Jul 2007, 06:57
Location: B.C. Canada

Post by Mc_ntk »

For a timed release:
type this into a bash shell (terminal):
"sleep 3600 && eject" = 1 hour before it opens

no quotes and after a hour it will eject
Just 60 X number of minutes you want to be "stuck"

Also works on mac XD

To make it work on windows:

Code: Select all

import random
import time
import WinCDRom
cd = WinCDRom.Cdrom()
#The number of minimum and maximum minutes for the program to run.
low = input("Enter minimum time (minutes): ")
high = input("Enter maximum time (minutes): ")

#Converts minutes into seconds for delay
low = low * 60
high = high * 60

#Assign the random time for the delay, from the parameters given
delay = random.randint(low, high)

#Delay the program till eject
time.sleep(delay)

#Eject the disk a couple times incase it doesn't go the first time
cd.eject()
cd.close()
cd.eject()
cd.close()
Could some one test it on windows?
User avatar
bdbgum
**
Posts: 178
Joined: 17 Nov 2007, 18:25
Location: Belgium - somewhere

Post by bdbgum »

Haha, someone I know used that method. Of course it won't work if your computer hangs or crashes! And as usual, use other releases too including one that normally can't fail.

"sleep 3600 && eject" = 1 hour"

Yeah, I was thinking along the lines of that. :)

What's that? Windows BAT code? If so, doesn't work at all... x)
User avatar
bound_jenny
Moderator
Posts: 10268
Joined: 09 Dec 2007, 12:37
Location: Montreal, Canada, Great Kinky North

Post by bound_jenny »

Done, darkelve!

Jenny.
Forum Moderator
Helplessness is a doorway to the innermost reaches of the soul.
If my corset isn't tight, it just isn't right!
Kink is the spice of life!
Come to the Dark Side - we have cookies!
User avatar
Mc_ntk
**
Posts: 159
Joined: 21 Jul 2007, 06:57
Location: B.C. Canada

Post by Mc_ntk »

Download and install python 2.5.2 for windows:
http://www.python.org/ftp/python/2.5.2/python-2.5.2.msi

Then open notepad and copy the code I posted.
Save it in C:\ as eject.py

Now it should be in C:\eject.py

Now goto start, run, command or cmd
type: python eject.py and hit enter

Tell me if it works.
User avatar
Mc_ntk
**
Posts: 159
Joined: 21 Jul 2007, 06:57
Location: B.C. Canada

Post by Mc_ntk »

Darkelve wrote:Haha, someone I know used that method. Of course it won't work if your computer hangs or crashes! And as usual, use other releases too including one that normally can't fail.

"sleep 3600 && eject" = 1 hour"

Yeah, I was thinking along the lines of that. :)

What's that? Windows BAT code? If so, doesn't work at all... x)
Are you being sarcastic? I think you are because of the x) but I can't tell.

On windows this will not work. If your on linux you don't need to worry about your computer hanging or crashing.
Image

^ running linux

Nah its linux shell code w007
sleep 3600 && eject
WOOO!


If your on windows:
Download and copy this to your home dir and C:\ this: http://memberwebs.com/stef/software/eject/eject.exe

Open notepad and put this:
@echo off
CALL WAIT 3600
eject

and save it in C:\ as 60min.bat as "all files"

Now goto start, run, command then:
cd C:\
then:
start 60min.bat

it should pause for 1 hour then eject

Of course I don't trust windows not to crash.
User avatar
smbdjim1
*
Posts: 14
Joined: 17 Jul 2008, 21:42
Location: Washington DC

Post by smbdjim1 »

I'm an IT professional and I actually never thought about using computer code to initiate a release method. Interesting.

Linux is much more stable. I agree. I don't think I would trust XP or VISTA with my SB. :)

Also a saftey note....you do use a UPS with your system that can maintain battery power for the amount of time you are in SB, right??? Just a thought.

Sub Jim
User avatar
Sam-Ho
**
Posts: 76
Joined: 15 Apr 2008, 21:21
Location: Santa Clara, CA
Contact:

Post by Sam-Ho »

Linux, .001% fail rate. Power backup can last for 5 hours when I'm maxing my lappy, so on a simple delay function it ought to last well over 20.

Windows, I occasionally crash when attempting to open start menu. Power backup runs out faster since something loves to always be using my processing power, thus needing more power.

I've tested the script and it runs perfectly. Perhaps somewhere along the line my CD drive may be the one at fault, but thats why we have back-up releases, right?
The slave learns to love the lash. Add me!
User avatar
bdbgum
**
Posts: 178
Joined: 17 Nov 2007, 18:25
Location: Belgium - somewhere

Post by bdbgum »

Hey, if you try hard enough you CAN get Linux to 'freeze'... I should know ;p
Are you being sarcastic
No I'm just not familiar with Python...


Open notepad and put this:
@echo off
CALL WAIT 3600
eject
Haha great... only I have two DVD Readers, it only opened the top one. Good thing I tested first! :p

Hmmm actually that WAIT function didn't work for me. I found the reason here:

http://malektips.com/dos0017.html

I changed the script to
@echo off
@ping 127.0.0.1 -n 3600-w 1000 > nul
@ping 127.0.0.1 -n %1% -w 1000> nul
eject
'3600' stands for the number of seconds
However, I'm not very comfortable with this method and I don't advise it... at least not with several less error-prone release mechanisms.
User avatar
Mc_ntk
**
Posts: 159
Joined: 21 Jul 2007, 06:57
Location: B.C. Canada

Post by Mc_ntk »

Darkelve wrote: I changed the script to
@echo off
@ping 127.0.0.1 -n 3600-w 1000 > nul
@ping 127.0.0.1 -n %1% -w 1000> nul
eject
'3600' stands for the number of seconds
However, I'm not very comfortable with this method and I don't advise it... at least not with several less error-prone release mechanisms.
Why the @ping?
Oh and good job on searching it up and finding a alternate method.!! :D
User avatar
bdbgum
**
Posts: 178
Joined: 17 Nov 2007, 18:25
Location: Belgium - somewhere

Post by bdbgum »

Mc_ntk wrote:
Darkelve wrote: I changed the script to
@echo off
@ping 127.0.0.1 -n 3600-w 1000 > nul
@ping 127.0.0.1 -n %1% -w 1000> nul
eject
'3600' stands for the number of seconds
However, I'm not very comfortable with this method and I don't advise it... at least not with several less error-prone release mechanisms.
Why the @ping?
Oh and good job on searching it up and finding a alternate method.!! :D
Yeah, the ping command replaces the wait command. It's explained on the page I provided:
Do you need a batch file that waits a certain amount of seconds? In some languages, the command would be WAIT, but DOS and Windows do not come with this command for batch files. If you want to implement the WAIT command:
And then the guy used the ping 'trick' instead of a WAIT/PAUSE/SLEEP command.
Post Reply