Skip to content

Instantly share code, notes, and snippets.

View niksmac's full-sized avatar
🇮🇳
🧜 Merperson

Nikhil M niksmac

🇮🇳
🧜 Merperson
View GitHub Profile
@niksmac
niksmac / seo-guide.md
Last active September 19, 2023 07:08
Bare minimum SEO Guidelines for launching a website

Basic technical SEO guidelines for a webpage:

  1. Unique H1 Tag: Ensure there's only one H1 tag per page, which typically represents the main heading or topic of the page.
  2. Hierarchical Use of Heading Tags: Use H tags (H1 to H6) in a hierarchical manner. H1 for main topics, H2 for subtopics, H3 for further subtopics, and so on.
  3. Distributed Use of Headings: Use H2, H3, H4, etc., tags appropriately to break down content into readable and organized sections.
  4. Meta Description and Titles:
    • Title Tag: Ensure each page has a unique and descriptive title that's within 50-60 characters.
    • Meta Description: Write a concise summary of the page's content within 150-160 characters. It should be unique for each page.
  5. Social Media Integration: Incorporate social sharing buttons or links to improve visibility and shareability.
  6. URL Structure:
@niksmac
niksmac / tiffdump.py
Created July 8, 2023 06:24 — forked from pebbie/tiffdump.py
hopefully generic TIFF file format extraction tool (GeoTIFF, NEF, ARW)
"""
\description TIFF file format dump
\author paryan
"""
from __future__ import print_function
import argparse
from struct import *
import os
import os.path as path
@niksmac
niksmac / TouchIDSudo.md
Last active August 27, 2022 03:31
Use TouchID to Authenticate sudo on macOS

Use TouchID to Authenticate sudo on macOS

How to use TouchID to Authenticate sudo on macOS

Use your favorite text editor and open the file

/etc/pam.d/sudo

and add the following line

@niksmac
niksmac / iptables.md
Last active April 25, 2022 05:07
Persist iptables even after reboot Ubuntu

Set the rules

sudo iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000

On Ubuntu: sudo apt-get install iptables-persistent

@niksmac
niksmac / google-location-opt-out.md
Last active June 21, 2021 18:23
How to opt out of Google's Location services for your WiFi Router

How do I opt my access point out of Google Location services?

To opt out, change the SSID (name) of your Wi-Fi access point (your wireless network name) so that it ends with _nomap. For example, if your SSID is 12345 you would change it to 12345_nomap.

Follow general steps for many access points

  1. Make a physical connection between your access point and your computer with an Ethernet cable.
  2. Find the default gateway of your connection:
  • On Windows, type "ipconfig" into the command prompt (on the Start menu).
@niksmac
niksmac / sw-cache-clear.js
Created June 3, 2021 01:36
Clear service worker cache from browser
caches.keys().then(function (cachesNames) {
console.log("Delete " + document.defaultView.location.origin + " caches");
return Promise.all(cachesNames.map(function (cacheName) {
return caches.delete(cacheName).then(function () {
console.log("Cache with name " + cacheName + " is deleted");
});
}))
}).then(function () {
console.log("All " + document.defaultView.location.origin + " caches are deleted");
});
function titleCase(str) {
let splitStr = str.toLowerCase().split(' ')
for (let i = 0; i < splitStr.length; i++) {
splitStr[i] =
splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1)
}
return splitStr
.join(' ')
.replace(/[\u0300-\u036f]/g, '')
.replace(/\s+/g, '')
'use strict'
// Refer https://baseweb.design/components/base-provider/#baseprovider-api
const primitives = {
primaryFontFamily: `'B612', sans-serif;`,
accent600: '#059669',
accent700: '#047857',
}
const overrides = {
#!/bin/bash
cd /home/ubuntu/
touch pipeline_trace.txt
sleep 5s
node /home/ubuntu/clpush/index.js &
while true;
do
input_directory=`cat inputpath.txt`
w=`cat wpath.txt`
out_directory=`cat outpath.txt`
#!/bin/bash
cd /home/ubuntu/
touch pipeline_trace.txt
sleep 5s
node /home/ubuntu/clpush/index.js &
while true;
do
input_directory=`cat inputpath.txt`
w=`cat wpath.txt`
out_directory=`cat outpath.txt`