CSV to XML

The following is a way to move from CSV to XML Node. If one were to want to manually structure an xml node,  there is an alternative way to create xml nodes from CSV files that is fast and easy and can be done in the following form:

Dim ReferenceToElement as XElement =

<nameOfTheNode>

<%= From strings In StringArray

Let fields = Split(strs, “,”)

Select

<rows>

<column1><%= fields(0)%></column1>

</rows>

%>

</nameOfTheNode>

This takes in a string taken from the csv file and put in an array called String Array. This then only takes the first item (fields 0), and puts it in the column of the new xelement. Then once this is done the xelement must be converted into a node.  And this is done in the following code:

Dim xn As XmlNode = XmlDoc.ReadNode(ReferenceToElement.CreateReader)

Now xn can be inserted as a new child or any other task that would need to be done with a xml node. This method allows direct control over the structure of the node without the complexity of creating a table and allows for very fast manipulation of data into a xml node. This is to the advantage of the user as the nodes are a very easy way to insert data into a xml document. Situations could be adding text to an html email or manipulation of data on a website. The most relevant website for this would be the Microsoft developer network on the subject. https://msdn.microsoft.com/en-us/library/bb387090(v=vs.100).aspx

Share Button

New Backup Philosophy … no more direct SMB connecting – SSH/SFTP

It might be better to “pull” things from a server for backup , but pushing is much easier to setup. So … I looked into things and connecting to  a Z drive COULD be dangerous. One Encryption-Ransomware makes it a first priority to kill off the backup drive, then encrypt the files. So any drive that is connected as a Z drive (for example) would either be encrypted or wiped. So how best to protect? Well what about (s)ftp? Better, but it could overwrite old backups. So 2 fold … backup NOT via SMB and then have a 2nd “last backup” as well. Drop box does this  but it is expensive to have dropbox for that large and to have ‘history’ turned on – but it DOES WHAT WE NEED!! What I did was install WinSCP and have it use a queue and when the queue is empty – it shuts WinSCP down. Simple, drag and drop. Yes it is not automatic, so what i have is the backups being stored on a simple hard drive – the WRONG way, but then I take that backup and WinSCP it off as my historical copy alongside the other historical folders. That 2nd computer, if there is a fire, should be offsite or across the building minimizing the chances of a complete disaster. Beats tape rotations. Fire safe, secure, encryption proof (within a week) and an offsite rotation if the customer wishes by taking the local hard drive weekly (if you can find the J personality style who will do that religiously)

Share Button

Windows Server (SBS) bloats often like a little kid who needs his nose CONSTANTLY wiped. Drives me nuts

Ok – so the SBS server is FULL AGAIN. WHAT NOW!?? I deleted exchange clear off it – so it is not those logs, disabled IIS – so not those logs – WHAT NOW!? SBS Monitoring. OK – so follow this 1 (or two once you get in there) and clear out the temp files in

  1. C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\Data

I had to pay attention to the note at the bottom to enable the .ps1 file.

Also there is a temp.mdf – that too is MASSIVE. Look at properties of the System Databases -> TempdB and see if the ‘large file’ is the one you think it is (there is a file path) Then Follow these instructions … note that a detail is missing on where sqlservr.exe is located – see here.

Don’t forget that to find large files SUPER fast – use Windirstat.exe – cause it is awesome (awesome like Notepad++ and Beyond Compare – yes… that cool!!!)

Share Button

oVPN add Ubuntu endpoint and setup client

I had a need to install something for a client to avoid using RDP port 3389 as Microsoft has a vulnerability and people can exploit it. Now with crypto viruses on the rise, it is never too late to lock things down. Also now that heart bleed is solved – we can get back to this method. This was BEYOND a super explanation that really made my day (it was a long few days) . It is long, but … copy/paste things in and voila – end point complete.

Share Button

VNC Centos

This link FINALLY got me up and going using the RealVnc Client. I just made a new account like this guy did. FINALLY it is running. It has been years and I am trying to lock things down a little on my Linux machine.

Share Button

Windows 2012 doesn’t sync its time to an NTP – here is how

Seriously!? And no checkbox to turn it on? Powershell commands!? I guess is why Mac costs 2x as much. Here is a great post. Get Started.

Share Button

SPF Records – why and how

Finally an article that explains it. Microsoft has rules that mark incoming mail as spam even tough, as humans we would prefer to see the emails without the spam warning. Enter SPF. If you have a microsoft email – it is quite an ordeal.

 

Share Button

Helpful VBA/ActiveX AutoCAD Links

Some links that can help with designing VBA to handle AutoCAD are below:

Iterating through layer collections

Delete all objects in a layer

How to copy all objects from one drawing to another in autocad through VBA

Share Button

Take ANY SharePoint 2010 or 2013 Library. Does clicking on “Open in Explorer” hang your computer with an error after 1-2minutes?

Lets say you have a SharePoint Library and want to open in in Explorer to a whack of files by copying them in rather than through the web interface. BUT you cannot as there is an error. In SharePoint’s Library ribbon, you can if you…

Click Library -> Open with Explorer

And it hangs your computer for about 1-2 minutes – arriving with an error box

“Your client does not support opening this list with Windows Explorer”

Root Cause: The webclient services is not running and (in my case) COULD NOT start. Do this …
Continue reading

Share Button

Dropbox .. your fired!

Dropbox cannot be run as service and always up has failed us making it so.

So … what next?

Share Button