Tips & Tricks : Introduction to Laravel : Free coding tools


In previous articles:

we created and published web project.

Now it’s time to try to do some development and modify out-of-the-box project to create our own application.

Question is what tools should we use to start code development.

You might want to have a look at two available for free:

Sublime Text

Download from: http://www.sublimetext.com

Sublime Text

Visual Studio Code

Download from: http://code.visualstudio.com

Visual Studio Code

Both apps can highlight syntax for PHP-based code, so both can be used for development purposes with Laravel web application.

Check them and decide which one will be better fit for you.


Code snippets : Windows : Importing Event Logs to Database


Code snippet from old archives. It shows how to import Windows event log entries to database. Important is to setup database and table accordingly, so it contains apropriate columns.

Set objConn = CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.Recordset")
objConn.Open "DSN=EventLogs;"
objRS.CursorLocation = 3
objRS.Open "SELECT * FROM tblEventLog" , objConn, 3, 3
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colRetrievedEvents = objWMIService.ExecQuery _
("Select Category, CategoryString, ComputerName, Data, EventCode, _
EventIdentifier, EventType, LogFile, Message, RecordNumber, SourceName, _
TimeGenerated, TimeWritten, Type, User from Win32_NTLogEvent")
For Each objEvent in colRetrievedEvents
objRS("el_Category") = objEvent.Category
objRS("el_CategoryString") = objEvent.CategoryString
objRS("el_ComputerName") = objEvent.ComputerName
objRS("el_Data") = objEvent.Data
objRS("el_EventCode") = objEvent.EventCode
objRS("el_EventIdentifier") = objEvent.EventIdentifier
objRS("el_EventType") = objEvent.EventType
objRS("el_LogFile") = objEvent.LogFile
objRS("el_Message") = objEvent.Message
objRS("el_RecordNumber") = objEvent.RecordNumber
objRS("el_SourceName") = objEvent.SourceName
objRS("el_TimeGenerated") = objEvent.TimeGenerated
objRS("el_TimeWritten") = objEvent.TimeWritten
objRS("el_Type") = objEvent.Type
objRS("el_User") = objEvent.User

Config snippets : useful Netdom command


Quick side note, not to forget for future.

Rename computer

Netdom renamecomputer %computername% /newname:Test-Server

Join computer to domain

Netdom join %computername% /domain:domain.com /UserD:Administrator /PasswordD:*

Tips & Tricks : Windows 8.1 as wireless hotspot


When you need to use your computer as wireless hotspot, you can easily enable that functionality with PowerShell:

Windows PowerShell
Copyright (C) 2013 Microsoft Corporation. All rights reserved.

PS C:\windows\system32> netsh wlan set hostednetwork mode=allow ssid=Windows-Wireless-Hotspot key=password123
The hosted network mode has been set to allow.
The SSID of the hosted network has been successfully changed.
The user key passphrase of the hosted network has been successfully changed.

PS C:\windows\system32> netsh wlan start hostednetwork
The hosted network started.

PS C:\windows\system32>

Tips & Tricks : Remove Event Log Source


To remove Event Log Source use this:

Remove-EventLog -Source "Desktop Window Manager"
Replace Desktop Window Manager with Event Log Source you want to remove.

Tips & Tricks : List Event Logs and associated sources


To list all Event Logs and sources associated with them use:

Get-EventLog -LogName * |ForEach-Object {$LogName = $_.Log;Get-EventLog -LogName $LogName -ErrorAction SilentlyContinue |Select-Object @{Name= "Log Name";Expression = {$LogName}}, Source -Unique}