Categories
Uncategorized

Making Space on Windows

Task

Creating space on a storage device.

Description

NVME, SSD, HDD, USB, Disk, Cloud – with time, our storage fills up with unnecessary data, this can take up a lot of space and with storage devices, they can slow down the more data they have, even if they are not full.

Quick guide

Use tools, remove temp files.
Find old programs and data.
Making priorities.

Part 0 – Info

Identify the problems

  • Lack of space (20% or more free)
  • Show loading PC

Install the required tools

  • Windows Disk Cleanup (pre-installed)
  • CCleaner
  • TreeSize

Part 1 – Finding files

Making priorities

Finding the files you want to keep and the files you can remove, priority for the biggest size.
Make a list of games and tools you use and which ones you need and don’t need, including programs that overlap and games that are large or unplayed.

Places to look

  • Apps & features (programs)
  • Desktop (personal data)
  • User folder – Documents, Downloads, etc. (projects and personal data)
  • Steam (installed games)
  • C drive

System files to keep

  • Windows, Program Files, Installed programs and directories
  • 33 GB – System Volume Information (System restore)
  • 12 GB – hiberfil.sys
  • 1 GB – pagefile.sys
  • 25 GB – Users/ianea/.nuget – windows programs

Can be removed but are also useful

  • Browsers
  • Browser temp files
  • Development (Unity, Visual Studio, Emulators)
  • Windows common and system files
  • Games and game saves

Currently used games and tools

  • Rocket League – in use
  • Fifa – unused
  • Visual Studio – in use
  • Visual Studio (older version) – unused
  • Projects from GitHub – some in use

Biggest files – A list of my largest folders

User data, Programs, windows and program data/temp files
215 GB – Users/ianea
Program data
64 GB – Users/ianea/AppData/Local
13 GB – Users/ianea/AppData/Local/Google
8 GB – Users/ianea/AppData/Local/Microsoft
6.9 GB – Users/ianea/AppData/Local/Unity
Emulators
48 GB – Users/ianea/.android
18 GB – Users/ianea/.android/avd/pixel5.avd
17 GB – Users/ianea/.android/avd/pixel2.avd
10 GB – Users/ianea/.android/avd/pixel2-k.avd
Windows programs
25 GB – Users/ianea/.nuget
21 GB – Users/ianea/AppData/Roaming
4 GB – Users/ianea/AppData/Roaming/Opera
2.5 GB – Users/ianea/AppData/Roaming/.minecraft
GitHub Repos, Games saves, Projects
13 GB – Users/ianea/source
12 GB – Users/ianea/Documents
11 GB – Users/ianea/Downloads

58 GB – Program Files
17 GB – Program Files/WindowsApps
8 GB – Program Files/Microsoft Visual Studio // 2022
6 GB – Program Files/dotnet
58 GB – Program Files (x86)
14 GB – Program Files/Microsoft Visual Studio // 2019
7 GB – Program Files/Android
57 GB – Windows
18 GB – Windows/Installer
11 GB – Windows/WinSxS
53 GB – ProgramData
22 GB – ProgramData/Microsoft // visual studio

Part 2 – Removing files

  1. Empty recycling bin
  2. Uninstall unused programs
  3. Uninstall unused games
  4. Remove old projects
  5. Remove unused data and files – Downloads, Documents, Desktop
  6. Temp files – CCleaner
  7. Windows update cache – Disk Cleanup
  8. Windows update cache – Manual
    Go to Services – Windows Update – Stop
    Delete C:\Windows\SoftwareDistribution\Download
    Go to Services – Windows Update – Start
  9. Remove files with command line – force remove rm ".\some folder" -r -force
  10. Empty recycling bin (again)

Other possible solutions

1. Move

Move data not frequently used or games onto another drive or USB device.

2. Cloud

Move data onto the cloud with a cloud provider (OneDrive, Google Drive, IDrive, Dropbox).

3. Upgrade

Upgrade to a larger storage device or add additional devices for storage.
You can also use a NAS to store data on the network.

4. Compression (not recommended for SSD lifespan)

Windows Properties – Advanced- Compress.

5. Disable services (not recommended)

