Skip to main content

Posts

No bootable medium found error VirtualBox

Migrating from physical to virtual or P2V is a common thing to do. In this virtualization era. If hardware or a server is showing some issues, like rebooting by itself when no changes are made and the server is at the age of a primary 3 kid. Then this could be that the server is showing some signs that it needs to be retired. P2V is a good option if an existing powerful server that is not fully utilized and is able to handle another load. Migrating from OpenStack or exporting OpenStack VM to a volume so it can be used outside of OpenStack is another practice also. But sometimes things don’t go smoothly and few bumps or issues here and there may arise at times. For example doing P2V in VirtualBox for a Linux system shows an error, “FATAL: No bootable medium found! System halted.” And you let the VM run for hours hoping that it will just boot by itself but it won’t just budge the error persist no matter how long you wait. P2V is migrating or cloning a physical server to a virtu...

PowerShell Get Apache Tomcat application path

PowerShell code snippet to get the path of the Apache Tomcat folder. The PowerShell code snippet will get the Apache Tomcat folder based on the service path. So, if the Apache Tomcat is not installed on a specific folder or path. Code snippet below, will check where the folder is located. $varDirectory="" $apacheServiceName=((Get-WmiObject win32_service | ?{$_.Name -like '*tomcat*'} | select Name, State, PathName).Name) $apacheServicePath=((Get-WmiObject win32_service | ?{$_.Name -eq $apacheServiceName} | select Name, State, PathName).PathName) $apacheHome = $apacheServicePath.Substring(0, $apacheServicePath.IndexOf('\bin')) #set the folder path for the SSL cert #or set any path to teh Apache Home Folder $varDirectory = "$apacheHome\key\" #Check the Path if okay or not write-host $varDirectory #Force OverWrite and supress prompting #Copy files to the Apache Tomcat folder Copy-Item -Path "C:\Temp\star_007_com.jks" -Destination $varDirectory ...

Get EC2 Image used by the AWS Instance

PowerShell code snippet to get the image used by an specific instance. $accesskey = 'access-key' $secretkey = 'secret-key' $dregion =  'us-east-1' (Get-EC2Instance -AccessKey $accesskey -SecretKey $secretkey -Region $dregion -InstanceId i-055353ks53sd6n).Instances  | select ImageId | ft -HideTableHeaders | out-string  #i-055353ks53sd6n -- replace with the actual instance-id EC2 Image in AWS is quite important especially if you are deploying a fleet of AWS instances and it has to be in the same image.

Get Public and Private IP Address of an AWS instance

PowerShell code snippet below will get or display the Public and Private IP Address of all running instances that matches  the Tag Key and Value specified. #replace the access key, secret key and region with the actual value $accesskey = 'acces-key' $secretkey = 'secret-key' $dregion =  'us-east-1' #Display Public and Private IP Address of the Instance (Get-EC2Instance -AccessKey $accesskey -SecretKey $secretkey -Region $dregion) | Select -ExpandProperty RunningInstance | ? {$_.Tag.Key -eq "Server" -and $_.Tag.Value -eq "Web-Server"} | Select-Object PrivateIpAddress, PublicIpAddress  #Replace the Tag Key and Tag Value as required #$_.Tag.Key -eq "Server"   #$_.Tag.Value -eq "Web-Server"

AWS PowerShell check if tag exist

How to check if a Tag exist on an instance? How to change the value of the tag, if tag exist? Code below shows how to check tags on AWS instances using PowerShell.   The script will also check if the tag exists and change the value to a different value. Sample scenario where the script can be used: Example: the tag can be "Web_Server", Value "In Progress" Then once the instance is ready, the tag can be changed to "Web_Server", Value "Online"   $accesskey = 'AWS-Access-Key' $secretkey = 'AWS-Secret-Key' $dregion =   'eu-west-1' #change the region as required   #instances to be checked #repace the value with the actual instance-id $array_prefix_instanceID = @( "i-04e5er7ac566vc8", "i-0c3c3cerbc3165685vc", "i-0ecc355gf0aa5758g" )   #Assume value of the tag #Change as required / script will look for the value Yes $value="Yes"   #Tag to look...

PowerShell display pop-up message theVBScript way

Create a new object in PowerShell by referring to Wscript.Shell component. Here's the code to display a pop-up message using  PowerShell via VBScript components. #create Wscript.Shell object to $WshShell variable $WshShell = New-Object -ComObject WScript.Shell #This will display the members of WshShell #$WshShell | Get-Member #This will display the message for 5 seconds, even if the user does not click ok" $WshShell.Popup("Hello, remember to shutdown your PC! Long holiday is around the corner.", 5 , "A Gentle Reminder") #Sample image of the output above: Code below will display a warning sign and the message will stay until the OK button is clicked. #create Wscript.Shell object to $WshShell variable $WshShell = New-Object -ComObject WScript.Shell #This will display the message until the OK button is clicked and also display the warning sign $WshShell.Popup("Hello, remember to shutdown your PC! Long holiday is around the corner.", 0 , "A Gentl...

Windows 10 WiFi not working after network reset

Resetting Windows WiFi is quite a good option when wireless is not working. Indeed, “network reset” will does help if there are network issues. What if after doing “network reset” comes with another issue? For example, after doing network reset the Wireless option on the taskbar is unable to find or see the available WiFi networks. If Windows 10 is unable to find available WiFi or does not show wireless SSID available networks after network reset, then it could be that some services are not running or were set to “Manual” and did not run automatically after reset. Therefore, the service or services has to be started manually to run or enable the service. Screenshot below shows how to do a network reset on Windows 10. Press Windows key + I, on the search box type “network reset” and from the drop-down result, choose “network reset”. The system will ask to reboot or might reboot immediately. So, save files that needs to be saved before doing network reset.   After “ne...

Notepad++ convert multiple lines to a single line and vice versa

Notepad++ is an awesome text editing tool, it can accept regex to process the text data. If the data is in a “.csv” format or comma separated values which is basically just a text file that can either be opened using a text editor, excel or even word. Notepad++ can process the contents of the file using regex. Example if the data has multiple rows or lines, and what is needed is to convert the whole lines of data into a single line. Notepad++ can easily do it using regex. However, if the data is on a single line and it needs to be converted into multiple lines or rows then regex can also be used for this case. Here’s an example on how to convert multiple rows or lines into a single line. Example data: Multiple rows, just a sample data. Press Ctrl+H, and  on "Find what" type: [\r\n]+ and on "Replace with" type with: , (white space) --white space is needed if need to have a space in between the data. See image below, "Regular Expression" must be se...