I use the following to remove a char from a C char array by index.
In this instance, I search for the first char and if it's a 0 then remove it.
Heisenberg - Digital Alchemist, Software Architect, Automation Specialist and Mechanical Engineer.
I use the following to remove a char from a C char array by index.
In this instance, I search for the first char and if it's a 0 then remove it.
This can be done using alacarte
MAIN-MENU>ACCESSORIES>Main Menu
The following are two methods of updating a bash script from a repository
Had several issues through the years with UK keyboards not being recognised in MAC OS.
nmap -PN -n -v -p 80,3306 192.168.254.50
To write debugging information to the browser console, add a helper function as follows;
then simply do;
[source]
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.
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'@'%';
hdiutil makehybrid -iso -joliet -o LIC.iso LIC.cdr
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
rsync -av source destination
To reset Ernitec Network cameras
Starting and stopping VirtualBox guests from the command line in Linux.
Functions and String in C
See also here
When echoing text with PHP, if the string contains more than one space, the extra spaces are lost when rendered in the browser.
the following is a workaround;
str_replace(' ', ' ', $my_text);
This is especially important if we want to display values returned from a database query and the value has a double space for example and of course if that double space is important.
Location of DSN configuration in Linux
The basic format of the commands are as follows;
For issues with Debian keyboard layout, firstly see here
gpg keys can normally be removed from the /etc/apt/trusted.gpg.d directory.
This would be in the format of sudo rm ...
However if the keys are stored in /etc/apt/trusted.gpg then we need to use;
sudo apt-key del [keyid] which is fine for older? systems where the following shows a list of the keys;
sudo apt-key list
and the keyid field would be shown but on modern systems that seems not to be the case, so this time, we again use sudo apt-key list but note the last 8 characters of the long number and this becomes the keyid which can then be removed by using;
sudo apt-key del [keyid]
In some cases the incorrect uncompressed file size is reported when running the following command;
gzip -l myfile.gz
A work around is the use the alternative below;
zcat myfile.ga | wc -c
[source]
To resize a virtualbox disk, you can do it from the GUI on current systems;