Get Sharepoint List Access from SQL Server

Well, here I go – how to natively (or naively at this point – I just started this) manipulate Sharepoint Lists from SQL Server.

I did it! It is not using a linked server (I will get to the bottom of that though) but using an OPENROWSET works. This means that the user needs to have insert and select privileges – but there is a way around that too – by making a role/user internal to the dB and running the stored proc run (EXECUTE AS) that role/user. To get that to work takes some tinkering – another article will come soon regarding that.

Basically – the onerous method would show that the two statements below work Continue reading

Integrating ASP app – Users and more users, more permissions and 401s

When you integrate a site onto its final server – things with windows get hairy. Here are some notes to get out of trouble

  • seeing a 401 for anonymous user? Are your permissions for IUSR set to read, write, execute (ref)? This is for anonymous user. For a dynamic user, then you have to add permissions for NetworkService (see small note in this reference) (6.1 – or see this article for 7.5). For this, I had an account called (built in account: ApplicationPoolIdentity – this not correct – I will keep digging)
    • you might also require the group IIS_IUSRS to have read, write, execute. It depends on your version of IIS (see this link – this is succinct)
    • ensure BOTH the user accessing the page and the AppPoolIdentity user BOTH have NTFS permissions set to the directory and subsequent web pages (reference) Continue reading

Adding jQuery to Report Services – (Make parameter field bigger is the reason for doing this in this article)

There are really 2 concepts here which is the reason for the long title. First, adding jQuery to Report Services means hacking 2 install files (.aspx files) of Report Services. If you don’t have someone who has access to the server that is hosting the web pages, it might be hard to get this done. Your IT department might say ‘no way’ but this problem is well known for RS 2008 up to the current – so it is really not a risk – if it breaks, simply fix it – most likely it will never need fixing especially if you are using an older version of RS which is by this point mature. Next to address the width – this article helped. Here is how I did it and who helped me (urls in the code and the links above)… Continue reading

Configure Access to SourceTree to Gitorious Source Control

Overview:

  • SourceTree is a visual client to a git-style source control repository for Windows (in this example) and Mac-OS-X.
  • Gitorious is a wiki/git-style web based file browser and repo setup system like github – except YOU run it.  It is delivered as standalone computer (Virtual Machine) that hosts a git server and wiki all in one. The wiki is integrated into the project. My good buddy at Geek Inc. delivered this all on a 4GB stick which had a VMWare AND a VirtualBox version of it and then he and pointed me in the right direction. Thanks Ben.
  • IMPORTANT – EVERYONE ELSE CAN VIEW PROJECTS PUBLICLY WITHOUT WRITE ACCESS (awesome!) – meaning they don’t have to know git – just send them links to the relevant directories or files AS A WEB LINK – they don’t have control over your files since the files are stored on the Virtual Machine’s internal directory structure. They can make their own accounts – but the admin determines who is on what team for write to the repository. THAT WAS THE GOAL
  • Ideally there Continue reading

Installing IIS and ASP.NET – installing things so you can get your website up and running

I have gotten a lot of issues of tinkering with IIS solved before – but never have I written anything down and I have never installed it from scratch. Now, I have to do these steps again so this time I will write them down for myself and others. I will not be using the default website.  I am doing so on Windows 7. Note that this is on the Intranet – so security is NOT my main focus although it is on my mind while setting it up but I am not going to be crazy on that in this discussion – just mention a few thing here or there that you might want to think about. This is where I started from a tutorial standpoint – but I am going back to this once I am done. There is a great MS tutorial in the 1st link in the install section below.

UPDATE: This little step of registering IIS (aspnet_regiis.exe -I) after install has gotten me SOOO many times. ALWAYS do this – see this link.

Install MS Visual Studio Express 2012 for Web

  • download from Microsoft and follow the instructions
  • http://www.asp.net/web-forms – great tutorial site too
  • register it, MS says its free but you have to register – ok – no issues
  • you will require a reboot

Install IIS

