Вся суть харча™ (на самом деле все далеко не так...)
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
| # One can write a class that wraps a Proc and calls it: | |
| class Handler | |
| def initialize(&@proc : -> String) | |
| end | |
| def call | |
| @proc.call | |
| end | |
| end |
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 | |
| # Gustavo Arnosti Neves - Dec 2018 | |
| # Modified from many other snippets | |
| # Adapted to work virtually anywhere | |
| # Works on busybox/ash | |
| # This script: https://gist.github.com/tavinus/925c7c9e67b5ba20ae38637fd0e06b07 | |
| # SO reference: https://stackoverflow.com/questions/16843382/colored-shell-script-output-library |
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
| // Based on https://stackoverflow.com/a/23898449/266720 | |
| void tallymarker_hextobin(const char * str, uint8_t * bytes, size_t blen) | |
| { | |
| uint8_t pos; | |
| uint8_t idx0; | |
| uint8_t idx1; | |
| // mapping of ASCII characters to hex values | |
| const uint8_t hashmap[] = | |
| { |
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 | |
| # POSIX | |
| # Reset all variables that might be set | |
| file= | |
| verbose=0 # Variables to be evaluated as shell arithmetic should be initialized to a default or validated beforehand. | |
| while :; do | |
| case $1 in | |
| -h|-\?|--help) # Call a "show_help" function to display a synopsis, then exit. |
The Transmission torrent client has an option to set a Blocklist, which helps protect you from getting caught and having the DMCA send a letter/email.
It's as simple as downloading and installing the latest client:
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
| # | |
| # Verify captcha | |
| $post_data = http_build_query( | |
| array( | |
| 'secret' => CAPTCHA_SECRET, | |
| 'response' => $_POST['g-recaptcha-response'], | |
| 'remoteip' => $_SERVER['REMOTE_ADDR'] | |
| ) | |
| ); | |
| $opts = array('http' => |
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
| /** | |
| * example C code using libcurl and json-c | |
| * to post and return a payload using | |
| * http://jsonplaceholder.typicode.com | |
| * | |
| * License: | |
| * | |
| * This code is licensed under MIT license | |
| * https://opensource.org/licenses/MIT | |
| * |
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
| set -x | |
| wget http://archive.zfsonlinux.org/debian/pool/main/z/zfsonlinux/zfsonlinux_2%7Ewheezy_all.deb | |
| dpkg -i zfsonlinux_2~wheezy_all.deb | |
| apt-get update | |
| apt-get install -y debian-zfs | |
| DISK_SIZE=$(parted /dev/sda unit MB print | grep '^Disk' | sed -r 's/.* ([0-9]+)MB.*/\1/') | |
| # Partitions |
NewerOlder

