Skip to content

Instantly share code, notes, and snippets.

View sarkrui's full-sized avatar
🚀
Kicking off

Sark sarkrui

🚀
Kicking off
View GitHub Profile
@sarkrui
sarkrui / crontab
Created July 12, 2020 17:29
list oracle object storage bucket via oci-cli
PATH=/users/<YOUR_USER_NAME>/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
*/10 * * * * cd ~/.scripts && ./oracle.sh > ~/.scripts/log/oracle.log 2>&1
@sarkrui
sarkrui / removeMacOSUpdateAlert.sh
Last active August 4, 2020 14:17
Snippets to remove macOS updates alert
#! /bin/bash
sudo softwareupdate --ignore "macOS Catalina"
defaults write com.apple.systempreferences AttentionPrefBundleIDs 0
killall Dock
echo "Done!"
@sarkrui
sarkrui / addSRT.sh
Last active August 30, 2020 20:29
微信表情包制作相关
#!/bin/bash
cd "$(dirname "$0")"
echo "拖拽文件"
read filepath
fullname=$(basename $filepath)
filename=${fullname%.*}
nullpath=${filepath%.*}
@sarkrui
sarkrui / segytb.sh
Last active September 12, 2020 22:32
Download YouTube videos with optional arguments for trimming
#!/bin/bash
dirpath="/path/to/directory"
cd "$dirpath"
url=$1
startTimestamps=$2
endTimestamps=$3
scriptname="segytb"
@sarkrui
sarkrui / makegif.sh
Last active September 15, 2020 20:08
Make GIFs and generate web URL
#!/bin/bash
scriptname="makgif"
FILEPATH=$1
FILENAME=$(basename "$FILEPATH")
EXTENSION="${FILENAME##*.}"
NULLPATH=${FILEPATH%/*}
OUTPUTNAME=$(echo "$FILENAME".gif | sed "s/ /_/g" | sed "s/.$EXTENSION//g")
NULLPATH=${FILEPATH%/*}
@sarkrui
sarkrui / installScript_1016beta_aria2c.sh
Last active September 25, 2020 12:47
Script to Install macOS 1016
#!/bin/sh
printf '\033[8;60;172t'
clear
LocalScriptVer="v1.0.5"
RemoteScriptVer=""
RemoteScriptPath="https://raw.githubusercontent.com/crazybirdy/MBR-Manual-Method/master/Q6-DownloadFullApp"
LocateScriptPath="$HOME/Desktop/"
ScriptName="installScript_110fullapp"
@sarkrui
sarkrui / main.py
Created September 29, 2020 08:08
Google Cloud Text-to-Speech API
import os
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="/path/to/your/json.json"
from google.cloud import texttospeech
# Instantiates a client
client = texttospeech.TextToSpeechClient()
# Set the text input to be synthesized
synthesis_input = texttospeech.SynthesisInput(
@sarkrui
sarkrui / customPlayback.js
Last active November 21, 2020 13:25
Netflix Custom Playback Rate
# Netflix 倍速 JavaScript 命令
# 已在 Safari/Chrome/Edge 浏览器下测试有效
# 使用方法:调用开发者工具 - 控制台
# Netflix Custom Playback Rate Javascript Command
# Usage: you shall enter the command at the developer tool - console
# The command has been tested vaild on Safari/Chrome/Edge browsers.
# 示例/Examle: document.querySelector ('video').playbackRate = 1.6, 1.6 could be any float value
@sarkrui
sarkrui / .zshrc
Last active April 15, 2021 03:46
My exclusive zsh alias
#Aliases
#Alias for uPic application
alias upic='/Applications/uPic.app/Contents/MacOS/uPic'
#Check if gif_temp existence and upload if true, and copy generated url link to clipboard
alias ugif='
file=~/Desktop/gif_temp.gif;
if [ -e "$file" ]; then
echo "File exists";
@sarkrui
sarkrui / export.sh
Created November 23, 2021 13:59
FFMpeg Abstract Audio
#/bin/bash
videoFMT=.mov
audioFMT=.aac
absAudio(){
for i in *$videoFMT;do
# ffmpeg -i $i -vn -ar 44100 -ac 2 -ab 320k -f mp3 $i.mp3;
ffmpeg -i $i -vn -acodec copy $i.aac;
mv "$i$audioFMT" "$(echo "$i$audioFMT" | sed -r "s/$videoFMT//")" ;