Nvidia is always a pain in the ass on Linux. Especially with a old white 2008 macbook. I have black screen issues every time so I create this article so I can easy find it when I reinstall this laptop 😉
First find the right identifiers.
We need both the IDs for the graphics card and the PCI-E bridge that it is connected to. Issue the following command in a shell:
Have a look at (1) the line saying display and (2) the line with bridge right before that display line. Write down the PCI-E bus ids (format XX:YY.Z) of the bridge device (here 00:17.0) and the display device (here 04:00.0) and remember which is which. Note: Those IDs may be different on your machine, depending on your Mac model and revision.
Create a GRUB script for setting the PCI-E registers during boot
Fire up a text editor with sudo nano /etc/grub.d/01_enable_vga.conf and copy/paste the content below. Make sure to paste all 4 lines into that file! Replace00:17.0 with the PCI-E ID of your bridge device noted in step 1. Replace04:00.0 with the PCI-E ID of your display device noted in step 1.
To automate some tasks with PowerShell on a website you sometimes need to log in. Today I tried some curl and postman tricks but it isn’t hard if you know what to script with PowerShell and bypass all other tools.
First, find a website to log in to, then check the page source and what the submit button does. In this example, it is “Inloggen” (dutch for login).
Then start the developer tools (F12), select the network tab, enter the credentials and login.
Now check the POST request in the developer tools.
My use case for a customer was to configure WSUS for a couple of DMZ servers. The DMZ servers are not domain-joined. So I create a PowerShell script to configure the registry so I can easily deploy the settings to the servers.
You can use this script also for non domain-joined servers
With Powershell ISE you can use CTRL + SPACE for auto completion.
But when you work in a native Powershell window you don’t have this option. And many often you cycle with tab completion trough the powershell and because you press the TAB button too soon you have to remove characters and cycle again trough all the commands.
Unit now 😉
There is an easy fix you can implement so the Powershell have the same auto completion like bash.
Type notepad $profile for Windows or gedit $profile for Linux
Add the line Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
Save the file and restart Powershell
And now you have a much better working tab completion
A friend of mine came back from vacation where he had taken a lot of pictures. When he got back home a large part of his Micro SD card (exFAT partition) was no longer accessible so he missed a couple of weeks of his photos and videos. His Windows Operating System froze completely when it hit a rotten cluster during a file copy action. So we had to find another solution to get his files back.
The first step I tried was to get the data from the SD card via Linux with ddrescue. With ddrecue, you create and complete dump of the SD card (or the sdb1 partition only). So you can do the data recovery on the image file (backup1.img) and not on the already corrupted SD Card.
But Linux also had also trouble reading when I hit a bad cluster. The only thing I could do during the read issues was a physical disconnect of the USB adapter, reconnect the adapter and restart the ddrescue process. The reason of was that a dual SD card adapter was used:
Micro SD > SD > SD > USB
(spoiler ALERT!: Never use multiple adapters for data recovery!!!)
Because ddrescue has a mapfile it goes further where he was stopped the last time.
While debugging I wrote a simple loop that forced a “physical” disconnection of the USB adapter wait one sec and reconnect the devices without touching anything.
This works but is a very very slow process. This will takes months to recover so I had to find another way.
## Steps to Prepare:
# lsusb check card reader and change the /dev/bus
# Start script in usbreset folder
# Run as sudo
# mount disk (media / thomas)
echo "Let's try Again!"
ddrescue -d /dev/sdb1 /media/thomas/4905eb31-1df4-49bb-bb75-ec4889641d20/backup1.img /media/thomas/4905eb31-1df4-49bb-bb75-ec4889641d20/backup1.mapfile
The funny thing is that it was Sinterklaas time and that my daughter had just received a vtech kiddy photo camera with a Micro SD to USB adapter included 😀
So I try new new adapter: Micro SD > USB and with success.
And after almost 15 hours the result 99.98% rescued rate 🙂
During my search for a solution I found some interesting articles: