Monday, January 25, 2016

Unable to see files and folders in my pen drive

External hardware devices such as pen drives are widely used for easy storage and transfer of files or folders. Sometimes users may not be able to see files or folders stored on pen drives. This be down to several reasons, the most common being that all files and folders are in the hidden mode. If the storage device doesn't have this setting enabled, it could be due to undetected malware. Users may need to remove the autorun files first and then proceed with removing the infected files using a recommended anti-malware


Issue
I can't see the files and folders in my pen drive after scanning with "Advanced Options - clean files" with nod antivirus software. The files are not in hidden mode and I know they are on the pen drive as I can tell from looking in "properties". How can I fix this problem? 


  1. Click on "Start" --> Run --> then type cmd and click on OK. 
  2. Assuming your pendrive is G, enter the following command: attrib -h -r -s /s /d g:\*.* 
  3. You can copy the above command then right click in the Command Prompt and paste it.
  4. NB: Replace the letter g with your flash drive letter. 
  5. Now check for your files in the pen drive. 

Monday, November 23, 2015

Deploying a WSP to SharePoint 2013



How to deploy a WSP to SharePoint Farm Solution library

This need to be done on the Server which host the SharePoint Central Administration.
  1. Add the WSP to the SharePoint Server
    1. The first thing you need to do is copy over the wsp deployment file. The best things to do is to create a deployment folder, where all the deployed files are kept.
    2. Copy over the deployment files to: c:\Deploy\WSP
  2. Add the WSP to the SharePoint Farm Solution library
    1. Open "SharePoint 2013 Management Shell " as administrator
      a. Open the Search on Server 2012
      b. Search for "SharePoint 2013 Management Shell"
      c. Right click "SharePoint 2013 Management Shell"
      d. Select "Run as Administrator"
    2. Run this script: 

      Add-SPSolution "c:\Deploy\WSP\{file name}.wsp"  
  3. Deploy the WSP to the SharePoint Farm Solution library

    1. Open Central Administration
    2. Click "System Settings"
    3. Click "Manage farm solutions", under "Farm Management"
    4. Click on the {file name}.wsp package
    5. Click "Deploy Solution"
    6. Deployment settings
      Deploy When: Now
      Deploy to: All content Web application
    7. Click "OK"

How to activate the WSP Feature on the Site Collection

  1. Activate the WSP Feature on the Site Collection
    1. Open the Root Site (the Site Collection)
    2. Click the cog, in the top right corner (Site Actions)
    3. Select "Site Settings"
    4. Click "Site collection features", under "Site Collection Administrator"
    5. Go to {file name}
    6. Click "Activate", to the right

Sunday, November 8, 2015

GitHub - From Fork to clone then push back to server

