Skip to content

Instantly share code, notes, and snippets.

View duksis's full-sized avatar
🇪🇺
I definitely will be slow to respond.

Hugo Duksis duksis

🇪🇺
I definitely will be slow to respond.
View GitHub Profile
@duksis
duksis / bsky_app_click_follow_btn.js
Created December 19, 2023 17:11
Click every (loaded) Follow button on the current bsky.app page
var buttons = document.querySelectorAll('button > div > div'); for (let i = 0; i < buttons.length; i++) {
buttons[i].textContent === 'Follow' ? buttons[i].click() : false;
}
@duksis
duksis / neighbor_search.py
Last active July 23, 2023 14:40
Script to find running web servers in local network
#!/usr/bin/env python
#########################################################################
# #
# Script for finding neighbor web servers in local network #
# #
# Author: Hugo Duksis <duksis@gmail.com> #
# Usage: python neighbor_search.py
# TODO: move pinging in multiple treads to increase performance #
# #
@duksis
duksis / .bash_profile
Created December 13, 2012 13:40
Default CentOS bash_profile and bashrc files
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
@duksis
duksis / pixi-basic-honeypot.js
Last active January 24, 2023 22:13
Pixi.js basic example with a rotating Honeypot
var renderer = PIXI.autoDetectRenderer(750, 600,{backgroundColor : 0x1099bb});
document.getElementById("rotating-honeypot").appendChild(renderer.view);
// create the root of the scene graph
var stage = new PIXI.Container();
// create a texture from an image path
var texture = PIXI.Texture.fromImage('../assets/images/mascot.png');
// create a new Sprite using the texture
@duksis
duksis / delayed_job.rake
Created February 21, 2012 08:08
Monitor delayed_job processes.
namespace :jobs do
#bundle exec rake delayed_job:monit RAILS_ENV=demo
desc "Monitor delayed_job processes."
task :monit => :environment do
@server_name = `uname -n`.split("\n").first
@application_name = Rails.application.class.parent_name
delayed_job_found = Hash.new
def do_alert(msg)
@duksis
duksis / README
Created September 17, 2012 19:25
Wi-Fi Protected Setup vulnerability VU#723755 brute force attack implementation in Python
PoC implementation of a brute force attack against WPS - PIN External Registrar
My test environment was Backtrack 5R1 + an Atheros USB adapter.
I used a mac80211/carl9170 driver but any mac80211-based driver should be ok.
DEPENDENCIES:
PyCrypto
Scapy (2.2.0) (does not come with Backtrack)
USAGE:
@duksis
duksis / test.sh
Created September 25, 2019 20:46
curl 'https://gql.example.com/v1' \
-d '{"query": "query($id:Int!) user(id: $id) { name }", "variables": {"id": 1}}'
@duksis
duksis / perl_urlencode.sh
Created October 15, 2012 07:22
URL encoding in bash
#!/bin/bash
function urlencode() {
echo -n "$1" | perl -MURI::Escape -ne 'print uri_escape($_)'
}
@duksis
duksis / geolocation.js
Created May 29, 2012 11:21
Script to get location information from browser
//
// Script for getting location data from browser
//
navigator.geolocation.getCurrentPosition(getLocation, unknownLocation);
function getLocation(pos) {
var latitde = pos.coords.latitude;
var longitude = pos.coords.longitude;
alert('Your current coordinates (latitide,longitude) are : ' + latitde + ', ' + longitude);
@duksis
duksis / whys_in_best_practices.md
Created February 15, 2017 09:12
Why's in Best Practices [rails migrations]

Why's in best practices

In software development there are loads of "Best practices" or suggestions what to do and what not in order to come to a better result.

For most of the cases you will be better of by just folowing these suggestions and for the rest it's very handy to understand why these suggestions exist.