Labels

Android (1) bash (2) boost (2) C (34) C++ (2) cheatsheet (2) CLion (6) css (3) Debian (33) DL (17) Docker (1) Dreamweaver (2) Eclipse (3) fail2ban (4) git (5) GitHub (4) Hacking (3) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (30) javascript (3) Linux (164) Mac (19) Machine Learning (1) mySQL (47) Netbeans (4) Networking (1) Nexus (1) OpenVMS (6) Oracle (1) Pandas (3) php (16) Postgresql (8) Python (9) raid (1) RedHat (14) Samba (2) Slackware (45) SQL (14) svn (1) tar (1) ThinkPad (1) Virtualbox (3) Visual Basic (1) Visual Studio (1) Windows (2)

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.

Tuesday 19 July 2022

MySQL create a new user

CREATE USER 'username'@'%' IDENTIFIED BY 'password';

GRANT privilege ON database.table TO 'username'@'%';

The above can be combined into one as;

GRANT privilege ON database.table TO 'username'@'%' IDENTIFIED BY 'password';

To grant basic permissions on a specific database or table. for example;

CREATE USER 'username'@'%' IDENTIFIED BY 'password';

GRANT EXECUTE ON database.* TO 'username'@'%';

which would allow the username to run procedures in the specified database and nothing else.

The following may also be of use;

GRANT ALL PRIVILEGES ON *.* TO  'username'@'%' IDENTIFIED BY 'password';

GRANT GRANT OPTION ON *.* TO  'username'@'%';


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

Alpha and OpenVMS

To return to the default directory, do;

SET DEF DFCROOT:[000000]

or SET DEF [-] 


DIR *.DIR

Shows all sub directories.

DIR /SIZE/DATE

Shows file size and date attributes.

 

To change to a directory normally do;

SET DEF [dir_name] or [dir_name.sub_dir_name]

where a directory is denoted by a .DIR extension.


Random stuff;

@SYS$UPDATE:VMSLICENSE.COM

See also here

To configure TCPIP, do @TCPIP$CONFIG

To start networking at boot time, add the following to STARTUP_VMS.COM by doing EDIT STARTUP_VMS.COM

@SYS$STARTUP:TCPIP$STARTUP

A note on the Alpha, TCPIP PING doesn't seem to work, however see UCX HELP

DELETE FILE.EXT;5

Deletes FILE.EXT version 5

PURGE /KEEP=100 FILE.EXT

Deletes FILE.EXT, keeping the 100 latest versions of the file.

 

To INITIALIZE a DISK;

INITIALIZE HN1$DKA100 DATA

where the output of SHOW DEVICE shows HN1$DKA100 UNDER Name.

Afterwords, we can mount the disk as;

MOUNT DKA100 DATA where DATA is the label

To mount a CDROM showing as DKA100, use;

MOUNT /override=ident DKA100