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 'rubygems' | |
require 'optparse' | |
require 'irb' | |
require 'irb/completion' | |
require 'rails' | |
module Dradis | |
class Console | |
def self.start(app) |
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
// ./server/public/javascripts/dx/dradis.notes.NotesBrowserPanel.js | |
// [...] | |
columns: [ | |
{ | |
id:'text', | |
header: 'Text', | |
width: 180, | |
sortable: true, | |
dataIndex: 'text', | |
//renderer: Ext.util.Format.htmlEncode |
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
require 'digest/sha2' | |
class UsersController < ApplicationController | |
before_filter :login_required, :except => [:new, :create] | |
before_filter :basicauth, :only => [:new, :create] | |
protected | |
def basicauth | |
if authenticate_with_http_basic { |user, password| !( user.nil? || password.nil? || ::Digest::SHA512.hexdigest(password) != Configuration.password ) } | |
Rails.logger.debug 'foo' | |
else |
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
// <dradispro>/public/javascripts/dx/dradis.notes.NoteEditorWindow.js | |
// [...] | |
// replace the clear() function in line #72 | |
clear: function(){ | |
this.fields.editor.setValue('#[Title]#\nNew Page Title\n\n#[Description]#\n \n\n#[Recommendation]#\n \n\n'); | |
this.fields.editor.selectText(); | |
this.fields.preview.clear(); | |
} |
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/env ruby | |
=begin | |
Copyright (c) 2012 Daniel Martin - Security Roots Ltd | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
of the Software, and to permit persons to whom the Software is furnished to do | |
so, subject to the following conditions: |
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
class ProjectsController < AuthenticatedController | |
before_filter :deny_access, :only => [:show, :destroy, :use] | |
// ... | |
protected | |
def deny_access | |
if (params[:id].to_i == 84) && ![81,85,86].include?(current_user.id) | |
redirect_to projects_path, :alert => 'Sorry, but the Force is not sufficiently strong within you to work on that project. Choose another one (and continue your training).' | |
end |
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
$:<< 'lib/' | |
require 'raffle' | |
participants = File.read('participants.txt').split | |
raffle = Raffle.new(participants) | |
puts "We've got #{raffle.participants.count} participants in the raffle." | |
puts raffle.pick_a_winner |
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
// ... line 368 | |
$('#fileupload').fileupload({ | |
dropZone: $('#dropzone'), | |
headers: { | |
'X-CSRF-Token': csrf_token | |
}, | |
destroy: function (e, data) { | |
data.headers = $(this).data('fileupload').options.headers; | |
$.blueimpUI.fileupload.prototype.options.destroy.call(this, e, 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
# as root or via sudo | |
cryptsetup luksOpen /dev/dradispro/data data-open | |
mount /dev/mapper/data-open /mnt/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
require 'csv' | |
if ARGV.count != 1 | |
puts "Usage:\n\t#{$0} <file.csv>" | |
exit 1 | |
end | |
file = ARGV.first | |
if !File.exist?(file) |
OlderNewer