This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ~ -maxdepth 3 -type f -name "*.py" -print0 | xargs -0 ls -lt | head -n 10 |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TREASURY OF THOUGHT. | |
An Encyclopedia of Quotations | |
FROM | |
ANCIENT AND MODERN AUTHORS. | |
BY | |
MATURIN M. BALLOU. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ~/myenv/bin/activate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from datetime import datetime, timedelta | |
from tinydb import TinyDB, Query | |
from cryptography.fernet import Fernet | |
import base64 | |
import os | |
# Generate a key for encryption | |
def generate_key(): | |
return base64.urlsafe_b64encode(os.urandom(32)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To allow all privileges for Account B on your macOS laptop while preventing Account B from modifying the /etc/hosts file, you need to modify the file permissions specifically for the /etc/hosts file. This way, Account B will have administrative privileges on the system, except for modifying this specific file. | |
Here's how you can do this: | |
Step-by-Step Guide | |
Log in as Admin Account A: Make sure you are logged in as Admin Account A, which will be the primary administrator. | |
Change Ownership of the /etc/hosts File: You need to change the ownership and permissions of the /etc/hosts file so that only Admin Account A (and not Admin Account B) can modify it. Open Terminal and run the following commands: | |
bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If changes to the /etc/hosts file on your macOS are not working as expected, here are some common troubleshooting steps to help resolve the issue: | |
1. Check File Format and Syntax | |
Make sure there are no syntax errors in the /etc/hosts file. | |
Each entry should be on a new line with the IP address followed by one or more hostnames, separated by spaces or tabs. For example: | |
Copy code | |
127.0.0.1 localhost | |
192.168.1.1 example.com | |
Avoid using special characters and ensure there is no trailing whitespace after the entries. | |
2. Flush DNS Cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://apple.stackexchange.com/questions/282339/protect-hosts-file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
NewerOlder