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
| /** | |
| * Generate and return a random characters string | |
| * | |
| * Useful for generating passwords or hashes. | |
| * | |
| * The default string returned is 8 alphanumeric characters string. | |
| * | |
| * The type of string returned can be changed with the "type" parameter. | |
| * Seven types are - by default - available: basic, alpha, alphanum, num, nozero, unique and md5. | |
| * |
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
| watch "(echo stats ; echo quit ) | nc 127.0.0.1 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
| #!/usr/bin/env bash | |
| echo $1 | grep -E -q "^[0-9]+$" || (echo "Please specify a port number to listen to." ; exit 1) | |
| PORT=$1 | |
| TCPDUMPARG="tcp port $PORT and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)" | |
| sudo tcpdump -s 0 -A -i eth0 $TCPDUMPARG | |
| #TCPDUMPARG="tcp port $PORT and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)" |
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
| #Luhn algorithm | |
| function a(inputNum) { | |
| var digit, digits, flag, sum, _i, _len; | |
| flag = true; | |
| sum = 0; | |
| digits = (inputNum + '').split('').reverse(); | |
| for (_i = 0, _len = digits.length; _i < _len; _i++) { | |
| digit = digits[_i]; | |
| digit = parseInt(digit, 10); |
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
| var timer = function(name) { | |
| var start = new Date(); | |
| return { | |
| stop: function() { | |
| var end = new Date(); | |
| var time = end.getTime() - start.getTime(); | |
| console.log('Timer:', name, 'finished in', time, 'ms'); | |
| } | |
| } | |
| }; |
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
| global | |
| #debug | |
| #daemon | |
| log 127.0.0.1 local0 | |
| defaults | |
| log global | |
| option httplog | |
| frontend unsecured *:80 |
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
| <?php | |
| namespace Acme\DemoBundle\Services; | |
| use Aws\S3\S3Client; | |
| /** | |
| * Class AmazonS3Service | |
| * | |
| * @package Acme\DemoBundle\Service | |
| */ |
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
| #centos 6~ | |
| sudo su | |
| #- Repos | |
| yum install epel-release | |
| mkdir /root/repos | |
| cd /root/repos | |
| wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm |
NewerOlder