Skip to content

Instantly share code, notes, and snippets.

View mskian's full-sized avatar
🦕
Focusing

Santhosh Veer mskian

🦕
Focusing
View GitHub Profile
@mcnaveen
mcnaveen / script.sh
Last active May 21, 2023 11:36
Periodically check home IP address and update on server to allow port 53
#!/bin/bash
# Setup Reference: https://blog.sbstp.ca/vps-pihole/
# Run this script as CRON Job in your laptop or any device.
# Author - mcnaveen<me@mcnaveen.com>
ip=$(curl -s https://api.ipify.org | grep -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')
ip_file="ip_address.txt"
vps_ip="YOUR_VPS_IP_ADDRESS"
if [[ -f $ip_file ]]; then
@mcnaveen
mcnaveen / actions.yml
Created April 30, 2023 03:22
On New Tag create, copy the source to the server, build and restart pm2 service
name: Deploy Next.js Site via SSH
on:
push:
tags:
- "*"
jobs:
deploy:
runs-on: ubuntu-latest
@liyasthomas
liyasthomas / GitHub stats count Scriptable widget script.md
Last active January 18, 2024 06:36
GitHub stats count Scriptable widget script

To use this script, simply replace the USERNAME, REPOSITORY, GITHUB_STARS_REPO and GITHUB_DOWNLOADS_REPO placeholders with the appropriate values for the GitHub repository you want to fetch the star and release download count for. Then, copy the complete script into a new Scriptable App script and run it. The star and release download count for the specified repository will be displayed in a Scriptable widget.

// Constants for widget configuration
const WIDGET_TITLE = "GitHub";
const USERNAME = "hoppscotch"
const REPOSITORY = "hoppscotch"
const GITHUB_STARS_REPO = "hoppscotch/hoppscotch";
const GITHUB_DOWNLOADS_REPO = "hoppscotch/releases";
const CACHED_DATA_HOURS = 0.5;
@sts10
sts10 / rust-command-line-utilities.markdown
Last active July 21, 2024 11:17
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@CHANG-CHING-CHUNG
CHANG-CHING-CHUNG / load_dotenv.sh
Created September 2, 2021 03:09 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@msramalho
msramalho / instructions.md
Last active May 29, 2024 08:41
How to get a Facebook long term (non-expiring) access token for a Page
@mcnaveen
mcnaveen / n8n docker command.md
Last active April 27, 2023 06:33
Docker Command to Run n8n on Docker Container with Static IP Address

Create Docker Network

docker network create --subnet=172.1.0.0/16 Network Name

Run Docker Container

docker run -d --net NETWORKNAME \
--ip STATICIP \
-it \
--name n8n \
@seeliang
seeliang / convert-ejs-to-html.js
Last active September 1, 2023 16:09
use node to generate html from ejs file
const ejs = require('ejs');
const fs = require('fs');
module.exports = ({template, config}) => {
fs.readFile(template, 'utf8', (err, data) => {
if (err) { console.log(err); return false; }
var ejs_string = data,
template = ejs.compile(ejs_string),
html = template(config);
fs.writeFile(template.replace('.ejs', '') + '.html', html, (err) => {
if(err) { console.log(err); return false }
@mcnaveen
mcnaveen / How to Create API Key in Gotify?
Last active December 17, 2021 13:55
How to Create API Key in Gotify?
Well, This tutorial will walk you through creating your First Gotify API Key which helps in setting up your appliation.
Comment contains step by step instruction with image. Check it out.
Thanks.

Vim Commands

Files

  • vi filename.txt - Open a file
  • : - Enter Command Mode
  • u - Undo changes
  • ctrl+u - Redo Changes
  • :q - Quit Vim
  • :q! - Force quit vim without saving