Skip to content

Instantly share code, notes, and snippets.

View sugayaa's full-sized avatar

sugaya sugayaa

View GitHub Profile
@sugayaa
sugayaa / append_dimensions.sh
Created September 6, 2020 16:02
made for appending image's dimensions to it's filename
#!/bin/bash
FILES=$(find -type f -exec basename {} \;)
for file in $FILES; do
dimensions=$(identify $file | awk '{print $3}')
name=$(echo $file | tr "." " " | awk '{print $1}')
extension=$(echo $file | tr "." " " | awk '{print $2}')
mv $file $name-$dimensions.$extension
done

Keybase proof

I hereby claim:

  • I am sugayaa on github.
  • I am sugaya (https://keybase.io/sugaya) on keybase.
  • I have a public key ASBP9YhGert1mqe2OdcPJT-Ckl4F-l3smnxU3kI33bqU4Qo

To claim this, I am signing this object:

@sugayaa
sugayaa / binary_from_text.py
Last active April 24, 2020 16:01
Script mainly intended for CTF's. Script create binaries from raw hex text.
def sanitize(content):
return content.replace(" ","").replace("\n","").replace("\r","")
def main():
with open("binary_as_text", "r") as f:
content = f.read()
content = sanitize(content)
bin_content = b''
import numpy as np
import matplotlib.pyplot as plt
#usei _ antes do nome para indicar que sao "variaveis globais"
_inicio, _meio, _fim = 1.0, (1.0+5.0)/2.0, 5.0
def F(x, y, r=2.0):
return x - 0.5 * np.cos(x) - r * np.arccos(1 - y / r) + np.sqrt(y * (2 * r - y))
@sugayaa
sugayaa / hostapd-wpe.PKGBUILD
Last active October 30, 2019 16:04 — forked from PedroHLC/hostapd-wpe.PKGBUILD
hostapd-wpe 2.8
_pkgname=hostapd
pkgname="${_pkgname}-wpe"
pkgver=2.8
pkgrel=0
pkgdesc="IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator (with hostapd-wpe patch)"
arch=('x86_64' 'aarch64')
url="https://w1.fi/hostapd/"
license=(GPL)
depends=('openssl' 'libnl')
options=(emptydirs)
#dijkstra single source using networkx in python3
def dijkstraSingleSource(source):
pq = []
dist = [m.inf] * TAM
vis = [False] * TAM
pred = [-1] * TAM
heapq.heappush(pq, (0 ,source))
dist[source] = 0