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 *.webm; do | |
| echo -e "Processing video '\e[32m$FILE\e[0m'"; | |
| ffmpeg -i "${FILE}" -vn -ab 128k -ar 44100 -y "${FILE%.webm}.mp3"; | |
| done; | |
| # find . -type f -iname "*.webm" -exec bash -c 'FILE="$1"; ffmpeg -i "${FILE}" -vn -ab 128k -ar 44100 -y "${FILE%.webm}.mp3";' _ '{}' \; |
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
| Change file encoding(helps with some errors in utf-8 encoding) :e ++enc=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
| #!/usr/bin/perl | |
| use File::Find; | |
| my $script = ""; | |
| sub wanted() { | |
| my $f = $File::Find::name; | |
| if (-f $f) { | |
| $script .= "put '$f'\n"; | |
| } else { |
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 -xe | |
| # for | |
| PASS=$(perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'); | |
| sed -i "s/^password =.*$/password = ${PASS}/" /etc/mysql/debian.cnf | |
| sed -i "s/^user =.*$/user = debian-sys-maint/" /etc/mysql/debian.cnf | |
| mysql -e "GRANT ALL ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY '${PASS}' WITH GRANT OPTION;" |
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 -xe | |
| loopdevice=/dev/loop0 | |
| loopfile=/root/crypt.loop | |
| #megabytes | |
| loopsize=256 | |
| #/dev/mapper/xxxxx when open | |
| cryptmapper=crypt |
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 | |
| #=============================================================================== | |
| # | |
| # FILE: convert.sh | |
| # | |
| # USAGE: ./convert.sh | |
| # | |
| # DESCRIPTION: convert mp4 to mp3 | |
| # | |
| # OPTIONS: --- |
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 | |
| rm -rf dumps | |
| mkdir -p dumps | |
| CRED= | |
| # CRED=-u $USER -p$PASSWORD | |
| OPTS="--single-transaction --quick" | |
| #rm "$OUTPUTDIR/*gz" > /dev/null 2>&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
| 'use strict'; | |
| var mysqlBackup = require('./mysql-backup'); | |
| var schedule = require('node-schedule'); | |
| schedule.scheduleJob({ hour: 22, minute: 0 }, mysqlBackup); |
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
| daemon off; | |
| worker_processes 1; | |
| events { worker_connections 1024; } | |
| http{ | |
| sendfile on; |
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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |