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 | |
| echo '**************************************' | |
| echo '* INITIAL FINDINGS *' | |
| echo '**************************************' | |
| IFS=' | |
| ' # split on newline only | |
| set -o noglob # disable globbing | |
| SOURCE="/process/" |
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
| sudo apt-get install ffmpeg | |
| for f in ./*.mkv; do sudo ffmpeg -i "$f" -vcodec libx264 -acodec aac -strict -2 -movflags faststart "${f%.mkv}.mp4"; rm -rf "$f"; done | |
| # get the files out of folders | |
| for f in `find . -name '*mp4' -or -name '*mkv' -or -name '*avi' -or -name '*srt'`; do mv $f .; done | |
| # not working find . -name '*mp4' -or -name '*mkv' -or -name '*avi' -or -name '*srt' -exec mv {} . \; | |
| # delete all files that are not videos | |
| for f in `find . -not -name '*mp4' -and -not -name '*mkv' -and -not -name '*avi' -and -not -name '*srt'`; do rm -rf $f; done |
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
| cd /media/ | |
| sudo mkdir movies | |
| sudo chmod 777 movies | |
| sudo mkdir tv | |
| sudo chmod 777 tv | |
| sudo mkdir kids | |
| sudo mkdir kids/tv | |
| sudo mkdir kids/movies | |
| sudo chmod -R 777 kids |
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
| MEMCHOST=localhost; printf "stats items\n" | nc $MEMCHOST 11211 | grep ":number" | awk -F":" '{print $2}' | xargs -I % printf "stats cachedump % 10000\r\n" | nc $MEMCHOST 11211 |
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
| public function actionRestProvider() | |
| { | |
| $page = Yii::$app->request->get('page', 1); | |
| $models = []; | |
| for($i = $page * 10; $i < $page * 10 + 10; $i++) { | |
| $models[] = ['name' => 'Name' . $i]; | |
| } | |
| $dataProvider = new \common\components\RestDataProvider([ | |
| 'allModels' => $models, |
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 Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
NewerOlder