Skip to content

Instantly share code, notes, and snippets.

View copley's full-sized avatar

Max Copley. SWEN Graduate from VUW (Wellington, NZ) copley

View GitHub Profile
@copley
copley / Locked Host File
Created December 3, 2023 20:47
Locked Host File
For reasons only you know, you have locked the hosts file, as well as adding an inappropriate ACL to the etc directory. I'll limit myself to fixing the hosts file. Enter the following command in the same way as before -- NO TYPING:
sudo chflags nouchg /etc/hosts
You'll be prompted for your password, which won't be displayed when you type it. Type nothing in the window except your password. Then quit Terminal.
@copley
copley / Java Snippets
Created May 23, 2020 02:57
Java Snippets
package snippets;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
@copley
copley / SQL vs MySQL: What's the Difference?
Created May 15, 2020 05:25
SQL vs MySQL: What's the Difference?
What is SQL?
SQL is a language which is used to operate your database. SQL is the basic language used for all the databases. There are minor syntax changes amongst different databases, but the basic SQL syntax remains largely the same. SQL is a short abbreviation of Structured Query Language. According to ANSI (American National Standards Institute), SQL is the standard language to operate a relational database management system.
SQL is used in the accessing, updating, and manipulation of data in a database. Its design allows for the management of data in an RDBMS, such as MYSQL. SQL language also used for controlling data access and for creation and modification of Database schemas.
What is MYSQL?
Developed in the mid-90s., MySQL was one of the first open-source database available in the market. Today there are many alternatives variants of MySQL,. However, the differences between the variants are not significant as they use the same syntax, and basic functionality also remains same.
@copley
copley / POWER PHRASES TO BUILD YOUR RESUME
Created May 10, 2020 10:37
POWER PHRASES TO BUILD YOUR RESUME
POWER PHRASES TO BUILD YOUR RESUME
ACCURACY
 Recognize the importance of accuracy
 Perform with a high degree of accuracy
 Perform with consistent accuracy
 Achieve results with accuracy and precision
 Maintain high statistical accuracy
 Expect perfection
 Strive for perfection
 Excel in achieving perfection
@copley
copley / Bash Hints
Last active April 21, 2023 17:33
Bash Hints
Find .class files,
# find . -mindepth 3 -maxdepth 5 -name "*.class"
Find the passwd file under all sub-directories starting from root directory.
# find / -name passwd
./usr/share/doc/nss_ldap-253/pam.d/passwd
./usr/bin/passwd
./etc/pam.d/passwd
1 Tools and Commands Reference
The JDK tools and their commands enable developers to handle development tasks such as compiling and running a program, packaging source files into a Java Archive (JAR) file, applying security policies to a JAR file, and more.
The tools and commands reference topic lists and describes the Java Development Kit (JDK) tools. They’re grouped into the following sections based on the related functions that they perform. Details about the tools and the commands that you use to run them are contained in the corresponding sections of this guide.
Main Tools
The following foundation tools and commands let you create and build applications:
javac: You can use the javac tool and its options to read Java class and interface definitions and compile them into bytecode and class files.
@copley
copley / 2000 Java Problems
Created May 5, 2020 03:55
2000 Java Problems
https://www.w3resource.com/java-exercises/sorting/index.php
Basic Part-I
Basic Part-II
Data Types
Conditional Statement
Array
String
Date Time
Method
https://www.w3resource.com/java-exercises/array/index.php#editorr
https://www.ntu.edu.sg/home/ehchua/programming/java/J2a_BasicsExercises.html
https://adriann.github.io/programming_problems.html (Shown Below)
Simple Programming Problems
Whenever I’m TA for a introductory CS class where students learn some programming language, I have trouble coming up with good exercises. Problems from Project Euler and the like are usually much too difficult for beginners, especially if they don’t have a strong background in mathematics.
@copley
copley / 100 Java Problems
Created May 5, 2020 02:24
100 Java Problems
https://adriann.github.io/programming_problems.html
Simple Programming Problems
Whenever I’m TA for a introductory CS class where students learn some programming language, I have trouble coming up with good exercises. Problems from Project Euler and the like are usually much too difficult for beginners, especially if they don’t have a strong background in mathematics.
This page is a collection of progressively more difficult exercises that are suitable for people who just started learning. It will be extended as I come up with new exercises. Except for the GUI questions, exercises are generally algorithmic and should be solvable without learning any libraries. The difficulty of the exercises of course somewhat depends on the programming language you use. The List exercises for example are more complicated in languages like C that don’t have build-in support for lists.
I suppose they are also useful, although much easier, whenever an experienced person wants to learn a new language.
@copley
copley / 10 Skills Java Programmer can Learn to Accelerate their Career
Created May 4, 2020 06:08
10 Skills Java Programmer can Learn to Accelerate their Career
https://dev.to/javinpaul/10-skills-java-programmer-can-learn-to-accelerate-their-career-3nlh
10 Skills Java Programmer can Learn to Accelerate their Career
javinpaul profile image javinpaul Jan 10 ・15 min read
#java #programming #docker #programmer
Disclosure: This post includes affiliate links; I may receive compensation if you purchase products or services from the different links provided in this article.
I often receive emails from my readers about how they can become a better Java developer, what things they should learn, and which area they can work on to become a Rockstar Java developer.
After answering them individually over the last few years, I thought to jot down a couple of points which I think will make you a better Java Programmer and Application developer.