Skip to content

Instantly share code, notes, and snippets.

View codenathan's full-sized avatar

Sakees Nathan codenathan

View GitHub Profile
@codenathan
codenathan / hide_google_recaptcha_except_contact_page.php
Created July 22, 2021 11:24
WordPress - Hide Google Recaptcha Except Contact Page
<?php
/* CONTACT FORM 7 */
// This code enables to disable contact form 7 from loading on every page except the contact page
// This form also disables the Google recaptcha from loading on every page
// add the following in your functions.php
@codenathan
codenathan / wordpress-security.php
Created July 22, 2021 11:26
Wordpress - Basic Security Features
<?php
//SOME BASIC WORDPRESS SECRUITY
// add this to your functions.php
add_filter('xmlrpc_enabled', '__return_false');
remove_action('wp_head', 'rsd_link'); //removes EditURI/RSD (Really Simple Discovery) link.
remove_action('wp_head', 'wlwmanifest_link'); //removes wlwmanifest (Windows Live Writer) link.
@codenathan
codenathan / moving_wordpress_website_mysql_command.sql
Created July 22, 2021 11:26
Wordpress - Move From Old Site To New Site Mysql Commands
/*
A simple command for updating wordpress urls when moving websites
*/
/* REPLACE THE THREE BELOW @prefix (if different from default) , @oldurl , @newurl */
SET @prefix = "wp";
SET @oldurl = "http://oldurl";
SET @newurl = 'http://newurl';
@codenathan
codenathan / wpcf7_validate_textarea.php
Last active July 22, 2021 11:30
Worpress Contact Form 7 - Textarea Validation - Your Message
add_filter( 'wpcf7_validate_textarea', 'no_urls_allowed', 10, 3 );
add_filter( 'wpcf7_validate_textarea*', 'no_urls_allowed', 10, 3 );
function no_urls_allowed( $result, $tag ) {
$tag = new WPCF7_Shortcode( $tag );
$type = $tag->type;
$name = $tag->name;
@codenathan
codenathan / create_admin_user_using_cmd.bat
Created July 22, 2021 11:33
Create an Admin User Account Using CMD Prompt
# Create The User
net user /add [*username] [password]
#e.g. net user /add codenathan
# Add User To Administrator Group
net localgroup administrators [username] /add
@codenathan
codenathan / reset_windows_10_admin_password.bat
Created July 22, 2021 11:35
Reset Windows 10 Local Admin Password with Command Prompt
#Take a backup copy of utilman.exe
copy c:\windows\system32\utilman.exe c:\windows\system32\utilman_bak.exe
#Copy to Utilman
copy c:\windows\system32\cmd.exe c:\windows\system32\utilman.exe

How to start a GoLang Project

This will guide you on how setup a go lang project through terminal. with Go you can now start your project inside any folder.

there a several steps you need to do.

Here are the step

Prerequisites

  • Install Git either via Homebrew using brew install git or download the binary installerr https://git-scm.com/

Generate SSH

Open Bash and run following commands

Sometimes the .ssh folder may not get created

@codenathan
codenathan / MaterialDarkCustom.itermcolors
Created September 6, 2023 20:24
Iterm 2 Colour Scheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.21960784494876862</real>
@codenathan
codenathan / Dnsmasq.md
Created September 6, 2023 21:25
CUSTOM Dnsmasq Configuration for MAC

Custom Dnsmsq Config on MAC

Add Additional Config File

Open the dnsmasq configuration file by running the following command in your terminal:

sudo nano /usr/local/etc/dnsmasq.conf