Skip to content

Instantly share code, notes, and snippets.

View modulsx's full-sized avatar

Surya modulsx

  • Earth
View GitHub Profile
@modulsx
modulsx / objectKeyCaseDeepTransform.js
Last active February 19, 2021 09:12
Convert Object Keys To Different String Cases (ex: camelCase And snake_case)
const { transform, set } = require('lodash');
const {
isArray, isObjectLike, isPlainObject, map,
} = require('lodash/fp')
const { camelCase, snakeCase } = require('lodash');
function createIteratee(converter, self) {
return (result, value, key) => set(result, converter(key), isObjectLike(value) ? self(value) : value)
}
@modulsx
modulsx / multiple_ssh_setting.md
Created August 17, 2021 08:07 — forked from suryabigapp/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key for different github accounts (must give filename while creating, else it'll overwrite - ex: ~/.ssh/id_ed25519_suryabigapp)

$ ssh-keygen -t ed25519 -C "[email protected]"
@modulsx
modulsx / fast-dns-checker.js
Last active February 6, 2025 15:43
Fast DNS Record Checker
const { argv } = require('node:process');
const dns = require('node:dns').promises;
const ALLOWED_RECORD_TYPES = ['A', 'AAAA', 'ANY', 'CAA', 'CNAME', 'MX', 'NS', 'NAPTR', 'PTR', 'SOA', 'SRV', 'TXT']
async function checkDNSRecord(domain, value, recordType = 'A'){
return new Promise(async (resolve, _) => {
try{
const resolver = new dns.Resolver();
const apexDomain = domain.split('.').splice(-2).join('.')
@modulsx
modulsx / [email protected]
Created June 27, 2023 22:46 — forked from guettli/[email protected]
Reliable persistent SSH-Tunnel via systemd (not autossh)
# Reliable persistent SSH-Tunnel via systemd (not autossh)
# https://gist.github.com/guettli/31242c61f00e365bbf5ed08d09cdc006#file-ssh-tunnel-service
[Unit]
Description=Tunnel for %i
After=network.target
[Service]
User=tunnel
ExecStart=/usr/bin/ssh -o "ExitOnForwardFailure yes" -o "ServerAliveInterval 60" -N tunnel@%i
@modulsx
modulsx / script.js
Created February 15, 2024 19:28 — forked from gd3kr/script.js
Download a JSON List of twitter bookmarks
/*
the twitter api is stupid. it is stupid and bad and expensive. hence, this.
Literally just paste this in the JS console on the bookmarks tab and the script will automatically scroll to the bottom of your bookmarks and keep a track of them as it goes.
When finished, it downloads a JSON file containing the raw text content of every bookmark.
for now it stores just the text inside the tweet itself, but if you're reading this why don't you go ahead and try to also store other information (author, tweetLink, pictures, everything). come on. do it. please?
*/
nodes:
- id: webcam
custom:
source: https://huggingface.co/datasets/dora-rs/dora-idefics2/raw/main/operators/opencv_stream.py
outputs:
- image
- id: idefics2
operator:
python: https://huggingface.co/datasets/dora-rs/dora-idefics2/raw/main/operators/idefics2_op.py
inputs:
#!/usr/bin/env python3
"""
Human quality transcripts from audio files using
AssemblyAI for transcription and Google's Gemini for enhancement.
Requirements:
- AssemblyAI API key (https://www.assemblyai.com/)
- Google API key (https://aistudio.google.com/)
- Python packages: assemblyai, google-generativeai, pydub