Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

2016-08-23

2016-04-04

ReversingStringsUsingCSharp

Our Logic in CSharp (C#):

string input = "DS tech blog";

string result = string.Join(" ", input
                      .Split(' ')
                      .Select(x => new String(x.Reverse().ToArray())));

Console.WriteLine(result);

Remember to include the below using statements:

using System;
using System.Linq; 


How-to-reverse-each-word-in-a-string-using-c#

Explanation for the above code:

Split the input string using a single space as the separator.
  • Split() method for returning a string array that contains each word of the input string.
  • Select method for constructing a new string array, by reversing each character in each word.
  • Join method for converting the string array into a string.

2015-04-14

MSSQL_Refresh-ListTablePKFKColumn

SELECT
PKeyTab.TableName, PKeyTab.PKName, FKeyTab.FKName, PKeyTab.ColumnName
FROM
(
SELECT
TableName, PKName, ColumnName
FROM
(
SELECT
OBJECT_NAME(parent_object_id) AS PKTableName,
OBJECT_NAME(OBJECT_ID) AS PKName
FROM
sys.objects
WHERE
type_desc
IN ('PRIMARY_KEY_CONSTRAINT')
) AS PKTab
LEFT OUTER JOIN
(
SELECT
Table_Name AS TableName,
Constraint_Name AS ConstraintName,
Column_Name AS ColumnName
FROM
INFORMATION_SCHEMA.KEY_COLUMN_USAGE
) As AllTab
ON ( PKTab.PKTableName = AllTab.TableName
AND
PKTab.PKName = AllTab.ConstraintName)
) AS PKeyTab
LEFT OUTER JOIN
(
SELECT
TableName, FKName, ColumnName
FROM
(
SELECT
OBJECT_NAME(parent_object_id) AS FKTableName,
OBJECT_NAME(OBJECT_ID) AS FKName
FROM
sys.objects
WHERE
type_desc
IN ('FOREIGN_KEY_CONSTRAINT')
) AS FKTab
LEFT OUTER JOIN
(
SELECT
Table_Name AS TableName,
Constraint_Name AS ConstraintName,
Column_Name AS ColumnName
FROM
INFORMATION_SCHEMA.KEY_COLUMN_USAGE
) As AllTab
ON ( FKTab.FKTableName = AllTab.TableName
AND
FKTab.FKName = AllTab.ConstraintName)
) AS FKeyTab
ON (PKeyTab.TableName = FKeyTab.TableName AND
PKeyTab.ColumnName = PKeyTab.ColumnName )
ORDER BY PKeyTab.TableName, PkeyTab.PKName

2014-11-07

WindowsEnvironmentVariables

Windows Environment Variables

SYSTEM
SystemDrive=C:
SystemRoot=C:\WINDOWS
APPS
AppsDrive=C:
AppsRoot=C:\Apps
HOME
HOMEDRIVE=C:
HOMEPATH=\Users\root
HOMEROOT=C:\Users
DATA
DataDrive=C:
DataRoot=C:\DATA
SHARE
ShareDrive=C:
ShareRoot=C:\SHARE
OPT
OptDrive=C:
OptRoot=C:\OPT

2014-01-09

Unshelve shelveset from another branch

First install Visual Studio Team Foundation Server 2012 Update 2 Power Tools.msi.

Second, browse in command prompt to the correct path.

The shelve's name is "SHELVENAME:USERPROFILE".

Use the command:
>tfpt unshelve "GA Devrun v1.4;XT18194" /migrate /source:$/CNCorporateWeb/Releases/2.9.0/Code /target:$/CNCorporateWeb/Releases/2.9.1/Code

A pop-up window will appear:

Click Unshelve

Click Auto-merge All




2014-01-07

Windows Tool List for Developers & Power Users

Hi,

I found this elegant list of Windows Tools that might be useful.
I use a lot of them but not all, whether been a developer or a power user, I am sure that you will find some goodies in this link (Thanks to Scott Hansel man):

2011-11-08

Microsoft SQL Server Migration Assistant

SQL Server Migration Assistant (SSMA)

The SSMA blog annouces the new version 5.3.

MySQL (SSMA for MySQL Client)

The SSMA for MySQL client consists of the program files that perform the following tasks:
  • Connect to a MySQL database.
  • Connect to an instance of SQL Server or SQL Azure.
  • Convert the MySQL database objects to the SQL Server or SQL Azure objects.
  • Load the objects into SQL Server or SQL Azure.
  • Migrate data to SQL Server or SQL Azure.

Prerequisites

SSMA for MySQL is designed to work with MySQL 4.1 or later versions and all editions of SQL Server 2005, SQL Server 2008, SQL Server “Denali” and SQL Azure.
Before you install SSMA, make sure that the computer meets the following requirements:
  • Windows XP SP2 or later versions, or Windows Server 2003 SP1 or later versions.
  • WinZip, or a similar utility, to extract files from a Zip file.
  • Microsoft Windows Installer 3.1 or a later version.
  • The Microsoft .NET Framework version 2.0 or a later version. The .NET Framework version 2.0 is available on the SQL Server product media. You can also obtain it from the .NET Framework Developer Center
  • MySQL ODBC 5.1 Driver and connectivity to the MySQL databases that you want to migrate. You can install the MySQL from the MySQL Web site
  • Connectivity to the instance of SQL Server / SQL Azure where you will be migrating database objects and data
  • In case of SQL Azure projects, Connectivity to the instance of SQL Azure where you will be migrating database objects and data.
  • 1 GB RAM recommended.

Installing SSMA for MySQL Client

SSMA is a Web download. To download the latest version, see the SQL Server Migration Tools product page
After you download the latest version, you must extract the installation files before you can install SSMA.
To install the SSMA client
  1. Extract all files from the SSMA compressed file
    If you are using WinZip, depending on the version that you have, you can either double-click the file, or right-click the file and select Extract All or Open in WinZip. Follow the instructions in the WinZip user interface to extract the files. If you are using another extraction utility, follow the directions for that utility.
  2. Double-click SSMA for MySQL n.Install.exe, where n is the build number.
  3. On the Welcome page, click Next.
    If you do not have the prerequisites installed, a message will appear indicating that you must first install the required components. Make sure that you have installed all the prerequisites before running the installation program again.
  4. Read the End User License Agreement. If you agree, select I accept the terms in the license agreement, and then click Next.
  5. Read the Usage Report Settings page, select or clear the feature reporting box, and then click Next.
  6. On the Choose Setup Type page, click Typical.
  7. Click Install.
Important
  1. SSMA for MySQL v5.1 product can be installed side by side (SxS) with older versions of SSMA Product (versions prior to SSMA for MySQL v5.0. SSMA for MySQL v5.0 has to be uninstalled before installing SSMA for MySQL v5.1).
  2. You can install the SSMA for MySQL v5.1 product successfully even though if there are any earlier versions of product already installed (SSMA for MySQL 2005 v4.2 or earlier/SSMA for MySQL 2008 v4.2 or earlier).
  3. Each of these SxS products can be uninstalled separately and are independent of each other.

The default installation location is C:\Program Files\Microsoft SQL Server Migration Assistant for MySQL.
On 64-bit Windows machine the product is installed in C:\Microsoft SQL Server Migration Assistant for MySQL.

Licensing SSMA

To use SSMA, you must download a registration key. To help you with the registration process, a License Key Required dialog box opens the first time that you start the SSMA program. Use the following instructions to download a license key and associate the key with SSMA.
To license SSMA
  1. Click Start, point to All Programs, point to Microsoft SQL Server Migration Assistant for MySQL, and then select Microsoft SQL Server Migration Assistant for MySQL.
  2. In the License Management dialog box, click the license registration page link.
  3. On the Sign In Web page, enter your Windows Live ID user name and password, and click Sign In.
    A Windows Live ID is a Hotmail e-mail address, MSN e-mail address, or Microsoft Passport account. If you do not have one of these accounts, you will have to create a new account. To create a new account, click the Sign up now button.
  4. On the SQL Server Migration Assistant for MySQL License Registration Web page, fill in at least the required fields, which are marked with a red asterisk, and then click Finish.
  5. In the File Download dialog box, click Save.
  6. In the Save As dialog box, locate the folder that is shown in the License Management dialog box, and then click Save.
    The default location is C:\Documents and Settings\user name\Application Data\Microsoft SQL Server Migration Assistant\MySQL.
  7. In the License Management dialog box, click Refresh License.

      2011-05-02

      About SFU Microsoft Windows Services for UNIX 3.5

      You can download and install it from their site.

      Subsystem for Unix-based Applications and Services for Unix (SFU/ SUA/ Interix Community)

      You can download and install it from their site.

      SUA 5.2 x64 (Windows 2003R2 x64)

      SUA 6.0 x64 (Windows Vista/2008 x64)

      SUA 6.1 x64 (Windows 7/2008R2 x64)


      Debian port

      2011-04-29

      About EnableSuToRoot registry key for SUA

      User Account Control is enabled by default. When User Account Control is enabled, any application or task that impersonates another user who is a member of the Administrators group (by using the su, cron, or login utilities, setuid, any of the setuid or exec_asuser family of calls, as examples) always runs in the security context of a standard user account.
      Note
      When an application impersonates a standard user, it will have the complete security context of a standard user. For more information about standard users, see the Microsoft Web site topic "Developer Best Practices and Guidelines for Applications in a Least Privileged Environment," Introduction section (http://go.microsoft.com/fwlink/?LinkId=70243).
      With default settings, an application cannot impersonate the root user. You can control this behavior by modifying the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SUA\EnableSuToRoot.



      How to modify the EnableSuToRoot registry key



      Important
      The Administrator account is disabled by default in Windows 7 and Windows Server 2008 R2 to help protect computers and data from access by unauthorized or malicious users, and it must be enabled for users to impersonate the root user or Administrator. Because the Administrator account must first be enabled to change the setting of the EnableSuToRoot registry key, the procedure to complete this task immediately follows. You must be a member of the Administrators group on the local computer to complete the following procedure.

      To enable the Administrator account

      1. Click Start, right-click Computer, and then click Manage.
      2. In the hierarchy pane of the Computer Management snap-in, open Local Users and Groups.
      3. Select Users.
      4. In the results pane, right-click Administrator, and then click Properties.
      5. Clear the check box for the Account is disabled option.
      6. Click OK.
      7. Close the Properties window, and then close the Computer Management snap-in.
      Perform the following steps to change the setting of the EnableSuToRoot registry key after you install Subsystem for UNIX-based Applications.

      To change the setting of the EnableSuToRoot registry key

      1. Click Start, click in the Start Search text box, and type regedit to open Registry Editor.
      2. In the hierarchy pane, open HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SUA.
      3. In the results pane, double-click EnableSuToRoot.
      4. In the Value data box, enter 0 to disallow impersonation of the root user, or 1 to allow it.
        The default setting is 0.
      5. Click OK.
      6. Close Registry Editor; if prompted, save your changes.

      When the value of this key is set to 0 (the default setting), impersonation of the root user is disallowed. When the value is set to 1, impersonation of the root user is allowed. When an application impersonates the root user or Administrator account, the application has the administrative security context of the root (Administrator) user.

      Setuid and Administrative Privilege


      If users who are members of the Administrators group attempt to mark applications with the setuid attribute, they would succeed only if they are allowed to run applications and perform tasks in an administrative security context.
      The following is an example of how to mark the binary file /bin/regpwd, which is typically marked with the setuid attribute:
      1. Open a Korn shell (ksh) with elevated privilege as described in this topic.

      2. Type chmod +s /bin/regpwd and then press ENTER.

      3. Type exit to close the ksh session.

      Modify the number of connections

      Better to modify in order to allow other connection and virtualization of other machines as:
      HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\Connections\MaxNumFilters

      2011-04-20

      About Windows Services for UNIX SFU or Subsystem for UNIX-based Applications SUA

      Windows Subsystem for UNIX-based Applications

      It runs on Windows 2000, 2000 Service Pack 3, 2000 Service Pack 4, Server 2003 & Windows XP.
      Download from its site.
      When installed on C:\ it creates automatically the following environment variables:
      set INTERIX_ROOT_WIN=C:\SFU\
      set SFUDIR=C:\SFU\
      set INTERIX_ROOT=/dev/fs/C/SFU/
      set OPENNT_ROOT=/dev/fs/C/SFU/
      set SFUDIR_INTERIX=/dev/fs/C/SFU/
      set LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib
      set XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
      set XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
      set XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
      set XNLSPATH=/usr/X11R6/lib/X11/locale

      2011-04-19

      About Case sensitivity & security for SUA Programs

      When installing Utilities and SDK for Subsystem for UNIX-based Applications, you might want to choose whether to change the default behavior of object names such as file names to being case sensitive. The choice you make will affect system security as well as how Subsystem for UNIX-based Applications functions.
      In Windows, the names of most objects (such as files and directories) are case preserving, but case insensitive. That means you can use uppercase and lowercase characters when naming such objects, but Windows does not distinguish between names based on case alone. For example, you cannot have two files in the same directory named sample.txt and Sample.txt because Windows regards the names to be identical for the purposes of identifying files. The UNIX operating system, on the other hand, is fully case sensitive, and so UNIX computers distinguish between object names when the only difference between those names is the case of characters used in the object names. On most UNIX computers, therefore, sample.txt and Sample.txt could appear in the same directory, and the UNIX computer would distinguish between them when performing operations on the files. For example, the command rm S*.txt would delete Sample.txt but not sample.txt.
      In order to implement typical UNIX behavior, the SUA subsystem is normally case sensitive when working with file names. This can present security issues, particularly for Windows users who are accustomed to the case-insensitive conventions of Windows. For example, a Trojan horse version of edit.exe named EDIT.EXE could be stored in the same directory as edit.exe. If a user were to type edit at a Windows command prompt, the Trojan horse version (EDIT.EXE) could be executed instead of the standard version. If case sensitivity is enabled, Windows users should be made aware of this possibility.
      In Windows Server 2003, the default behavior of subsystems other than the Win32 subsystem is to be case preserving but case insensitive; in previous versions of Windows, such subsystems were fully case sensitive by default. In order to support standard UNIX behavior, you have to do the following to enable Case sensitivity.
      Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.
      To enable Case-Sensitivity:
          click Start -> Run. type regedit.
          traverse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel
          Double Click on obcaseinsensitive -> Set the value to 0.
      To disable Case-Sensitivity:
          click Start -> Run. type regedit.
          traverse to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel
          Double Click on obcaseinsensitive -> Set the value to 1.
       Notes:
      •     you need administrator privileges to do this.
      •     You will have to restart the machine for this setting to take effect.

      About setuid behavior for (chown & chmod) SUA programs

      According to the POSIX standard, a file has permissions that include bits to set a UID (setuid) and set a GID (setgid) when the file is executed. If either or both bits are set on a file, and a process executes that file, the process gains the UID or GID of the file. When used carefully, this mechanism allows a nonprivileged user to execute programs that run with the higher privileges of the file's owner or group. When used incorrectly, however, this can present security risks by allowing nonprivileged users to perform actions that should only be performed by an administrator. For this reason, Utilities and SDK for Subsystem for UNIX-based Applications Setup does not enable support for this mechanism by default.
      You should enable support for setuid behavior only if you are sure you will be running programs that require support for this behavior. Even if you do not enable support for setuid behavior when installing Utilities and SDK for Subsystem for UNIX-based Applications, you can enable it later.
      Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.
      To enable Setuid:
          click Start -> Run. type regedit.
          traverse to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SUA
          Double Click on EnableSetuidBinaries -> Set the value to 1.
      To disable Setuid:
          click Start -> Run. type regedit.
          traverse to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SUA
          Double Click on EnableSetuidBinaries -> Set the value to 0.
      Notes:
      •     you need administrator privileges to do this.
      •     You will have to restart the machine for this setting to take effect.
      •     This is deprecated for the current release, since this has a security impact.

      About Console2

      Installation

      Refer to their web site.

      Environment Variables

      You can add to PATH the installation path using CONSOLE_PATH:
      set CONSOLE_PATH=D:\Console2\

      About EverNote

      Installation

      Refer to their web site.

      iOS

      Just install from AppStore.

      2011-04-11

      About DropBox

      Installation

      Read, download and install from their site.

      Environment Variables

      Under non Windows:
      export DROPBOXDRIVE=$HOME/Dropbox


      Under Windows and Cygwin:
      set DROPBOXDRIVE=%HOME%\Dropbox

      iOS

      Just install from AppStore.

      Linux

      Under Fedora, optimize Dropbox you need gtk, glib, nautilus & libnotify:
      &] rpm -qa | grep gtk ; yum list | grep gtk #install if is not present
      &] rpm -qa | grep glib ; yum list | grep glib #install if is not present
      &] rpm -qa | grep nautilus ; yum list | grep nautilus #install if is not present
      &] rpm -qa | grep libnotify ; yum list | grep libnotify #install if is not present
      &] wget  https://www.dropbox.com/download?dl=packages/nautilus-dropbox-0.6.2-1.fedora.i386.rpm
      &] sudo rpm -i nautilus-dropbox-0.6.2-1.fedora.i386.rpm



      Under Ubuntu/Kubuntu/Debian, optimize with Dropbox you need gtk, glib, nautilus & libnotify.

      Windows and Cygwin

      Just install the auto-installer.

      2010-02-23

      About Mono

      Download

      We always read the manual.

      Mono for Windows

      We always read the manual to start your Mono projects and have fun.
      1. Download the file for Mono 2.10.4 for Windows, Gtk# 2.12.11, and XSP and do the Port Selection default:8080
      2. Download, if you don't have MSVisualStudio, the dotNetFramwork2.0SP2, the dotNetFramework3.5, the dotNetFramwork4.0
      3. Download the Gtk# for .NET 2.12.10
      4. Download the Mono Migration Tools MoMa with its definition.
      5. Download the MonoDevelop 2.6beta3.

      2009-10-18

      About Windows XP

      Optimizing HD Space

      We may partition for specific use:
      • XPPR (20 Gigs) on C:\ for WindowsXP Pro setting an environment variable ROOTDRIVE='C:'
      • APPS (20 Gigs) on D:\ for new programs setting an environment variable APPSDRIVE='D:'
      • HOME (5 Gigs) on E:\ for all Home directories setting an environment variable HOMEDRIVE='E:'
      • DATA (10 Gigs) on F:\ for all data setting an environment variable DATADRIVE='F:'
      • SHAR (2 Gigs) on G:\ for all shared data in FAT32 setting an environment variable SHARDRIVE='G:'
      • OPTS (10 Gigs) on F:\opt for all optional software setting an environment variable OPTSDRIVE='F:\opt'

      Environment Variables

      $HOME
      app/
      bin/
      data/
      distro/
      doc/
      ext/
      generated/
      ico/
      lib/
      messages/
      modules/
      obj/
      pkg/
      script/
      sql/
      temp/
      test/

      MS VisualStudio

      We always read the manual.
      You can have free stuff at DreamSpark


      Cool Programs

      We always for new cool programs to use.

      We can use VirtualDub and download it.

      We can use TheKMPlayer for DVDs.

      We can use PS3MediaServer follow the blog nor the forum and don't forget the manual.

      We ca use BoxeeTV follow the instruction in their website.

      We can use TVersity follow the instuctions in their website.

      HTMLCode

      HTMLCode Content