setting up Time Machine to see a network drive instead of a local drive.

To allow macs to see other drives other than local ones (see link below), you basically

  • edit a setting on your mac
  • create a sparse bundle using some unix commands – make it at least 3 times larger than your expected data to be backed up
  • MOVE that sparse bundle to a remote machine and connect to that remote directory – then tell time machine to start looking for hard drives.

 

Here – just do what Stephan says and read with understanding and he leads you through the bullet points above. This stuff is written so you CAN understand what is going on. I learned this stuff long before he simplified it – so thank you.

Solved: Fonts on a Mac for Microsoft office – why are they not updating? Where are they?

Macs are not perfect even though one’s productivity is much higher with one. When things go wrong – they can sometimes really go wrong.

One customer had issues with a critical branding font that installs fine on everyone else’s Macbook but not theirs. I now know more about fonts that I ever wanted to know especially how Microsoft fonts fit into the Mac picture. I researched dozens of websites each adding a piece to the puzzle. Here we go …

  • There are 4 font stores on your Mac
    • user fonts stored in /Users/youraccount/Library/Fonts
    • computer wide (all accounts) fonts in /Library/Fonts
    • system fonts in /System/Library/Fonts (never ever touch these)
    • Microsoft Office fonts in /Library/Fonts/Microsoft (ahhh I see)
  • ONLY TTF fonts work for Office – or so MS claims
  • To install fonts for MS Office 2011 – don’t double click them – this installs them naturally in the user fonts
    • instead – start up Font Book (use the spotlight or magnifying glass to find it quick in the upper right of your Mac)
    • drag them from your Finder onto Computer (under the Collection section at the left of the Font Book app)
  • A reboot triggers the Mac Font store to sync with Office. Don’t forget to reboot before ripping your hair out
  • Adding fonts to the user fonts will never show up in Microsoft Office products
  • Don’t assume that because a font works in lets say Word, that it will appear in Excel – it might once the cache catches up
  • Microsoft font cache file can be delete so it will force a refresh – but it can be in 2 places – check both. Microsoft moved it for Office 2011 for Mac for some computers different than others
    • Lion? goto finder and hold the option key and …
    • click the menu Go->Library or type in a folder /Library by choosing the Go->Go to Folder option then navigate eventually to /Library/Preferences/Microsoft/Office 2011
      • not there? Microsoft moved them in later releases of Office 2011 to /Library/Application Support/Microsoft/Preferences/Office 2011 – even MS’ articles are incorrect!
      • also you might need to look in /Users/yourname/Library/Application Support/Microsoft/Preferences/Office 2011
    • when you re-start work or Excel you will now see a task completing to rebuild the cache files and if you observe the location above you will see new cache files
  • Here is a link to completely remove Office on a mac and is the final puzzle piece that allowed me to solve this riddle http://support.microsoft.com/kb/2398768

Many thanks to these sites:

How to send emails from iOS devices from the one you want

The service providers and even the Applestore do not know the simple art of setting up an email account NOT as an iCloud account or provider account. It is simple to do knowing a few basics of what you can do. A lot of us have our own domain names or preferred email accounts that we want to send “from” and appear as to others. It keeps things cohesive and flexible to change if that service provider is not a preferred one. I do this for all my customers and it takes about a minute longer.

First, use only the services you need to to get the job done. If you are setting up Gmail – then do NOT click on new account and choose the Gmail Type – choose other and type in the details the long way. THEN turn off every service except email for this new account and turn OFF email for the iCloud but leave all the other services like notes, etc. See? Substitute only the service you replacing – not all the services with this new other type account.

  • your name as you want it to appear
  • your email address – any email address
  • incoming server is imap.gmail.com
    • type in your full username and password as directed by the service you want to use – so google the settings for … telus or shaw or gmail.
  • outgoing server is smtp.gmail.com
    • again you have to do some googling for settings but it is usually the same as your incoming server
  • if you want you can use an existing smtp setup that you know already works. I have set up a special email account for outgoing mail only – so I would use that smtp server on ALL my email accounts set up on my iDevice once I have the basics setup

