अपनी खुद की स्क्रिप्ट्स दिखाइए
(news.ycombinator.com)HN पर पूछे गए उस सवाल के जवाब, जिसमें लोगों से कहा गया था कि वे अपनी निजी उपयोग वाली स्क्रिप्ट्स साझा करें
- हर उस सर्वर पर एक जैसा environment सेट करने के लिए
.ssh/config
→ सर्वर पर पहली बार कनेक्ट करते समय ज़रूरी dotfiles अपने-आपrsyncहो जाते हैं, और उसके बाद हर कनेक्शन पर वे अपने-आप अपडेट होते हैं - command help (
ch) स्क्रिप्ट
→ help और man pages में से सिर्फ command-line वाले हिस्से निकालकर दिखाती है - MISC (Manually Installed or Source Compiled)
→ सिर्फ manually installed या source से compiled पैकेजों को मैनेज करने वाली स्क्रिप्ट git-co-commit
→ pair programming के समय commit message के आखिर मेंCo-authored-by: ...जोड़ता है
→git-co-commitको path में जोड़ देने पर git इसे अपने-आपgit co-commitsubcommand के रूप में पहचान लेता है- Caps Lock + mouse click करने पर प्रति सेकंड 50 बार click कराने वाली AutoHotkey स्क्रिप्ट
rerun
→ डायरेक्टरी की फाइलें बदलने पर command को अपने-आप फिर से चलाने वाली स्क्रिप्टgit recent
→ हाल ही में काम की गई branches दिखानाccd
→ डायरेक्टरी बनाकर उसी डायरेक्टरी में जानाgit-move
→ repos के बीच फाइलें स्थानांतरित करना, history सुरक्षित रखते हुए
6 टिप्पणियां
alias df='df -h -x tmpfs -x devtmpfs -x squashfs'
alias xc='xclip -sel clipboard'
alias ttfb='curl -so /dev/null -w "HTTP %{http_version} %{http_code} Remote IP: %{remote_ip}\nConnect: %{time_connect}\nTTFB: %{time_starttransfer}\nTotal time: %{time_total}\nDownload speed: %{speed_download}bps\nBytes: %{size_download}\n"'
ap() {
https $@ Accept:application/activity+json
}
shodan() {
xdg-open https://shodan.io/domain/$1
dig +short $1 | xargs -i xdg-open https://shodan.io/host/{}
}
check_mtu() {
local target=$1
shift
local lower=0
local upper=1500
until [[ $((lower + 1)) -eq $upper ]]; do
current=$(((lower + upper) / 2))
echo -n "lower: $lower, upper: $upper, testing: $current -- "
if ping -M do -s $current -c 2 -i 0.2 $target $@ &> /dev/null; then
echo "ok"
lower=$current
else
echo "fail"
upper=$current
fi
done
}
मैं लगभग इतना ही इस्तेमाल करता हूँ।
→ ffmpeg -v warning -i "input.gif" -y "output.mp4" -pix_fmt yuv420p -c:v libx264 -movflags +faststart -filter:v "crop=floor(iw/2)*2:floor(ih/2)*2"
→ ffmpeg -v warning -i "input.mp4" -y "output.gif" -filter_complex "[0:v] fps=15, split [1:v] [2:v]; [1:v] palettegen [p]; [2:v] fifo [3:v]; [3:v] [p] paletteuse" -loop 0
जानकारी के लिए, GIF का सामान्य अधिकतम FPS लगभग 50 माना जा सकता है.
https://wunkolo.github.io/post/2020/02/buttery-smooth-10fps/
सुना है कि इसे emulate किया जा सकता है, लेकिन मैंने खुद आज़माया नहीं है इसलिए पक्का नहीं कह सकता.
https://superuser.com/questions/1449366/…
मैं एक स्क्रिप्ट इस्तेमाल कर रहा हूँ जो tmux session खोलकर तीन projects के code (api, front, admin) को तीन windows में चलाती है.
tmux new-session -d ; new-window ; send-key "nvim ~" C-m ; attach;
पिछली कंपनी में office आने-जाने की entry कंपनी की site में सीधे login करके करनी होती थी, तो मैंने उसे puppeteer से automate करके भी इस्तेमाल किया था...
git log --pretty="%ad [%ae] %s" --author E_MAIL_ADDRESS→ git revision में निर्दिष्ट committer को फ़िल्टर करके देखना
.ssh/config: https://news.ycombinator.com/item?id=32468605ch: https://github.com/learnbyexample/command_help/blob/master/chMISC: https://github.com/tpapastylianou/misc-updatergit-co-commit: https://gist.github.com/sshine/d5a2986a6fc377b440bc8aa096037ef0AutoHotkey: https://news.ycombinator.com/item?id=32468167rerun: https://news.ycombinator.com/item?id=32469012git-recent: https://news.ycombinator.com/item?id=32470619ccd:function ccd { mkdir -p "$1" && cd "$1" }git move: https://gist.github.com/mnemnion/87b51dc8f15af3242204472391f3bf59