Remove Hibernation, Page File, System Restore and other windows services.
You can also uninstall Windows Features

6. Check for viruses

A possible reason for a reduction in usable storage space.

Categories
Uncategorized

Windows Search Fix

Task

Fix an issue causing Windows Search to malfunction – e.g. SearchApp.exe crashing

Description

When typing into the Windows Search – e.g. press Windows Key then start typing, a window would open then close or it would search for one result but close on the next search.

Quick guide

Remove cortana, uninstall, remove with powershell and delete from Registry.
Create website, create/enable config, enable port
regedit – “search” backup, delete

Part 0 – Info

Error identified in Event Viewer

Alternative: Use PowerToys Run instead of Windows Search – Shortcut = Alt+Space

Part 1 – Registry Edit

  1. Run “Registry Editor” – Windows Key + R, type “regedit”
  2. Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search 
  3. Make a backup of the whole registry and another of this specific folder.
  4. Delete the “Search” folder entry.
  5. Restart your PC and see if Windows Search is still crashing.

Part 2 – (Optional) Remove Cortana

Settings

  1. Go to Settings > Privacy > Background apps
  2. Task Manager > Startup > Cortana > Disable

PowerShell Command

  • Run “Windows PowerShell (Admin)” – Windows key + X, A
# Command 1
WinGet uninstall "cortana"

# Command 2
Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage

Registry

Registry Editor – Navigate to Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search
Delete “BingSearchEnabled” then restart

Other possible solutions

1. Fonts

Fonts folder

  1. Go to: C:\Users\[username]\AppData\Local\Microsoft\Windows\Fonts
  2. Go to folder Properties – Security – Edit – Add – Advanced – Find Now – ALL APPLICATION PACKAGES
  3. Give  “Read & execute” permissions

2. PowerShell Command Search

  • Run “Windows PowerShell (Admin)” – Windows key + X, A
# Command 1
`Get-AppXPackage -Name Microsoft.Windows.Cortana | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}`
WinGet uninstall "cortana"

3. Rename Folder

Rename folder – Microsoft.Windows.Search_cs41h5txwa

4. Re-uninstall

  1. Install Cortana (Microsoft Store)
  2. Uninstall
Categories
Uncategorized

Multiple Apache Sites on Different Port Numbers

Task

Hosting multiple websites on a Linux server with apache using different ports for each

Description

Before – buy Linux hosting package… IONOS
Listen for ports 80, 8080 and direct to specific website folders.
Find IP address
Find ports
Setup website folders

Quick guide

Create website, create/enable config, enable port

nano cd /var/www/domain1.com/public_html/index.html
Hello World from domain1

nano etc/apache2/sites-enabled/site1.conf
DocumentRoot /var/www/domain1.com/public_html/

a2dissite 000-default.conf
a2ensite site1.conf
systemctl reload apache2

Part 0 – Info

ports 1-1024 = reserved
ports 1025-65535 = free

port 80 = website1
port 8080 = website2

Сommands used:

cd // change directory + cd .. to go back
nano // edit file
ip addr show // show private and public IP address
cat * // show all files contents
a2dissite // apache disable site config
a2ensite // apache enable site config
systemctl reload apache2 // reload apache web server

Directories:

etc/apache2/sites-enabled/ // Virtual Hosts directory
etc/apache2/ports.conf // Public ports
var/www/domain1.com/public_html // Website folders

Part 1 – Diagnostics

  1. Find address for domain to connect to
ip addr show

![[Pasted image 20231205173824.png]]


This shows the IP address you will need for the browser to connect to your website.

  1. Find open ports
ss -nat

![[Pasted image 20231205175025.png]]


“:80” = This shows port 80 is Listening for requests from the browser

Part 2 – Website folders

  1. Make sure files are in directories (using FileZilla or commands)
    ![[Pasted image 20231205174355.png]]
cd /var/www/domain1.com/public_html
nano cd /var/www/domain1.com/public_html/index.html
Hello World from domain1

cd /var/www/domain2.com/public_html
nano cd /var/www/domain2.com/public_html/index.html
Hello World from domain2
  1. Use browser to connect to IP address
    http://85.215.59.9:80/

Part 3

(Hint – shortcut)

