scribbleghost

scribbleghost

Author and editor of scribbleghost.net - A classic good old blog about tech, programming, computing, system administration, scripting, gaming, web development and a lot more...

Connect to Exchange Online with PowerShell

Install Exchange Online PowerShell Module Open Internet Explorer or Edge. (If you are using the Chromium version of Edge you will need to enable Edge OneClick [chrome://flags/#edge-click-once]). Other browsers are not supported. Go to or your local exchange server,…

Add text to a video with FFmpeg

If you want to add text to multiple video files in a bulk operation, FFmpeg is the way to go. You don’t want to manually edit a bunch of videos just to add the same stuff each time. Automation for the win! In this FFmpeg example, we will add some text to this video clip. As you can see, no text yet. We want to add “hard coded” text (that cannot be removed after it is added). We are not talking subtitles/captions. Here is the command, but hold on for a sec… The following command has been made simpler to read by breaking the long command into multiple lines. If you use this command you should remove all ^-symbols, so that everything is displayed in one line. Also don’t miss the spaces in there. This command is made for a Windows environment so it might look a little different if you are on another OS. You can also make the text with a little better position and padding like this: This is the result: Sources: https://superuser.com/questions/939357/ffmpeg-watermark-on-bottom-right-corner

Restore deleted files from SharePoint Online

The easiest way to restore files in SharePoint Online is obviously just to restore the deleted files using the web interface as Microsoft recommends. However, that won’t work if you need to restore 1000-plus files. Basically, the restore process will just get stuck, and you will probably die of age before anything happens. 💀 PowerShell to the rescue! 🦸‍♂️ Install the SharePoint Patterns and Practices (PnP) cmdlet Connect to the SharePoint site Notice the sites/rooms in the URL. You need to connect to an actual site on your SharePoint, not just the root of the site. In other words, you need to know from which site the files were deleted from. List all deleted items in the site “rooms” List all items deleted by a specific user Restore all files deleted by a specific user The restore process will take a while. In my case, I restored about 1000 files in about 20 minutes. Note that you will not get a restore log, but you can of course use the above command to check if files disappear from the recycle bin. If files exist on the server you will get error messages, which is fine. This just means that the deleted file already exists, or a newer file exists. Sources: Restore Recycle bin SharePoint Online with PowerShell

Make MPC-BC more like MPC-HC

I have been a long time user of MPC-HC which was recently abandoned by its developers. It’s a shame, because the media player was not only versatile and minimal. It was blazing fast, very user friendly, and supported all media formats I could think of. So I started to use MPC-BC instead, as recommended by many. Its a great alternative, though it honestly looks like a cheap and tacky version of MPC-HC. For me though, some of the default settings are a bit odd. Player window does not adjust to resolution First of all, the player window does not adjust to the video resolution. This means that if you open a video in UHD resolution, for example, the video player might be super small. Here is how you can fix it: Just turn on “Auto-zoom” to 100% in Options -> Playback. Blurry subtitles Another strange default setting in MPC-BC is that subtitles look very blurry. Almost as if they are burned in the video, even if they are external subtitles. You can fix this by going to Options -> Subtitles -> Rendering and set the “maximum texture resolution” to “Desktop”. Turn off dark theme You can also turn off the “dark theme”. Not sure why everyone is so obsessed with that these days. Options -> Player -> Interface -> Uncheck “Use dark theme”. Remove the logo The startup MPC-BC logo is not really too good looking either. Why not just remove it? Options -> Player -> Logo -> Skip with right arrow until the picture is gone.

Record microphone with FFmpeg in Windows

It’s easy to record your computer microphone with FFmpeg. The only tricky part (although not that tricky) is you just have to know the name of your microphone input. Before you begin make sure you have FFmpeg added to PATH. Let’s start by listing your recording devices. Amongst other things this will give you something like: The only thing you need to note is your device name. In this case it is Line (3- Steinberg UR44). To start the recording you just run the following code: To stop the recording hit CTRL+C. -f dshow means “DirectShow” and lets FFmpeg capture audio and video devices, video capture devices, analog tv tuner devices. -i audio="name_of_your_microphone" is the audio device you wish to record from. Replace name_of_your_microphone with the name of your input device. -c:a libmp3lame means FFmpeg will encode the audio with LAME MPEG Audio Layer III, also known as the MP3 format. -ar 44100 tels FFmpeg to record at a sample rate of 44,100 Hz. That is the standard for most audio nowadays unless you intend to use the audio for a video in which case you would use 48,000 Hz. -b:a 320k is the audio bit rate. The highest support for MP3 is 320 kbit/s. -ac 1 means the audio will be in mono as opposed to stereo streams. This makes sense as most microphones record in mono only. If you haven’t changed the directory in your command line you can always specify where to save the file. For example C:\output.mp3.

Super simple Windows 10 and Windows 11 automated installation

Update 11 October 2021: This autounattend.xml script also works for Windows 11 version 21H2. There are a lot of ways you can automate a Windows installation. The most obvious and simple way is using an answer file. So what’s an answer file? A Windows answer file is basically just an XML file that gives Windows instructions on how and what to install. So you don’t have to sit and click next, next, next… 😉 When installing Windows you just place the answer file at the root of the installation media and name it autounattend.xml. Of course, the file has to be a valid XML answer file for it to work. You can’t just put anything in it. Here is an example of an automated installation of Windows 10 using an answer file. Here is an example of the same script installing Windows 11. Making an answer file can be a little complicated and involves using Microsoft System Image Manager. If you want you can create one from scratch, but in this post, I am just going to share my go-to script. The following code is a simple file that will: Make a local Administrator called “User” without any password. Set the keyboard and regional settings to Norwegian. There is no activation, no license, no nothing. Just save the file as autounattend.xml and place it at the root of your Windows installation media. The only thing that is not automated is which disk Windows should be installed on. I intentionally skipped that step because of the risk of accidentally deleting a drive/partition.