Skip to content

Instantly share code, notes, and snippets.

@ramuta
ramuta / iso-usb.md
Created February 16, 2020 15:58
Put a bootable ISO on a USB stick

Check the volume name of your USB stick:

diskutil list  # check for something like /dev/disk2

Then erase what you have on the stick currently:

diskutil eraseDisk FAT32 LINUX /dev/<DISK>

Unmount the disk:

@ramuta
ramuta / reqscanner.py
Last active February 1, 2020 11:58
reqscanner.py
# Simple directory scanner written in Python (needs requests library)
# Author: Matej Ramuta
# Usage: python reqscanner.py domain.com wordlist.txt
# domain.com must not end with a slash!
import requests
import sys
domain = str(sys.argv[1]).replace("http://", "").replace("https://", "")
wordfile = sys.argv[2]
@ramuta
ramuta / sudo_brute_force.py
Last active April 8, 2024 05:12
A Python script to brute force the sudo password of a current user.
# Author: Matej Ramuta
# How to use this script:
# 1. You need to have a wordlist file, something like rockyou.txt
# 2. Make sure you have Python 3 installed. Try this with "python --version" command. Also check "python3 --version"
# 3. Run the script like this: python sudo_brute_force.py passwords.txt
import os
import sys
if len(sys.argv) == 1:

Keybase proof

I hereby claim:

  • I am ramuta on github.
  • I am ramuta (https://keybase.io/ramuta) on keybase.
  • I have a public key ASDMN0J7lQ3LYIKNJDKWBEkvmKufS28UxltrVVxxC1pzKgo

To claim this, I am signing this object:

@ramuta
ramuta / README.md
Created July 3, 2019 17:57
Austria postal codes (ZIP) with town names

Austria postal codes (ZIP) with town names

Examples:

{'zip': '1010', 'place': 'Wien, Innere Stadt'}, 
{'zip': '1020', 'place': 'Wien, Leopoldstadt'},
{'zip': '1030', 'place': 'Wien, Landstraße'}, 
{'zip': '1040', 'place': 'Wien, Wieden'},
{'zip': '1050', 'place': 'Wien, Margareten'}, 
@ramuta
ramuta / README.md
Last active July 3, 2019 17:05
Slovenia postal codes (ZIP) with town names

Slovenia postal codes (ZIP) with town names

Examples:

{'zip': '8341', 'place': 'Adlesici'}, 
{'zip': '5270', 'place': 'Ajdovscina'}, 
{'zip': '6280', 'place': 'Ankaran/Ancarano'},
{'zip': '9253', 'place': 'Apace'}, 
{'zip': '8253', 'place': 'Artice'}, 
@ramuta
ramuta / about.html
Created May 9, 2019 02:54
Jinja templates structure example (with Bootstrap)
{% extends "base.html" %}
{% block title %}About me{% endblock title %}
{% block content %}
<h1>About me</h1>
<p>Here are some things about me...</p>
{% endblock content %}
@ramuta
ramuta / decorators.py
Created December 21, 2018 15:28
Handlers and the use of decorators
from google.appengine.api import users
from webapp2 import redirect_to, redirect
def google_login_required(handler):
def _check_login(self, *args, **kwargs):
user = users.get_current_user()
if user:
return handler(self, *args, **kwargs)
else:
@ramuta
ramuta / mac_install_cloud_sdk.sh
Created May 30, 2018 10:44
Script for installing Cloud SDK on a Mac
if [ "$(uname)" == "Darwin" ]; then link="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-200.0.0-darwin-x86_64.tar.gz"; else echo "Not Mac";fi
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then link= "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-200.0.0-linux-x86_64.tar.gz"; else echo "Not Linux"; fi
echo ${link}
if [ ! -d ~/google-cloud-sdk ]; then wget -qO- "$link" | tar xvz -C ~; else echo "google-cloud-sdk folder already downloaded in home directory"; fi
cd ~
bash ./google-cloud-sdk/install.sh --quiet
gcloud components install app-engine-python --quiet
gcloud components install app-engine-python-extras --quiet
gcloud components update --quiet
@ramuta
ramuta / call_sendgrid_function.py
Created March 15, 2017 21:55
How to use sendgrid library
template = "some-template.html"
template_params = {"var1": "value1", "var2": "value2"}
jinja_env = jinja2.Environment(loader=jinja2.FileSystemLoader(template_dir),
extensions=['jinja2.ext.autoescape'],
autoescape=False)
html_template = jinja_env.get_template(template)
if not template_params: