Wednesday, September 27, 2023

Connecting from macbook to linux using samba.

 I was not able to connect to my linux machine from my macbook air using smb. I found the following string:

smb://WORKSPACE%5cUsername@Hostname/Username/

And putting this string into the Connect to Server box I connected right now. Weird that this didn't work in the gui.

That is %5c between the WORKSPACE and Username.


Now it is leaving little ._ files on the network drive when you load an image.  This is supposed to turn those little dot turd files off from the mac side.

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true


Then reboot.

Monday, September 25, 2023

Got an old arcade controller working.

 I had a now ancient arcade controller that hasn't work since sometime before the end of the last century.  It was basically just a big box of microswitches not hooked to anything.  I had been building an arcade cabinet at the time.


I bought a generic usb controller board from amazon based on lowest price.  It came with the wires to connect the board to the microswitches. It also had a longer wire with a usb connector on one end and a 4 pin board connector on the other end, along with a strain relief.  I searched for "Zero Delay Arcade USB Encoder" and came up with a huge list.  I could have gotten 2 of them for just a little more than I paid for one of them. 



I removed all the existing wires from everything but the joystick and put all the connections to the nearest open port on the board.  It doesn't really matter how you set it up, except for the 4 connections on one end adjusted the board settings. 

I left the wires attached to my joystick, but I had to switch two wires to get the common wire that went to every switch to the end.  The other wires are labelled with two letters, I'm sure you can figure that out.  Luckily the board connector on the joystick wires plugged right into the new board.  I ran the connector through the hole and forced the strain relief into an empty slot in the back.  

I plugged the board into my retropi machine that I just built and booted and was able to map the keys how I wanted. :D  I am now playing robotron with a game pad in my left hand and this arcade joystick in my right hand. :D 

I screwed the board into the bottom side of the top of the case.  I reused tiny screws I got from taking apart another project. :D  If not you may need to order some tiny screws from or just use a generous amount of hot glue. :D  I even had the bottom of the case I removed 20 years ago.  I fortified it with 4 felt pads to act as standoffs to keep the screw heads from scratching anything,  If I remember correctly the old case had little rubber standoffs held on by the case screws.  


Fin.

Upgraded the ssd in a 2017 intel mackbook air

Before starting this upgrade I made sure to upgrade my macbook to the latest version of the OS.  It seems that only the latest Montgomery OS has the internet restore option to load the OS onto the new drive. 

I did not back up the drive before I installed the OS, because I wanted a clean install without any older software versions left behind.  I did copy off everything I wanted to keep from my home directory. If you attempt a similar upgrade based on your research you may want to backup the drive before hand.  Be aware that your choice of drive formatting may affect if the backup and be restored to your computer.  Be sure that your exact model computer can be upgraded.  Be sure the drive you choose is useable by macbook.  I can't help you or recommend anything other than what worked for me. I just don't know.  I got lucky and everything worked for me.

Don't follow these directions.  This is merely an account of how I performed these operations to upgrade my solid state device.  These directions may not work for you and it could cause you to destroy your laptop or the new drive. Proceed entirely and solely at your own risk. Do your own research and create your own detailed step by step plan.   Your mileage may vary. Package contents may settle during shipping. Batteries not included. Seriously.  This worked for me, but it might not work for you.  I have no affiliation with any amazon seller whose products I linked to in this post.

The laptop came from the factory with an very small solid state drive that was 128GB in size.  This is barely big enough to hold a dozen big ai models.  I had a 250GB usb thumb drive attached to store my SD 1.5 automatic1111 setup.  I had managed to fill this up too with checkpoints and lora.  I was also worried about nuking the old ssd from overuse from swapping because it swaps almost constantly. After researching this I determined that 2017 and prior macbook air laptops do not have soldiered in solid state drives.  But they use a proprietary apple only drive.  There is an adapter to convert a standard drive to the correct format and length.  

https://www.amazon.com/gp/product/B07VVNKRYR/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&th=1

I then found a low cost ssd. I made sure it had good reviews.  I went with the 1TB disk, but the 2TB drive was only about $20 more. Again, if you are doing this, you might want to use a different drive.

https://www.amazon.com/gp/product/B08X4Z4R1Y/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&th=1

The little board goes on the end of the new drive.  It will click in once it is far enough. As always, don't force, it only goes on oneway, look at the key.

One problem I ran into was not having the correct pentalope screwdriver set to remove the bottom panel and take out the screw in the internal drive that holds it into place.  I have a thousand bits, along with hundreds of security bits, and not one of them would work on this. So I had to order a set and it took me another week to get this:

https://www.amazon.com/gp/product/B074QM29ZM/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

Once it all came, I powered down the computer and removed the bottom of the case, being careful not to lose any of the screws, there were 8 small screws along the front and sides and 2 longer screws in the middle back near the hinge. I was careful not to strip any of them out when removing or installing the screws.  

I used the included little plastic wedge from the screw driver set to gently pry up on the back of the case near the hinge and it popped free easily.  Changed to the small hex screw driver in the screw driver set to remove the one screw holding in the existing ssd.  

Be very careful here. There are dire warnings about raising this drive up too high and destroying the connector on the board.  So I raised it up just high enough to wiggle free of the connector, less than a quarter inch.  

I sat aside the old drive in the packaging I got with the new drive and labelled it as such, incase I needed to put it back in.  I put the new drive also keeping it very low, just high enough to click into place.  I noticed that the board was a little longer than the lip on the screw hole by a fraction of an inch, so I carefully tightened down the screw as far as possible and without crushing the board. 

The bottom snapped back down into place. I carefully put the screws all back into place, the two longer ones in the middle back near the hinge. I was careful to not over-tighten and strip out the screws.  Once they were all in, I when back around and got a few of them a little bit tighter.  Again, I was careful to not strip them out and to not cross thread anything.

I made sure to have access to a high speed internet connection for the next step.  I held option command r down as I powered on the computer.  Once I saw a swirling circle and the restore application starting I  let up on the keys.  After a minute or two I was able to connect to a network and it loaded the app to format and install the os.   

I formatted the drive as APFS and used a guid partition table.  I researched which was best, and a web page I read said that APFS was optimized for modern solid state drives to install macos. 

Then I selected the install os option and chose the drive I just formatted.  It took about 3 hours to install.  At one point it claimed it was going to take 21 hours.  But that was fake news.  The machine rebooted a few times during this process.  Another website said that sometimes you have to try a few times to install if it fails because of the internet connection.  If this keeps happening try a different internet connection, the faster the better.

Once the machine came back up it was just like when I got the computer brand new.  It walked me through page after page of setup.  I read each page and did what I thought was best.  Once I got logged in I was surprised to have to set the wifi password in a second time.  It didn't keep this setting from the OS install.  

I then installed a lot of software to get the machine useable again, and copied over the 250GB thumb drive to get my Stable Diffusion 1.5 install set up on the much faster ssd now. 

I did setup time machine on this new drive.  All I had to do was connect a 2TB drive to the machine and erase it and the macbook popped up a "Do you want to setup time machine on this new external drive." Which I did.  Time machine is very cool.  I have setup an rsync based backup on Linux before and this is very similar. The first backup took a few hours to backup the OS, the apps, and the SD 1.5 folder. But after that it only took a few minutes once an hour to just do a diff and get the few changed files. 

So I now have a 2017 Intel Macbook Air with a 1TB drive that starts and runs a desktop much faster than before.