This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/node | |
const puppeteer = require('puppeteer'); | |
const fs = require('fs'); | |
// Start Chrome with `--remote-debugging-port=9222` and then goto `localhost:9222/json/version` to get the CDP Url | |
const cdpUrl = 'ws://localhost:9222/devtools/browser/e3ed8a89-ebb3-40f9-a818-fb1738926229'; | |
const newScript = fs.readFileSync('./new_script.sh', 'utf8'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in $(ls *.mp4); do | |
ffmpeg -i $f -c copy -bsf:v h264_mp4toannexb -f mpegts $f.ts | |
done | |
CONCAT=$(echo $(ls *.ts) | sed -e "s/ /|/g") | |
ffmpeg -i "concat:$CONCAT" -c copy -bsf:a aac_adtstoasc output.mp4 | |
rm *.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi | |
if [ -z "${MONGO_PASSWORD}" ]; then | |
echo "You need to set then environment variable MONGO_PASSWORD" | |
exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# usage: <command> | pastebin [+|++|+++] | |
# | |
# (none): paste expires in 10 minutes | |
# +: paste expires in 1 hour | |
# ++: paste expires in 1 day | |
# +++: paste expires in 1 months | |
HOST='pastebin.com' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Jest Current File", | |
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js", | |
"cwd": "${workspaceFolder}", | |
"args": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//usr/bin/env go run $0 $@ ; exit | |
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"os" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const os = require('os'); | |
class ServerError extends Error { | |
constructor(message, innerError) { | |
super(); | |
this.name = this.constructor.name; | |
this.innerError = innerError; | |
// Borrowed from: https://stackoverflow.com/questions/35392675/how-to-override-error-stack-getter | |
Object.defineProperty(this, 'message', { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check disksize with `parted /dev/sda print` before | |
STARTING_SIZE=$1 | |
DISK_SIZE=$2 | |
RESTART_DOCKER=false | |
if [ -z "${STARTING_SIZE}" ]; then | |
echo "Please enter the starting size in GB from where the new partition should be created" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while IFS='' read -r line || [[ -n "$line" ]]; do | |
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' $line | |
done < "$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for FILE in *.mp4; do | |
mv "$FILE" "`echo $FILE | sed -r "s/^(.+)_hd-froscon16.+.mp4$/\1.mp4"/`"; | |
done |
NewerOlder