When you send mail make sure it works over wifi and 3G/4G so that you won’t get to a friends house and cannot send things until you get back to home or work.

Make sure your ‘default account’ for sending is the one you want. When you add new accounts, the new one might take over and you might not want this to happen.

Would you like ONLY calendar info then from gmail? Simply choose to add a gmail the simple way – but because we set up email independently using the new other account type – be sure to turn OFF mail on the gmail account.

Setting up a CentOS 6.3 linux box as a RAID networked attached storage unit

One customer has been set up with Paragon backup software for a Windows 2008 SBS installation. Whis is frustrating about SBS is that the Server Backup tool taunts you to use it but MS states that it is not meant to be used on anything except R2 2008. It was a nightmare but we did get it running on a 2008 Enterprise installation after fixing the VSS shadow copy service. That took 5 hours of time – luckily it was for a friend and they did not pay for it.

OK back to a wonderful tool called Paragon which does work and restoration of files is MILES easier than restoration using Symantec’s Backup Exec. It too works – but it is a huge hassle to understand. The home edition works too but not necessarily for a server installation.

We set up a CentOS 6.3 box (I say we because it was a good friend of mine who taught me what he was doing). I have set up DOS partitions long ago and this is similar just super involved on Linux. Here is what we did

Made a RAID of 2 x 3TB drives partitioned to have 1 boot partition,1 temp/log partition 1 swap partition, 1 OS partition and another one for the /home. In short, the theory is that if the logs filled up a partition the whole box would not come crashing down. Most partitions were set up with RAID to mirror each other in  case of drive failure. Cent OS 6.x was needed for these larger drives – and CentOS 5.x failed miserably.

We took off all unnecessary tools and then I added VNC setup which is a whole article unto itself, smb which is still not working despite both of us working on it – one hint is that Selunix fights smb and there is a setting that you have to apply to get the home directories to be sharable. See Dan’s article here and look for the word selinux in the smb.conf file – sure enough it tells you why it is will not work without proper setup right in there. We are still working on why things mounted one day fine and not the next day. Mac or PC cannot connect via smb.

Netatalk was setup (Appletalk) so Macs could put their time machine backups on the large partition. See this article for Netatalk and this one for TimeMachine on a NAS.

Windows Task Scheduler – a consistent way to execute exe files

A guaranteed way to make exe’s with parameters kick off is

aa) don’t run a scheduled task on a network share – if you get 0x1 as a result code .. copy everything to a local drive??? (latest update). Worked for me but is 2X work when source code changes.

aa1) UPDATE: If running bat files (tips from here)

  • run as highest privileges is checked
  • put the path of the bat file in the “start in” and a full path and bat file in the “Program/script” box
  • ensure there are no quotes in the Program/script and Start in boxes (not tested but I didn’t need them)
  • ensure all directories have “Ful Permissions” for the account you finally use to with’
  • test it with “r-mouse click” run. If it works there – it will worked with it logged on.

a) make a new Task Scheduler and make it it point to a bat file. You can try all sorts of other scenarios but  I have already spent hours – this works every time .

 

b) Now, lets take a look at that RunScriptNow.vbs.qualitysurfaces.bat file – I will copy the guts of it here:

[shell]
echo %date% %time% %username% qualitysurfaces >> c:\temp\test.txt
cd c:\Users\Administrator\Desktop\Moreaware
cscript //nologo //B RunScriptNow.vbs qualitysurfaces >>c:\temp\test.txt
echo %date% %time% >> c:\test.txt

[/shell]

It writes to a log file of your choice, then it mimicks the “Start in” by cd’ing to the directory where the executable file is

In this case, I wanted to run a .vbs file with parameters so I use cscript but this is not the focus on this step b). We put any output to the dos prompt from this .vbs process to the log file.

Lastly – to know that we made it to the end of the cscript line – we write again to the log.

