Showing posts with label bat. Show all posts
Showing posts with label bat. Show all posts

Thursday

cut avi files (freeware , mac included)

1.Download mcoder

from developer site:

or mencoder for MACOS


2.After unpacking mencoder run following command in unpacked directory.
(first time is start-time , second is duration.)

>mencoder -ss 00:08:57 -endpos 00:08:12 -ovc copy -oac copy file2cut.avi  -o result.avi

Wednesday

How can I make yes/no questions is a batch file?


mplayer.exe -cache 1024 -speed 1.66 %1
SET /P ANSWER=Do you want to delete %1 file (Y/N)?
echo You chose: %ANSWER%
if /i {%ANSWER%}=={y} (goto :yes)
if /i {%ANSWER%}=={yes} (goto :yes)
goto :no
:yes
rm -f %1
exit /b 0
:no
echo file wasn't deleted
exit /b 1

more...

Friday

Convert WMA Into MP3 (free/no-installation)

      0. download and unpack these apps : MPlayer and lame
      1. Convert the WAV file by this command:
         mplayer -vo null -vc dummy -af resample=44100 -ao pcm "Song 1.wma"
2. convert into MP3 the result of step 1 (audiodump.wav).
lame audiodump.wav "Song 1.mp3"

3. delete large wav file created in step 1(audiodump.wav)

Monday

command line xml parser ( free, open source)

located @ http://xmlstar.sourceforge.net/


XMLStarlet Toolkit: Command line utilities for XML
Usage: xml [] []
where is one of:
ed (or edit) - Edit/Update XML document(s)
sel (or select) - Select data or query XML document(s) (XPATH, etc)
tr (or transform) - Transform XML document(s) using XSLT
val (or validate) - Validate XML document(s) (well-formed/DTD/XSD/RelaxNG)
fo (or format) - Format XML document(s)
el (or elements) - Display element structure of XML document
c14n (or canonic) - XML canonicalization
ls (or list) - List directory as XML
esc (or escape) - Escape special XML characters
unesc (or unescape) - Unescape special XML characters
pyx (or xmln) - Convert XML into PYX format (based on ESIS - ISO 8879)
p2x (or depyx) - Convert PYX into XML
are:
--version - show version
--help - show help
Wherever file name mentioned in command help it is assumed
that URL can be used instead as well.

Type: xml --help for command help

XMLStarlet is a command line toolkit to query/edit/check/transform
XML documents (for more information see http://xmlstar.sourceforge.net/)


more...

Thursday

play sound in console or bat file

to play sound in console or bat file use this line
sndrec32.exe /play /embedding c:\i386\Blip.wav

more...

Wednesday

run regsvr32 command for all files in folder

you can create simple bat file with one line
--regdir--
for %%f in (%1\*.ocx) do (regsvr32 /s "%%f")
--end of regdir--
then run >: regdir c:\mylibs
that might be useful if you want to run command for all files

more...

Thursday

grep how to find recursively all files with keywords from keyword file

assume that kw.txt is text file with keywords we have to find , then :
grep -irn -f ../kw.txt . *
more...

port forwarding RDP;cannot connect to localhost


symptoms:
"The client could not connect. You
are already connected to the console of this computer. A new console
session cannot be established".

Procedure:
1. Create a folder (For example c:\TSclient) on your XP box
2. Copy mstsc.exe and mstscax.dll from your XP's %systemroot%\system32
to this folder.
3. Right click mstsc.exe and go to the properties of it.
4. Select the Compatibility tab
5. Check "Run this program in compatibility mode for"
6. Select "Windows 98/ Windows Me"
7. Click on OK
8. Connect your SSH to the remote network or machine
9. Forward another port than 3389, for example 3390
10. Use the newly copied mstsc.exe to connect to 127.0.0.1:3390

more...

make ubuntu business casual

to make ubuntu business casual - make it black remove background: gsettings set org.gnome.desktop.background picture-options ...