Reflog (Informationstechnische Howtos, Hinweise und Merkwürdiges)
http://cypressor.twoday.net/
Informationstechnische Howtos, Hinweise und Merkwürdiges
cypressor
cypressor
2012-02-12T18:57:42Z
en
hourly
1
2000-01-01T00:00:00Z
Reflog
http://static.twoday.net/icon.gif
http://cypressor.twoday.net/
-
Uptweak Windows XP Home Edition to XP Professional
http://cypressor.twoday.net/stories/8382364/
There are a lot of annoying limitations in Windows XP Home Edition, that prevents me from switching the main account to a non-administrator, just user account. However, <a href="http://www.computerhilfe-nachfuelltinte.at/winxp.htm">this page</a> shows a way how to set an internal switch so that most included, but disabled functions are available.
<ol>
<li>Boot with Bart PE Windows disc or any other Windows 2000 or later OS that is not the XP Home you want to modify.</li>
<li>Start the registry editor and load the file <span class="code">%windir%\System 32\Config\SYSTEM</span>.</li>
<li>Switch to the key <span class="code">HKLM\RemoteSys\ControlSet001\Control\ProductOptions</span> and delete "Personal" from the String <span class="code">Product-Suite</span>. You have to keep the empty string!</li>
<li>Reboot to your modified Windows XP Home Edition and open <span class="code">regedit</span>.</li>
<li>Open the key <span class="code">HKLM\System\CurrentControlSet\Control\Lsa</span> and set the DWORD entry <span class="code">forceguest</span> to 0.</li>
<li>Reboot your Windows.</li>
</ol>
Now, what new features does your Windows XP "Prome" reveal?
<ul>
<li>Explorer shows the tab "Security"</li>
<li>EFS encryption is enabled</li>
<li>runas has a working "savecred" switch</li>
<li>many more...</li>
</ul>
cypressor
tech
Copyright © 2010 cypressor
2010-10-09T17:14:00Z
-
HOWTO_ O2 DSL Surf & Phone-Router mit sipgate
http://cypressor.twoday.net/stories/5115440/
Der O2 DSL Surf & Phone-Router ist für die alleinige Benutzung der O2-Rufnummern vorkonfiguriert. Dabei werden die 4 zugewiesenen Rufnummern auf die SIP-Konfigurationsplätz 1 bis vier gelegt, die Verbindung zum SIPserver wird über eine zweite PPPoE-Session hergestellt. Umkonfigurieren lässt sich jedoch nichts.<br />
<br />
Allerdings gibt es eine Möglichkeit, doch noch alternative SIP-Provider wie etwa sipgate einzurichten und auch zu verwenden.<br />
<br />
Zunächst muss man sich dazu wie gewohnt auf dem Router einloggen, per default ist das durch Aufrufen des Links <a href="http://192.168.0.1/">http://192.168.0.1/</a> im Browser und Eingabe des Passworts erledigt. Anschließend kann der VoIP-Wizard unter dem URL <a href="http://192.168.0.1/wzVoIP_2.html">http://192.168.0.1/wzVoIP_2.html</a> aufgerufen werden. Die Plätze 5 bis 10 können frei vergeben werden. Sowohl für die Rufnummer als auch für den Benutzernamen ist die sipgate-User-ID einzutragen, als Server sipgate.de und bei Passwort das entsprechende Passwort einzutragen.<br />
<br />
Nun versucht der Router jedoch, die Verbindung zu sipgate über die zweite PPPoE-Session aufzubauen. Um das umzustellen, muss man sich per Telnet auf den Router einloggen:<br />
<br />
telnet 192.168.1.1<br />
Benutzername: admin<br />
Passwort: <Router-Passwort><br />
<br />
ras> voice config signal index 5<br />
ras> voice config signal setport 5 0<br />
ras> voice config signal portselectactive 5 1<br />
port select active on<br />
ras> voice config signal save 5<br />
<br />
Das war's schon.<br />
<br />
<b>UPDATE</b><br />
Mit dem Firmwareupdate <i>V3.40(AOF.8)D0 | 21.11.2011</i> wurden die Einstellungsmöglichkeiten über das Webfrontend eingeschränkt. Daher müssen nun zusätzlich diverse Serveradressen sowie Benutzername und Passwort per Telnet eingegeben werden:<br />
<br />
ras> voice config signal index 5<br />
ras> voice config signal serveraddress 5 sipgate.de<br />
ras> voice config signal registeraddress 5 sipgate.de<br />
ras> voice config signal domain 5 sipgate.de<br />
ras> voice config signal userid 5 <sipgate User-ID><br />
ras> voice config signal password 5 <SIP-Passwort><br />
ras> voice config signal save 5
cypressor
howto
Copyright © 2008 cypressor
2008-08-10T16:05:00Z
-
BATCHLIB_ Batchlib package v1.0
http://cypressor.twoday.net/stories/4821858/
<b>Download</b><br />
<a href="http://cypressor.twoday.net/files/batchlib-v1-0-zip">Batchlib package v1.0</a> (5 KB zip file)<br />
<br />
<b>What is it?</b><br />
Inspired by my <a href="http://cypressor.twoday.net/stories/4491198/">library idea</a>, I created a package containing several libraries with subroutines that I need more or less often.
<br /><br />
<b>What Libraries are contained?</b><br />
Currently, the following libraries are contained in the package:
<ul>
<li><a href="http://cypressor.twoday.net/stories/4821946/">io.cmd:</a> input and output subroutines</li>
<li><a href="http://cypressor.twoday.net/stories/4821928/">number.cmd:</a> number related subroutines</li>
<li><a href="http://cypressor.twoday.net/stories/4823354/">string.cmd:</a> string manipulation</li>
</ul>
<br />
<b>How to use the libraries?</b><br />
Place the libraries in a subdirectory named "lib" of your batch script(s). To call the subroutine <span class="code">:TRIM</span> of the <span class="code">string.cmd</span> library, use the following code:
<pre>
SET MY_STRING= A string with spaces around the text
CALL %~dps0lib\string.cmd :TRIM "%MY_STRING%"
ECHO Trimmed string is '%RESULT%'.
</pre>
<br />
<b>License</b><br />
This work is licensed under the Creative Commons <a href="http://creativecommons.org/licenses/by-nc/2.0/de/">Attribution-Noncommercial 2.0 Germany</a> (Namensnennung-Keine kommerzielle Nutzung 2.0 Deutschland).
<br /><br />
<b>History</b>
<ul>
<li>v1.0 2008-03-29 First release</li>
</ul>
cypressor
batchlib
Copyright © 2008 cypressor
2008-03-29T17:15:00Z
-
BATCHLIB_ Batchlib library string.cmd
http://cypressor.twoday.net/stories/4823354/
The batchlib library string.cmd is part of the <a href="http://cypressor.twoday.net/stories/4821858/">batchlib package</a>. It provides the following subroutines:<br />
<br />
<a href="#:STRLEN">:STRLEN</a>: Returns the string length.<br />
<a href="#:SUBSTR">:SUBSTR</a>: Extracts a substring. Works exactly the same the string substitution function %VAR:~x,y% does.<br />
<a href="#:TRIM">:TRIM</a>: Trims whitespace at beginning and end of a string.<br />
<a href="#:GET_ASCII_CHARS">:GET_ASCII_CHARS</a>: Returns a string containing all ASCII characters at their given offset.<br />
<a href="#:ASC2HEX">:ASC2HEX</a>: Converts the ASCII string to a space separated list of hex numbers.<br />
<a href="#:ASC2DEC">:ASC2DEC</a>: Converts an ASCII string to a space separated list of decimal numbers.<br />
<a href="#:HEX2ASC">:HEX2ASC</a>: Converts a list of hexadecimal numbers to an ASCII string.<br />
<a href="#:DEC2ASC">:DEC2ASC</a>: Converts a list of decimal numbers to an ASCII string.<br />
<a href="#:ASCII">:ASCII</a>: Returns the numeric (decimal) ASCII code of the character.<br />
<a href="#:CHAR">:CHAR</a>: Returns the ASCII character denoted by the decimal number.<br />
<br />
<br />
<br />
<a name=":STRLEN"><b>Integer :STRLEN String</b></a><br />
Returns the string length.<br />
<b>Parameters:</b>
<ol>
<li>string</li>
</ol>
<b>Returns:</b><br />
string length<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<br />
<a name=":SUBSTR"><b>String :SUBSTR String Integer Integer?</b></a><br />
Extracts a substring. Works exactly the same the string substitution function %VAR:~x,y% does. Provides a way for dynamically extracting substrings.<br />
<b>Parameters:</b>
<ol>
<li>string to extract substring of</li>
<li>x; 0 or greater: string offset, negative number: string offset from end</li>
<li><i>(default -0)</i> y; 0 or greater: number of characters to extract, negative number: string offset from end where to stop substring extraction</li>
</ol>
<b>Returns:</b><br />
substring<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<br />
<a name=":TRIM"><b>String :TRIM String</b></a><br />
Trims whitespace at beginning and end of a string.<br />
<b>Parameters:</b>
<ol>
<li>string to trim</li>
</ol>
<b>Returns:</b><br />
trimmed string<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<br />
<a name=":GET_ASCII_CHARS"><b>String :GET_ASCII_CHARS</b></a><br />
Returns a string containing all ASCII characters at their given offset. All (in batch) non-printable characters will be replaced by a space.<br />
<b>Returns:</b><br />
all ASCII characters<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<br />
<a name=":ASC2HEX"><b>String[] :ASC2HEX String Boolean? String?</b></a><br />
Converts the ASCII string to a space separated list of hex numbers. For example "ABC" will be converted to "41 42 43".<br />
<b>Parameters:</b>
<ol>
<li>ASCII string</li>
<li><i>(default false)</i> use 0x prefix</li>
<li><i>(default " ")</i> separator string</li>
</ol>
<b>Returns:</b><br />
list of hex numbers<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<br />
<a name=":ASC2DEC"><b>Integer[] :ASC2DEC String String?</b></a><br />
Converts an ASCII string to a space separated list of decimal numbers. For each character in the the string it's decimal ASCII index will be used. For example the string "ABC" will be converted to "65 66 67".<br />
<b>Parameters:</b>
<ol>
<li>ASCII string</li>
<li><i>(default " ")</i> list item separator string</li>
</ol>
<b>Returns:</b><br />
list of decimals<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<br />
<a name=":HEX2ASC"><b>String :HEX2ASC String[] String?</b></a><br />
Converts a list of hexadecimal numbers to an ASCII string. Automatically detects if numbers are prefixed with "0x".<br />
<b>Parameters:</b>
<ol>
<li>hexadecimal list</li>
<li><i>(default " ")</i> list item separator</li>
</ol>
<b>Returns:</b><br />
ASCII string<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<br />
<a name=":DEC2ASC"><b>String :DEC2ASC Integer[] String?</b></a><br />
Converts a list of decimal numbers to an ASCII string.<br />
<b>Parameters:</b>
<ol>
<li>decimal list</li>
<li><i>(default " ")</i> list item separator string</li>
</ol>
<b>Returns:</b><br />
ASCII string<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<br />
<a name=":ASCII"><b>Integer :ASCII String</b></a><br />
Returns the numeric (decimal) ASCII code of the character.<br />
<b>Parameters:</b>
<ol>
<li>single character</li>
</ol>
<b>Returns:</b><br />
ASCII code<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<br />
<a name=":CHAR"><b>String :CHAR Integer</b></a><br />
Returns the ASCII character denoted by the decimal number. Non-printable characters will be returned as space.<br />
<b>Parameters:</b>
<ol>
<li>ASCII offset number of character</li>
</ol>
<b>Returns:</b><br />
ASCII character<br />
<b>Since:</b> 1.0
cypressor
batchlib
Copyright © 2008 cypressor
2008-03-29T16:39:00Z
-
BATCHLIB_ Batchlib library io.cmd
http://cypressor.twoday.net/stories/4821946/
The batchlib library io.cmd is part of the <a href="http://cypressor.twoday.net/stories/4821858/">batchlib package</a>. It provides the following subroutines:<br />
<br />
<a href="#:PRINT">:PRINT</a>: Prints all arguments into one line without new line.<br />
<a href="#:PRINTLN">:PRINTLN</a>: Prints all arguments into one line with delimiting new line.<br />
<a href="#:ISDIR">:ISDIR</a>: Tests for exisiting directory.<br />
<a href="#:CREATE_TEMPFILE">:CREATE_TEMPFILE</a>: Creates an empty temporary file within the user's temp directory.<br />
<br />
<br />
<a name=":PRINT"><b>void :PRINT varargs</b></a><br />
Prints all arguments into one line without new line.<br />
<b>Parameters:</b>
<ol>
<li>variable number of arguments</li>
</ol>
<b>Since:</b> 1.0<br />
<br />
<br />
<a name=":PRINTLN"><b>void :PRINTLN varargs</b></a><br />
Prints all arguments into one line with delimiting new line.<br />
<b>Parameters:</b>
<ol>
<li>variable number of arguments</li>
</ol>
<b>Since:</b> 1.0<br />
<br />
<br />
<a name=":ISDIR"><b>Boolean :ISDIR String</b></a><br />
Tests for exisiting directory.<br />
<b>Parameters:</b>
<ol>
<li>path to directory or file</li>
</ol>
<b>Returns:</b><br />
"true" if input is an existing directory, otherwise "false"<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<a name=":CREATE_TEMPFILE"><b>String :CREATE_TEMPFILE</b></a> <br />
Creates an empty temporary file within the user's temp directory.<br />
<b>Returns:</b><br />
full path to temp file<br />
<b>Since:</b> 1.0
cypressor
batchlib
Copyright © 2008 cypressor
2008-03-28T20:39:00Z
-
BATCHLIB_ Batchlib library number.cmd
http://cypressor.twoday.net/stories/4821928/
The batchlib library number.cmd is part of the <a href="http://cypressor.twoday.net/stories/4821858/">batchlib package</a>. It provides the following subroutines:<br />
<br />
<a href="#:IS_NUMBER">:IS_NUMBER</a>: Checks if the first parameter is a number.<br />
<a href="#:NEAREST">:NEAREST</a>: Returns the nearest matching number from a sorted list of numbers.<br />
<a href="#:NEAREST_LESS">:NEAREST_LESS</a>: Returns the nearest matching number from a sorted list of numbers that is equal or less.<br />
<a href="#:NEAREST_GREATER">:NEAREST_GREATER</a>: Returns the nearest matching number from a sorted list of numbers that is equal or greater.<br />
<a href="#:DEC2HEX">:DEC2HEX</a>: Converts a decimal number to hex.<br />
<br />
<br />
<a name=":IS_NUMBER"><b>Boolean :IS_NUMBER String</b></a><br />
Checks if the first parameter is a number. That is it only contains the characters 0 to 9 and additionally the minus as the first character.<br />
<b>Parameters:</b>
<ol>
<li>string to test for number</li>
</ol>
<b>Returns:</b><br />
"true" if string is a valid number, "false" otherwise<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<a name=":NEAREST"><b>Integer :NEAREST Integer[] Integer</b></a><br />
Returns the nearest matching number from a sorted list of numbers.<br />
<b>Parameters:</b>
<ol>
<li>list of integers sorted ascending</li>
<li>number to match</li>
</ol>
<b>Returns:</b><br />
nearest matching number of list<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<a name=":NEAREST_LESS"><b>Integer :NEAREST_LESS Integer[] Integer</b></a><br />
Returns the nearest matching number from a sorted list of numbers that is equal or less. If no such number can be found, the smallest from the list will be returned.<br />
<b>Parameters:</b>
<ol>
<li>list of integers sorted ascending</li>
<li>number to match</li>
</ol>
<b>Returns:</b><br />
nearest matching number of list<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<a name=":NEAREST_GREATER"><b>Integer :NEAREST_GREATER Integer[] Integer</b></a><br />
Returns the nearest matching number from a sorted list of numbers that is equal or greater. If no such number can be found, the greatest from the list will be returned.<br />
<b>Parameters:</b>
<ol>
<li>list of integers sorted ascending</li>
<li>number to match</li>
</ol>
<b>Returns:</b><br />
nearest matching number of list<br />
<b>Since:</b> 1.0<br />
<br />
<br />
<a name=":DEC2HEX"><b>String :DEC2HEX Integer</b></a><br />
Converts a decimal number to hex. Currently only numbers 0 <= x <= 255 are supported (0x00 <= x <= 0xFF). The result will NOT be prefixed with 0x!<br />
<b>Parameters:</b>
<ol>
<li>decimal number 0 <= x <= 255</li>
</ol>
<b>Returns:</b><br />
hex representation of number<br />
<b>Since:</b> 1.0
cypressor
batchlib
Copyright © 2008 cypressor
2008-03-28T20:18:00Z
-
BATCH_ Convert decimal number to hex string
http://cypressor.twoday.net/stories/4821854/
Though hex numbers can be converted to decimals using <span class="code">SET /A MY_DECIMAL=0xFF</span>, the other way around is not natively supported in Windows batch. However, the following subroutine does this job for numbers 0 <= x <= 255 (8bit).
<pre>
:: Converts a decimal number to hex. Currently only numbers 0 <= x <= 255 are
:: supported (0x00 <= x <= 0xFF). The result will NOT be prefixed with 0x!
::
:: @PARAM Integer decimal number 0 <= x <= 255
:: @RETURN String hex representation of number
:: @SINCE 1.0
:DEC2HEX
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
SET HEX=0123456789ABCDEF
SET /A T1=%1 / 16
SET /A T2=%1 %% 16
SET RESULT=!HEX:~%T1%,1!!HEX:~%T2%,1!
ENDLOCAL & SET RESULT=%RESULT%
GOTO :EOF
</pre>
<br />
<b>Note:</b> This subroutine is part of the <a href="#asd">number.cmd</a> library contained in the <a href="http://cypressor.twoday.net/stories/4821858/">batchlib package</a> since version 1.0.
cypressor
batch
Copyright © 2008 cypressor
2008-03-28T19:49:00Z
-
BATCH_ Find virtual cygwin SCSI device for a CD-ROM drive
http://cypressor.twoday.net/stories/4821481/
I needed a command line tool for automatic extraction (ripping) of CDDA discs (CD Digital Audio). After long hours of searching the only tool that came up was <a href="http://akrip.sourceforge.net/">AKRip</a>. However, AKRip is a library (DLL) and only a demo application providing a command line interface exists. As the link on the AKRip homepage is dead, I downloaded it from <a href="http://www.sonicspot.com/akrip/akrip.html">Sonic Spot</a>. It's not working though, and always fails with an exception when trying to list the drives available in my system.<br />
<br />
So I finally fell back to the ported linux application <a href="http://www.cdda2wav.de/">cdda2wav</a>, running under windows using <a href="http://www.cygwin.com/">cygwin</a>. Unfortunately cdda2wav accesses CD-ROM drives using (emulated and virtual) SCSI devices in the form of <span class="code">Bus,ID,Lun</span>, e.g. 0,3,0. Here is what <span class="code">cdda2wav.exe -scanbus</span> tells me what I have:
<pre>
scsibus0:
0,0,0 0) *
0,1,0 1) *
0,2,0 2) 'HL-DT-ST' 'CD-RW GCE-8320B ' '1.04' Removable CD-ROM
0,3,0 3) 'LG (KOR)' 'DVD-ROM DRD8120B' '1e05' Removable CD-ROM
0,4,0 4) *
0,5,0 5) *
0,6,0 6) *
0,7,0 7) HOST ADAPTOR
scsibus1:
1,0,0 100) 'KB9081Z ' 'YHQ276H ' '1.0 ' Removable CD-ROM
1,1,0 101) *
1,2,0 102) *
1,3,0 103) *
1,4,0 104) *
1,5,0 105) *
1,6,0 106) *
1,7,0 107) HOST ADAPTOR
</pre>
Note that running cdda2wav with and without Administrator priviledges might return different results! Now I need to find a way to map these virtual SCSI devices to the drive letters Windows uses. It should look like this:
<pre>
X: -> 1,0,0
Y: -> 0,3,0
Z: -> 0,2,0
</pre>
I figured out a solution in three varying ways that should work on Windows 2000 systems and newer (XP, 2003). I will start to explain these with the easyest, most simple yet most specific solution, and fall back step by step to the most complicated but compatible one.<br />
<br /><br />
<h4>WMIC</h4>
WMIC, the Windows Management Instrumentation Console, is a native tool since Windows XP Professional and 2003 Server. Although I only need it to query information, it needs Administrator priviledges. Okay, what information does WMIC provide for my CD-ROM drives? Using the command <span class="code">WMIC.EXE Path Win32_CDROMDrive GET * /VALUE /format:list</span> tells me this (output shortened to one drive only):
<pre>
Availability=3
Capabilities={3,7}
CapabilityDescriptions=
Caption=HL-DT-ST CD-RW GCE-8320B
CompressionMethod=
ConfigManagerErrorCode=0
ConfigManagerUserConfig=FALSE
CreationClassName=Win32_CDROMDrive
DefaultBlockSize=
Description=CD-ROM Drive
DeviceID=IDE\CDROMHL-DT-ST_CD-RW_GCE-8320B________________1.04____\4&2EA472A
E&0&1.0.0
<b>Drive=Z:</b>
DriveIntegrity=
ErrorCleared=
ErrorDescription=
ErrorMethodology=
FileSystemFlags=
FileSystemFlagsEx=
Id=Z:
InstallDate=
LastErrorCode=
Manufacturer=(Standard CD-ROM drives)
MaxBlockSize=
MaximumComponentLength=
MaxMediaSize=
MediaLoaded=FALSE
MediaType=CD-ROM
MfrAssignedRevisionLevel=
MinBlockSize=
<b>Name=HL-DT-ST CD-RW GCE-8320B</b>
NeedsCleaning=
NumberOfMediaSupported=
PNPDeviceID=IDE\CDROMHL-DT-ST_CD-RW_GCE-8320B________________1.04____\4&2EA4
72AE&0&1.0.0
PowerManagementCapabilities=
PowerManagementSupported=
RevisionLevel=
<b>SCSIBus=0</b>
<b>SCSILogicalUnit=0</b>
SCSIPort=0
<b>SCSITargetId=2</b>
Size=
Status=OK
StatusInfo=
SystemCreationClassName=Win32_ComputerSystem
SystemName=CYPRESSOR
TransferRate=
VolumeName=
VolumeSerialNumber=
</pre>
I marked the important information. There seems to be some information in SCSI writing, namely <span class="code">SCSIBus</span>, <span class="code">SCSITargetId</span> and <span class="code">SCSILogicalUnit</span>. Using these I get 0,2,0 for drive Z: which is exactly what I wanted (see beginning). But how bad - looking at Drive X:, WMIC says 0,0,0 which is obviously wrong. <abbr title="as far as I know">AFAIK</abbr> only happy guessing could lead to the correct Bus number, but I don't like guessing in automated scripts. That's why I marked the drive name, too, because it seems to be similar to the name cdda2wav told me. Let's compare drive names. First, extract the information from cdda2wav's output to return the device for a specified name:
<pre>
:: Returns the cygwin SCSI CD-ROM device Bus,ID,Lun (e.g. 1,3,0) for the
:: provided drive name (e.g. "HL-DT-ST CD-RW GCE-8320B").
::
:: @PARAM String drive name
:: @RETURN String cygwin SCSI device
:: @REQUIRES tools\cdda2wav.exe
:: @REQUIRES <a href="#LINK_TO_LIB_STRING">lib\string.cmd</a>
:GET_SCSI_CDROM_DEVICE_FOR_NAME
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
FOR /F "usebackq tokens=1,3,5,7 delims=' " %%A IN (`^
%~dps0tools\cdda2wav.exe -scanbus 2^>^&1 ^| FIND "Removable CD-ROM"`) DO (
:: A=device, B=vendor, C=model, D=version
CALL <a href="#LINK_TO_LIB_STRING">%~dps0lib\string.cmd</a> :TRIM "%%B"
SET VENDOR=!RESULT!
CALL <a href="#LINK_TO_LIB_STRING">%~dps0lib\string.cmd</a> :TRIM "%%C"
SET MODEL=!RESULT!
SET NAME=!VENDOR! !MODEL!
IF "!NAME!" == "%~1" (
ENDLOCAL & SET RESULT=%%A
GOTO :EOF
)
)
ECHO ERROR: No CD-ROM device by the name '%~1' could be found. >&2
ENDLOCAL & SET RESULT=
GOTO :EOF
</pre>
Now, I can query the drive name for a specific drive letter using the command <span class="code">WMIC.EXE Path Win32_CDROMDrive WHERE Drive='X:' GET Name /format:csv >NUL</span>. SCSI drive name's will be postfixed with "SCSI CdRom Device", so that string has to be manually removed from the name. Here is all what it takes to get the device for a specific drive letter:
<pre>
:: Returns the cygwin SCSI device Bus,ID,Lun (e.g. 1,3,0) for the provided
:: Windows drive letter (e.g. D:) using WMIC.EXE.
:: NOTE: WMIC is natively available since Windows XP/2003 and requires
:: Administrator priviledges.
::
:: @INTERNAL use :GET_SCSI_CDROM_DEVICE_FOR_DRIVE instead
:: @PARAM String Windows drive letter including colon
:: @RETURN String cygwin SCSI device
:GET_SCSI_CDROM_DEVICE_FOR_DRIVE_BY_WMIC
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
FOR /F "usebackq skip=2 tokens=2 delims=," %%N IN (`^
WMIC.EXE Path Win32_CDROMDrive ^
WHERE Drive^='%~1' GET Name /format:csv 2^>NUL`) DO (
SET DRIVENAME=%%N
SET DRIVENAME=!DRIVENAME: SCSI CdRom Device=!
)
IF DEFINED DRIVENAME (
CALL :GET_SCSI_CDROM_DEVICE_FOR_NAME "!DRIVENAME!"
) ELSE (
ECHO ERROR: No CD-ROM drive could be found for drive letter '%~1'. >&2
SET RESULT=
)
ENDLOCAL & SET RESULT=%RESULT%
GOTO :EOF
</pre><br />
<br />
<br /><br />
<h4>REG</h4>
Unfortunately WMIC need Administrator priviledges as stated above. So I thought about another method for retrieving data about CD-ROM drives. All the information that WMIC returns is available in the registry.<br />
First, the used drive letters can be found in HKLM\SYSTEM\MountedDevices, named like <span class="code">\DosDevices\X:</span>. The value is a 16bit little-endian hex string, storing something like <span class="code">\??\SCSI#CdRom&Ven_KB9081Z&Prod_YHQ276H&Rev_1.0#5&3a3a60d9&0&000#{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}</span>. Replace the # through backslashes, remove the first 4 characters and the last element <span class="code">\{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}</span> and you get the registry path below <span class="code">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\</span>. And here I find the <span class="code">FriendlyName</span> of our drive, in that case <span class="code">KB9081Z YHQ276H SCSI CdRom Device</span>. From here on it's the very same as with WMIC.<br />
<br />
Three simple steps to be taken:
<ol>
<li>Query the drive letter from registry, convert the hex value to an ASCII string, and fix the registry path.</li>
<li>Open the registry path and check if device's Class is <span class="code">CDROM</span>.</li>
<li>Query the FriendlyName.</li>
</ol>
<pre>
:: Returns the cygwin SCSI CD-ROM device Bus,ID,Lun (e.g. 1,3,0) for the
:: provided Windows drive letter (e.g. D:) using REG.EXE.
:: NOTE: REG.EXE is natively available since Windows XP/2003.
::
:: @INTERNAL use :GET_SCSI_CDROM_DEVICE_FOR_DRIVE instead
:: @PARAM String Windows drive letter including colon
:: @RETURN String cygwin SCSI device
:: @REQUIRES <a href="#LINK_TO_LIB_STRING">lib\string.cmd</a>
:GET_SCSI_CDROM_DEVICE_FOR_DRIVE_BY_REG
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
FOR /F "usebackq tokens=3 delims= " %%B IN (`^
REG.EXE QUERY "HKLM\SYSTEM\MountedDevices" ^| ^
FINDSTR /R "\\DosDevices\\%~1.*REG_BINARY.*5C00"`) DO (
SET LINE=%%B
:: remove high bytes (reduce 16bit hex to 8bit hex numbers)
SET LINE=!LINE:000=0,!
SET LINE=!LINE:00=,!
:: extract registry path
CALL <a href="#LINK_TO_LIB_STRING">%~dps0lib\string.cmd</a> :HEX2ASC "!LINE:~0,-1!" ","
SET REGPATH=!RESULT:~4,-39!
SET REGPATH=HKLM\SYSTEM\CurrentControlSet\Enum\!REGPATH:#=\!
)
SET CDROM_DEVICE=
IF DEFINED REGPATH (
FOR /F "tokens=1,2* delims= " %%C IN ('^
REG.EXE QUERY "!REGPATH!" ^| ^
FINDSTR /R "Class[^^A-Za-z0-9_-].*REG_SZ"') DO (
IF "%%C" == "Class" IF "%%E" == "CDROM" (
FOR /F "tokens=2* delims= " %%M IN ('^
REG.EXE QUERY "!REGPATH!" ^| FINDSTR /R "FriendlyName.*REG_SZ"') DO (
SET DRIVENAME=%%N
CALL :GET_SCSI_CDROM_DEVICE_FOR_NAME "!DRIVENAME: SCSI CdRom Device=!"
SET CDROM_DEVICE=!RESULT!
)
)
)
)
IF NOT DEFINED CDROM_DEVICE (
ECHO ERROR: No CD-ROM drive could be found for drive letter '%~1'. >&2
)
ENDLOCAL & SET RESULT=%CDROM_DEVICE%
GOTO :EOF
</pre>
Instead of converting little endian to big endian on the hex string, I simply remove all high bytes - which are always 00. Additionally I insert a comma as a delimiter as needed by the <a href="#NOT YET CREATED">:HEX2ASC</a> method. At first, I walked through the string, copying every first and second character, inserting a comma and simply omitting every third and fourth character. As this method was veeeery slow, I switched to the quick and dirty solution. Nevertheless, here is the good one:
<pre>
:: remove high bytes and replace by comma
SET LINE_FIXED=
CALL <a href="#LINK_TO_LIB_STRING">%~dps0lib\string.cmd</a> :STRLEN "!LINE!"
SET /A MAX=!RESULT! - 1
FOR /L %%I IN (0,2,!MAX!) DO (
SET /A MOD=%%I%%4
IF !MOD! == 0 (
CALL <a href="#LINK_TO_LIB_STRING">%~dps0lib\string.cmd</a> :SUBSTR "!LINE!" %%I 2
SET LINE_FIXED=!LINE_FIXED!!RESULT!,
)
)
</pre><br />
<br />
<br /><br />
<h4>REGEDIT</h4>
The last solution that should also work on Windows 2000 systems is much more complex. It works basically the same way as the REG.EXE one, however I have to export the registry keys to a file and work on that one. The problem is that long keys are spanned over multiple lines, indicated by a backslash at the end of the line. So I have to scan the file until finding my drive, and then starting concatenating the string until the last backslash. However I am using a little performance tweak here: Instead of checking each read line for my drive letter, I first retrieve the line where it is using FINDSTR, then start scanning until that line and begin concatenation. Testing each line was way to slow...
<pre>
:: Returns the cygwin SCSI CD-ROM device Bus,ID,Lun (e.g. 1,3,0) for the
:: provided Windows drive letter (e.g. D:) using REGEDIT.EXE.
::
:: @INTERNAL use :GET_SCSI_CDROM_DEVICE_FOR_DRIVE instead
:: @PARAM String Windows drive letter including colon
:: @RETURN String cygwin SCSI device
:: @REQUIRES <a href="#LINK_TO_LIB_IO">lib\io.cmd</a>
:: @REQUIRES <a href="#LINK_TO_LIB_STRING">lib\string.cmd</a>
:GET_SCSI_CDROM_DEVICE_FOR_DRIVE_BY_REGEDIT
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
:: export registry key HKLM\SYSTEM\MountedDevices to a file
CALL <a href="#LINK_TO_LIB_IO">%~dps0lib\io.cmd</a> :CREATE_TEMPFILE
SET REG_FILENAME=!RESULT!
REGEDIT.EXE /E "!REG_FILENAME!" "HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices"
:: parse registry file excluding empty lines
SET HEX=
FOR /F "usebackq tokens=1 delims=:" %%I IN (`^
TYPE "!REG_FILENAME!" ^| FINDSTR /R /V "^^$" ^| ^
FINDSTR /R /N "^^.\\\\DosDevices\\\\%~1.=hex:5c,00"`) DO (
:: %%I is the line number where the searched key starts
SET CURRENTLINE=
SET LINESTR=
SET LINENR=0
:: as a key might span over multiple lines, concat these lines
FOR /F "usebackq tokens=1,2* delims=: " %%M IN (`TYPE data.reg ^| FINDSTR /R /V "^^$"`) DO (
SET /A LINENR=!LINENR! + 1
:: found the key, check for spanning (line ending with backslash "\")
IF !LINENR! == %%I (
SET CURRENTLINE=%%O
IF "!CURRENTLINE:~-1!" == "\" (
SET LINESTR="!CURRENTLINE:~0,-1!"
) ELSE (
SET HEX=!CURRENTLINE!
GOTO :GET_SCSI_CDROM_DEVICE_FOR_DRIVE_BY_REGEDIT_GET_NAME
)
) ELSE IF DEFINED LINESTR (
SET CURRENTLINE=%%M
IF "!CURRENTLINE:~-1!" == "\" (
SET LINESTR="!LINESTR:~1,-1!!CURRENTLINE:~0,-1!"
) ELSE (
SET HEX=!LINESTR:~1,-1!!CURRENTLINE!
SET LINESTR=
GOTO :GET_SCSI_CDROM_DEVICE_FOR_DRIVE_BY_REGEDIT_GET_NAME
)
)
)
)
:GET_SCSI_CDROM_DEVICE_FOR_DRIVE_BY_REGEDIT_GET_NAME
SET CDROM_DEVICE=
IF DEFINED HEX (
:: quick fix: convert 16bit hex to 8bit by removing high byte
SET HEX=!HEX:,00=!
CALL <a href="#LINK_TO_LIB_STRING">%~dps0lib\string.cmd</a> :HEX2ASC "!HEX!" ","
SET REGPATH=!RESULT:~4,-39!
SET REGPATH=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\!REGPATH:#=\!
REGEDIT.EXE /E "!REG_FILENAME!" "!REGPATH!"
FOR /F %%X IN ('TYPE "!REG_FILENAME!" ^| FINDSTR /R "^^.Class.=.CDROM"') DO (
FOR /F "tokens=2 delims==" %%N IN ('TYPE "!REG_FILENAME!" ^| FINDSTR /R "^^.FriendlyName.=."') DO (
SET DRIVENAME=%%N
CALL :GET_SCSI_CDROM_DEVICE_FOR_NAME !DRIVENAME: SCSI CdRom Device=!
SET CDROM_DEVICE=!RESULT!
)
)
)
IF NOT DEFINED CDROM_DEVICE (
ECHO ERROR: No CD-ROM drive could be found for drive letter '%~1'. >&2
)
DEL /F "!REG_FILENAME!"
ENDLOCAL & SET RESULT=%CDROM_DEVICE%
GOTO :EOF
</pre><br />
<br />
<br />
Finally, here is my main method that checks what solution is available and selectes that one:
<pre>
:: Returns the cygwin SCSI CD-ROM device Bus,ID,Lun (e.g. 1,3,0) for the
:: provided Windows drive letter (e.g. D:).
::
:: @PARAM String Windows drive letter including colon
:: @RETURN String cygwin SCSI device
:GET_SCSI_CDROM_DEVICE_FOR_DRIVE
:: Provides 3 internal methods to detect the device with auto-fallback.
:: 1) WMIC.EXE (since Windows XP/2003, requires Administrator priviledges)
:: 2) Registry through REG.EXE (since Windows XP/2003)
:: 3) Registry through REGEDIT.EXE (since Windows NT)
WMIC.EXE ALIAS /? >NUL 2>&1 || GOTO :GET_SCSI_CDROM_DEVICE_FOR_DRIVE_REG_LABEL
FOR /F "skip=2 tokens=2 delims=:" %%T IN ('WMIC.EXE ALIAS /? 2^>^&1') DO (
IF "%%T" == "Win32 Error" GOTO :GET_SCSI_CDROM_DEVICE_FOR_DRIVE_REG_LABEL
GOTO :GET_SCSI_CDROM_DEVICE_FOR_DRIVE_WMIC_LABEL
)
:GET_SCSI_CDROM_DEVICE_FOR_DRIVE_WMIC_LABEL
CALL :GET_SCSI_CDROM_DEVICE_FOR_DRIVE_BY_WMIC "%~1"
GOTO :EOF
:GET_SCSI_CDROM_DEVICE_FOR_DRIVE_REG_LABEL
REG.EXE EXPORT /? >NUL 2>&1 || GOTO :GET_SCSI_CDROM_DEVICE_FOR_DRIVE_REGEDIT_LABEL
CALL :GET_SCSI_CDROM_DEVICE_FOR_DRIVE_BY_REG "%~1"
GOTO :EOF
:GET_SCSI_CDROM_DEVICE_FOR_DRIVE_REGEDIT_LABEL
CALL :GET_SCSI_CDROM_DEVICE_FOR_DRIVE_BY_REGEDIT "%~1"
GOTO :EOF
</pre><br />
Copy that stuff into one file, copy my <a href="#TO_IMPLEMENT">libraries</a> to lib\io.cmd, lib\string.cmd and lib\number.cmd and add tools\cdda2wav.exe including the tools\cygwin1.dll. Now by typing <span class="code">CALL :GET_SCSI_CDROM_DEVICE_FOR_DRIVE "X:"</span> you will receive the SCSI device in the variable <span class="code">%RESULT%</span>.
cypressor
batch
Copyright © 2008 cypressor
2008-03-28T16:55:00Z
-
VIDEO_ Demux MPEG2 recording
http://cypressor.twoday.net/stories/4671008/
Demuxing MPEG2 is quite simple. You can either use Project X or <a href="http://www.offeryn.de/dv.htm#pvas">PVAStrumento</a> which I prefer.<br />
<br />
Download PVAStrumento and install it. Start the GUI, open your recording (TS, MPG, what so ever) and click <span class="code">demux</span>. Give a base filename for output, and check all three options saying something with "Cuttermaran" so you can easily cut your recording afterwards. Now click <span class="code">start</span> and you're done.
cypressor
video
Copyright © 2008 cypressor
2008-02-03T11:35:00Z
-
VIDEO_ Cut DVB-T recordings
http://cypressor.twoday.net/stories/4670990/
Cutting DVB-T recordings is simple. If the recording is a MPEG2 transport stream (file ending <span class="code">.ts</span>), you have to either convert or demux it.<br />
If your just have MPEG2 Audio and Video, you can convert the transport stream to a MPEG2 program stream (PS, file ending <span class="code">.mpg</span>) as described in <a href="http://cypressor.twoday.net/stories/4670936/">this article</a> and then cut it using TerraTec Cut!. That's it, you don't have to read any further.<br />
If your recording contains AC3 audio streams you want to keep, you have to demux it to MPEG2 Video (<span class="code">.m2v</span>), MPEG2 Audio (<span class="code">.mp2</span> or <span class="code">.mpa</span>) and AC3 Audio (<span class="code">.ac3</span>). See <a href="http://cypressor.twoday.net/stories/4671008/">this article</a> and then continue reading.<br />
<br />
Open your video file(s) with <a href="http://www.cuttermaran.de/">Cuttermaran</a>. Perhaps you have to open additional audio files if they are not automatically recognized. To use inter-frame cutting you have to configure a MPEG2-Encoder. I am using the free <a href="http://quenc.bitburners.com/">QuEnc</a>, which you have to configure under <span class="code">Actions</span> > <span class="code">Settings...</span> > <span class="code">Encoding</span>.<br />
Navigate to the begin of the film and use the I-, P- and B-Controls to finetune. Click <span class="code">cut in</span>. Navigate to the end, finetune and click <span class="code">cut out</span> and then <span class="code">+</span> to add the range to the cut list.<br />
When done, click <span class="code">Cut audio and video</span> to open the output dialogue. Specify the output path and change to the <span class="code">Mux</span> tab. Choose any muxer you want and select the desired format. MPG or "Generic MPEG2" creates a standard MPEG2 file to play on your computer. Or create a DVD/VOB which you can directly burn, author or shrink. Start the process with <span class="code">Cut & Close</span>.
cypressor
video
Copyright © 2008 cypressor
2008-02-03T11:25:00Z
-
VIDEO_ Archive DVB-T recordings
http://cypressor.twoday.net/stories/4670967/
Here are some choices how I do this depending on what I am trying to achieve.<br />
<br />
<a href="#simple">1. Simple cut and storing as MPEG2 file</a><br />
<a href="#cut">2. Exact cut and storing as MPEG2 file</a><br />
<a href="#author">3. Exact cut and authoring a DVD</a><br />
<br />
<br />
<a name="simple"></a>
<h4>1. Simple cut and storing as MPEG2 file</h4>
I am assuming the record is a MPEG2 program stream (PS), the file has the ending <span class="code">.mpg</span>. If you have recorded a MPEG2 transport stream (TS), where the file ending is <span class="code">.ts</span>, read the article <a href="http://cypressor.twoday.net/stories/4670936/">how to convert it to a program stream</a> first.<br />
Now, open it with the freeware <a href="http://tvde.terratec.net/index.php?name=EZCMS&menu=3&page_id=3">TerraTec Cut!</a>, which is included in the Home Cinema installation. Let it scan the file, mark all ranges to be included in the cut file and cut it. Finished!<br />
<br />
<br />
<a name="cut"></a>
<h4>2. Exact cut and storing as MPEG2 file</h4>
Download and install <a href="http://www.offeryn.de/dv.htm#pvas">PVAStrumento</a>. Start it, select the recording (either <span class="code">.mpg</span> or <span class="code">.ts</span>) and click <span class="code">demux</span>. Enable all three checkboxes for Cuttermaran and start the demux.<br />
<br />
Download and install <a href="http://www.cuttermaran.de/">Cuttermaran</a> and the free MPEG2 encoder <a href="http://quenc.bitburners.com/">QuEnc</a>. Start Cuttermaran, open the settings (<span class="code">Actions</span> > <span class="code">Settings...</span>) and change to the <span class="code">Encode</span> tab. Enable encoding, select QuEnc and configure the path to the <span class="code">QuEnc.exe</span>.<br />
<br />
Open the files (yes, there might be multiple files!) you want to cut in Cuttermaran, each in it's own Video tab. Add additional audio files if cuttermaran did not autoload them.<br />
Select the ranges (in order!) you want to have in the result cut file using the timeline below and the I-, P-, B-Buttons at the left side. Add the ranges.<br />
When done, select <span class="code">Cut audio and video</span>, configure the output path and start the cut.<br />
<br />
Download and install the ImagoMPEG-Muxer. Select input video and audio files, the desired output format and path and start muxing. Additionally you can configure Cuttermaran to use ImagoMPEG-Muxer to auto-mux after cutting.<br />
<br />
<br />
<br />
<a name="author"></a>
<h4>3. Exact cut and authoring a DVD</h4>
First cut your record using the <a href="#cut">steps above</a>, but do not multiplex the resulting files at the end.<br />
<br />
Download and install <a href="http://download.videohelp.com/gfd/index.html">GUI for dvdauthor</a>. Start it, browse in <span class="code">Source</span> to the video file and drag it onto the empty menu. Add the audio tracks and set the according language. Create chapters using the <span class="code">Visual Chapter Editor</span>. Additionally, you can create chapters in Cuttermaran before cut, advise Cuttermaran to create a text file for dvdauthor in the cut dialogue and open that file here.<br />
<br />
Right click onto the newly create text button to edit it. Doubleclick it to go into the title menu where you can set the chapters. Mark a chapter in the chapter list, and click <span class="code">Insert</span> > <span class="code">Chapter Button</span> and then click into the preview window. Right click to edit. If you were using the Visual Chapter Editor to create chapters, you were able to create images or short clips for each chapter. These will be automatically inserted, too.<br />
<br />
Now configure the output. Open the Settings (no matter which) and configure output directory and check <span class="code">Create ISO</span> and tick <span class="code">ImgBurn</span>. Switch to the <span class="code">Permanent</span> tab and enter a volume name for the DVD to be created. Close the settings.<br />
<br />
Create your DVD image by pressing <span class="code">Create DVD</span>. Now you have an ISO image that you can burn to a CD or DVD.
cypressor
video
Copyright © 2008 cypressor
2008-02-03T11:09:00Z
-
VIDEO_ Convert TS to MPG
http://cypressor.twoday.net/stories/4670936/
I have some DVB-T recordings made as a MPEG2 transport stream (file ending .ts). Unfortunately, the latest version of TerraTec Cut! cannot handle these. It just loads them, scans until the end of the first video (in most cases there are multiple videos contained in the stream) and then won't do anything more. So I was looking for a way to convert these to the "standard" MPEG2 program stream (PS) with file ending .mpg which Cut! handles without any problem.<br />
<br />
Download and unpack <a href="http://www.offeryn.de/dv.htm#pvas">PVAStrumento</a>. Start the GUI, open the .ts-file and click <span class="code">make ps</span>. Name an output file and and press <span class="code">start</span>.<br />
<br />
Now you will have a single mpg-file for each of the videos contained. Just delete the files you do not need, e.g. adverts, previews etc and you are finished.
cypressor
video
Copyright © 2008 cypressor
2008-02-03T10:53:00Z
-
HOWTO_ Backup your IMAP mail accounts
http://cypressor.twoday.net/stories/4646820/
I just thought about what might happen if accidentally a crash or <a href="http://www.heise.de/newsticker/meldung/102434/">whatever</a> will cause all my hundreds of personal E-Mail including logins, subscriptions, personal notes, etc to disappear? After years of fine service I prefer to have a backup of all this stuff. This is how I achieved it.<br />
<h4>Backup user</h4>
First step is to create a user for the sole purpose of backing up files. You do not need it, however it is advised to use such one which has generally limited and some special permissions regarding reading passwords etc.<br />
Go to the <span class="code">Control Panel</span>, click <span class="code">User Accounts</span>, and create a new account (I named it <span class="code">backup</span>) with <span class="code">Limited</span> permissions (that is it belongs solely to the group <span class="code">Users</span>). One could add it to the group <span class="code">Backup Operators</span>, however as I am not running any system backup, the limited rights of the <span class="code">Users</span> group should be fine.<br />
Remember to set a secure password of at least 10 characters, including capital and small letters, numbers and special characters (,:_+-).<br />
<br />
<br />
<b>Note:</b> Perform the following steps as an Administrator unless advised otherwise!
<h4>Install IMAPSize</h4>
Using the freeware <a href="http://www.broobles.com/imapsize/">IMAPSize</a> (version as of now is 0.3.6), your backup is just some clicks away. Download and install/unzip to a directory of your choice, presumably something like <span class="code">C:\Program Files\IMAPSize</span>.<br />
Change to that directory and create a new text file. Rename it to <span class="code">imapsize.log</span>. Mark that file and the configuration <span class="code">imapsize.xml</span>, right click, open <span class="code">Properties</span> and change to tab <span class="code">Security</span>. Now remove <b>all</b> users and groups from the list. Some permissions might be inherited, so you have to uncheck the <span class="code">Inherit</span> option in the <span class="code">Advanced</span> dialogue. Now add the backup user created in the first step, and additionally allow him to <span class="code">Modify</span> and <span class="code">Write</span> these two files.<br />
<br />
<h4>Create backup directory</h4>
Now create a backup directory. It should be always accessible when performing backups (more on that later), so when using automation, only internal hard drives, internal mounted flash memory or an always-on file server comes to my mind. For security reasons the file system should allow you to set explicit permissions. I am using the local hard drive which is formatted with NTFS.<br />
Let's say you choose <span class="code">D:\backup\mail</span>. Create that directory, right click <span class="code">backup</span>, open the <span class="code">Properties</span> dialogue, switch to the <span class="code">Security</span> tab, remove all users and groups from the list and add the backup user. Allow him <span class="code">Full control</span>.<br />
<br />
<h4>Setup IMAPSize</h4>
Start IMAPSize as the backup user. You can either login as that user or start IMAPSize in his context via StartMenu > <span class="code">Run..</span> using the following command:<br />
<div class="code">
runas /USER:backup "C:\Program Files\IMAPSize\imapsize.exe"<br />
</div>
Cancel the dialogue for creating a new account. Open <span class="code">View</span> > <span class="code">Options...</span>, change to tab <span class="code">Misc</span> and set the <span class="code">Root Backup Directory</span> to the backup directory you created in the preceding step (e.g. <span class="code">D:\backup\mail</span>).<br />
<br />
Switch to tab <span class="code">Accounts</span> and create one for each E-Mail account you want to backup. You can choose whatever name you want to, however using the full E-Mail address is the best choice for easy overview. Choose no spam handler and save your E-Mail password (check <span class="code">Save it</span>). The passwords will be stored in plain text in the configuration file <span class="code">imapsize.xml</span>, and that's why it is only accessible by the backup user!<br />
<br />
<h4>Initial backup</h4>
To allow automatic and incremental backups, each account has to be manually backed up a first time. Perform the following steps for each account.
<ol>
<li>Select the account from the drop down list in the upper left.</li>
<li>Click <span class="code">Account backup</span> (CTRL+B).</li>
<li>Check all folders you want to back up.</li>
<li>Press <span class="code">Save Folders</span> to use that setting for future backups.</li>
<li>Press <span class="code">Backup</span> to start the process. You will be notified by a dialogue when completed.</li>
</ol><br />
<h4>Regular incremental backup</h4>
IMAPSize allows a simple command line usage. I wrote the following batch script for automation and placed it as <span class="code">autobackup.cmd</span> in the IMAPSize program folder. Remove all permissions and add the user <span class="code">backup</span> as stated above.<br />
<div class="code">
@ECHO OFF<br />
:: CONFIGURATION<br />
:: IMAPSize account names to backup<br />
SET IMAP_ACCOUNT_NAME_1=mail@domain.com<br />
SET IMAP_ACCOUNT_NAME_2=user@gmx.net<br />
SET IMAP_ACCOUNT_NAME_3=...<br />
...<br />
<br />
ECHO Starting IMAP account backup...<br />
FOR /F "usebackq delims== tokens=2" %%A IN (`SET IMAP_ACCOUNT_NAME_`) DO ( <br />
ECHO * Backing up account %%A... <br />
"%~dp0imapsize.exe" -backup -account=%%A<br />
)<br />
ECHO Backup finished.<br />
ECHO Full backup log available in file %~dp0imapsize.log.<br />
</div>
Open the task scheduler to setup a regular backup. Open it via <span class="code">Start > Programs > Accessories > System Tools > Scheduled Tasks</span>. Double click <span class="code">Add Scheduled Task</span>, click <span class="code">Next</span>, <span class="code">Browse</span> to the script file <span class="code">autobackup.cmd</span> and select it. Now you can select a name like "Daily IMAP backup" and check <span class="code">Daily</span>. Click <span class="code">Next</span> and choose a time (should be a time when you your PC is online nearly every day). Click <span class="code">Next</span> and set <span class="code">backup</span> as the user. Type in twice the according password. Click <span class="code">Next</span> and then <span class="code">Finish</span>.<br />
<br />
<h4>Increase security</h4>
To increase security, you also have to change to owner of the files you changed the permissions of. First, you have to add the backup user to the <span class="code">Administrators</span> group. Open <span class="code">User Accounts</span> in the <span class="code">Control Panel</span>, click <span class="code">Change an account</span>, select the user <span class="code">backup</span>, click <span class="code">change the account type</span>, and switch it to <span class="code">Computer Administrator</span>.<br />
Now log in with backup, browse to the program directory of IMAPSize, select the files <span class="code">imapsize.xml</span>, <span class="code">imapsize.log</span> and <span class="code">autobackup.cmd</span>, right click and open <span class="code">Properties</span>, change to <span class="code">Security</span> tab, click the <span class="code">Advanced</span> button, change to the <span class="code">Owner</span> tab, select the backup user and apply changes.<br />
Do the same with the backup folder, but additionally check <span class="code">Replace owner on subcontainers and objects</span>.<br />
<br />
Logout and login with administrator, and switch the backup user back to the <span class="code">Limited</span> account. Now you're done!
cypressor
howto
Copyright © 2008 cypressor
2008-01-25T12:28:00Z
-
HOWTO_ Ringtones for Grandstream BT-101
http://cypressor.twoday.net/stories/4588321/
Grandstream's VoIP-Phone BT-101 allows up to 192 kBytes of custom ringtones, divided into a maximum of three 64 kByte blocks. As it is using the ULAW compression, one block can be up to 8 seconds long, which allows the following ringtone combination:
<ul>
<li>3 ringtones, each up 8 seconds long</li>
<li>1 ringtone with up to 8 sec, 1 ringtone with up to 16 sec</li>
<li>1 ringtone with up to 24 seconds</li>
</ul>
<b>Generation</b><br />
Grandstream supports two <a href="http://www.grandstream.com/ringtone.html">ringtone generation tools</a>, one <a href="http://sox.sourceforge.net">sox</a> based for Linux and Solaris, and another one for Windows. I first tried the Windows tool, but you have to provide 16 bit, 8kHz mono WAV files, otherwise it fails with error. Additionally, sound quality was more than poor.<br />
So I fell back to the Linux tool, for which I first had to install the distribution specific sox (<span class="code">apt-get install sox</span> under Debian). Then I created a 16-bit, 44kHz stereo ringtone with 3,5 seconds, copied the file to the tool directory and typed the following command:<br />
<div class="code">
./sox.linux ring.wav ring.ring<br />
</div><br />
<br />
<b>Upload to phone</b><br />
At boottime the phone connects to the configured TFTP update server and looks for updates - including ringtones. The custom ringtones have to be named <span class="code">ring1.bin</span>, <span class="code">ring2.bin</span> and <span class="code">ring3.bin</span>. It first tries to download <span class="code">ring1.bin</span> and installs it if found. Depending on that ringtone's length, it will continue looking for tone 2 and 3.<br />
I renamed <span class="code">ring.ring</span> to <span class="code">ring1.bin</span> and copied it into an empty directory (I could also use <span class="code">ring3.bin</span>, but I wanted to overwrite the first ringtone, the other one's were alright). I configured my TFTP-Server <a href="http://kin.klever.net/pumpkin/">Pumpkin</a> to use that directory, started it, reconfigured the BT-101 to use my local PC as TFTP-Server and rebooted the phone. The ringtone was immediately installed and I could selected it using the phone's menu.
cypressor
howto
Copyright © 2008 cypressor
2008-01-06T17:49:00Z
-
TECH_ Sambashares with UTF-8
http://cypressor.twoday.net/stories/4587755/
Debian running with Samba 3 and Windows XP client.<br />
<br />
Configure Debian to use UTF-8 locale by typing <span class="code">dpkg-reconfigure locale</span> and select <span class="code">de_DE.UTF-8</span> and enable it as default. Set <span class="code">LC_CTYPE</span> in the file <span class="code">/etc/environment</span> to <span class="code">de_DE.UTF-8</span>. Relogin to enable the new settings.<br />
<br />
Configure Samba by setting <span class="code">unix encoding</span> to <span class="code">UTF-8</span> in the file <span class="code">/etc/samba/smb.conf</span> and restart the daemon by typing <span class="code">/etc/init.d/samba restart</span>.<br />
<br />
If puTTy won't display umlauts or other non-ASCII characters, enable UTF-8 in <span class="code">Window -> Translation</span>.<br />
<br />
You still have files named in another encoding? Use the tool <span class="code">convmv</span> to convert for example ISO-8859-15:<br />
<div class="code">
convmv -f ISO-8859-15 -t UTF-8 -r --notest /dir/to/convert/recursively > renamed_files.txt<br />
</div>
cypressor
tech
Copyright © 2008 cypressor
2008-01-06T13:59:00Z
find
Search this site:
q
http://cypressor.twoday.net/search