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 \MangoPay\Libraries\OAuthToken; | |
| function extractValues(OAuthToken $token) { | |
| $ref = new \ReflectionClass(OAuthToken::CLASS); | |
| $values = []; | |
| $props = $ref->getProperties(); | |
| foreach($props as $prop) { | |
| if (!$prop->isPublic()) { |
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 | |
| MAX=80 | |
| EMAIL=email@example.com | |
| HOST=`hostname` | |
| DISKS=`df -h | awk -v max=$MAX 'NR>1 && NF>1 { perc = (NF==5) ? $4 : $5; sub("%","",perc); if (0+perc >= 0+max) print perc"%", $NF }'` | |
| if [ "$DISKS" != "" ]; then | |
| echo -e "Warning we are running out of disk space on $HOST \n$DISKS" | mail -s "Running out of disk space on $HOST" $EMAIL | |
| 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
| #!/bin/sh | |
| cmd=${0##*/} | |
| ssh -t $1 "$(sed '1,/^#xxxREMOTExxx#$/d' < $0) > /tmp/$cmd.$$.sh && sh /tmp/$cmd.$$.sh; rm /tmp/$cmd.$$.sh" | |
| exit $? | |
| #xxxREMOTExxx# | |
| #!/bin/sh | |
| echo "This is executed on the remote server" |
OlderNewer