This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :deploy do | |
desc "Configure logrotate" | |
task :logrotate, :roles => :install do | |
config_file = "/etc/logrotate.d/app_#{rails_env}" | |
config_lines = ["daily", | |
"rotate 10", | |
"missingok", | |
"nocompress", | |
"sharedscripts", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 # | |
# # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function urlencode() { | |
echo -n "$1" | perl -MURI::Escape -ne 'print uri_escape($_)' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bash_profile | |
# Get the aliases and functions | |
if [ -f ~/.bashrc ]; then | |
. ~/.bashrc | |
fi | |
# User specific environment and startup programs | |
PATH=$PATH:$HOME/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 = {}) |
OlderNewer