This file contains 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> | |
const char kBase64Alphabet[64] = { | |
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', | |
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', | |
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '-' | |
}; | |
const char kBase64Padding = '='; |
This file contains 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
nc -zvn <target> <begin-port>-<end-port> |
This file contains 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 <execinfo.h> | |
#define PRINT_STACKTRACE(TAG) \ | |
{ \ | |
void* buffer[256]; \ | |
int count = backtrace(buffer, 256); \ | |
\ | |
char** calls = backtrace_symbols(buffer, count); \ | |
if (calls != nullptr) \ | |
{ \ |
This file contains 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
https://stackoverflow.com/questions/6205157/iterm-2-how-to-set-keyboard-shortcuts-to-jump-to-beginning-end-of-line | |
FOR ACTION SEND | |
⌘← "SEND HEX CODE" 0x01 | |
⌘→ "SEND HEX CODE" 0x05 |
This file contains 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
# Command Line Progress Viewer for many tools | |
sudo apt-get install libncurses5-dev | |
git clone https://github.com/Xfennec/progress.git | |
# Random Cowsay Message and Cow | |
fortune | cowsay -f $(ls /usr/share/cowsay/cows/ | shuf -n 1) |
This file contains 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
# perform a fresh install of Ubuntu 17.10 | |
# upgrade the kernel to v4.13.10 | |
mkdir ~/kernel-v4.13.10 | |
cd ~/kernel-v4.13.10 | |
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310_4.13.10-041310.201710270531_all.deb | |
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb | |
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-image-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb | |
sudo dpkg -i *.deb |
This file contains 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
Programming Info | |
Information about GameBoy hardware and programming is extremely hard to find. Most of it is incomplete, uncertain and vague. If you have any new information, PLEASE, email it to me. The following information is mostly based on a document by Pan of Anthrox, Jeff Frohwein's, Pascal Felber's, and my own findings. | |
Memory Map | |
--------------------------- FFFF | 32kB ROMs are non-switchable and occupy | |
I/O ports + internal RAM | 0000-7FFF are. Bigger ROMs use one of two | |
--------------------------- FF00 | different bank switches. The type of a | |
Internal RAM | bank switch can be determined from the |
This file contains 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 | |
#Autor: Emiliano Carlos de Moraes Firmino | |
#Comentario: igual a usar "sar -A 1", mas sem a interface de rede | |
# que não abre no kSar | |
#Script Variables | |
output_file="sar_data.txt" #arquivo de saída | |
interval=1 #taxa de amostragem em segundos | |
#Inicia rodada de testes |
This file contains 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
There are many small errors or discrepancies in the docs listed above, unfortunately I don't know if/how those docs are maintained so I'm going to list the errors I've found here for now: | |
RLCA instruction: various sources disagree on whether the Z flag should be modified by the operation. After some research I'm pretty sure it shouldn't be modified (the Z80 processor for instance does not modify Z). | |
HALT instruction: when this instruction is executed while interrupts are disabled in the CPU (for instance by a DI instruction) the CPU will still be awoken by any interrupt enabled in the IE register, however the interrupt handler will not be run and the control will be given back to the code that called the HALT. Be careful that the instruction following an HALT is glitchy but that's well documented. | |
ADD SP,N (opcode 0xe8) and LDHL SP,N (opcode 0xf8): the values of the carry and halfcarry are computed on the low 8bits. | |
RLCA, RLA, RRCA, RRA instructions: the flags are described wrong in the CP |
This file contains 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> | |
#include "jsmn.h" | |
char* types[] = {"UNDEFINED", "OBJECT", "ARRAY", "STRING", "PRIMITIVE"}; | |
int main() { | |
char* json = NULL; | |
size_t len = 0; |
NewerOlder