Labels

Android (1) Apache (1) bash (2) boost (2) C (36) C++ (4) cheatsheet (2) CLion (6) css (3) Debian (33) DL (17) Docker (3) Dreamweaver (2) Eclipse (3) fail2ban (5) git (6) GitHub (5) Hacking (4) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (33) javascript (3) Linux (181) Mac (21) Machine Learning (1) mySQL (52) Netbeans (6) Networking (1) Nexus (1) OpenVMS (6) Oracle (3) Pandas (3) php (17) Postgresql (8) Python (9) raid (1) RedHat (15) Samba (2) Slackware (52) SQL (14) ssh (1) svn (1) tar (1) ThinkPad (1) Virtualbox (4) Visual Basic (2) Visual Studio (1) Windows (5) wire (1)
Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts

Friday, 24 April 2026

Target windows XP from Mac using Netbeans and Docker

I had tried building C/C++ applications for Windows XP using my Mac and mingw-w64 installed using Home-brew but it just didnt work out. This mostly resulted in the following when trying to run the executable on Windows XP;


What I finally discovered and use is, setting up a Docker image with the appropriate XP-compatible toolchain, ie. a MinGW that targets MSVCRT, not UCRT.

Saturday, 25 January 2025

Force zerotier one to stop and preventing reload on Mac

To unload the service and stop: 
launchctl unload -w /Library/LaunchDaemons/com.mysql.mysql.plist
To load the service and start:
launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist
 
[source]

Saturday, 2 March 2024

Adding a PATH variable on the Mac

We can modify the /etc/paths file or we can create a file under /etc/paths.d such as /etc/paths.d/docker

which could contain;

~/.docker/bin

where the docker bin was located at /Users/my_username/.docker/bin

See also [here] for an example of adding JAVA to the System PATH in Linux.

Install command line tools on Mac

xcode-select --install 

Friday, 23 September 2022

ISO keyboard on Mac

Had several issues through the years with UK keyboards not being recognised in MAC OS.

Sunday, 24 July 2022

Change java version on Mac

To see which version of java is installed, do;

java -version

with an example of the output being;

java version "17.0.4" 2022-07-19 LTS

Java(TM) SE Runtime Environment (build 17.0.4+11-LTS-179)

Java HotSpot(TM) 64-Bit Server VM (build 17.0.4+11-LTS-179, mixed mode, sharing)

If we want to change the default version, first do;

/usr/libexec/java_home -V

an example of the output is;

Matching Java Virtual Machines (2):

    17.0.4 (x86_64) "Oracle Corporation" - "Java SE 17.0.4" /Library/Java/JavaVirtualMachines/jdk-17.0.4.jdk/Contents/Home

    11.0.15.1 (x86_64) "Oracle Corporation" - "Java SE 11.0.15.1" /Library/Java/JavaVirtualMachines/jdk-11.0.15.1.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk-17.0.4.jdk/Contents/Home

then if we wanted to change it, we would do;

export JAVA_HOME='/usr/libexec/java_home -v 11.015.1'

The above is untested.

Friday, 15 July 2022

Create iso file from file on a Mac

1) Open Disk Utility and choose FILE > NEW IMAGE > IMAGE FROM FOLDER
2) Choose the folder and select IMAGE FORMAT as DVD/CD Master.
3) Navigate to where the file is created and run the following command;

hdiutil makehybrid -iso -joliet -o LIC.iso LIC.cdr



where LIC.iso is the TARGET and LIC.cdr is the SOURCE.

On Linux we would use;

mkisofs -o LIC.iso /path/to/LIC

where LIC.iso is the TARGET and LIC is the SOURCE folder.

If we have a cdrom as a source, we could use;

dd if=/dev/cdrom of=/path/to/LIC.iso

Saturday, 19 September 2020

Xdebug install and configuration for use with PhpStrom

To enable and configure Xdebug for use with PhpStorm

This was carried out on my Mac, yet to be tested under Linux.

Wednesday, 26 August 2020

start/stop apache on Mac


sudo apachectl start

sudo apachectl stop

also note

brew services 

