Skip to content

Instantly share code, notes, and snippets.

View gadelkareem's full-sized avatar
🎯
Focusing

Gadelkareem gadelkareem

🎯
Focusing
View GitHub Profile
@gadelkareem
gadelkareem / install-nodejs-on-raspberrypi-armv6.md
Created September 21, 2024 10:54 — forked from davps/install-nodejs-on-raspberrypi-armv6.md
Steps to install nodejs on Raspberry Pi B+ (armv6)

Steps to install nodejs v6.2 on Raspberry Pi B+ (armv6)

cd ~
wget http://nodejs.org/dist/v6.2.1/node-v6.2.1-linux-armv6l.tar.gz
tar -xzf node-v6.2.1-linux-armv6l.tar.gz
node-v6.2.1-linux-armv6l/bin/node -v

The last command should print v6.2.1.

Now you can copy it to /usr/local

@gadelkareem
gadelkareem / suno-download-all-songs.js
Last active September 16, 2024 21:35 — forked from FGRibreau/suno-download-all-songs.js
Download all Suno (app.suno.ai) songs displayed on a page
// open your javascript console and paste this
copy([...$('[role="grid"]')[Object.keys($('[role="grid"]')).filter(x => x.startsWith('__reactProps'))[0]].children[0].props.values[0][1].collection]
.filter(x => x.value.audio_url || x.value.video_url)
.map(x => {
const title = x.value.title.trim() || x.value.id ;
const audio = x.value.audio_url ? `${title}.mp3|${x.value.audio_url}` : '';
const video = x.value.video_url ? `${title}.mp4|${x.value.video_url}` : '';
return [audio, video].filter(Boolean).join("\n");
})
.join("\n")
@gadelkareem
gadelkareem / certbot.sh
Created April 8, 2022 04:57
Letsencrypt DNS challenge wildcard certificate
sudo certbot -d "*.example.com" --manual --preferred-challenges dns certonly
@gadelkareem
gadelkareem / retry.sh
Created March 16, 2022 23:26
Retry Bash function
#!/usr/bin/env bash
function retry {
local retries=$1
shift
local count=0
until "$@"; do
exit=$?
wait=$((2 ** $count))
@gadelkareem
gadelkareem / README.md
Last active November 26, 2021 02:25
Cryptocurrency prices calculation in Google Sheets
  • Add your coinMarketCap private key YOUR_PRIVATE_KEY
  • Use =$COUNT_CELL*coingecko($SYMBOL_CELL) in your sheet
@gadelkareem
gadelkareem / fake.go
Created October 15, 2021 16:09
Fake server in golang
package main
import (
"bufio"
"fmt"
"log"
"net"
)
func handleConnection(conn net.Conn) {
@gadelkareem
gadelkareem / coinMarketCap.gs
Created August 16, 2021 22:48
Crypto coin prices on Google Sheets
/*
* use =coinMarketCap('ETH') in your sheet
*/
function coinMarketCap(symbol) {
const url = `https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=${symbol}&convert=EUR`
const headers = {
"X-CMC_PRO_API_KEY": 'API_KEY from https://pro.coinmarketcap.com/account'
};
@gadelkareem
gadelkareem / Squash.sh
Last active August 29, 2022 15:52
Git Squash
git reset $(git merge-base main $(git branch --show-current))
git push --force
@gadelkareem
gadelkareem / cache-warmer.py
Last active June 18, 2021 00:29 — forked from hn-support/cache-warmer.py
A threaded cache warmer in python
#!/usr/bin/env python3
"""
Warm the caches of your website by crawling each page or sitemap index defined in sitemap.xml.
To use, download this file and make it executable. Then run:
./cache-warmer.py --threads 4 --interval 10 --file https://example.com/sitemap.xml -v
./cache-warmer.py --threads 4 --interval 10 --file /data/web/public/sitemap.xml -v
"""
import argparse
from multiprocessing.pool import ThreadPool
import os.path
#Gently:
ps -ef | grep terraform | grep -v grep | awk '{print $2}' | xargs -n 1 kill
#Forcefully:
ps -ef | grep terraform | grep -v grep | awk '{print $2}' | xargs -n 1 kill -9