NOW WE KNOW FOR SURE THINGS WERE DONE! If gui items pop up from the command line – don’t expect to see them like with window 2003 – this is now all silent. Note I have a diff bat file for every parameter – substituting %1 in that bat file above for ‘quality surfaces’ in the script line DOES NOT WORK – neither does %%1.

c) For directly kicking off an exe – hmmm. I think I converted them all to .vbs but you simply put the exe file on the command line NOT fully qualified with a path since the cd line directly above it. Again – pipe the output (append or >> ) to the log file so you know what is going on.

d) here is the guts of the .vbs file which should speed things up for you. This is in leiu of me having a .exe example in c) 😉

[vbnet]
Dim myDate, myTimeS
Dim nowvar
Dim incust
Dim ArgsListExtra

‘ get the arguments from the command line – we only want the first one and put it incust
if WScript.Arguments.Count >= 1 Then
incust = WScript.Arguments.Item(0)

‘get the rest of the arguments – not sure why I left this in but it works with this in so lets leave it
ArgsListExtra = ""
if WScript.Arguments.Count >= 1 Then
For i = 1 to WScript.Arguments.Count
ArgsListExtra = ArgsListExtra & " " & WScript.Arguments.Item(i-1)

Next
End If

‘lets make the filename with a nice date and timestamp in the file name
nowvar =  Now()
myDate = FormatDateTime(nowvar, 2)
myTimeS = FormatDateTime(nowvar, 3)

myTimeS = replace(myTimeS, ":", "_", 1, -1, 1)
myTimeS = replace(myTimeS," ","",1,-1,1)

myDate = replace("0"&myDate,"/","_0",1,-1,1)
myDate = replace(myDate, "_0201", "201", 1, -1, 1)
myDate = replace(myDate, "_00", "0", 1, -1, 1)
myDate = replace(myDate, "_0", "0", 1, -1, 1)
myDate = replace(myDate,"_00","0",1,-1,1)
myDate = replace(myDate," ","",1,-1,1)

Dim finalstring
finalstring = myDate & "_" & myTimeS

‘ now assemble the command line we would normally type

Dim cmdstart
cmdstart = "cd ""C:\Users\Administrator\Desktop"" && "    ‘ look up what && does on the command line – it allows multi command line items on one line of text. Crazy

Dim command
command  = cmdstart & "JobMaterialCost.exe -c "&incust&" -u username -p password -fe c:\Users\Administrator\Desktop\"&incust&"_"&finalstring’& ArgsListExtra &" && pause"

‘ now execute it

if 0 Then
WScript.Echo(command) ‘ this is here in case you want to debug – this will NOT show up in the TaskScheduled version – but it might hang there until you press OK – except you cannot
‘  press ok …. cause you cannot see the windows although it will still wait for you  🙂
Else
Set oShell = CreateObject("WScript.Shell")
‘Launch a command shell …. "/K" &lt;- keeps it open   – we want —&gt; /C */ – read up a GREAT text at <a href="http://technet.microsoft.com/en-us/library/ee692837">http://technet.microsoft.com/en-us/library/ee692837</a>
oShell.Run "CMD /C " &amp;command, , True
End If

‘WScript.Echo("Done" &amp; incust)  ‘ again this might hang your Scheduled Tasks

Else

End If
[/vbnet]

Appendix:
If you are interested in what makes the command prompt wait or not for the next process etc. within vbs files – see these links and read them twice – it is REALLY IMPORTANT if you use .vbs to help you script things
– http://technet.microsoft.com/en-us/library/ee692837
– http://technet.microsoft.com/en-us/library/ee692836
– http://visualbasic.about.com/gi/dynamic/offsite.htm?site=http://msdn.microsoft.com/library/en-us/script56/html/wsoriObjects.asp
– http://visualbasic.about.com/gi/dynamic/offsite.htm?site=http://msdn.microsoft.com/library/en-us/script56/html/wsoriObjects.asp
– http://technet.microsoft.com/en-us/library/ee176904.aspx
– http://labmice.techtarget.com/scripting/WSH.htm