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 java.io.*; | |
| import java.util.*; | |
| import java.text.*; | |
| import java.math.*; | |
| import java.util.regex.*; | |
| import java.io.UnsupportedEncodingException; | |
| import java.security.NoSuchAlgorithmException; | |
| public class Solution { |
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
| typedef void (*t_func)(void); | |
| enum s_state{ | |
| STATE1, | |
| STATE2 | |
| }; | |
| void func_state1() | |
| { | |
| printf("func_state1\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
| #!/bin/bash | |
| # | |
| # article: http://neblog.info/skript-bekapa-na-yandeks-disk | |
| # | |
| # REST API: https://tech.yandex.ru/disk/api/reference/upload-docpage/ | |
| TOKEN="" | |
| # NB: slash ending |
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
| all: | |
| /usr/local/musl/bin/musl-gcc -o pping pping.c | |
| # $(CC) -o pping pping.c |
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 | |
| #sort | |
| ps -eo size,pid,user,command | awk '{ hr=$1/1024 ; printf("%13.6f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | sort | |
| # memory statistics | |
| cat /proc/meminfo | |
| # drop cache (but not for VPS) | |
| sync |
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 -eux | |
| if [[ "$DESKTOP" =~ ^(true|yes|on|1|TRUE|YES|ON])$ ]]; then | |
| exit | |
| fi | |
| echo "==> Disk usage before minimization" | |
| df -h | |
| echo "==> Installed packages before cleanup" |
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
| int main (int argc, char *argv[]) | |
| { | |
| int i; | |
| int j; | |
| int n=2; | |
| int size = 2*n+1; | |
| int (*data)[size] = malloc(sizeof(int[size][size])); | |
| memset(data, 0, sizeof(int[size][size])); |
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
| for line in $(seq 996 1086) ; do history -d 996; done |
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 | |
| # | |
| # Copyright (C) 2010 Matthias Buecher (http://www.maddes.net/) | |
| # | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation; either version 2 of the License, or | |
| # (at your option) any later version. | |
| # http://www.gnu.org/licenses/gpl-2.0.txt |
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 | |
| # recursive rights setup for files and directories (instead of chmod -R) | |
| find ${DIR} -type d -exec chmod 755 {} \; | |
| find ${DIR} -type f -exec chmod 644 {} \; | |
| # in the case of blocking by seLinux: | |
| # restorecon -rv /var/www/html |