Skip to content

Instantly share code, notes, and snippets.

View zerorooot's full-sized avatar
🎯
Focusing

zerorooot zerorooot

🎯
Focusing
  • linyi
View GitHub Profile
@zerorooot
zerorooot / zip.sh
Created December 1, 2022 05:22
zip some file
#!/bin/bash
(
IFS=$'\n'
for y in $(ls| grep -v re| grep -v out)
do
zip -q -r $y.zip $y
echo $y
done
mkdir z
mv *.zip z/
@zerorooot
zerorooot / video_time.sh
Last active December 1, 2022 05:23
print video time when time < sometime
#!/bin/bash
(
IFS=$'\n'
for i in $(find -type f)
do
time=$(mediainfo -f $i | grep Duration |cut -d":" -f2 | head -1 | cut -d "." -f1)
min=480000
if [ ! -n "$time" ]; then
echo "$i IS NULL"
else
#!/bin/bash
UNZIP_DISABLE_ZIPBOMB_DETECTION=true /bin/unzip -x "$@"
@zerorooot
zerorooot / format.sh
Created December 1, 2022 05:20
format file name where there have "("
#!/bin/bash
(
IFS=$'\n'
for q in $(ls -p| grep /)
do
cd $q
perl-rename 's/.*?\(//' *
perl-rename 's/\)//' *
for i in $(ls)
do
@zerorooot
zerorooot / shrink
Created December 1, 2022 05:18
shrink photo size
#!/bin/bash
find -type f -iname "*.jpg" -size "+700k" -print0 | xargs -0 jpegoptim -m60
find -type f -iname "*.jpeg" -size "+700k" -print0 | xargs -0 jpegoptim -m60
find -type f -iname "*.png" -size "+700k" -print0 | xargs -0 optipng
@zerorooot
zerorooot / smart-caps-lock.md
Created March 19, 2021 03:30 — forked from tanyuan/smart-caps-lock.md
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.