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 | |
| # Crontab Entry - use flock to prevent duplicate running | |
| 30 3 * * 1 /usr/bin/flock -xn /root/logs/rsync_lock -c /usr/local/bin/rsync_scripts/rsync.sh >/dev/null 2>&1 | |
| # Resume broken network connection. | |
| while [ 1 ] | |
| do | |
| rsync --log-file=/root/logs/rsync.log --verbose --delete --force --checksum --inplace --no-whole-file --update --append --archive --compress-level=9 --skip-compress=gz/zip/z/rpm/deb/iso/bz2/t[gb]z/7z/mp[34]/mov/avi/ogg/jpg/jpeg/lzo/rzip/lzma/rar/ace --acls --xattrs --compress --partial --human-readable --one-file-system --timeout=999 --exclude-from=/.rsync-filter -e "ssh -T -o ConnectTimeout=999 -o ServerAliveInterval=340 -c arcfour" /tank/drives/xxxxx/ serverxxxxx:/tank/drives/xxxxx | |
| if [ "$?" = "0" ] ; then |
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 | |
| # Check new IPv4 addresses | |
| # If address is not in iptables add rule | |
| IPLISTV4=$(host maps.googleapis.com | grep -E 'has address' | awk '{print $4}') | |
| for x in $IPLISTV4 | |
| do | |
| $(iptables -L -nv | grep "$x" >> /dev/null) | |
| if [[ "$?" -ne '0' ]]; then |
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 | |
| class YandexMusic { | |
| public static function getAlbumInfo($url) { | |
| $req = file_get_contents($url); | |
| $data = preg_match('/var\s+Mu\s+=\s+(.+?);\s+<\/script>/is', $req, $matches); | |
| $data = json_decode($matches[1], true); | |
| return $data['pageData']; | |
| } |
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 | |
| $i = 100; | |
| while ($i <= 150) { | |
| $id = $i; | |
| $start = microtime(true); | |
| $binary_id_enc = dec2bin_i($id); | |
| $binary_id_dec = bin2dec_i($binary_id_enc); | |
| echo "-------------------------------------<br />"; |
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 | |
| function getsign($day,$month) { | |
| if(($month==1 && $day>20)||($month==2 && $day<20)) { | |
| $mysign = "aquarius"; | |
| } | |
| if(($month==2 && $day>18 )||($month==3 && $day<21)) { | |
| $mysign = "pisces"; | |
| } | |
| if(($month==3 && $day>20)||($month==4 && $day<21)) { | |
| $mysign = "aries"; |
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 | |
| // Updated code from comments | |
| function encode($value) { | |
| if (!$value) { | |
| return false; | |
| } | |
| $key = sha1('EnCRypT10nK#Y!RiSRNn'); |
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 | |
| /* | |
| * Copyright 2011 Michael Cutler <m@cotdp.com> | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-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
| package mysqlinsert.solr; | |
| import java.io.IOException; | |
| import java.sql.Connection; | |
| import java.sql.DriverManager; | |
| import java.sql.PreparedStatement; | |
| import java.sql.Statement; | |
| import java.util.Properties; | |
| import org.apache.solr.common.SolrInputDocument; |
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
| # conky configuration | |
| # | |
| # The list of variables has been removed from this file in favour | |
| # of keeping the documentation more maintainable. | |
| # Check http://conky.sf.net for an up-to-date-list. | |
| # | |
| # For ideas about how to modify conky, please see: | |
| # http://crunchbanglinux.org/forums/topic/59/my-conky-config/ | |
| # | |
| # For help with conky, please see: |
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 | |
| $extensions = array(); | |
| $extensions = json_decode('{"JavaScript+Mako":[["js+mako","javascript+mako"],[],["application\/x-javascript+mako","text\/x-javascript+mako","text\/javascript+mako"]],"Brainfuck":[["brainfuck","bf"],["bf","b"],["application\/x-brainfuck"]],"HTML+Cheetah":[["html+cheetah","html+spitfire"],[],["text\/html+cheetah","text\/html+spitfire"]],"Bash":[["bash","sh","ksh"],["sh","ksh","bash","ebuild","eclass"],["application\/x-sh","application\/x-shellscript"]],"CSS+Myghty":[["css+myghty"],[],["text\/css+myghty"]],"Coldfusion HTML":[["cfm"],["cfm","cfml","cfc"],["application\/x-coldfusion"]],"Smarty":[["smarty"],["tpl"],["application\/x-smarty"]],"Protocol Buffer":[["protobuf"],["proto"],[]],"ApacheConf":[["apacheconf","aconf","apache"],[".htaccess","apache.conf","apache2.conf"],["text\/x-apacheconf"]],"Java":[["java"],["java"],["text\/x-java"]],"JavaScript+Genshi Text":[["js+genshitext","js+genshi","javascript+genshitext","javascript+genshi"],[],["application\/x-javascript+genshi","text\/x |