Skip to content

Instantly share code, notes, and snippets.

View mehranz's full-sized avatar

Mehran Zolghadr mehranz

View GitHub Profile
@mehranz
mehranz / utags_with_user_id.js
Last active May 6, 2024 21:13
utags with user id
// ==UserScript==
// @name 🏷️ UTags - Add usertags to links
// @name:zh-CN 🏷️ 小鱼标签 (UTags) - 为链接添加用户标签
// @namespace https://utags.pipecraft.net/
// @homepageURL https://github.com/utags/utags#readme
// @supportURL https://github.com/utags/utags/issues
// @version 0.9.7
// @description Allow users to add custom tags to links.
// @description:zh-CN 此插件允许用户为网站的链接添加自定义标签。比如,可以给论坛的用户或帖子添加标签。
// @icon data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23ff6361' class='bi bi-tags-fill' viewBox='0 0 16 16'%3E %3Cpath d='M2 2a1 1 0 0 1 1-1h4.586a1 1 0 0 1 .707.293l7 7a1 1 0 0 1 0 1.414l-4.586 4.586a1 1 0 0 1-1.414 0l-7-7A1 1 0 0 1 2 6.586V2zm3.5 4a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z'/%3E %3Cpath d='M1.293 7.793A1 1 0 0 1 1 7.086V2a1 1 0 0 0-1 1v4.586a1 1 0 0 0 .293.707l7 7a1 1 0 0 0 1.414 0l.043-.043-7.457-7.457z'/%3E %3C/svg%3E
@mehranz
mehranz / grafana-loki-docker-compose.yaml
Last active March 1, 2021 18:28
docker compose to run grafana + loki.
version: "3"
networks:
loki:
services:
loki:
image: grafana/loki:2.0.0
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
@mehranz
mehranz / mp3extractor.sh
Last active December 9, 2018 17:55
a simple script to extract mp3 links from a webpage
#! /bin/bash
thread=$1
while IFS= read -r url ; do
echo "$url"
done < <(lynx -dump -listonly "$thread" | awk '/\.mp3$/ {print $2}')
@mehranz
mehranz / googletranslate.sh
Created December 3, 2018 20:00
a script to translate english to persian and persian to english with google translate and show the result as notification
#!/bin/bash
text="$@"
if [[ "$text" =~ ^[a-z] ]];then
translate="$(wget -U "Mozilla/5.0" -qO - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=fa&dt=t&q=$(echo $text | sed "s/[\"'<>]//g")" | sed "s/,,,0]],,.*//g" | awk -F'"' '{print $2}')"
else
translate="$(wget -U "Mozilla/5.0" -qO - "http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=en&dt=t&q=$(echo $text | sed "s/[\"'<>]//g")" | sed "s/,,,0]],,.*//g" | awk -F'"' '{print $2}')"
fi