utility-bash-scripts

授权协议 MIT License
开发语言 SHELL
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 谢誉
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

�� Utility bash scripts

Utility bash scripts to do automatable tasks with a single command. We have scripts to download youtube videos, download music from youtube, convert media files, etc.

Contribute and add your secret script.

�� NOTES

Download scripts download to ~/Downloads/ folder. For videos, they download to ~/Downloads/Videos and for audio, they download to ~/Downloads/Music.

For best results, clone this git repo to a fixed location on your computer and add it to $PATH.

cd ~
git clone https://github.com/aviaryan/utility-bash-scripts.git utility-scripts
cd utility-scripts
export PATH="$(pwd):$PATH"

�� SCRIPTS

�� Download video from YouTube in MP4 format

Script: youtube-video
Dependencies: youtube-dl, ffmpeg, aria2c (optional)

youtube-video "https://www.youtube.com/watch?v=HgfojLtSBTM"

�� Merge video and audio together

Script: vamerge
Dependencies: ffmpeg

vamerge <path to video file> <path to audio file>
# the order is important, first video, then audio

�� Download audio from YouTube

Script: youtube-music
Dependencies: youtube-dl, ffmpeg, aria2c (optional)

Default download format is ogg(vorbis), pass second parameter as mp3, wav, m4a to use another format.

youtube-music "https://www.youtube.com/watch?v=HgfojLtSBTM"  
youtube-music "https://www.youtube.com/watch?v=HgfojLtSBTM" mp3

♋️ Convert audio file to OGG

Script: toogg
Dependencies: ffmpeg

toogg <path to file>

�� Uglify a JS code

Script: uglify
Dependencies: Uglify-JS

uglify <input JS file> <output file>

✂️ Extract any archive

Script: extract
Dependencies: tar, gzip, p7zip, bzip2

Extracting .dmg files works only on MacOS.

extract <path to archive>

♋️ Convert audio file to MP3

Script: tomp3
Dependencies: ffmpeg

tomp3 <path to file>

�� Download audio from SoundCloud

Script: soundcloud-music
Dependencies: Soundscrape

soundcloud-music <link to soundcloud>

�� Force stop and clean Docker containers

Script: dckill

dckill

♻️ Empty Trash folder

Script: empty-trash

empty-trash

Get current time at any timezone

Script: clock
Dependencies: timedatectl for Linux, sudo access for Mac

clock list
clock <Time Zone>

�� Get weather report for a location

Script: weather

weather <City Name>
weather # Will use your IP Address location

�� Create custom short link for a GitHub URL using git.io

Script: gh-url

gh-url <url-to-shorten> <short-code>

�� ZIP without .DS_Store on a Mac

Script: maczip

maczip <path to folder>

�� Delete screenshots from Desktop on a Mac

Script: delete-ss

delete-ss

Remove .DS_Store files recursively (Mac)

Script: rm-ds-store

rm-ds-store

�� Show certificate information of a service

Script: show-certificate
Dependencies: openssl

show-certificate google.com

�� Encode video to x265

Script: encode-x265
Dependencies: ffmpeg

Default encoded video's name is videoname-x265. But you can change it like the second example.

encode-x265 <path to video>
encode-x265 <path to video> <path to encoded video>

�� Convert video to gif

Script: gif-convert
Dependencies: ffmpeg

gif-convert <path to video> <path to gif> <start_at> <end_at> <fps> <scale>

If you don't want to change the value, you can use -.

gif-convert input.mp4 output.gif 05:00 05:03.6 - 640x360

�� Learn a new command

Script: learn
Dependencies: cowsay

learn

�� Pomodoro

Script: pomodoro

pomodoro <focus time length> <break time length>

���� SIMPLE BASH COMMANDS

These commands are so easy to use that creating a script for them would be overkill.

�� Display filesystem information (disk usage, mount path)

df
  • BASH (Bourne Again Shell) 是 GNU 開發的 Shell (外殼),是以由 Steve Bourne 開發的 Shell 為名,開發的目的,是希望借 BASH 代替一般商業化的 Shell。 Shell 的意念在 UNIX Version 7 時已經出現,其版本是 Bourne Shell ,也就是 sh。 後來,由 Bill Joy (名字很熟識吧?他就是 vi 的作者

  • 功能测试是软件开发的一个关键部分 -- 而已经装入 Linux 的 Bash 可以帮您轻而易举地完成功能测试。在本文中,Angel Rivera 将说明如何运用 Bash shell 脚本通过行命令来执行 Linux 应用程序的功能测试。由于此脚本依赖于命令行的返回码,因而您不能将这种方法运用于 GUI 应用程序 功能测试是开发周期的一个阶段,在这个阶段中将测试软件应用程序以确保软件的函数如预期的

  • https://www.shellscript.sh/index.html https://linuxconfig.org/bash-scripting-tutorial https://www.tecmint.com/basic-shell-programming-part-ii/ #example1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • Shell script programming is an essential skill of Unix/Linux/Cygwin users. With the support of dozens of utilities, the shell script could be multi-purpose Swiss knife to improve our productivity and

  • sometimes you want to create a bash script,a better way is using template. so you can set a script like this -  bash-script #! /bin/bash works_dir=`pwd` function scriptTemplate(){ cat >$1 <<EOF #!

  • http://www.linuxjournal.com/node/1005818 In this post I'll show you how to create a self extracting bash script to automate the installation of files on your system. This script requires coreutils (fo

  •      命令替换和输出捕获 `command`   $(command),  $()是posix shell的标准, `command`是bash shell的标准。 hard quote 单引号中的所有字符都不被shell解析, soft quote 双引号,部分字符还是会被shell解析(如$), escape / 紧接在反斜线后面的字符是不被shell解析。        fork sou

  • Linux有的程序需要用户通过键盘敲入一些字符时,Linux bash script有here documents 的结构: command <<SOMESPECIALSTRING statments ... SOMESPECIALSTRING 完全可以模拟用户输入,SOMESPECIALSTRING只是一个标识,标志开头结尾,可以随便起名字.statments是本该用键盘输入的内容

 相关资料
  • Bash Utility Bash library which provides utility functions and helpers for functional programming in Bash. Detailed documentation is available at https://labbots.github.io/bash-utility/ Table of Conte

  • 本章介绍了几种工具类,它们可以大大简化我们的日常工作。BOOST_STATIC_ASSERT 提供编译期断言,它有助于我们测试前提条件或强制某些要求。对于泛型编程,checked_delete 在检查错误用法时非常有用,它可以节省我们大量的阅读可怕的错误信息和研究代码的时间。我们还讨论了 addressof, 它是一个获得对象真实地址的小工具,不用管 operator& 有否被重载。我们还看到了

  • Craig's Utility Library 是功能性的基类。已经包装得很完善,可以安装单个命名空间的包。例如官方列出了: DataTypes: Install-Package CraigsUtilityLibrary-DataTypesLDAP: Install-Package CraigsUtilityLibrary-LDAPSQL: Install-Package CraigsUtilit

  • TeX Live Utility 是 Mac OS X 下的一款 TeX Live Manager 的图形化工具,旨在提供 Mac 下原生的 GUI 工具来使用 TeX Live Manager 提供的命令行工具。

  • A flexible programming library for evolutionary computation. Steady-state, generational and island model genetic algorithms are supported, using Darwinian, Lamarckian or Baldwinian evolution. Includes