Skip to content

Instantly share code, notes, and snippets.

View havocesp's full-sized avatar

Daniel Umpierrez havocesp

  • Spain
View GitHub Profile
@havocesp
havocesp / autotypedict.py
Created March 15, 2023 00:38 — forked from bhughes339/autotypedict.py
Dictionary-like class that automatically tries to typecast each scalar value to a standard type
from collections import UserDict
from collections.abc import Iterable, Mapping
import json
class AutoTypeDict(UserDict):
"""Dictionary-like class that automatically tries to typecast each
scalar value to a standard type.
Values are only typecasted when the `AutoTypeDict` instance is
updated directly, so avoid using type-specific operations on mutable
@havocesp
havocesp / html_to_text.py
Created February 25, 2020 07:37 — forked from jspri/html_to_text.py
Converts html to plain text in python3. Only standard libraries used.
"""
HTML <-> text conversions.
http://stackoverflow.com/questions/328356/extracting-text-from-html-file-using-python
"""
from html.parser import HTMLParser
from html.entities import name2codepoint
import re
class _HTMLToText(HTMLParser):
def __init__(self):
@havocesp
havocesp / measure.py
Created April 3, 2019 13:48 — forked from sjtosco/measure.py
Linux Network Traffic Measure/Calculator Python Script
#!/usr/bin/env python
'''
_______ ______
|_ _\ \ / / ___|
| | \ \ / /\___ \
| | \ V / ___) |
|_| \_/ |____/
Teske Virtual System
import sys
import getpass
import stem.connection
import stem.socket
try:
control_socket = stem.socket.ControlPort(port = 9051)
except stem.SocketError as exc:
print 'Unable to connect to port 9051 (%s)' % exc
sys.exit(1)
@havocesp
havocesp / webview-app.py
Created January 25, 2019 12:33
Load web site inside a windows.
#!/usr/bin/python3
from gi.repository import Gtk
from gi.repository import WebKit
import sys
class MainWindow(Gtk.Window):
def __init__(self, *args):
Gtk.Window.__init__(self)
if len(sys.argv) == 5:
@havocesp
havocesp / micro-installer.sh
Last active January 11, 2019 23:17
Command line "micro" text editor installer.
#!/usr/bin/env bash
curl https://getmic.ro | bash

Keybase proof

I hereby claim:

  • I am havocesp on github.
  • I am havocesp (https://keybase.io/havocesp) on keybase.
  • I have a public key ASAJ9oIY58cKXDsPwo3wKaOQwsrTFSOK4P3KiV-GzVj8vwo

To claim this, I am signing this object:

@havocesp
havocesp / install_codiad.sh
Created December 29, 2018 00:27 — forked from rnauber/install_codiad.sh
this installs the browser-based editor Codiad
#installs the browser-based editor Codiad
DEST=~/codiad
ADDR=127.0.0.1:9876
pkg install php
if [ ! -e $DEST ]
then
git clone https://github.com/Codiad/Codiad $DEST
@havocesp
havocesp / foo.text
Last active December 17, 2018 20:33
Interesting FUSE package listf
Interesting FUSE package list:
### Ubuntu Bionic:
afuse
ciopfs
copyfs
curlftpfs
enfuse
etcd-fs
@havocesp
havocesp / config
Created December 13, 2018 10:01
SSH Server over TOR
### $HOME/.ssh/config
host hidden
hostname <hidden_url.onion>
proxyCommand ncat --proxy 127.0.0.1:9050 --proxy-type socks5 %h %p