A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label post. Show all posts
Showing posts with label post. Show all posts

The best way to embed code snippets in your blogger posts

Use gist.github.com

That is all.

Its very easy, its hosted by Github.
I like git.

Common admin tasks in phpBB 3

Change the author of a post:

  • Click on the post
  • Click on the "Moderator Control Panel" link in the top left
  • Click on the "Post details" link on the right-hand side (note: It might look like a triangle with a question mark in it)
  • Scroll down to the bottom of the post, and you will see a drop-down menu to change the poster.

POST contents of a file

#!/usr/bin/perl

use strict;
use warnings;
require LWP::UserAgent;

use HTTP::Request;

my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;

my $url = $ARGV[0];
my $file = $ARGV[1];
my $head = $ARGV[2];

my $text = do { local( @ARGV, $/ ) = $file or die $!; <> } ;

my $headers;
if ($head) {
$headers = HTTP::Headers->new(Accept=> $head);
}

my $req = HTTP::Request->new('POST', $url, $headers);
$req->content($text);
my $response = $ua->request($req);

print $response->content;