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 | |
| smtp_address="" | |
| smtp_username="" | |
| smtp_password="" | |
| smtp_server="" | |
| smtp_port=587 | |
| use_starttls=true | |
| send_mail() { |
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 time | |
| def convert_time(conv_time, ago=False): | |
| """Returns time ago/stuff lol""" | |
| periods = ["second", "minute", "hour", "day", "week", "month", "year", "decade", "century", "millennium"] | |
| lengths = [60, 60, 24, 7, 4.35, 12, 10, 10, 10] | |
| if ago: | |
| now = time.time() | |
| difference = now - conv_time | |
| else: |
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
| # Atomic Swap/Exchange (Test-and-set) (T&S) | |
| lock1: addi $t0, $zero, 1 | |
| ll $t1, 0($s1) | |
| sc $t0, 0($s1) | |
| beq $t0, $zero, lock1 | |
| add $s2, $zero, $t1 | |
| # Atomic Increment (Fetch-and-Add) (FAA) | |
| lock2: ll $t0, 0($s1) | |
| addi $t1, $t0 |
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
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| char * | |
| itoa ( | |
| int value , | |
| char * | |
| result ), | |
| charlist [ | |
| 10 ]; |
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 | |
| # Add this script to crontab: | |
| # `sudo printf "33 3\t* * *\troot\t/etc/dead_switch.sh" >> /etc/crontab` | |
| # Dead Switch configuration | |
| your_email="" | |
| server_username="" | |
| warning_time=$((3600 * 24 * 14)) | |
| trigger_time=$((3600 * 24 * 28)) |
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
| /\_/\ | |
| (O. o)__/ | |
| (___)| | |
| | | |_) | |
| (_/\_) |
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
| define("HTTP_CONTINUE", 100); | |
| define("HTTP_SWITCHING_PROTOCOLS", 101); | |
| define("HTTP_PROCESSING", 102); | |
| define("HTTP_EARLY_HINTS", 103); | |
| define("HTTP_OK", 200); | |
| define("HTTP_CREATED", 201); | |
| define("HTTP_ACCEPTED", 202); | |
| define("HTTP_NON_AUTHORITATIVE_INFORMATION", 203); | |
| define("HTTP_NO_CONTENT", 204); | |
| define("HTTP_RESET_CONTENT", 205); |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #define BFSZ 1024 | |
| char* template = "test.html"; | |
| char* generated = "new_test.html"; | |
| char* listFile = "zanimals.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
| /* Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
| This file is part of the GNU C Library. | |
| The GNU C Library is free software; you can redistribute it and/or | |
| modify it under the terms of the GNU Lesser General Public | |
| License as published by the Free Software Foundation; either | |
| version 2.1 of the License, or (at your option) any later version. | |
| The GNU C Library is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| Lesser General Public License for more details. |
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
| ################################################################### | |
| Writing C software without the standard library | |
| Linux Edition | |
| ################################################################### | |
| There are many tutorials on the web that explain how to build a | |
| simple hello world in C without the libc on AMD64, but most of them | |
| stop there. | |
| I will provide a more complete explanation that will allow you to | |
| build yourself a little framework to write more complex programs. |