Add to top of Virtual Hosts configurations files:
Listen 80
Listen 8080

  1. Show and edit Virtual Hosts configuration files
cd etc/apache2/sites-enabled/
cat *

![[Pasted image 20231205180200.png]]

nano etc/apache2/sites-enabled/site1.conf
nano etc/apache2/sites-enabled/site2.conf

Change “DocumentRoot” to your website folder
Change VirtualHost port of site2 to 8080

  1. Disable default VirtualHosts config and enable new configs
a2dissite 000-default.conf
a2ensite site1.conf
a2ensite site2.conf
  1. Edit ports (don’t need if used shortcut)
nano etc/apache2/ports.conf

Add to file:
Listen 80
Listen 8080

  1. Check ports are working
systemctl reload apache2
ss -nat
  1. Enable ports on server
    Ionos…
  2. Go to website
    http://85.215.59.9:80/
    http://85.215.59.9:8080/

DONE

Categories
Uncategorized

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

Categories
Uncategorized

Chrome Extension Development

How I built and published my own Chrome Extensions using JSON and JavaScript.

Overview

Over the weekend I decided to solve a small problem I had when using the Google Chrome web browser.

Problem – Some pages don’t have clickable links to middle mouse button into a new tab when I want to do something else.

Reason – I like to open a new tab in the Chrome web browser whenever I research or have an idea, normally I do this with the middle mouse button to click a link on the page such as the “home” button/ image link.

Solution – Open up a new tab of the current page whenever you right click anywhere on a page and select it from the context menu.

My example

Google Chrome Web Store page – Open page in new tab

Github repo – https://github.com/IanEarnest/OpenPageInNewTab

Helpful links – https://developer.chrome.com/docs/extensions/mv3/manifest/

Setup

Create a folder with 2 files and 4 pictures

File 1 – manifest.json

File 2 – background.js

Pictures – .png files – 16×16, 32×32, 48×48, 128×128

-Code

{
“manifest_version”: 3,
“name”: “Open page in new tab”,
“version”: “1.0”,

“description”: “Add a context menu item to load a new tab of the current page URL.”,
“icons”: {
“16”: “icon16.png”,
“32”: “icon32.png”,
“48”: “icon48.png”,
“128”: “icon128.png”
},
“background”: {
“service_worker”: “background.js”
},
“permissions”: [
“contextMenus”
]
}

//When installed, add context menu item “-Open page in new tab”
chrome.runtime.onInstalled.addListener(newMenuItem);

//Clicked “-Open page in new tab”
chrome.contextMenus.onClicked.addListener(newTab);

function newMenuItem() {
chrome.contextMenus.create({
id: “MY_CONTEXT_MENU”,
title: “-Open page in new tab”,
type: “normal”,
contexts:[“all”]
});
}

function newTab(info, tab) {
chrome.tabs.create({
index: tab.index + 1,
url: tab.url //requires “tabs”
});
}

if (chrome.extension.lastError) {
console.log(“Got expected error: ” + chrome.extension.lastError.message);
}

Run extension

Go to Extensions management – chrome://extensions

Toggle the enable developer mode option

Click the load unpacked (navigate to folder)

You should now be able to right click on a normal website to show your context menu item

Publish

Register as a dev (pay 5 euros) – https://chrome.google.com/webstore/devconsole

Follow the steps for filling in the forms, including pictures, video and descriptions, etc.

Upload your folder as a .zip file

Wait for publish review

All done, try downloading the extension as a user once it has finished the review.

Categories
Uncategorized

Android Tips

Android tips – Installing Google play on an Amazon Fire 7 tablet

Categories
Uncategorized

Synthesia custom music

Synthesia Free custom sheet music using MuseScore 2

 

Categories
Uncategorized

RuneScape Calculator (CodePen)

https://codepen.io/IanEarnest/pen/RXWYvq?editors=1111
Locally saved values
Accurate date/ time prediction

Categories
Uncategorized

Iphone screen recording

1. Load video
2. Screen capture with Record It!
3. Edit recording with Imovie.
4. Use CloudConvert to MP3.
5. Save to Icloud/ phone

Categories
Uncategorized

Hello World

hi hi