I have had the need to send mutiple email messages which contains for each one specific URL, this message had to be sent to multiple recipients.
Continue reading “Send email to multiple recipients which contains URL from file”
welcome..
I have had the need to send mutiple email messages which contains for each one specific URL, this message had to be sent to multiple recipients.
Continue reading “Send email to multiple recipients which contains URL from file”
I wanted to get notified for specific Windows Application Event log ID would appears; As unfortunately the Application does have such of feature/mechanism.
Continue reading “Email Notification for specific Windows Application Event ID”
I had implemented my raspberry pi to use wireless network, unfortunately the connection might after a while disconnect, the only option that I have found was to run a script that check the connection and re-connect if network is down.
Continue reading “Monitor wlan0 Interface (Wireless) to avoid disconnection from Raspberry Pi”
I have written a little script which generate number for your next lotto ticket.
Schedule it in the crontab to get your number each day you do need it.
Working from text files, sometime you might come accross the need to remove the line numbers from line into a file.
cat file_with_line_nbers | sed 's/ *[0-9]*.//' > my_new_file
I have been looking to make using some sort of script the way to make massive upload to a sharePoint server;
I have been finding many using Powershell and I came up with this type of script
param ([String]$spPath, [String]$localPath) ################################################################################# ## Load the SharePoint Snapin so the script can be executed from PowerShell editor ## INTERACTIVE OR AUTOMATIC MODE. ## FOR AUTOMATIC MODE. SET THE VARIABLE BELOW.OTHERWISE PROMPT WOULD REQUEST EACH. ## SET THE NUMBER OF TIME YOU WISH UPLOAD FOR EACH FILES ##$t = "10" ### SET THE REMOTE SHAREPOINT REMOTE LOCATION FOR THE SHARED DOCUMENT ### OR LET THE PROMPT ### EX: $spPath = "http://sharepoint/home/Shared%20Documents/" #### SET LOCAL PATH OF FILES TO BE UPLOADED. #### EX: $localPath = "e:\my_files" ################################################################################## Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue # get the SharePoint path if not specified $i = 1 if ($spPath -eq "") { Write-Host $spPath = Read-Host -Prompt " Please enter the full path for the shared librairy?" } if ($t -eq "") { Write-Host $t = Read-Host -Prompt " How Many times you wish to upload?" } # get the local path if not specified if ($localPath -eq "") { Write-Host $localPath = Read-Host -Prompt " Please enter the full path to the local directory that contains the documents to be uploaded" } do {Write-Host $i;$i++ ## Define our library name and web url $LibraryName = $spPath.Substring($spPath.LastIndexOf("/")+1) $webUrl = $spPath.Substring(0,$spPath.LastIndexOf("/")) ## Define a function to return the destination file name Function BuildFileName($filename) { "$webUrl/$LibraryName/" + $(split-path -leaf $filename) } ## Upload all the documents found in the specified location Write-Host "Uploading all documents from $sourceDocs" $webClient = New-Object System.Net.WebClient $webClient.Credentials = [System.Net.CredentialCache]::DefaultCredentials dir $localPath | % { Write-Host "Uploading file from "$localPath": $_" -nonewline $fName = BuildFileName $_ $webClient.UploadFile($fName,"PUT", $_.FullName) Write-Host " done" -ForegroundColor Green } } until ($i -gt $t)
Having dynamic IP addressing from your Internet Provider (ISP) could give you some trouble; especially when you need to remotely accessing machines;
I had to write a little script that regulary based checks my external IP; And if it change then sending to me an email.
Schedule it into your crontab and you are done.
Below, the script :
I have been using a script for a while switching off the esxi to a certain time. Crontab in used to do it, as this post
Unfortunately, this script does not do much than poweroff the vms and switching off the esxi; As a consequence the vmware’s running at that time would have been stopped roughtly;
All the work done would have been lost, so I decided to review this script to do the following;
– List of Machines currently running
– Retrieve ID’s for each Machines
– suspend command for each IDs.
– Then Poweroff the Esx(i).
Continue reading “Suspend running vmware and switch the esx(i) off”
I have been using this small script to check if multiple host would have been online. Continue reading “Checking multiple hosts available through the network in once on Linux”
Having a huge amount of files, I had to change the files in uppercase.
Just a quick command line/script that at change in uppercase the file’s name and extension based on the extension given.
Continue reading “Change file ‘s name and extension in uppercase on Linux”