Command line pastebin
I have been frustrated with copying/pasting command line output to pastebin lately. To solve the problem I’ve whipped up a simple script to pastebin stdin. Check it out.
I have been frustrated with copying/pasting command line output to pastebin lately. To solve the problem I’ve whipped up a simple script to pastebin stdin. Check it out.
I hacked up a new wordpress plugin that gives users more control over the appearance of their blogs. This plugin is especially useful for WordpressMU maintainers and users. Read more about it or visit its wordpress.org home.
Thanks, Jeremy. I hope to use this to practice some basic CSS experiments with my blog. It’ll be very helpful and I really appreciate your work.
Hello and thanks.
I have a few recommendations for this plugin, especially when used on WordPress µ.
First of all, add the menu page under the Appearance menu. This can be accomplished with
add_theme_page('Custom CSS Options', 'Custom CSS', 'switch_themes', __FILE__, 'custom_user_css_options');
as opposed to the current call under the custom_user_css_menu() function.
Secondly, when installing for WordPress µ, it is wise to place the plugin folder under /wp-content/plugins/ BUT also to move the main plugin file to /wp-content/mu-plugins/. This will enable the Custom CSS feature for all blogs and users. It is necessary to rewrite the include() function so that the menu page, which exists in /wp-content/plugins/custom-user-css/, can be included or required by the plugin file.
Hope this helps the plugin.
Regards,
Frederick
custom_user_css.php line(52)
$css_val = $wpdb->escape(strip_tags($_POST[ $opt_name ]));
….
Yeah I know, redundant, but still helpful. Makes it extra secure.
function custom_user_css_menu() {
add_submenu_page(‘themes.php’, ‘Custom User CSS’, ‘Custom User CSS’, 8, ‘Custom User CSS’, ‘custom_user_css_options’);
}
This puts the Custom CSS inside the Appearance Menu for users.
Do you know whether it’s possible to have a slide-out menu that contains a tag cloud or some other way to browse an archive?
It would be something like this:
ARCHIVE (top menu item)
> TAGS
>> (all tags listed as slideout)
> CATEGORIES
>> (all categories listed as a slideout)
> MONTH
>> (all months listed as a slideout)
I often need to create lock files in my scripts, so crontab doesn’t spawn more than one process. This is a simple bash lock file function I like to use:
function create_lock {
LOCK_NAME=$1
if [[ -e "$LOCK_NAME" ]]
then
OLDPID=`cat $LOCK_NAME`
if ps p $OLDPID > /dev/null
then
return 1
fi
rm $LOCK_NAME
fi
echo $$ > $LOCK_NAME
return 0
}
create_lock doesn’t handle race conditions, but it is typically good enough for me.
You can avoid the race condition by using “set -o noclobber”. Like this:
if ! (set -o noclobber; echo “$$” > “/tmp/lock”) 2> /dev/null; then
echo “locking failed”
exit 1
fi
I was given the task of integrating our old Google Search Appliance with our internal wiki. It turns out MediaWiki offers a couple of different ways to alter search functionality: $wgSearchForwardUrl and $wgSearchType. The $wgSearchType variable accepts a SearchEngine class name and enables custom search back-ends. SimpleXML and the GSA XML API then allowed me to fetch and process the search results. After a few hours of tweaking I am pretty happy with the result, a tightly integrated full text search.
If you are interested in setting up your Google Search Appliance with a mediawiki instance, installation is simple, download or checkout the extension and follow the installation instructions.
Lately, I’ve found the process of assigning a bug to myself slightly cumbersome and wanted to speed up the process. I happen to be a fan of Ubiquity, so I decided to write a command.
The command assigntome, by default, changes the assigned to field to your user. The whole process can be automated by tacking on the submit noun, which will simulate clicking the “Commit” button.
To install assigntome subscribe to my Ubiquity feed.
Hi
Nice site!
G’night
Wow, what a coincidence I hate ubiquity feeds as well. I am so glad you developed this amazing tool. Where can I find more of your work.
All HttpAuth Plugin development has moved here from my work blog. Mozilla’s internal wikis have been using the extension without issue. Is anyone aware of issues that need fixing?
If you could put the snippet from your diff that goes in to LocalSettings.php into the mediawiki article on your plugin, that’d be swell. The directions for which hook to change didn’t parse too well in my head, I’m afraid.
Hi, i’m trying to use your extension, y log in the apache popup window and all is ok, the wiki loads, but i’m not logged in the wiki and the user is not created, what i do in the wrong way??
I’ve decided to move SimpleCaptcha development to my personal server.
hi. Thanks for plugin
perfect.
Regards
Shyam 1:42 pm on August 20, 2009 Permalink |
And there’s also wgetpaste! http://wgetpaste.zlin.dk/ Does pretty much the same, with a bunch of options etc.