This is one of my favorite pieces of electronic equipment that I own. Any device that allows me to interface with the real world - and natively to my Mac - is a piece of art. The GPIO interface connects via USB to the computer on one side; two 10-pin SIP connectors provide the power, ground, and I/O pins on the other.
The FT232-H supports many protocols. I don't get into this. I do, however, utilize the digital I/O pins for standard binary entry. This allows integration with simple switch circuits and advanced buttoned matrices ( or a parallel binary connection to any other circuit, i.e. a binary decoder ( 74HC595 ) ).
A Python API exposes all basic services of the chip and allows rapid integration into any programme environment that requires GPIO. This solution provides an affordable, expandable, I/O interface to all popular computing platforms, ultimately controlled via shell scripts and abstracted through a web interface. The design encourages opportunities for remote IOT installations or extending the digital GUI into a unique hands-on physical experience.
Are there any tips or tricks for WordPress developers?
Friday, May 26th, 2023 | Technology
Here are some tips and tricks for WordPress developers:
1. Stay Updated: Keep yourself updated with the latest versions of WordPress, themes, and plugins. Stay informed about new features, security updates, and best practices by following WordPress news, official documentation, and developer resources.
2. Use Child Themes: When customizing a WordPress theme, create a child theme instead of modifying the parent theme directly. This allows you to preserve your changes even when the parent theme is updated. Child themes inherit the functionality and styling of the parent theme while giving you the flexibility to make modifications.
3. Use Hooks and Filters: WordPress provides a robust system of hooks and filters that allow you to modify the behavior and appearance of WordPress core, themes, and plugins. Hooks (actions and filters) provide a way to insert custom code at specific points in the execution flow, enabling you to extend and customize WordPress functionality without modifying the core files directly.
4. Debugging Tools: Utilize debugging tools and techniques to identify and fix issues efficiently. Enable WP_DEBUG in your development environment to display PHP errors and warnings. Use debugging plugins, such as Query Monitor or Debug Bar, to analyze database queries, PHP errors, and performance bottlenecks.
5. Secure Your Website: Implement security measures to protect your WordPress website. Use strong passwords, keep your themes and plugins updated, and regularly backup your site. Consider using security plugins and employing security best practices, such as two-factor authentication and limiting login attempts, to enhance the security of your WordPress installation.
6. Optimize Performance: Optimize your WordPress website for better performance. Minimize HTTP requests, leverage caching mechanisms, optimize images, and use a content delivery network (CDN) to improve page load times. Performance optimization plugins, such as WP Rocket or W3 Total Cache, can assist in implementing these optimizations.
7. Version Control: Use a version control system like Git to track changes and collaborate with other developers effectively. Version control helps you manage different versions of your code, track changes, and easily roll back to previous versions if needed.
8. Community Engagement: Engage with the WordPress community by participating in forums, attending WordCamps or local WordPress meetups, and contributing to the WordPress project. Networking with other developers can provide valuable insights, learning opportunities, and potential collaborations.
9. Documentation and Testing: Maintain clear and comprehensive documentation for your WordPress projects. Document code, APIs, customizations, and any project-specific information. Additionally, write unit tests to ensure the stability and quality of your codebase.
10. Continual Learning: WordPress evolves rapidly, so commit to continuous learning. Explore new technologies, frameworks, and coding practices. Stay updated with industry trends and best practices in web development to enhance your skills and deliver better WordPress solutions.
Remember, these tips and tricks are meant to assist you in developing high-quality WordPress websites. Adapt them based on your specific project requirements and keep exploring new techniques and strategies as you grow as a WordPress developer.
Art of Modern Wizardry
Friday, March 23rd, 2018 | Lifestyle
I've always been fascinated by wizardry and our geophysical relationship with the earth and sky. Ready to get started? Check out this amazing guide on treeing, the method for reupping your wizard energy:
#!/bin/bash
clear
echo "Please make yourselves comfortable"
echo "while I go to the door of the Throne Room"
echo "and tell Oz you are here."
# START APACHE SERVER
apachectl start
# START MYSQL SERVER
cd /usr/local/mysql/support-files
./mysql.server start
# START COLDFUSION
cd /Applications/ColdFusion11/cfusion/bin
./coldfusion start
#!/bin/bash
clear
echo "Please make yourselves comfortable"
echo "while I go to the door of the Throne Room"
echo "and tell Oz you are here."
# START APACHE SERVER
cd /etc/init.d/
./apache2 start
# START MYSQL SERVER
cd /etc/init.d
mysql start
# START COLDFUSION
cd /opt/coldfusion9/bin
./coldfusion start
ColdFusion - CFBuilder Regular Expressions for Search
# Import standard Python time library.
import time
# Import GPIO and FT232H modules.
import Adafruit_GPIO as GPIO
import Adafruit_GPIO.FT232H as FT232H
# Temporarily disable the built-in FTDI serial driver on Mac & Linux platforms.
FT232H.use_FT232H()
# Create an FT232H object that grabs the first available FT232H device found.
ft232h = FT232H.FT232H()
# Configure digital inputs and outputs using the setup function.
# Note that pin numbers 0 to 15 map to pins D0 to D7 then C0 to C7 on the board.
ft232h.setup(7, GPIO.IN) # Make pin D7 a digital input.
ft232h.setup(8, GPIO.OUT) # Make pin C0 a digital output.
# Loop turning the LED on and off and reading the input state.
print 'Press Ctrl-C to quit.'
while True:
# Set pin C0 to a high level so the LED turns on.
ft232h.output(8, GPIO.HIGH)
# Sleep for 1 second.
time.sleep(1)
# Set pin C0 to a low level so the LED turns off.
ft232h.output(8, GPIO.LOW)
# Sleep for 1 second.
time.sleep(1)
# Read the input on pin D7 and print out if it's high or low.
level = ft232h.input(7)
if level == GPIO.LOW:
print 'Pin D7 is LOW!'
else:
print 'Pin D7 is HIGH!'
Get original remote IP address with CloudFlare and Apache / NGINX
WordPress editor plugins work by extending the functionality of the default WordPress editor, also known as the Gutenberg editor or block editor. The default editor provides a set of core blocks for creating content, such as paragraphs, headings, images, and lists. Editor plugins enhance this functionality by adding new blocks, modifying existing blocks, or providing additional options and features within the editor interface.
Here's an overview of how WordPress editor plugins typically work:
1. Integration: Editor plugins integrate with the WordPress core and the Gutenberg editor. They leverage the Gutenberg block system to add their own custom blocks or modify existing ones. The plugin registers its blocks and hooks into the editor's rendering process.
2. User Interface: Editor plugins provide a user interface within the WordPress admin area for configuring and managing the plugin's features. This interface may include settings, options, and customization controls specific to the plugin's functionality.
3. Custom Blocks: Editor plugins often introduce new blocks that offer specialized functionality. These blocks can be added to the editor like any other block, providing additional content elements or interactive components. For example, a plugin may introduce blocks for testimonials, sliders, pricing tables, contact forms, or social media feeds.
4. Block Extensions: Editor plugins can also extend the capabilities of existing blocks provided by WordPress or other plugins. They may add new customization options, styling controls, or advanced settings to the default blocks. This allows users to have more flexibility and control over the appearance and behavior of their content.
5. Backend Processing: When a user creates or updates content using the editor plugin, the plugin's code processes the data entered by the user. This may involve validating inputs, sanitizing data, and performing any necessary operations specific to the plugin's functionality.
6. Frontend Rendering: The content created or modified using the editor plugin is saved in the WordPress database and rendered on the frontend of the website. The plugin's code ensures that the custom blocks or modifications made by the user are properly rendered and displayed as intended on the live site.
It's important to note that the exact implementation and features of editor plugins can vary depending on the specific plugin. The WordPress plugin architecture provides a flexible framework for developers to extend and enhance the editor's capabilities according to their specific needs and requirements.
How do you build a mini house?
Saturday, June 24th, 2023 | Architecture
Building a mini house, also known as a tiny house, involves several steps. Here are some general steps to follow:
1. Determine your needs: Before you begin building, you need to decide on the size and layout of your mini house. Consider your needs and the maximum number of people who will be living in the house. You may also want to think about any special features or requirements, such as a loft or a solar-powered system.
2. Create a design: Sketch out a design for your mini house. Consider things like the number of rooms, the overall shape, and the placement of windows and doors.
3. Gather materials: Once you have your design in place, it's time to gather the necessary materials. This will include items like lumber, insulation, roofing materials, and siding.
4. Build the foundation: Depending on your design, you may need to create a foundation. This can be as simple as pouring a concrete slab or as complex as building a raised platform.
5. Construct the frame: With the foundation in place, it's time to begin constructing the frame of your mini house. This will involve building the walls, roof, and floor.
6. Install utilities: Once the frame is in place, you'll need to install any necessary utilities. This may include things like plumbing, electrical, and heating and cooling systems.
7. Finish the interior: With the basic structure and utilities in place, it's time to finish the interior of your mini house. This may involve installing flooring, walls, and ceilings, as well as any fixtures and appliances.
8. Add finishing touches: Finally, you can add any finishing touches to your mini house. This may include things like paint, landscaping, and exterior features like a porch or deck.
It's important to note that building a mini house requires careful planning and attention to detail. Be sure to consult with local building codes and regulations, and consider hiring a professional builder or contractor if you're not experienced in construction.
onclick="return confirm('Are you sure you want to delete?');"
JavaScript | jQuery - Popup Overlay
Friday, March 23rd, 2018 | Coding
Stand Alone - http://dev.vast.com/jquery-popup-overlay/
JavaScript | Random Key
Tuesday, October 30th, 2018 | Coding
var order_id = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for( var i=0; i < 8; i++ )
order_id += possible.charAt(Math.floor(Math.random() * possible.length));
Javascript | Send OS X Notifications
Wednesday, October 31st, 2018 | Coding
< script>
var notify = function () {
// Check for notification compatibility.
if (!'Notification' in window) {
// If the browser version is unsupported, remain silent.
return;
}
// Log current permission level
console.log(Notification.permission);
// If the user has not been asked to grant or deny notifications
// from this domain...
if (Notification.permission === 'default') {
Notification.requestPermission(function () {
// ...callback this function once a permission level has been set.
notify();
});
}
// If the user has granted permission for this domain to send notifications...
else if (Notification.permission === 'granted') {
var n = new Notification(
'New message from Liz',
{
'body': 'Liz: "Hi there!"',
// ...prevent duplicate notifications
'tag' : 'unique string'
}
);
// Remove the notification from Notification Center when clicked.
n.onclick = function () {
this.close();
};
// Callback function when the notification is closed.
n.onclose = function () {
console.log('Notification closed');
};
}
// If the user does not want notifications to come from this domain...
else if (Notification.permission === 'denied') {
// ...remain silent.
return;
}
};
notify();
< /script>
The Lookup tool in Network Utility allowed you to identify the IP addresses associated with a domain name and vice versa. In Terminal, the nslookup command effectively replicates this feature.
An example Terminal command on a Mac looks like this:
nslookup apple.com
For a reverse lookup, use the IP address of the domain:
nslookup 17.253.144.10
Mac - OS X Mail / Message DUMP Recents
Thursday, January 25th, 2018 | Coding
sqlite3 -csv ~/Library/Containers/com.apple.corerecents.recentsd/Data/Library/Recents/Recents 'select display_name, address from contacts where kind like "email";'>~/Desktop/recent.csv
Reset the World: https://www.spigotmc.org/threads/reset-the-world.264427/
Minecraft Raspberry Juice Server Commands
Saturday, April 1st, 2023 | Server
time set 1000 - ( daytime )
Enter Creative Mode - You can do 2 things: 1) Enter: 'gamemode creative playername' inside the console ( gamemode creative playername ) 2) Enter: 'op yourname' inside the console and then enter: '/gamemode creative playername' inside the client
What is the purpose of writing? The purpose of writing is to express one’s self, thoughts, and experiences so they may be recollected at a later time. Writing is an excellent way to achieve your self clarity of thought and a traceable history of your own personal evolution.
It’s easier to attempt to be one’s self than it is to truly be. However, with practice and perseverance, we know that all things are possible - even the impossible.
Understanding DMARC, SPF, and DKIM
Friday, July 21st, 2023 | Server
DMARC stands for Domain-based Message Authentication, Reporting, and Conformance. It is an email authentication protocol that helps prevent email spoofing and phishing attacks. DMARC works by allowing domain owners to publish policies specifying how incoming email messages should be handled if they fail authentication checks.
Here's a breakdown of the key components and how DMARC works:
1. Authentication Mechanisms: DMARC builds upon two existing email authentication mechanisms: SPF (Sender Policy Framework) and DKIM (DomainKeys Identified Mail). SPF allows domain owners to define a list of authorized sending IP addresses for their domain, while DKIM enables the domain owner to digitally sign outgoing email messages.
2. DMARC Policy: The domain owner publishes a DMARC policy in their Domain Name System (DNS) records. This policy contains instructions for receiving email servers on how to handle emails that fail authentication checks. The policy can be set to three different modes: "none," "quarantine," or "reject."
None: In this mode, the domain owner only monitors the email authentication results and receives reports but doesn't specify any action for failed messages.
Quarantine: Emails that fail authentication checks are marked as potentially suspicious and may be placed in the recipient's spam or quarantine folder.
Reject: Emails that fail authentication checks are rejected outright and not delivered to the recipient's inbox.
3. Email Authentication Checks: When an email server receives an email, it performs SPF and DKIM checks to verify the sender's identity. SPF checks if the IP address of the sending server is authorized to send emails on behalf of the domain. DKIM verifies the digital signature attached to the email using the domain's public key.
4. DMARC Alignment: DMARC verifies that the domain in the "From" header aligns with either the SPF or DKIM authentication results. This ensures that the visible "From" domain matches the authenticated domain.
5. DMARC Actions and Reporting: Based on the DMARC policy, the email server takes appropriate action when an email fails authentication. It can either mark the message, quarantine it, or reject it. Additionally, DMARC generates reports containing information about the authentication results, which the domain owner can analyze to identify unauthorized senders and potential abuse.
DMARC helps protect domain owners from email spoofing and phishing attacks by providing a framework for email authentication and enabling domain owners to define specific policies for handling suspicious or fraudulent emails. By implementing DMARC, organizations can enhance email deliverability, protect their brand reputation, and provide a safer email environment for their users.
Visual Studio VS Code Regex to Find and Ignore Whitespace
Tuesday, March 7th, 2023 | Coding
Search for all instances of "FROM" + "PATIENTS" while ignoring whitespace:
from(\r\n)*\s+patients(\r\n)*\s+
What are some main differences between how WordPress works vs other platforms or languages?
Friday, May 26th, 2023 | Technology
WordPress differs from other platforms and languages in several ways. Here are some main differences:
1. Content Management System (CMS): WordPress is primarily known as a content management system. It provides a user-friendly interface and tools specifically designed for managing and organizing content, such as blog posts, pages, media files, and user comments. Other platforms or languages may require more custom development or additional frameworks to achieve similar content management capabilities.
2. Themes and Plugins: WordPress offers a vast ecosystem of themes and plugins. Themes determine the overall design and layout of a WordPress website, while plugins extend its functionality by adding features such as contact forms, e-commerce, SEO optimization, and more. This plugin and theme architecture allows users to customize their websites without extensive coding knowledge. In comparison, other platforms or languages may require more manual coding to achieve similar customizations.
3. PHP Development: WordPress is predominantly built using PHP, a server-side scripting language. PHP allows for dynamic content generation, database interactions, and handling server-side processes. Other platforms or languages may use different programming languages, frameworks, or paradigms for web development, which may involve a different learning curve or development approach.
4. Community and Support: WordPress has a large and active community of developers, designers, and users. This community contributes to the development of WordPress itself, creates themes and plugins, and provides support through forums, documentation, and tutorials. This vibrant community aspect of WordPress can be beneficial for troubleshooting issues, seeking advice, and finding resources. In contrast, other platforms or languages may have different community sizes or support structures.
5. Open Source: WordPress is an open-source software, which means its source code is freely available and can be modified and distributed by anyone. This open nature has contributed to its popularity and widespread adoption. Other platforms or languages may have different licensing models or restrictions on modifying and distributing the software.
It's important to note that while WordPress is widely used and versatile, there are alternative platforms and languages that may better suit specific project requirements or development preferences. Each platform or language has its own strengths, weaknesses, and use cases.
What is the best server environment for WordPress?
Friday, May 26th, 2023 | Technology
WordPress can run on various server environments, and the choice of the "best" environment depends on your specific needs and resources. However, there are a few commonly recommended server environments for WordPress:
1. Apache: Apache HTTP Server is one of the most popular web servers and has extensive compatibility with WordPress. It is widely supported, easy to configure, and has a large community. Apache works well with PHP and can handle WordPress effectively.
2. Nginx: Nginx is another widely used web server known for its high performance and scalability. It can handle a large number of concurrent connections efficiently and is often recommended for high-traffic websites. Nginx can work with PHP using PHP-FPM (FastCGI Process Manager) to handle PHP requests.
3. LAMP Stack: LAMP stands for Linux, Apache, MySQL, and PHP. It is a common server environment for hosting WordPress. Linux serves as the operating system, Apache as the web server, MySQL as the database management system, and PHP as the programming language. This stack is well-documented and widely supported.
4. LEMP Stack: LEMP stands for Linux, Nginx, MySQL, and PHP. It is an alternative to the LAMP stack and has gained popularity in recent years. LEMP is similar to LAMP but replaces Apache with Nginx. It is known for its performance and efficiency, particularly for serving static content.
5. Managed WordPress Hosting: Managed WordPress hosting providers offer specialized hosting environments optimized for WordPress. These providers typically handle server management, security, backups, and performance optimizations, allowing you to focus on building and managing your WordPress website. Managed WordPress hosting can be a convenient option if you prefer a hassle-free hosting experience.
When choosing a server environment for WordPress, consider factors such as performance, scalability, security, ease of configuration, and your level of technical expertise. It's also important to ensure that the server environment meets the minimum requirements for running the version of WordPress you are using.
What is WordPress written in?
Friday, May 26th, 2023 | Technology
WordPress is primarily written in the programming languages PHP (Hypertext Preprocessor) and JavaScript. PHP is a server-side scripting language that is widely used for web development. WordPress uses PHP for its core functionalities, such as handling database interactions, processing server-side requests, and generating dynamic web pages.
JavaScript, on the other hand, is a client-side scripting language primarily used for enhancing user interactions and providing dynamic functionality on the web. WordPress utilizes JavaScript extensively in its administration panel (backend) and for various frontend features, including themes and plugins.
In addition to PHP and JavaScript, WordPress also incorporates HTML (Hypertext Markup Language) and CSS (Cascading Style Sheets) for structuring and styling web pages, respectively. These languages work together to create the overall functionality and appearance of WordPress websites.