Skip to content

Instantly share code, notes, and snippets.

@yoshimov
yoshimov / Gyotaku.js
Created November 26, 2008 02:09
Get Web Gyotaku from Ubiquity
CmdUtils.CreateCommand({
names: ["gyotaku", "get gyotaku"],
description: "Get Web Gyotaku.",
icon: "http://megalodon.jp/favicon.ico",
homepage: "http://megalodon.jp/",
author: { name: "Yoshimov", email: "yoshimov@pobox.com"},
preview: "Get Web Gyotaku",
execute: function(){
CmdUtils.CreateCommand({
names: ["archive search", "get archive"],
description: "Search Internet Archive Wayback Machine.",
icon: "http://web.archive.org/favicon.ico",
homepage: "http://web.archive.org/",
author: { name: "Yoshimov", email: "yoshimov@pobox.com"},
preview: "Search the current page archive.",
execute: function(){
@yoshimov
yoshimov / social-launcher.js
Created November 26, 2008 07:05
Social Launcher could show the url list of same person's social sites.
CmdUtils.CreateCommand({
name: "social-launcher",
description: "Show the list of same person's social sites.",
icon: "http://yoshimov.com/favicon.ico",
homepage: "http://yoshimov.com/?page=Social+Launcher",
author: { name: "Yoshimov", email: "yoshimov@pobox.com"},
preview: "Show the list of same person's social sites.",
execute: function(){
@yoshimov
yoshimov / paste-quoted-text-and-url.js
Created November 26, 2008 09:20
Paste quoted text and url to current cursor position.
CmdUtils.CreateCommand({
name: "paste-quoted-text-and-url",
description: "Paste quoted text and url to current cursor position.",
icon: "http://yoshimov.com/favicon.ico",
homepage: "http://yoshimov.com",
author: { name: "Yoshimov", email: "yoshimov@pobox.com"},
preview: "Paste quoted text and url to current corsor position",
execute: function(){
CmdUtils.CreateCommand({
name: "java-ja",
description: "Search java 1.6 API",
help: "Simply type java and the classname and it will doa google search for API documentation on that class",
icon:"http://java.com/favicon.ico",
takes: {"class name": noun_arb_text},
author: {name: "Yoshimov", email: "yoshimov@pobox.com"},
homepage: "http://yoshimov.com",
preview: function(pblock, directObject) {
var searchTerm = directObject.text;
@yoshimov
yoshimov / WakeOnLan.groovy
Created November 27, 2008 04:51
Send Wake On LAN Magic Packet from Groovy script
// Send Wake On LAN Magic Packet
def int PORT = 9
def cli = new CliBuilder()
cli.h(longOpt: 'help', 'usage information')
cli.i(argName: 'networkInterface', longOpt: 'interface', args: 1, required: true, 'MAC address of network interface(IPv4)')
cli.b(argName: 'broadcast', longOpt: 'broadcast', args: 1, required: true, 'Broadcast address')
def opt = cli.parse(args)
@yoshimov
yoshimov / mv2squashfs.sh
Created December 17, 2008 07:06
Move live usb persistent files into compressed squashfs.
#!/bin/bash
if [ -z `which mksquashfs` ]; then
sudo aptitude update
sudo aptitude install squashfs-tools
fi
sudo mount /cdrom -o remount,rw
EXCLUDES='.wh* cdrom etc home lost+found medoa rofs root tmp* var/backups var/cache var/crash var/log var/run var/spool var/tmp'
@yoshimov
yoshimov / shmconfig.fdi
Created January 5, 2009 11:06
/etc/hal/fdi/policy/
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
<match key="input.x11_driver" string="synaptics">
<merge key="input.x11_options.SHMConfig" type="string">True</merge>
</match>
</device>
</deviceinfo>
@yoshimov
yoshimov / mkbootiso.sh
Created January 15, 2009 11:22
Create bootable cd for specified device.
#!/bin/bash
MEDIA=$1
mkdir -p boot-cd/boot/grub
cp /usr/lib/grub/i386-pc/stage2_eltorito boot-cd/boot/grub
cp ${MEDIA}/boot/grub/menu.lst boot-cd/boot/grub
cp ${MEDIA}/boot/vmlinuz* boot-cd/boot
cp ${MEDIA}/boot/initrd.img* boot-cd/boot
@yoshimov
yoshimov / share-on-twitter.js
Created March 25, 2009 02:51
Share quoted text and url and comment on Twitter.
Cu.import("resource://ubiquity/modules/oauth.js");
const TWITTER_STATUS_MAXLEN = 140;
CmdUtils.CreateCommand({
names: ["share url on twitter", "twitter url"],
description: "Share quoted text and url on Twitter.",
icon: "http://yoshimov.com/favicon.ico",
homepage: "http://yoshimov.com",
author: { name: "Yoshimov", email: "yoshimov@pobox.com"},
arguments: [
{role: "object", label: _("status"), nountype: noun_arb_text},