web analytics

Synchronize subtitles with the movie in VLC player

Re-sync by small steps:

g – move subtitles forward +0.5 sec

h – move subtitles back -0.5 sec

Re-sync based on clear sentence:

Press Shift+H to mark the recognizable sentence, when you hear it

Press Shift+J to mark the subtitles for this sentence

Press Shift+K to synchronize the subtitles

If subtitles are ahead of the video, press Shift+J, then Shift+H, and Shift+K to finalize

Re-sync in menu:

Tools -> Track Synchronization -> Subtitle track synchronization

Select negative number if subtitles are ahead of the sound

Command line:

Define delay in 1/10 of the second (negative or positive)

vlc –sub-delay 100 –sub-file myfile.srt file.avi

Permanent changes:

Subtitles editor (open source)

Windows: get product key

To find the product key for Windows Vista / 7 / 8.x /10, run the following in the command line:

wmic path softwarelicensingservice get OA3xOriginalProductKey

Powershell analog:

powershell “(Get-WmiObject -query ‘select * from SoftwareLicensingService’).OA3xOriginalProductKey”

 

Windows: disable sticky keys

If some keyboard key is pressed several times in the short period of time, the accessibility window will appear.
It’s possible to disable this behaviour.

Just create the following REG-file and import it with the regedit:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys]
"Flags"="0"

Alternative: just do it from the command line:

REG ADD "HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys" /v Flags /t REG_SZ /d 0 /f

Restart after the operation could be required.

Oracle Data Modeler: unable to create Java instance

The following error was displayed during the start of Oracle SQL Developer Data Modeler (v3.3.0.734) on Windows:

Unable to create an instance of the Java Virtual Machine
Located at path: ..\..\jdk\jre\bin\client\jvm.dll

This could be fixed by editing the file datamodeler\bin\datamodeler.conf :
try to change the following line
AddVMOption -Xmx768M
to
AddVMOption -Xmx512M

and restart Data Modeler after this.

Oracle Data Modeler: change user interface language

Oracle Data Modeler in the current version (3.3.0.x) does not allow to change the user interface language in “Options” or somewhere else in the GUI.

However, it’s possible to force it to switch to some other language, using datamodeler\bin\datamodeler.conf configuration file.
The following lines should be added to the file for English:

AddVMOption -Duser.language=en
AddVMOption -Duser.country=US

Oracle: error messages for read only database

The old Oracle database (8i) was switched to the read-only mode. The following messages are shown now in alert.log:
***Warning – Executing transaction without active Undo Tablespace

It’s possible, that the error is caused by Oracle bug 3270493 (EXCESSIVE QMNX TRACE FILES WHEN PLACING STANDBY IN READ ONLY MODE). Workaround is to set aq_tm_processes parameter to 0:

ALTER SYSTEM SET aq_tm_processes=0;

AutoCAD: slow mouse reaction

Sometimes in AutoCAD the mouse hangs for some time (up to 1 seconds) for every operation.

Here are some methods to reduce these “sticking” moments.

  • If this is wireless mouse, check the batteries.  (In fact, this will work for every application, not for AutoCAD only!)
  • If the Layer Palette is used – turn it OFF (set LAYERDLGMODE to “0” to get the classic layer manager back)
  • If the “Selection Preview” is on – turn it OFF
  • If Dynamic UCS is turned on – turn it OFF
  • Set the anti-virus program to ignore AutoCAD related extensions (DWG, DWT, DCL, LSP etc)
  • Uncheck the “Check Web for Live Enablers” box  in Options->System
  • Remove unnecessary hyperlinks (or broken links)

Perl: print the name of the input file

The special variable $ARGV could be used to get the name of the input file.
It returns the name of the file or ‘-‘ if the standard input was used.

Here are some examples:

perl -nle 'END { print $ARGV }' /etc/passwd
/etc/passwd
echo test | perl -nle 'print $ARGV'
-
$ (echo test; echo test2) | perl -nle 'print $ARGV'
-
-
perl -nle 'print $ARGV if !$seen{$ARGV}++' /etc/passwd /etc/shells
/etc/passwd
/etc/shells

Unix: show tcp packets

TCP packets could be catched by tcpdump:

tcpdump -n -i any 'tcp[tcpflags] & (tcp-syn|tcp-ack) == tcp-syn and port 80'

Oracle: converting timestamp to date

Here is the method to display timestamp in the convenient format:

SELECT TO_CHAR (SYSTIMESTAMP, 'YYYY-MM-DD HH24:MI:SS') s_date
FROM DUAL;

Simple conversion of the timestamp:

SELECT CAST(SYSTIMESTAMP AS DATE) x_date FROM DUAL;