Using RegEx in Notepad++

Using the following RegEx strings in NotePad++ to clean up book marks file.
Do a Search and replace,
In for search for fields put the following strings
In the replace field, put nothing,
Make sure regex is selected.
ADD_DATE=”[^”]+”
LAST_MODIFIED=”[^”]+”
PERSONAL_TOOLBAR_FOLDER=”[^”]+”
ICON=”[^”]+”
LAST_VISIT=”[^”]+”
ICON_URI=”[^”]+”

Change mouse scroll direction in Windows

How to Reverse the mouse scroll direction in windows

 
TL;DR – Run regedit as an admin, search for “FlipFlopWheel” and replace the 0’s with 1’s, unplug and reinsert the mouse.
Step-By-Step.

  1. Open Control Panel, double click “Mouse” to open the mouse properties windows, and then click on the “Hardware” tab.
  2. Select your mouse in the list of devices then click on the properties button in the bottom right corner, just above the “Apply” and “Help” buttons.
  3. In the device properties dialogue window, click on the “Details” tab and then select “Hardwire Ids” from the “Property” drop-down list.  You should see a list of entries starting with “HID…”.  Write down the values that start with “HIDVID_???…”.
  4. Close device properties by clicking “Cancel”.
  5. Close “Mouse Properties” by clicking “Cancel”.
  6. Find and open the application “regedt32.exe” as an administrator, if you are not already logged in as one.
  7. Navigate to “HKEY_LOCAL_MACHINESYSTEMCurrentControlSetEnumHID”, and look for an entry that resembles the “VID_???…” number that you wrote down earlier in step 3.
  8. Open each sub entry under your specified “VID_???…” key, and open the “Device Parameters” key.
  9. There should be a key named “FlipFlopWheel” under each of the “Device Parameters” key.  Reverse the entry value for the “FlipFlopWheel”.  i.e. if default is “0” (zero) change it to “1”, and vice-versa.
  10. Do the same step 9, for each alphanumeric text string key entry, and their “Device Parameters”, “FlipFlopWheel”.
  11. Close “regedt32.exe”.
  12. Unplug your USB mouse, wait for 5 to 10 seconds, then plug the mouse back in again. If that doesn’t work then reboot.

How to run a shell script in OS X by double-clicking

  • First in terminal make the script executable by typing:
    chmod a+x (yourscriptname)

 

  • Then, in Finder, right-click your file and select “Open with” and then “Other…”.

 

  • Here you select the application you want the file to execute into, in this case it would be Terminal.
  • To be able to select terminal you need to switch from “Recommended Applications” to “All Applications”.
    NOTE: The Terminal.app application can be found in the Utilities folder

 

  • If you want this to be the default behaviour from now on, check the “Always Open With” box.
  • After clicking OK you should be able to execute you script by simply double-clicking it.

Setting the hostname on your Mac

Setting the hostname on your Mac using scuttle

  1. Open a terminal.
  2. Type the following command to change the primary hostname of your Mac:
    sudo scutil –set HostName <new host name>
  3. Type the following command to change the Bonjour hostname of your Mac:
    sudo scutil –set LocalHostName <new host name>
  4. Optional: If you also want to change the computer name, type the following command:
    sudo scutil –set ComputerName <new name>
Like this:
 sudo scutil --get HostName
 sudo scutil --get LocalHostName
 sudo scutil --get ComputerName