Stoyanov

  • Home

Speedup Your Work by using Keyboard More and Mouse Less

July 5, 2018 By stoyanov

Useful Shortcut:

  • Start + M: Minimizes all open windows
  • Start + Shift + M: Maximizes All Windows
  • Start + E: Runs Windows Explorer
  • Start + R: Open the RUN Dialog Box
  • Start + F: Open the Search Results Dialog box
  • Start + CTRL + F: Opens the Search Results-Computer dialog Box (if the computer is connected to a network)
  • Start + Pause (Break): Opens the System Properties Dialog Box

Windows System Key Combinations: 

  • F1: Help
  • CTRL + ESC: Open Start menu
  • ALT + TAB: Switch between open programs
  • ALT + F4: Quit program
  • SHIFT + DELETE: Delete item permanently

Windows Program Key Combinations: 

  • CTRL + C: Copy
  • CTRL + X: Cut
  • CTRL + V: Paste
  • CTRL + Z: Undo
  • CTRL + B: Bold
  • CTRL + U: Underline
  • CTRL + I: Italic

Mouse Click/Keyboard Modifier Combinations for Shell Objects: 

  • SHIFT + right click: Displays a shortcut menu containing alternative commands
  • SHIFT + double click: Runs the alternate default command (the second item on the menu)
  • ALT + double click: Displays properties
  • SHIFT + DELETE: Deletes an item immediately without placing it in the Recycle Bin

