This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
Output filepath if the mp3 has no album artwork. | |
Usage: | |
./get_no_artwork_file.py file [file..] | |
Example: | |
find . -name "*.mp3" -print0 | xargs -0 ./get_no_artwork_file.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# uridecodebin.py - Audio autoplugin example using 'uridecodebin' element | |
# | |
# Based on: | |
# decodebin.py - Audio autopluging example using 'decodebin' element | |
# Copyright (C) 2006 Jason Gerard DeRose <[email protected]> | |
# This library is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU Library General Public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Install dionaea on Ubuntu 10.04 | |
# | |
# Based on: http://dionaea.carnivore.it/#compiling | |
# | |
# keep privileged state(bad hack...) | |
LOCKFILE=$$.pid | |
touch $LOCKFILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Usage of libnotify | |
* $ gcc -g `pkg-config --libs --cflags gtk+-2.0 glib-2.0` -lnotify -o notify notify.c | |
*/ | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <libnotify/notify.h> | |
int main(int argc, char* argv[]) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Create user with specified uid and gid. | |
# Tested on Ubuntu 10.04 | |
# | |
if [ $# -ne 3 ]; then | |
echo 'Usage:' $0 'USERNAME UID GID' 1>&2 | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Install klink on Fedora15 | |
# Copy url from http://www.faveset.com/klink/download and paste it | |
URL='http://download.faveset.com/klink/files/*/klink_1.03_amd64.deb' | |
wget $URL -O /tmp/klink.deb | |
cd /tmp | |
ar x klink.deb data.tar.gz | |
tar zxf data.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Log the battery stete to a file | |
# Sources of battery information | |
PROC_INFO='/proc/acpi/battery/BAT0/info' | |
PROC_STATE='/proc/acpi/battery/BAT0/state' | |
# Get the current state | |
type=`grep "model number:" $PROC_INFO | awk -e '{print $3}'` | |
current=`grep "remaining capacity:" $PROC_STATE | awk -e '{print $3}'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# -*- coding: utf-8 -*- | |
require "julius" | |
require "twitter" | |
Twitter.configure do |config| | |
config.consumer_key = '' | |
config.consumer_secret = '' | |
config.oauth_token = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import dbus | |
bat_bus = dbus.SystemBus() | |
bat_object = bat_bus.get_object('org.freedesktop.UPower', | |
'/org/freedesktop/UPower/devices/battery_BAT0') | |
bat_interface = dbus.Interface(bat_object, | |
'org.freedesktop.DBus.Properties') | |
percentage = bat_interface.Get("org.freedesktop.UPower.Device", | |
"Percentage" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DEBUG="" | |
#DEBUG="--dry-run -vv" | |
MOUNTPOINT="/mnt/qb/common" | |
BACKUPROOT="${MOUNTPOINT}/backup/${HOSTNAME%.*}" | |
mount_backuppoint() { | |
## バックアップ先のマウント |
OlderNewer