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/sh | |
| for f1 in *.wma; | |
| do | |
| f2=`echo $f1 | cut -d '.' -f 1`.mp3; | |
| avconv -i "$f1" "$f2"; | |
| 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
| /** | |
| * Bunch of useful filters for angularJS(with no external dependencies!) | |
| * @version v0.5.15 - 2017-01-17 * @link https://github.com/a8m/angular-filter | |
| * @author Ariel Mashraki <[email protected]> | |
| * @license MIT License, http://www.opensource.org/licenses/MIT | |
| */!function(a,b,c){"use strict";function d(a){return E(a)?a:Object.keys(a).map(function(b){return a[b]})}function e(a){return null===a}function f(a,b){var d=Object.keys(a);return d.map(function(d){return b[d]!==c&&b[d]==a[d]}).indexOf(!1)==-1}function g(a,b){function c(a,b,c){for(var d=0;b+d<=a.length;){if(a.charAt(b+d)==c)return d;d++}return-1}for(var d=0,e=0;e<=b.length;e++){var f=c(a,d,b.charAt(e));if(f==-1)return!1;d+=f+1}return!0}function h(a,b,c){var d=0;return a.filter(function(a){var e=y(c)?d<b&&c(a):d<b;return d=e?d+1:d,e})}function i(a,b){return Math.round(a*Math.pow(10,b))/Math.pow(10,b)}function j(a,b,c){b=b||[];var d=Object.keys(a);return d.forEach(function(d){if(D(a[d])&&!E(a[d])){var e=c?c+"."+d:c;j(a[d],b,e||d)}else{var f=c?c+". |
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
| openssl pkcs12 -export -in fullchain.pem -inkey privkey.pem -out keystore.p12 -name tomcat; |
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
| # $1 -> cue file | |
| # $2 -> flac file | |
| cuebreakpoints $1 | shnsplit -o flac $2 |
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
| <html style="cursor: none"> | |
| <script> | |
| var x = 0; | |
| var y = 0; | |
| document.addEventListener("mousemove", function(e){ | |
| document.getElementById("pacman").style.left = e.x; | |
| document.getElementById("pacman").style.top = e.y; | |
| console.log("x ", x, "; y ", y); |
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
| import hashlib | |
| import time | |
| def genToken(password): | |
| h = hashlib.sha1(password) | |
| h.update(str(int(time.time()*1000))) | |
| return h.hexdigest() | |
| def isValid(password, token): | |
| t = int(time.time()*1000) | |
| for i in range(5000): |
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
| # Example perl -pe 's/{css}/`cat stylesheet.css`/ge' -i index.html | |
| perl -pe 's/{tag}/`cat file.from`/ge' -i file.to |
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 | |
| oFilename=$(basename "$1") | |
| extension="${oFilename##*.}" | |
| filename="${oFilename%.*}" | |
| if [ "$extension" == "pdf" ]; then | |
| convert -thumbnail 300 "$oFilename"[0] "$filename".thumb.png | |
| else | |
| convert -thumbnail 300 "$oFilename" "$filename".thumb.png | |
| fi |
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
| inotifywait -m -e modify -e create --format '%w%f' . | while read file; do (cp "$file" ./tmp/"$file$(date +%T)$counter.bk") 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
| from math import sqrt | |
| def primosHasta(n): | |
| numbers = range(2, n) | |
| for i in range(2, int(2*sqrt(n))): | |
| numbers = filter(lambda x: x==i or x%i, numbers) | |
| return numbers |