To start, please make sure that you already have:

  1. GitHub account (https://github.com/)
  2. Git Bash software (http://git-scm.com/)


This is step by step guideline to fork, clone and push back at GitHub server.

1. Open any folder at GitHub that you want to fork (copy to your GitHub folder). Then press Fork at top-right of the page


2. After fork, the page will redirect you to your GitHub account. Next, we want to clone the file to your local repository (own computer). Copy the link first at the folder you want to clone.


3. Open Git Bash application then change the working directory to your preferred folder first.

         code: cd "folder url"
         example: cd "/e/Training/Training 2015/Data/Module 4/Week 1 - Course Project 1"
        Then request for clone by entering the following command:

         code: git clone URL
         example: git clone https://github.com/fairulshahrizat/practice_assignment.git


After that you can closed Git Bash & check your preferred folder for content.


4. After you are done with your task, you will want to push the emended in the folder to your GitHub account back. To do this, follow this step:
  1. From the local repository folder, right click and select 'Git Commit Tool'.
  2. There, select the files you want to upload, under 'Unstaged Changes' and click 'Stage Changed' button. (You can initially click on 'Rescan' button to check what files are modified and not uploaded yet.)
  3. Then write a Commit Message and click 'Commit' button.



      4. Now right click in the folder again and select 'Git Bash'
      5. Type: git push origin master and enter your credentials (GitHub account). 


         6. Then you can check back your GitHub folder to see the update. Click commits for version details. 









Wednesday, October 7, 2015

Query times out (very slow) when executed from web, but super-fast when executed from SQL Server Management Studio (SSMS)


Some cache corrupt on your SQL server, Run 2 commands to clean:

DBCC DROPCLEANBUFFERS 
DBCC FREEPROCCACHE

DBCC DROPCLEANBUFFERS removes any non dirty (iow, clean) pages:
Use DBCC DROPCLEANBUFFERS to test queries with a cold buffer cache without shutting down and restarting the server. To drop clean buffers from the buffer pool, first use CHECKPOINT to produce a cold buffer cache. This forces all dirty pages for the current database to be written to disk and cleans the buffers. After you do this, you can issue DBCC DROPCLEANBUFFERS command to remove all buffers from the buffer pool.

DBCC FREEPROCCACHE does is empty the procedure cache.
Removes all elements from the plan cache, removes a specific plan from the plan cache by specifying a plan handle or SQL handle, or removes all cache entries associated with a specified resource pool. Use DBCC FREEPROCCACHE to clear the plan cache carefully. Freeing the plan cache causes, for example, a stored procedure to be recompiled instead of reused from the cache. This can cause a sudden, temporary decrease in query performance

Extra Note:

The ARITHABORT setting is one of the things the optimizer looks at when it is determining how to execute your query (more specifically, for plan matching). It is possible that the plan in cache has the same setting as SSMS, so it uses the cached plan, but with the opposite setting your C# code is forcing a recompile (or perhaps you are hitting a really BAD plan in the cache), which can certainly hurt performance in a lot of cases.

 SET ARITHABORT ON; SELECT ...

Reference: http://www.sommarskog.se/query-plan-mysteries.html

Clearing the cache DBCC DROPCLEANBUFFERS and DBCC FREEPROCCACHE did the trick! The execution plan was somehow corrupt or not updated.

Reference: http://stackoverflow.com/questions/6585417/stored-procedure-slow-when-called-from-web-fast-from-management-studio

Monday, September 21, 2015

Trans-SQL Query - return empty row from Sql Server

Generally, if you must have an empty row returned..
If your original query is:
 select a,b,c from query_table where a='something'

You can turn it into a subquery:

select t.a,t.b,t.c
from (select 1 as adummy) a left join (
    select a,b,c from query_table where a='something'
) t on 1=1

Which ensures the query will always have a rowcount of at least one.

Wednesday, May 20, 2015

The list of workflow actions on the server references an assembly that does not exist. Some actions will not be available

When I tried to create SharePoint 2010 workflows in SharePoint Designer 2013, I got the following error message shown below:


This error may occur if the system does not have enough memory, I was running a VM at 4GB; when I scale up to 6GB, it’s working fine. in some cases, This error comes up if you don’t have local privileges, therefore, you need to check you local admin privileges. 

If you already checked the previous reasons and the problem not solved! so you need to clear the cache of the following Folders (If didn’t work delete them):
  • %USERPROFILE%\AppData\Local\Microsoft\WebsiteCache
  • %USERPROFILE%\AppData\Roaming\Microsoft\SharePoint Designer\ProxyAssemblyCache
  • %USERPROFILE%\AppData\Roaming\Microsoft\Web Server Extensions\Cache
If the problem still exists that mean someone has extended the Workflow actions available in SPD with a custom action developed in Visual Studio.These custom actions are loaded when your workstation reads the WSS.ACTIONS file on the server.

The file is located in the 14 hive under Template\1033\workflow.Your WSS.Actions file contains a reference to a custom action .dll. Delete WSS.Actions file and your designer should start working again.

Make sure you take a backup of the file first.


Reference: https://mohamedelkassas.wordpress.com/2014/12/26/the-list-of-workflow-actions-on-the-server-references-an-assembly-that-does-not-exist-some-actions-will-not-be-available/

Thursday, April 9, 2015

How to Sign in as a Different User in SharePoint 2013

SharePoint used to have a menu option called “Sign in as Different User” in the top-right corner of every page. It was a handy tool for developers and IT professionals in SharePoint 2007 and 2010, which allowed them to login with another account to test their solutions or customizations. Microsoft removed the option in SharePoint 2013, but you can still do it with workarounds or a one-click bookmarklet.

Navigate to the Close Connection Page

http://<site URL>/_layouts/closeConnection.aspx?loginasanotheruser=true

Reference: http://blog.credera.com/technology-insights/microsoft-solutions/how-to-sign-in-as-a-different-user-in-sharepoint-2013/