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
| #!/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 -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 -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
| #!/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
| 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
| 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
| for FILE in *.mp4; do | |
| echo -e "Processing video '\e[32m$FILE\e[0m'"; | |
| ffmpeg -i "${FILE}" -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 "${FILE%.mp4}.mp3" | |
| done; | |
| # find . -type f -iname "*.webm" -exec bash -c 'FILE="$1"; ffmpeg -i "${FILE}" -vn -ab 128k -ar 44100 -y "${FILE%.webm}.mp3";' _ '{}' \; | |
| #ffmpeg -i video.mp4 -vn \ | |
| # -acodec libmp3lame -ac 2 -ab 160k -ar 48000 \ | |
| # audio.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
| udevadm info -n /dev/sdb -q property | |
| udevadm monitor | |
| Pre-installed udev rules | |
| /lib/udev/rules.d/60-block.rules | |
| ACTION=="add", SUBSYSTEM=="block", ENV{ID_FS_UUID}=="xxxxx", RUN+="/root/my-usb.sh $devpath $name" |
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
| List deptree | |
| for i in `rpm -qa` ; do echo "Package [$i]:"; rpm -q --requires $i ; echo ; done |