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 | |
| $data = file_get_contents('php://stdin'); | |
| $password = 'ps8T0G/39oHgRehuV0TjUv2lyeA='; | |
| $c = rkxor($data, $password); | |
| $x = rkxor($c, $password); | |
| var_dump($c,$x); | |
| function rkxor($data, $password) { |
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
| # values from https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Welcome%20to%20High%20Performance%20Computing%20%28HPC%29%20Central/page/Linux%20System%20Tuning%20Recommendations | |
| # install (root): curl -s https://gist.githubusercontent.com/polonskiy/00a71bab32360ffcb79f/raw/10-custom.conf > /etc/sysctl.d/10-custom.conf | |
| # apply (root): sysctl -p /etc/sysctl.d/10-custom.conf | |
| net.ipv4.neigh.default.gc_thresh1 = 30000 | |
| net.ipv4.neigh.default.gc_thresh2 = 32000 | |
| net.ipv4.neigh.default.gc_thresh3 = 32768 | |
| net.ipv6.neigh.default.gc_thresh1 = 30000 | |
| net.ipv6.neigh.default.gc_thresh2 = 32000 |
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 | |
| #enable job control | |
| set -m | |
| #propagate INT/TERM signals | |
| trap 'kill -TERM $(jobs -p); wait' TERM | |
| trap 'kill -INT $(jobs -p); wait' INT | |
| #services |
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 | |
| setlocale(LC_ALL, 'uk_UA.UTF-8'); | |
| $float = 1.2345; | |
| echo "$float\n"; |
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 csv_decode($csv, $columns = [], $delimiter = ',', $enclosure = '"', $escape = '\\') { | |
| $tmp = fopen('php://temp', 'rb+'); | |
| fwrite($tmp, $csv); | |
| rewind($tmp); | |
| $result = []; | |
| $assoc = (bool) $columns; |
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 | |
| LC_ALL=C grep '^[a-z]\+$' /usr/share/dict/words | shuf --random-source=/dev/urandom -n 4 | paste -s -d- | |
| grep '^[abcdefghijklmnopqrstuvwxyz]\{3,7\}$' /usr/share/dict/words | shuf -n 6 | xargs | sed 's/ /-/g' |
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 | |
| dpkg -l | awk '/linux-image-[0-9]/ {print $2}' | grep -vF "$(uname -r)" | xargs -r apt-get -y purge |
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 | |
| git filter-branch --prune-empty --index-filter "git rm --cached -f --ignore-unmatch $1" --tag-name-filter cat -- --all |
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 User { | |
| public | |
| $name, | |
| $lastName; | |
| public function __construct($name, $lastName) { | |
| $this->name = $name; | |
| $this->lastName = $lastName; |
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 | |
| register_tick_function(function() { | |
| $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); | |
| $last = reset($bt); | |
| echo sprintf("%s +%d\n", $last['file'], $last['line']); | |
| }); | |
| declare(ticks=1); |