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
| function startsWith($haystack, $needle) | |
| { | |
| $length = strlen($needle); | |
| return (substr($haystack, 0, $length) === $needle); | |
| } |
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 | |
| ################################################################################ | |
| # This script will check to see if a website is up/down by pinging the url | |
| # If there is no response an email wil be send via an external smtp mail server | |
| # If the site status is down an email will be send when the site is up again | |
| # set your check interval here :-) ############################################# | |
| interval=3600 # hour |
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
| # Modify this file accordingly for your specific requirement. | |
| # http://www.thegeekstuff.com | |
| # 1. Delete all existing rules | |
| iptables -F | |
| # 2. Set default chain policies | |
| iptables -P INPUT DROP | |
| iptables -P FORWARD DROP | |
| iptables -P OUTPUT DROP |
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 |
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
| // paste in your console | |
| speechSynthesis.onvoiceschanged = function() { | |
| var msg = new SpeechSynthesisUtterance(); | |
| msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0]; | |
| msg.text = Object.keys(window).join(' '); | |
| this.speak(msg); | |
| }; |