Skip to content

Instantly share code, notes, and snippets.

View dnutiu's full-sized avatar
🌱

Denis Nuțiu dnutiu

🌱
View GitHub Profile
### Keybase proof
I hereby claim:
* I am dnutiu on github.
* I am denisnutiu (https://keybase.io/denisnutiu) on keybase.
* I have a public key ASDzEkyeLbX1bNuVbCuz8d39CzRt4k6k1gtZThgr71QK0go
To claim this, I am signing this object:
@dnutiu
dnutiu / black_precomit_hook.sh
Last active February 11, 2019 10:29
Format all python files with black before comiting them.
#!/usr/bin/env bash
files=`git status | grep -e "modified:.*\.py" | sed -E "s/\s*modified:\s*//"`
for FILE in ${files}
do
echo "Running black on" ${FILE}
black ${FILE}
done
# Add modified stagged files back to stagged.
git diff --name-only --cached | xargs -l git add
#!/usr/bin/python3
"""
Update the vultr api for the my domain.
"""
import os
import requests
import syslog
PUBLIC_IP_ADDRESS = "https://api.ipify.org"
VULTR_API_UPDATE = "https://api.vultr.com/v1/dns/update_record"
@dnutiu
dnutiu / kmn.c
Created December 25, 2018 15:46
/*
* Keygen for the "KeygenMe or Not" challenge.
* */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
void exit_error(char * e) {
fprintf(stderr, "%s\n", e);
@dnutiu
dnutiu / gcc_inline.c
Last active July 29, 2018 14:15
GCC Inline Assembly, str_set
#include <stdio.h>
#include <stdlib.h>
int str_set(char * str, const size_t n, const size_t pos, const uint8_t val) {
uint8_t return_value = 0;
asm
(
"cmp %[pos], %[n]\n\t"
@dnutiu
dnutiu / qsort.go
Created April 28, 2018 10:32
Quicksort algorithm in GO
package main
import "fmt"
func quicksort(slice []int) ([]int) {
length := len(slice)
// The array is considered sorted if it contains only one element.
if length < 2 {
return slice
@dnutiu
dnutiu / find.py
Created January 22, 2018 18:09
Computer Engineering Foundamentals C.E.F assignments.
import re
import sys
import matplotlib.pyplot as plt
# src, dst
sources = []
def find_dependencies(filename):
dependecies = 0
@dnutiu
dnutiu / pixie_dust_setup.sh
Last active December 1, 2017 22:57
Pixie Dust Atack - May work on routers which have WPS enabled.
# Assuming you're running this as root in kali.
apt-get update
# Pixie-Dust required packages.
apt-get install build-essential
apt-get install libpcap-dev
apt-get install sqlite3
apt-get install libsqlite3-dev
apt-get install pixiewps
@dnutiu
dnutiu / reverse-shell-windows.go
Created December 1, 2017 20:54
A simple reverse shell written in Go, may not work.
// Reverse shell in go
package main
import (
"bufio"
"flag"
"fmt"
"io"
"net"
"os"
@dnutiu
dnutiu / cmd.c
Last active November 29, 2017 21:36
This gist how to orchestrate two programs in C by using pipes and forks.
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <dirent.h>
#include <string.h>
/*
1. Un program care scanfile