PHP install on MacOS with note on Debian 10.5

For Mac with Home-brew

brew install php

After install with Home-brew, the location of both the default and new install can be seen below;


the latter is the original Mac install.

Also see here

For Debian;


sudo apt-get install php

then

sudo apt-get install php7.3-cgi

Note, replace the 7.3 with whatever php version was installed in the previous step.

This can be checked by

php -version

or

dpkg -s php



Saturday, 18 July 2020

Linux shell command shortcuts

Handy forgotten shortcuts, for those lazy moments;



  • UP Arrow - Previous command.
  • TAB - Autocomplete.
  • history - Displays command history.
  • !! - Execute previous command (I don't like, prefer UP ARROW).
  • !n - Executes the command n in the history.
  • !$ - Recall argument used on the previous command (if there was one).
  • ALT . - Filter through previous arguments (doesn't always work, especially on Mac).
  • ^r (CTRL r) - search through history. 




Thursday, 18 June 2020

How to find the Hostname and Domain name on Mac or Linux

To find the hostname on a Mac, simply do as one would on a Linux box;

hostname

To find the domain name on a Mac, we can do as we would on a Linux box also;

cat /etc/resolv.conf

The following may also help on a Mac;

scutil --dns

It may also be worth looking under the Search Domains section;

System Preferences >> Network >> [Select NIC] >> Advanced  >> DNS

On Linux, we can also do the following;

domainname - not always set for some reason, especially on my Slackware systems.

dnsdomainname - This shows on my Slackware systems.

nisdomainname - not always set for some reason, especially on my Slackware systems.

ypdomainname - not always set for some reason, especially on my Slackware systems.


Sunday, 7 June 2020

Double tapping the space bar inserts a period or full stop on Mac

If you have a Mac and find that you are randomly seeing a full stop or period being inserted after words randomly, then it is most likely that you have the following setting enabled;


SETTINGS > KEYBOARD > TEXT

Thursday, 4 June 2020

How to boot into macOS Recovery and optionally erase the disk

The following can be used to reboot into recovery;


Command (⌘) + R
Reinstall the latest macOS that was installed on your Mac (recommended).

Option + ⌘ + R
Upgrade to the latest macOS that is compatible with your Mac.

Shift + Option + Command (⌘) +  R
Reinstall the macOS that came with your Mac, or the closest version still available.

To optionally erase the disk;


Choose View > Show All Devices and then choose the top drive, the system drive and choose erase.
Note: Its worth copying the drive name as we can use it to name the newly formatted drive, if that's your thing.

Reference here and here for recover options.

Tuesday, 26 May 2020

Add to the shell PATH in MacOS

The following will add to the shell path in MacOS;

Open .bath_profile
(Don't forget [SHIFT + CMD + .] toggles displaying of hidden filed in finder.)

To ad a folder such as /Users/plisken/connectiq/bin we would add the following line to the end of .bash_profile;

export PATH="/Users/plisken/connectiq/bin:$PATH"

OR

export PATH=$PATH:/Users/plisken/connectiq/bin

and of course we can check the current $PATH by doing echo $PATH

Relaunching the terminal may be required...


Monday, 11 May 2020

Quickly add dir to OSX

A quick and dirty method of adding dir to a Mac is as simple as creating a link to /bin/ls

ls is located in /bin

By default we can't add or modify things there (topic for another time), but we can modify things in /usr/local/bin so where better a place to add a dir file/command...

goto /usr/local/bin
and do sudo ln -s /bin/ls dir

dir now exists in /usr/local/bin as a symbolic link to /bin/ls

Saturday, 18 April 2020

Add a Right Click action to any Application

The following is an automator screenshot of how to add a Right Click action to highlighted text in any application on a Mac.

Friday, 4 January 2019

Mac add Open With to Right Click menu

Add OPEN WITH to Right click menu
  1. Open Automator and select Service document type.
  2. Select Files and Folders in the top Service receives selected menu
  3. Search for and select the Open Finder Items action.
  4. Now select TextEdit in Open with:
  5. Save the service with a name you want to see in the menus
You can now find this by: 
  • Right-clicking the file > Services