Skip to content

Instantly share code, notes, and snippets.

View ss23's full-sized avatar

☃ Stephen Shkardoon ☃ ss23

View GitHub Profile
@ss23
ss23 / SnapshotsCleanupTask.php
Created October 7, 2014 23:33
A task you can run to clean up your snapshots folder if it's got lots of failed transfers in it
<?php
class SnapshotsCleanup extends BuildTask {
protected $title = 'Snapshot Cleanup';
protected $description = 'Attempt to aggressivly remove all broken or half completed snapshots';
public function run($request) {
echo PHP_EOL . PHP_EOL;
@ss23
ss23 / gist:9852996
Last active August 29, 2015 13:57
Draft of how to audit SilverStripe code

Whitebox

Folder structure isn't easy to notice at first. Generally, each folder is a "module" (where framework is core SilverStripe, cms is the CMS part of core SilverStripe, and mysite is the custom code). There's also a /vendor directory that might be used if they're using composer. If they're using Composer you'll be able to use the composer.json file in the root of the project to determine where some folders are coming from and if they're using official modules, etc. Extra points if you checking their live webserver and find access to it. Information disclosure and all that.

Most of the interesting code will be in mysite/ probably (though worth noting, there's no explicit rule that you have to put your code in a folder called that -- another common option is to put in a folder named after the project). CMS and Framework are the only two modules you probably won't need to audit or worry about, however, it's fairly common for developers (especially ones not fa

  • Latest Stable of Branch: 2.4.*@stable (@stable is required if the project is set to dev)
  • Latest Dev of Branch: 2.4.x-dev
  • Any version that meets requirements: *
  • Explicitly the latest of any branch: dev-master, dev-feature-branch
13:36 < Kenshy> Chromium won't load BakaBT.me for me
13:37 < Kenshy> and I think it's just Chromium doing something stupid
[...]
13:53 < Kenshy> I can't connect to BakaBT.me :l
13:53 < ss23> Kenshy: Shinu
13:53 < ss23> baaaaka
13:53 < Kenshy> Shinu?
13:53 < ss23> Die
[...]
13:54 < Kenshy> I just tried to ping the site with curl
@real34
real34 / APC-Recipe.rb
Created June 22, 2012 13:26
Capistrano : APC recipe to deal with Apache APC cache
##
# APC recipe
# => convenience rules for dealing with APC in applications
##
_cset(:apc_webroot) { "" }
namespace :apc do
desc <<-DESC
Create a temporary PHP file to clear APC cache, call it (using curl) and removes it