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
;macro, struct and syscall uname | |
;just practicing programming in assembly language (Ferdinand Silva) | |
%macro print_info 3 | |
mov r13, %1 | |
mov r14, %2 | |
call print | |
mov r13, utsname + %3 | |
mov r14, 24 | |
call print | |
mov r13, NEW_LINE |
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
;usage: ./kill2 <PID> | |
;same as `kill -n 9 <PID>` command in Linux | |
;just practicing programming in assembly language (Ferdinand Silva) | |
section .data | |
SYS_EXIT: equ 60 | |
SYS_KILL: equ 62 | |
SYS_WRITE: equ 1 | |
SIGKILL: equ 9 | |
STD_IN: equ 1 | |
INVALID: db "Usage: kill2 <PID>", 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
package main | |
import ( | |
"fmt" | |
"os" | |
"bufio" | |
"encoding/base64" | |
"encoding/json" | |
"net/http" | |
"bytes" |
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
#!/usr/bin/env python | |
""" | |
Note: | |
----- | |
* Install pycrypto | |
""" | |
import socket | |
import re | |
from Crypto.PublicKey import RSA | |
from Crypto.Cipher import PKCS1_v1_5 as Cipher_PKCS1_v1_5 |
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
; Assembling and linking | |
; ---------------------- | |
; nasm -f macho64 test.asm | |
; gcc -o test test.o -Wl,-no_pie | |
section .data ; data section | |
line1: | |
db "My name is: " ; constant string | |
line2: | |
db "Ferdinand", 0xA ; constant string with newline |
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
package main | |
import ( | |
"fmt" | |
"syscall" | |
"unsafe" | |
) | |
const ( | |
FOREGROUND_BLACK uint16 = 0x0000 |
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
#!/usr/bin/env python | |
import serial | |
import time | |
import re | |
if __name__ == "__main__": | |
ser = serial.Serial('/dev/cu.SLAB_USBtoUART', 9600, timeout=1) | |
isOk = False | |
try: |
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
package main | |
import ( | |
"fmt" | |
"bufio" | |
"os" | |
"errors" | |
"unicode" | |
"strconv" | |
) |
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
/* | |
Thanks to this post: https://balau82.wordpress.com/2014/10/15/using-a-buzzer-with-arduino-in-pure-c/ | |
*/ | |
#ifndef F_CPU | |
#define F_CPU 16000000UL //set frequency | |
#endif | |
#define __DELAY_BACKWARD_COMPATIBLE__ | |
#include <avr/io.h> |
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
/* | |
Compiling and uploading to Arduino Uno (Sample Code 3) [Digital Read] | |
===================================================================== | |
avr-gcc -Os -mmcu=atmega328p -c test.c | |
avr-gcc -mmcu=atmega328p -o test.elf test.o | |
avr-objcopy -O ihex -R .eeprom test.elf test.hex | |
avrdude -F -V -c arduino -p ATMEGA328P -P /dev/cu.usbmodem1421 -b 115200 -U flash:w:test.hex | |
*/ |