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 | |
| if [ "$EUID" -ne 0 ] | |
| then echo "Please run as root" | |
| exit | |
| fi | |
| if [ $# -eq 0 ] | |
| then | |
| echo "You have to supply the name of the user as a parameter" |
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 | |
| FILES="$(mysql -u database.user -pdatabase.password -h database.host -Bse 'show binary logs' | cut -f 1)" | |
| for file in $FILES | |
| do | |
| if [ ! -f files/$file ]; then | |
| logger "Trying to download new file: $file" | |
| echo "Trying to download new file: $file" | |
| mysqlbinlog \ |
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
| class Animal | |
| { | |
| use Cat, Dog { | |
| Dog::wantWalkies as protected doggyWalk; | |
| // this next line does not work | |
| // Dog::wantWalkies as protected insteadof Cat; | |
| Dog::wantWalkies instead of Cat; | |
| Dog::wantWalkies as protected; |
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 | |
| trait Dog | |
| { | |
| public function wantWalkies() | |
| { | |
| echo "Yes please!"; | |
| } | |
| } |
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 | |
| trait Singleton | |
| { | |
| private static $instance; | |
| private function __construct() {} | |
| public static function getInstance() | |
| { | |
| if (!(self::$instance instanceof self)) { |
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 | |
| logger Configuring iptables | |
| # Flush existing rules | |
| sudo iptables -F | |
| # Allow SSH from Brightsource | |
| sudo iptables -A INPUT -p tcp -s 31.221.84.114/32 --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT | |
| sudo iptables -A OUTPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT |
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
| class RSS | |
| { | |
| const CACHE_FILENAME = 'feed.cache'; | |
| const CACHE_TTL = 60; | |
| /** | |
| * Public exposed function to read the feed, checks if the cache needs to be refreshed and if so reads from web, | |
| * otherwise reads from the cache |
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
| # This is a minimal example used to demonstrate swapping PHP versions | |
| # It is not production ready and omits basic security checks. | |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| root /usr/share/nginx/html; | |
| location ~ \.php$ { | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
| fastcgi_index index.php; |
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 { Component, Inject } from '@angular/core'; | |
| import { PhoenixChannelService } from './app.phoenix_channels.service'; | |
| @Component({ | |
| selector: 'my-app', | |
| templateUrl: 'templates/app.html', | |
| providers: [PhoenixChannelService] | |
| }) | |
| export class AppComponent { |
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
| /** | |
| * setupBeforeClass | |
| * @static | |
| * @access public | |
| */ | |
| public function setup() | |
| { | |
| parent::setUp(); | |
| Session::flush(); |