General Keyboard-Only Commands: 

  • F1: Starts Windows Help
  • F10: Activates menu bar options
  • SHIFT + F10: Opens a shortcut menu for the selected item (this is the same as right-clicking an object
  • CTRL + ESC: Opens the Start menu (use the ARROW keys to select an item)
  • CTRL + ESC or ESC: Selects the Start button (press TAB to select the taskbar, or press SHIFT+F10 for a context menu)
  • ALT + DOWN ARROW: Opens a drop-down list box
  • ALT + TAB: Switch to another running program (hold down the ALT key and then press the TAB key to view the task-switching window)
  • SHIFT: Press and hold down the SHIFT key while you insert a CD-ROM to bypass the automatic-run feature
  • ALT + SPACE: Displays the main window’s System menu (from the System menu, you can restore, move, resize, minimize, maximize, or close the window)
  • ALT +- (ALT + hyphen): Displays the Multiple Document Interface (MDI)child window’s System menu (from the MDI child window’s System menu, you can restore, move, resize, minimize, maximize, or close the child window)
  • CTRL + TAB: Switch to the next child window of a Multiple Document Interface (MDI) program
  • ALT + underlined letter in menu: Opens the menu
  • ALT + F4: Closes the current window
  • CTRL + F4: Closes the current Multiple Document Interface (MDI) window
  • ALT + F6: Switch between multiple windows in the same program (for example, when the Notepad Find dialog box is displayed
  • ALT + F6: switches between the Find dialog box and the main Notepad window)

Shell Objects and General Folder/Windows Explorer Shortcuts For a selected object: 

  • F2: Rename object
  • F3: Find all files
  • CTRL + X: Cut
  • CTRL + C: Copy
  • CTRL + V: Paste
  • SHIFT + DELETE: Delete selection immediately, without moving the item to the Recycle Bin
  • ALT + ENTER: Open the properties for the selected object
  • To Copy a File: Press and hold down the CTRL key while you drag the file to another folder.
  • To Create a Shortcut: Press and hold down CTRL+SHIFT while you drag a file to the desktop or a folder.

General Folder/Shortcut Control: 

  • F4: Selects the Go To A Different Folder box and moves down the entries in the box (if the toolbar is active in Windows Explorer)
  • F5: Refreshes the current window.
  • F6: Moves among panes in Windows Explorer
  • CTRL + G: Opens the Go To Folder tool (in Windows 95 Windows Explorer only)
  • CTRL + Z: Undo the last command
  • CTRL + A: Select all the items in the current window
  • BACKSPACE: Switch to the parent folder
  • SHIFT + click + Close button: For folders, close the current folder plus all parent folders

Windows Explorer Tree Control:

  • Numeric Keypad *: Expands everything under the current selection
  • Numeric Keypad +: Expands the current selection
  • Numeric Keypad -: Collapses the current selection.
  • RIGHT ARROW: Expands the current selection if it is not expanded, otherwise goes to the first child
  • LEFT ARROW: Collapses the current selection if it is expanded, otherwise goes to the parent

Properties Control: 

  • CTRL + TAB/CTRL + SHIFT + TAB: Move through the property tabs

Accessibility Shortcuts: 

  • Press SHIFT five times: Toggles StickyKeys on and off
  • Press down and hold the right SHIFT key for eight seconds: Toggles FilterKeys on and off
  • Press down and hold the NUM LOCK key for five seconds: Toggles ToggleKeys on and off
  • Left ALT + left SHIFT+NUM LOCK: Toggles MouseKeys on and off
  • Left ALT + left SHIFT+PRINT SCREEN: Toggles high contrast on and off

Microsoft Natural Keyboard Keys: 

  • Windows Logo: Start menu
  • Windows Logo + R: Run dialog box
  • Windows Logo + M: Minimize all
  • SHIFT + Windows Logo+M: Undo minimize all
  • Windows Logo + F1: Help
  • Windows Logo + E: Windows Explorer
  • Windows Logo + F: Find files or folders
  • Windows Logo + D: Minimizes all open windows and displays the desktop
  • CTRL + Windows Logo + F: Find computer
  • CTRL + Windows Logo + TAB: Moves focus from Start, to the Quick Launch toolbar, to the system tray (use RIGHT ARROW or LEFT ARROW to move focus to items on the Quick Launch toolbar and the system tray)
  • Windows Logo + TAB: Cycle through taskbar buttons
  • Windows Logo + Break: System Properties dialog box
  • Application key: Displays a shortcut menu for the selected item

Microsoft Natural Keyboard with IntelliType Software Installed: 

  • Windows Logo + L: Log off Windows
  • Windows Logo + P: Starts Print Manager
  • Windows Logo + C: Opens Control Panel
  • Windows Logo + V: Starts Clipboard
  • Windows Logo + K: Opens Keyboard Properties dialog box
  • Windows Logo + I: Opens Mouse Properties dialog box
  • Windows Logo + A: Starts Accessibility Options (if installed)
  • Windows Logo + SPACEBAR: Displays the list of Microsoft IntelliType shortcut keys
  • Windows Logo + S: Toggles CAPS LOCK on and off

Dialog Box Keyboard Commands:

  • TAB: Move to the next control in the dialog box
  • SHIFT + TAB: Move to the previous control in the dialog box
  • SPACEBAR: If the current control is a button, this clicks the button. If the current control is a checkbox, this toggles the checkbox. If the current control is an option, this selects the option.
  • ENTER: Equivalent to clicking the selected button (the button with the outline)
  • ESC: Equivalent to clicking the Cancel button
  • ALT + underlined letter in dialog box item: Move to the corresponding item

Filed Under: Home

Blocking Unwanted Advertisements and Malware with a HOSTS File

June 6, 2018 By stoyanov

A fellow Microsoft MVP has assembled a large list (> 6MB) of domain names/IP addresses mainly used to serve advertisements, tracking cookies, and sometimes even malware.

You can find the full instructions at http://www.mvps.org/winhelp2002/hosts.htm. I personally have been using this list for almost two years now (it is frequently updated).

Because I have IIS set-up on my main machine I decided to change the redirect IP address to 0.0.0.0 instead of 127.0.0.1, so that IIS is not “bothered” with the failed requests.

P.S. This list also blocks the YouTube commercials, which is a nice touch!

Previous readers of my blog might already know that I am a big fan of ImageX, a tool that has been supplied by Microsoft in the Windows Automated Installation Kit since the release of Windows Vista.

A quick introduction

ImageX is a command-line tool that enables original equipment manufacturers (OEMs) and corporations to capture, to modify, and to apply file-based disk images (.wim files) for rapid deployment.

WIM files can capture disk or directory snapshots in such a that identical files are only stored once in the internal structure of the image. In addition to this, compression can be used to minimize the size of the final data.

These are some of the reasons I have been using ImageX to take full “snapshots” of all of my code, private files, etc. from time to time, for backup and archiving purposes. When needed, I can extract different revisions of the same file, or restore a whole image/snapshot in case of disk damage or data loss.

The graph on the left visualizes the changes to my projects backup file spread across 16 months. The last image’s actual data weighs at 64GB, while the whole WIM is 59GB—and it contains all file changes, directory structures, even information that has long been deleted from my working copy.

Requirements

  • The scripts package. Download and extract to a folder of your choice.
  • ImageX.
    1. Download and install the Windows Automated Installation Kit (WAIK).
    2. Copy the ImageX binaries (both amd64 and x86 folders), located in \Program files\Windows AIK\Tools\ to the backup\app\imagex folder.

The Scripts:

Capturing, mounting, or unmounting images requires administrative privileges, so you can either right-click the scripts and select Run as Administrator or create a shortcut to the script and change its Compatibility options to always require elevation.

The script defaults are below. These can change (in all four scripts, where used) as needed:

  • C:\projects The folder to back up
  • projects.wim (created and updated in the root backup folder) The Windows image to be used
  • projects.YYMMDD-HHMM The image name template; it is dynamically updated based on the time when the capturing process is started
  • mount (folder; located in the root folder) The mounted folder to use

Mounting Windows images is only possible after installing the driver by right-clicking wimmount.inf (in the respective ImageX folder), and selecting Install.

Using the solution

Testing and using the backup solution is quite easy. After preparing the ImageX binaries and editing the script defaults as needed:

  1. Simply run the capture.cmd script to take the initial snapshot of the target directory.
  2. To verify that the new image is processed, you can run the info.cmd script. The command-line output will show information about all images, including the new one.
  3. Repeat when a backup is needed.

Of course, the process can be fully automated, by just referencing the capture.cmd in the scheduling program of your choice.

Filed Under: Home Tagged With: Malware with a HOSTS File, Unwanted Advertisements

Resizing forms while keeping aspect ratio

June 4, 2018 By stoyanov

Resizing a form while keeping aspect ratio is useful in many cases, like video playback or vector graphics. This way, the window can be resized while retaining the original ratio and avoiding the use of letterboxing or pillarboxing.

What’s needed is for the window function to be overridden (WndProc) and pre-process the target window rectangle used by the WM_SIZING message.

The new destination rectangle is calculated by taking into account the resizing handle and the window chrome size (title height, border width, etc.).

protected override void WndProc(ref Message m)
{
if (m.Msg == WM_SIZING)
{
RECT rc = (RECT)Marshal.PtrToStructure(m.LParam, typeof(RECT));

int w = rc.Right – rc.Left – chromeWidth;
int h = rc.Bottom – rc.Top – chromeHeight;

switch (m.WParam.ToInt32()) // Resize handle
{

// …

}

Marshal.StructureToPtr(rc, m.LParam, true);
}

base.WndProc(ref m);
}

You can find the full C# source code here, including a test program. The aspect ratio and initial client size is set to 16:9.

Why lossless?

Lossless audio is used on various media, including studio masters, CD, DVD-Audio (via MLP) and Blu-ray (via Dolby TrueHD, which is technically a rebrand of and an extension to MLP, and DTS-HD Master Audio). All of these, when decoded, will result in a pulse-code modulated signal identical to the source, unlike the popular MP3 format. MP3 performs a quality-file size trade-off by discarding or reducing frequencies less audible to human hearing.

PCM by design uses a constant bitrate, which is proportional to the sample rate, bit depth and number of audio channels, which results in very large file sizes with the increasing of each parameter, and/or duration of the audio track.

Solutions such as FLAC, TrueHD and DTS-HD MA are used to losslessly compress the source audio so that the rest of the medium (for example, a Blu-ray disc) can be used for more audio tracks, higher-bandwidth video or extras.

Out of the aforementioned, only FLAC is free to use—both TrueHD and DTS-HD MA encoders and decoders have to be licensed.

The first part of the series will explore the processing of uncompressed audio data with the FLAC API in C#. In case you prefer to use Visual Basic .NET, you can use this online converter.

Anatomy of a WAVE file

In order to process a digital audio signal, we have to know three key parameters:

  • The frequency, at which the signal was sampled. Usual sample rates are 44,100 Hz; 48,000 Hz, 96,000 Hz and rarely 192,000 Hz.
  • The “depth” of each sample, measured in bits. The FLAC encoder supports up to 24 bits. Our C# WAVE reader will support 16 and 24 bits of audio data.
  • The number of channels, which the recording consists of. This is usually mono, stereo (CD), 5.1 (DVD-Audio, Blu-ray) or 7.1 (Blu-ray).

The most common container for PCM audio data is the WAVE file format. As noted above, PCM has a constant bitrate of

SampleRate * BitDepth * Channels,

which makes it very easy to predict the size of each block of audio samples—a single second of audio data would be Bitrate / 8 bytes (8 bits in a byte)—e.g. 176.4KB for a second of CD-quality audio.

We can create the initialization method of the WavReader class by starting with an input Stream object. We have to ensure that there is enough available data for the wave format header, and check that the file is indeed a RIFF/WAVE file to avoid unnecessary reading and processing.

uRiffHeader = reader.ReadInt32();
uRiffHeaderSize = reader.ReadInt32();
uWaveHeader = reader.ReadInt32();

if (uRiffHeader != 0×46464952 /* RIFF */ ||
uWaveHeader != 0×45564157 /* WAVE */)
throw new Exception(”Invalid WAVE header!”);

Right after the RIFF chunk there can be a number of JUNK (padding) chunks, which we can skip and data and fmt chunks, whose data we need.

// Read all WAVE chunks
while (reader.BaseStream.Position < reader.BaseStream.Length)
{
int type = reader.ReadInt32();
int size = reader.ReadInt32();

long last = reader.BaseStream.Position;

switch (type)
{
case 0×61746164: /* data */
uDataHeader = type;
nTotalAudioBytes = size;
break;

case 0×20746d66: /* fmt */
uFmtHeader = type;
uFmtHeaderSize = size;

format.wFormatTag = reader.ReadInt16();
format.nChannels = reader.ReadInt16();
format.nSamplesPerSec = reader.ReadInt32();
format.nAvgBytesPerSec = reader.ReadInt32();
format.nBlockAlign = reader.ReadInt16();
format.wBitsPerSample = reader.ReadInt16();
format.cbSize = reader.ReadInt16();
break;
}

if (uDataHeader == 0) // Do not skip the ‘data’ chunk size
reader.BaseStream.Position = last + size;
else
break;
}

Our WavReader class only supports 16 and 24-bit PCM samples, so we have to ensure that format format.wFormatTag is 1 (PCM) and format.wBitsPerSample ple is either 16 or 24. These limitations can be further removed by implementing sample rate conversion on-the-fly.

After all, headers are read, nTotalAudioBytes will contain the total count of audio data bytes in the WAVE file. To determine the duration of the audio file, we can simply divide it by the block size (Bitrate / 8 bytes).

The input stream will now be at the start of the audio samples. Every 16th or 24th bit (respectively, 2nd or 3rd byte) will mark the beginning of each sample. All audio samples are interleaved so the stream consists of:

channel 0, sample 0

channel 1, sample 0

channel n, sample 0

channel 0, sample 1

Now that we have reached the audio samples, we can start feeding them to FLAC.

Filed Under: Home Tagged With: Resizing forms, while keeping aspect ratio

How the Active Directory – Data Store Really Works (Inside NTDS.dit) – Part 1

June 2, 2018 By stoyanov

Directory data store: You might as I have asked yourself many times – What is inside NTDS.dit? (Most experienced Active Directory admins know that NTDS.dit is the database and the physical on-disk store that Active Directory uses to store information – most of you have probably got in touch with NTDS.dit during backup and restore scenarios)

Long story in a short version – I wasn’t satisfied not knowing – neither was I after being reading the following article:
(That I actually think isn’t that bad – but is also probably the most detailed public available information on the subject)
[1] http://technet.microsoft.com/en-us/library/cc772829(WS.10).aspx

So I decided with a very good friend of mine Christoffer Andersson (long-time Microsoft MVP in AD) to go ahead and build a tool that could read NTDS.dit and decode its internals, and then we started a journey that has given us invaluable knowledge at this part of Active Directory, this is the first article in a series of articles that will describe what’s really inside NTDS.dit and how Active Directory works on the database layer.

The illustration below has been presented in various documentations since Active Directory was initially released over 10 years ago; a similar illustration is also available in (However after this research project it’s actually turning out to be inaccurate in some aspects – in the way the DRA/REPL communicates with the DBLayer) [1]

Table 1: DSA Components (Simplified for the DBLayer)

Component

Description

Ntdsa.dll – Directory System Agent The DSA, which runs as Ntdsa.dll on each domain controller, provides the interfaces through which directory clients and other directory servers gain access to the directory database (the DBLayer). In addition, the DSA enforces directory semantics, maintains the schema, guarantees object identity, and enforces data types on attributes.
Esent.dll – Extensible Storage Engine (ESE) APIs The Extensible Storage Engine (ESE) is an advanced indexed and sequential access method (ISAM) storage technology. ESE enables applications to store and retrieve data from tables using indexed or sequential cursor navigation. It supports denormalized schemas including wide tables with numerous sparse columns, multi-valued columns, and sparse and rich indexes. It enables applications to enjoy a consistent data state using transacted data update and retrieval.

ESE was formerly known as Joint Engine Technology (JET) Blue, The DBLayer uses the ESE APIs documented here: http://msdn.microsoft.com/en-us/library/windows/desktop/gg269259(v=exchg.10).aspx

NTDS.dit The on physical-disk file that represents the ESE/JetBlue database that holds the information store for the given DSA/Active Directory Domain Controller.

Data Store Physical Structure / Inside NTDS.dit – Tables

Finally we can start looking into the content/internal structure of NTDS.dit – but first let’s take a look on what has been revealed before, the illustration below is from [1] and is accurate as far as outside the white box that represents the tables within the database, the tables do exist (Except for * “sd_table” on Windows 2000 DSAs) – but there are more tables that aren’t mentioned in this example.

So it’s about time to reveal the real table structure of an NTDS. dit database file – It’s time to use the tool we produced to first discover this:

Table 2: NTDS.DIT – Tables

Table

Description

Minimum DSA Version

Data table Contains all objects and phantoms [2.1] represented as rows (1 object/phantom = 1 row in the table) from any instanced naming context (NC) held as either writable or read-only by the Directory System Agent (DSA) hosting the database and where columns represent every [2:3] attribute present in the schema except linked attributes [2:2]

[2.1]: phantoms are references to object’s hosted outside the given database (NTDS.DIT) and the given Directory System Agent (DSA)

[2:2] Post-Windows Server 2003 the attribute “ntSecurityDescriptor” is stored in the “sd_table” rather than in the “datatable”

[2:3] Some columns doesn’t reflect attributes and are columns pre-defined in the NTDS.dit template database generated by Microsoft (those are needed for internal states to the DSA)

Windows 2000 Server

Note: Windows Server 2008 R2 added a column to support the “is-Recycled” state

Hidden table Contains one row but several columns that defines the state of the database as well the [2:2] DNT (reference) of the NTDSA-Settings object that represents this DSA (used for finding config information specific to this domain controller.)

[2:4] The concept of DNTs (Distinguished Name Tags)

Windows 2000 Server
Note: Windows Server 2003 Introduced additional state columns such as backupexpiration_col
Link_table Contains link-pair references (DNT, DNT), the link base (link id >> 1) and possibly a binary blob (In case of DN-binary, DN-string syntax) Windows 2000 Server

Note: Windows Server 2008 R2 added a column to support deactivated links for recycle-bin

Sd_table Contains single-instance-stored SDs (Security Descriptors) that pre-Windows Server 2003 was stored in the ntSecurityDescriptor attribute in the “data table” – those are now instead referenced to the SDs in the “sd_table” that is, if more than one object has exactly the same security defined (Security Descriptor) both objects are referenced to the same row in the “sd_table”, hence the single-instance-storage and reducing the size needed to store Security Descriptors. Windows Server 2003.
Sdpropcounttable Used by the Security Descriptor Propagation Demon (SDProp) responsible for Security Descriptor inheritance down the tree, within the local database
Sdproptable Used by the Security Descriptor Propagation Demon (SDProp) responsible for Security Descriptor inheritance down the tree, within the local database Windows 2000 Server
Quota_rebuild_progress_table Contains temporary information during quota tracking rebuild, for the Active Directory quota feature introduced in Windows Server 2003 – this allows the demon to keep track of processed objects. Windows Server 2003
Quota_table Contains quota tracking information, for the Active Directory quota feature introduced in Windows Server 2003, quota tracking is peer naming context (NC) and for a given security principal identified by its SID. Windows Server 2003
MSysObjects ESE Internals – out of scope for this article N/A
MSysObjectsShadow ESE Internals – out of scope for this article N/A
MSysUnicodeFixupVer2 ESE Internals – out of scope for this article N/A

In the next article – we will take a deep-dive into the content and the structure of the “data table” also known as the object-store.

Filed Under: Home

The 7 Best Android Apps to Watch TV

May 30, 2018 By stoyanov

The series and TV show have revitalized an industry that many had predicted would die with the rise of the internet. And it is this same boom that has made it possible to access the best of the world TV from mobile phones.

Now we show you some of the best applications to watch TV and DTT from the comfort of your favorite place, always with your Android phone.

Best Android Apps to Watch TV

Watch TV:

Watch TV is an application that will allow us to access more than 100 online TV channels with the most varied programming. Just navigate through the different categories and find the channel of your choice among movies, music, cartoons, news or sports.

For the correct execution of the application the device needs to have installed Adobe Flash Player and soon it will be replaced by HTML5 to achieve an improvement. Watch TV has an extremely simple graphical interface that will be very easy to use by any Android user.

TDT Android TV:

  • This application is designed for Spanish users, but it will be a delight for those who like Spanish TV, from national to regional channels.
  • With TDT Android TV you will be able to see live and free all the TV of Spain with a minimum consumption of internet. The app works on devices with Android 4 or higher and is very small and fast.

Nube TV Spain:

  • Another app designed for Spaniards. With this application, you can watch TV from phones and tablets with Android version equal to or greater than 4 and you can access the channels in full screen without the need for plugins or external applications.
  • Another interesting fact about this app is that apart from the TV channels it has radio, podcast and press stations.

TV Guide – ES:

  • TV Guide is an application that offers a list of more than 240 regional, national and international television channels and more than 50 radio stations. The app also has an Internet Radio Player for stations in Spain.
  • With this application, you can organize your favorites using Drag n Drop and share the programming with your friend’s thanks to their social options.
  • You can also define alarms to notify you of the beginning of a specific program, in a close link with Google Calendar.
  • You can do a search of programs and series by different categories. The application has a good integration with IMDb and Filmaffinity so you can also enjoy the best movies.

SPB TV:

  • SPB TV is a solution for TV over IP optimized for mobile devices. The app offers a large number of channels in several languages with easy-to-use functions and settings.
  • The application has a careful interface with very intuitive options. With it you can access searches by categories and favorites and the schedules of different channels.
  • Added support for Chromecast and support for Miracast and WiDi with the latest version of the app.

RTVE:

  • The RTVE application will allow you access to TVE and RNE live and according to your interests, you will be able to find all the news, series, programs and sports on your Tablet at all times.
  • With RTVE you will be able to directly access the channels of Televisión Española and Radio Nacional de España to follow the programs, series and news of La1;Teledeporte and the Canal 24h.
  • Live broadcasts need Adobe Flash Player installed on the device for proper operation.
  • You can access the different programs by Channels or Categories. It is worth noting that 90% of the broadcast of La 1 and Teledeporte will be available although it may suffer some interruptions due to audiovisual rights restrictions.

Sport TV:

I want to finish this selection with an application dedicated exclusively to sports television news. Sport TV is an app to watch streaming live sports channels and also contains sports news and live scores of Football, Basketball, Handball, Volleyball and Tennis.

The application has a simple and easy to use interface for sports lovers.

At this time, each user uses a small multimedia station where they can access their favorite television spots when they are traveling or away from home, but it should always be noted that these applications consume a large amount of data because they transfer TV signals that are relatively heavy, that’s why it’s good to control the use of these applications so as not to end up with the hired data service so quickly.

Filed Under: Home Tagged With: apps to watch tv shows free, Best Android Apps to Watch TV, best free live tv app for android

Recent Posts

  • Speedup Your Work by using Keyboard More and Mouse Less
  • Blocking Unwanted Advertisements and Malware with a HOSTS File
  • Resizing forms while keeping aspect ratio
  • How the Active Directory – Data Store Really Works (Inside NTDS.dit) – Part 1
  • The 7 Best Android Apps to Watch TV

Copyright © 2019 · stoyanov