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
# bundle exec ruby live_coverage.rb
require 'simplecov'
SimpleCov.start 'rails'
puts 'required simplecov'
require './config/environment'
require 'rails/commands/server'
Rails::Server.start
#!/usr/bin/env ruby
require "optparse"
require "uri"
class PreCiRunner
DEFAULTS = {
:jobs => [:wimdu, :wimdu_js, :wimdu_jasmine, :wimdu_guard_jasmine, :wimdu_checkout]
}
def initialize(attributes = {})
@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 / log.rb
Created November 26, 2012 16:03 — forked from tmikoss/log.rb
Capistrano recipes for remote log viewing
namespace :log do
desc "Search from log files on server"
task :grep, :roles => :app do
run "cd #{current_path}/log && grep #{ENV['str']} -B #{ENV['before'] || 5} -A #{ENV['after'] || 35} #{rails_env}.log*"
end
desc "Tail log files on servers"
task :tail, :roles => :app do
run "tail -f #{shared_path}/log/#{rails_env}.log" do |channel, stream, data|
puts "#{data}"
@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 / 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 / cisco_decrypt.c
Created June 28, 2012 11:26
Cisco VPN group password decryptor
/* Decoder for password encoding of Cisco VPN client.
Copyright (C) 2005 Maurice Massar
Thanks to HAL-9000@evilscientists.de for decoding and posting the algorithm!
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@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 / 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 / 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)