Skip to content

Instantly share code, notes, and snippets.

Vinicyus Macedo vinicyusmacedo

Block or report user

Report or block vinicyusmacedo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Kubernetes the hard way -

Kubernetes the hard way - notes


Creating a project and linking billing

# Create project
gcloud projects create project-name --set-as-default
# List billing accounts
vinicyusmacedo /
Last active May 12, 2019
This gist shows how to create a dev environment of Teresa using minikube (not suitable for production)

My Teresa dev environment


  • mysql user: teresa
  • mysql password: foobar
  • mysql database: teresa
  • mysql namespace: mysql
  • mysql helm name: mysql
  • mysql service name: teresa
vinicyusmacedo /
Last active May 11, 2019
Some useful bash commands
# Making substitutions on files where a certain pattern is found
fgrep -r "<something>" . | awk -F : '{print $1}' | xargs sed -i "s/<something>/<something else>/g" $@
## Mac OS specifics
## Cleaning up Time Machine snapshots
tmutil listlocalsnapshots / | awk -F "." '{print $4}' | while read dt; do tmutil deletelocalsnapshots $dt; done
vinicyusmacedo / boverflow_strcpy.c
Created Mar 24, 2019
Example of buffer overflow using strcpy
View boverflow_strcpy.c
// to compile: gcc -fno-stack-protector -o boverflow_strcpy boverflow_strcpy.c
// to run (test): ./boverflow_strcpy $(python -c "print 'a'*15")
#include <stdio.h>
#include <strings.h>
void foo(char *bar){
char buffer[16];
strcpy(buffer, bar);
printf("%s", buffer);
vinicyusmacedo / boverflow_gets.c
Created Mar 24, 2019
Example code for buffer overflow vuln with gets
View boverflow_gets.c
// To compile: gcc -fno-stack-protector -o boverflow_gets boverflow_gets.c
// To run (test): python -c "print 'a'*<some number>" | ./boverflow_gets
#include <stdio.h>
#include <string.h>
int main() {
char buffer[16];
printf("%s", buffer);
return 0;
vinicyusmacedo / ioverflow.c
Last active Feb 22, 2019
Some tests I made while studying buffer overflows and integer overflows
View ioverflow.c
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
char *test = argv[1];
int tt = (int)strlen(test);
printf("%d", tt);
return 0;
vinicyusmacedo / bind.c
Created Feb 22, 2019
Code for binding a port and spawning a shell
View bind.c
#include <unistd.h>
#include <stdlib.h>
#include <netinet/in.h>
void main() {
int sock = socket(AF_INET, SOCK_STREAM, 0);
struct sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = INADDR_ANY;
vinicyusmacedo / node.go
Created Feb 22, 2019
The first code I've ever written in Golang :).
View node.go
package main
import (
type Node struct {
Data int
Next_node *Node
vinicyusmacedo / batman_vs_snowwhite.js
Created Jan 4, 2019
Wow.... I found the first code I've written, back in 2012, thanks to Codecademy.
View batman_vs_snowwhite.js
var confirm1;
confirm1 = confirm("Are you ready to play?");
var age = prompt("how old are you?");
if (age < 18){
console.log("you are not old enough to play");
console.log("You may start your quest!");
You can’t perform that action at this time.