Bad behaviour whitelisting, part 3

Apr 13 2012

The bad-behaviour plugin has changed the whitelisting method to use an admin form now instead of either editing whitelist.inc.php or using whitelist.ini.

From the changelog;

WordPress: The WordPress automatic update system destroys a user-provided whitelist.ini file, making it difficult for WordPress users to maintain a whitelist. For this reason, Bad Behavior no longer uses whitelist.ini on WordPress. Instead, a new administrative page is now available where users can manage their whitelists within WordPress.

In the Plugins > Bad Behaviour > Whitelist URL text area, enter the following to allow OpenID;

 /openid/server
/index.php/openid/server
/openid/consumer
/index.php/openid/consumer

 

No responses yet

running flake8 in git's pre-commit

Oct 23 2011

I'm forever forgetting to remove debug statements or to run flake8 on my source code. Not to panic though, git hooks to the rescue!

You can just put pre-commit into $PROJECT_DIR/.git/hooks, chmod +x it and be away.

This is the useful part of the file;

ret_code=0

for file in $(git diff --name-only --cached $against)
do
    if [ ! -z "$(grep 'DEBUGS' $file)" ]
    then
        echo "DEBUGS in file $file"
        ret_code=1
    fi

    if [ "${file##*.}" == "py" ]
    then
        flake8 $file
        if [ $? != 0 ]
        then
            ret_code=1
        fi
    fi
done

exit $ret_code

$against is the commit to check against (taken from the pre-commit.sample file).

DEBUGS is the comment tag I use to denote debug statements, which is used by geany in the Task addons plugin to list any occurrences of it in the file (along with TODO and FIXME comments)

No responses yet

Importing existing git repos into Eclipse/PyDev

Aug 22 2011

I've spent most of today trying to get either Anjuta or Eclipse/PyDev working with my django git repos for lapwing.os/website. And watching notch work on his LundumDare 48 submission.

I probably missed an easier method, but these were the steps;

  1. File > Import > Projects from Git
  2. Next, Add
  3. Browse, Select the directory with your git repo in, OK
  4. Search, OK
  5. Next, Import as General Project, Enter a project name if you wish
  6. In the Package Explorer pane, right click on the new project
  7. Pydev > Set as Django Project
  8. In the Package Explorer pane, right click on the project again
  9. Properties > PyDev - PYTHONPATH, in Source Folders click "Add source folder" and include the selected directory
  10. Properties > PyDev - Django  and set where manage.py and settings.py are. You may need to copy manage.py from somewhere if isn't part of your git repo

By default Eclipse/PyDev add .project and .pydevproject to the directory, so you may want to add them to your .gitignore file.

No responses yet

OpenID for WordPress with Bad Behaviour 2.1

Aug 19 2011

Bad Behaviour 2.1 now uses a file (whitelist.ini) to determine what URLs/IP address/user agents to allow in, so instead of editing whitelist.inc.php you can just add this file into 'wp-content/plugins/bad-behavior' and be away.
As a bonus whitelist.ini isn't updated so upgrades are less of a hassle now.

No responses yet

Stop it CPS, you're killing us

Dec 16 2010

What? You mean to say this whole episode with Julian Assange hasn't been a comedy sketch?
You mean it wasn't intended as a massive joke, making a mockery of the justice system in this country and across Europe?
Really? Sure looks it from here.

Today it turns out it was the Crown Prosecution Service (CPS) who wanted Assange's bail refused, not the Swedes as speculated before.

I'm having difficulty understanding why; the original reason he was refused bail was because he was a flight risk. The bail conditions include an electronic tag, an authorised residence, his passport(s) confiscated and checking in with a police station every day. Where and how is he going to flee exactly?
Coming at it the other way, who are we going to protect by keeping him in jail? He is accused of a non-violent crime during consensual relations with two women. He has not been accused of being a violent serial rapist and thus shouldn't be treated as such.

Before people jump down my throat about me being a rapist apologist, I find rape disgusting. It is one of the most inhuman acts, is rightly regarded as a war crime and carries a heavy prison sentence.
It is precisely because of these powerful emotional viewpoints that we must be sure we are doing the right thing.

All this circus is doing is reinforcing the view that this determination to keep Assage locked up is politically motivated and that Europe (and Britain in particular) is bending over backwards to accommodate the USA.

The punchline to this episode? Whilst we're all concentrating on Assange's trip through solitary, Bradley Manning, the man generally regarded as the source for the recent leaks, is also sitting in solitary, also uncharged, awaiting a court marshal.
He's been in a cell for 23 out of 24 hours, every day, for over 6 months. This system falls into the definition of cruel, unusual, inhumane and torturous treatment, which is internationally and in some places nationally outlawed.
What country can advertise itself as free, law-abiding and democratic then mistreat someone who has revealed the truth. The truth that is required in a free, law-abiding and democratic country as it's foundation.

I have to admit that I didn't know until today that Manning holds both American and British citizenships. It is also to my shame that I didn't read into his mistreatment sooner because I thought it didn't concern me as he was American. It's also to my shame that I've included him as I've learned he has British citizenship. In future I hope I won't make this frankly racist mistake again.

If you wish to support this free flow of information, please support WikiLeaks and donate to Bradley Manning's defence fund.

No responses yet

Older posts »