Category: Tutorial

Radeon RX 580 on Hackintosh OSX 10.13.4 Automatically Rotate Screen on Boot

Recently I got an ASUS Radeon RX 580 to replace an NVidia Card I was tired of fighting and trying to make work properly. As it turns out, no video card is very easy to get working with Hackintosh!

Anyway, today the problem was after finally getting two monitors working the secondary monitor was booting with a weird rotation and was a pain in the ass to change each time I logged in because the mouse was about 5″ off location on that screen.

There must be a way to automate it, thought I.

Here’s how I did it.

# cd ~/Documents/Source
# git clone https://github.com/CdLbB/fb-rotate.git
# cd fb-rotate
# gcc -w -o fb-rotate fb-rotate.c -framework IOKit -framework ApplicationServices
# nano /Users/YOURUSERNAME/Library/LaunchAgents/com.blofeld.fb-rotate.plist

put this

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>Label</key>
 <string>com.YOURUSERNAME.fb-rotate</string>
 <key>ProgramArguments</key>
 <array>
 <string>/Users/YOURUSERNAME/Documents/Source/rotate.sh</string>
 </array>
 <key>RunAtLoad</key>
 <true/>
</dict>
</plist>

then get the list of your screens

# /Users/YOURUSERNAME/Documents/Source/fb-rotate/fb-rotate -l

Which will output something like this

Display ID Resolution
 0xb430e32 1920x1080 [main display]
 0x2b287c4c 1200x1920

Take note of the screen you want to automatically rotate on boot. Copy the 0x00000 number.

# nano ~/Documents/Source/rotate.sh

And put fb-rotate command into the file

/Users/YOURUSERNAME/Documents/Source/fb-rotate/fb-rotate -d 0X_YOURIDHERE -r 0
/Users/YOURUSERNAME/Documents/Source/fb-rotate/fb-rotate -d 0X_YOURIDHERE -r 270

then make it executable

chmod +x ~/Documents/Source/rotate.sh

Now on your next reboot, it should auto flip your monitor the orientation you want. Obviously not a super elegant solution, but, whatever it’s done right, and, it work

If you want to test your scripts here they are testing:

to load:

launchctl load com.YOURUSERNAME.fb-rotate

to unload:

launchctl unload com.YOURUSERNAME.fb-rotate.plist

Making a cheap bookshelf using milk-crates

A couple weekends ago, my fiance and myself came up with the idea to make custom bookshelf using milk-crates. We didn’t actually have any milk crates, so we had to scour sites like Kijiji and Craigslist to find people in our area giving them away, or selling them cheaply. We also aquired some from a small corner store we visit frequently, first for free, then having to pay small amounts for them until we cleared them out!

Making this bookshelf will be pretty straightforward, and you don’t need many tools or additional items to make it. And, all you really need for this design is a total of 6 milk crates. However, this can change based on your design or what you plan on extending it to. 

First we had to figure out how wide the two milkcrates pushed together would be, so my fiance decided to use a small lighter to visualize the width before heading over to the home store. Not sure if this is the best method, but it seemed to work – lol!

So, let’s get down to business and start building this thing!

Here’s the list of stuff we had to procure.

  • Box of 1.5″ by 1/4″ stove bolts, with nuts. We got the box of 100 total nuts and bolts.
  • Box of 5/16″ fender washers (small hole, big disc)
  • Drill + drill bit (depending on bolt location)
  • Vice Grips, Wrench or (ugh!) Pliers to hold the bolt
  • 1 or 2 bottles of spray paint of your choosing. We picked Gold cause bling!

Now that you have parts procured and ready

So, now you’re going to want to lay out your shelf. Make sure to keep in mind that you may need to get it up, and down stairs or around tight corners. So, don’t make it too long, or, assemble it in it’s final resting place.

For our design, we chose to make a ‘staircase’ or ‘triangle’ out of the milk-crates, using 6 crates in total. This allows us to have it sitting in a triangle formation on the ground with shoe or other storage below, and 6 large spaces for books that will show up on an angle. You could also put it in a ‘staircase’ format up the wall, and have top shelves available for plants or other accessories.

You can do stepped shelves
Or, be fun like us and do a triangular shape !

So, once you have your design finalized (maybe you want to make an atari spaceship, or a rectangle, or whatever) lay out your milk crates in the design you want to get together.

Figure out where you want to put the bolts into the milk crates that will join them together securely, and easily. We chose to put 3 bolts per join, so in total we used this to secure ours (6 join spots):

  • 18 Bolts
  • 18 Nuts
  • 18 Washers

This is what we did to join ours together

First, we held them together and drilled a hole for the bolts.
Then, we tightened down with a screwdriver and vice-grips, or whatever they are called 🙂
Ended up looking like this, nice and tight!

What did it all cost?

  • Milk Crates – Free + $10
  • 2 Cans of spray paint  – $25.58
  • Fender Washers – $11.65 (50 qty) ($4.14 cost for the whole shelf)
  • Stove Bolts + Nuts – $15.61 (100 qty)  ($2.88 cost for this whole shelf)

Grand total of $42.60 with plenty of nuts/bolts/washers for more shelves!

 

 

SED lines to remove Bold customer pricing app from Shopify Theme

The Bold Customer Pricing app for Shopify is a little complex to remove.

You can follow the installation instructions in reverse for removal but you’ll probably also need these lines below to quickly find and replace the lines it has modified in your theme.

The other edits can’t really be automated with ease as each theme is different, but, these should remain the same.

If you’re on Mac, you’ll need to do this first in your terminal.

export LC_CTYPE=C 
export LANG=C

Then, go to the directory with your theme downloaded, probably using the themekit if you’re a regular developer, and execute these commands which will find and replace all instances of bold’s code.

find ./ -type f -exec sed -i -e 's/bold_price/product.price/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_price_min/product.price_min/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_price_max/product.price_max/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_price_varies/product.price_varies/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_compare_at_price/product.compare_at_price/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_compare_at_price_min/product.compare_at_price_min/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_compare_at_price_max/product.compare_at_price_max/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_compare_at_price_varies/product.compare_at_price_varies/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_selected_or_first_available_variant/product.selected_or_first_available_variant/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_selected_or_first_available_variant/product.variants.first/g' {} \;
find ./ -type f -exec sed -i -e 's/bold_selected_or_first_available_variant/product.variants[0]/g' {} \;

Then just make sure you’ve done all the changes mentioned in their installation instructions (in reverse!) and you should be good to go.

Hope this helps someone else too!