Monday, November 3, 2014

Adding a new Infragistics Ultragrid in Microsoft Visual Studio

Infragistics version used: version 4

Microsoft Visual Studio: 2010

Steps:
1. Add a new ManualSpreadSheet Control to the Page (Drag and Drop)
2. Manual Initialize DataSchema by adding only Table0 with no columns.
3. Spreadsheet Properties->Add Columns using the Collection(...) Option.
4. Save and Rebuild Project
5. Once the Designer is refreshed, Save and Rebuild again.
6. Done.

Tuesday, October 28, 2014

Find files Command in Linux


The below command searches for all files with the 'tmpl' extension in the / folder:

sudo find / -type f -name '*.tmpl'

Monday, September 29, 2014

Amazon AWS Cloud: Change RDP default port number in order to connect to Windows instance

While this doesn't make the security unbreakable, it is a good practice as default 3389 port is most often a target to be attacked.

Here are the steps to modify the default port and use another one:

1. Make sure the Security Group assigned to the Amazon instance has proper Inbound rule defined for the new port.

2. Set up Windows firewall to allow Inbound Traffic on the new port.

3. Change default port from registry:
- Start->Run-> regedit
- Go to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
- Change default decimal value(3389) with the new port.


Please be careful when applying this kind of changes as you may end up without being able to access your machine at all.

Thursday, September 25, 2014

Amazon AWS Cloud: Create Security Policy for IAM user to Start/Stop only specific instance

{
   "Version": "2012-10-17",
   "Statement": [
   {
   "Effect": "Allow",
      "Action": "ec2:DescribeInstance*",
      "Resource": "*"
   },
   {
      "Effect": "Allow",
      "Action": [
        "ec2:StopInstances", 
        "ec2:StartInstances"
      ],
      "Resource": [
      "arn:aws:ec2:us-west-1:account_ID:instance/i-c58ff64a"
      ]
    }
   ]
}

Sunday, September 21, 2014

Saturday, September 20, 2014

Apex Code to insert a row into a Salesforce Object

Assuming that AWS Cost is an Object with two custom Fields (Cost and Date), here is the Apex code that inserts a new row:

AWS_Cost__c ml;
ml = new AWS_Cost__c(Cost__c=12, Date__c = '8 Sep' );
insert ml;

Permission denied message from MAC command line

When getting the "Permission denied" message when trying to execute a certain file or script, here is the fix:

1. Run ls -l to see if you have execute permissions on the file

2. Run "chmod 755 file.ext" to assign proper execute permissions

3. Run "./file.ext" . It should work fine now.

Saturday, July 26, 2014

Display a Log Off button on Windows Desktop

Here are the steps:

1. Create a new text document and add the following line:
shutdown -l

l is from log off.

2. Save the file with a .cmd extension

3. If there is the need for a different icon, make a shortcut copy and modify the icon for that shortcut.

That's all...


Working with RDP files

Here is a full list of parameters that can be added to a Remote Desktop File:


PARAMETER
VALUE
NOTES
alternate shell
s
c:\winnt\system32\notepad.exe
Sets the shell to be used within the Terminal Services session. This can be used to set an alternate shell such as progman.exe; you can also use it to set the application which the user runs on logon to the Terminal Server.
audiomode
i
2
Known values:
0 - Bring to this computer
1 - Leave at remote computer
2 - Do not play
auto connect
i
0
0 or 1
autoreconnection enabled
i
1
Set to 1 to connect automatically when file is opened.
bitmapcachepersistenable
i
1
? 1 maintains bitmap cache between sessions
compression
i
1
1 means use extra compressions
connect to console
i
1
0 - connect to a virtual session
1 - connect to the console session
desktopheight
i
768
height of session desktop in pixels
desktopwidth
i
width of session desktop in pixels
disable cursor setting
i
0
?
disable full window drag
i
1
set to 1, disables display of window contents while dragging in session
disable menu anims
i
1
set to 1, disables menu animations in session
disable themes
i
1
set to 1, disables use of themes in session
disable wallpaper
i
1
set to 1, disables display of wallpaper in session
displayconnectionbar
i
1
Set to 1, displays the connection bar in a fullscreen session
domain
s
HQ
domain name to use for logon
full address
s
192.168.1.1:33389
IP address/name of server (and optional alternate port)
keyboardhook
i
2
For applying standard Windows key combinations
0 - On the local computer
1 - On the remote computer
2 - In fullscreen mode only
maximizeshell
i
0
set to 1, maximizes any alternate shell used in the session
password 51
b
(big long binary hash)
Ifyou choose to save the connection password, this will be a large binary hash value
port
i
3389
redirectcomports
i
1
set to 1, redirects client COM ports in session (XP/.NET only)
redirectdrives
i
1
set to 1, redirects client drives in session (XP/.NET only)
redirectprinters
i
1
set to 1, redirects client printers in session
redirectsmartcards
i
1
set to 1, redirects client smart cards in session (XP/.NET only)
screen mode id
i
1
FullScreen vs. normal
0 - ?
1 - windowed
2 - fullscreen
server port
i
3389
You can specify the port separately from the "full address" parameter.  
session bpp
i
16
bit depth for session - 8, 16, or 24. Only 8 is valid for Windows 2000 Terminal Servers
shell working directory
s
c:\program files\microsoft office
Working directory if an alternate shell was specified.
smart sizing
i
Scale the client window display of desktop when resizing
0 or not present - Do not scale
1 - Scale (Takes extra resources to scale)
username
s
administrator
name of user logging on
winposstr
s
0,1,0,249,808,876
Not sure about the details on this one.  There are always 6 comma-separated values.  I would guess that these are presets for position and "window mode" sizes - maximized versus sized.

Full documentation can be found here: