43 पॉइंट द्वारा xguru 2022-08-30 | 6 टिप्पणियां | WhatsApp पर शेयर करें

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-commit subcommand के रूप में पहचान लेता है
  • Caps Lock + mouse click करने पर प्रति सेकंड 50 बार click कराने वाली AutoHotkey स्क्रिप्ट
  • rerun
    → डायरेक्टरी की फाइलें बदलने पर command को अपने-आप फिर से चलाने वाली स्क्रिप्ट
  • git recent
    → हाल ही में काम की गई branches दिखाना
  • ccd
    → डायरेक्टरी बनाकर उसी डायरेक्टरी में जाना
  • git-move
    → repos के बीच फाइलें स्थानांतरित करना, history सुरक्षित रखते हुए

6 टिप्पणियां

 
tribela 2022-08-30

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

echo "max packet size: $lower, mtu: $((lower + 28))"  

}
मैं लगभग इतना ही इस्तेमाल करता हूँ।

 
alstjr7375 2022-08-30
  • GIF -> Video
    → 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"
  • Video -> GIF
    → 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
 
alstjr7375 2022-08-30

जानकारी के लिए, GIF का सामान्य अधिकतम FPS लगभग 50 माना जा सकता है.
https://wunkolo.github.io/post/2020/02/buttery-smooth-10fps/

सुना है कि इसे emulate किया जा सकता है, लेकिन मैंने खुद आज़माया नहीं है इसलिए पक्का नहीं कह सकता.
https://superuser.com/questions/1449366/…

 
bbulbum 2022-08-30

मैं एक स्क्रिप्ट इस्तेमाल कर रहा हूँ जो 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 करके भी इस्तेमाल किया था...

 
cr543l 2022-08-30

git log --pretty="%ad [%ae] %s" --author E_MAIL_ADDRESS
→ git revision में निर्दिष्ट committer को फ़िल्टर करके देखना