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 | |
# -*- coding: utf-8 -*- | |
import pexpect | |
import signal | |
import fcntl | |
import termios | |
import struct | |
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 | |
from norikraclient.client import Client | |
import pprint | |
norikra = Client() | |
def __read_data(): | |
# Actually, here we read data from a data source (e.g., csv file) |
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
[testuser@HOSTNAME norikra]$ uname -a | |
Linux HOSTNAME 2.6.32-431.29.2.el6.x86_64 #1 SMP Tue Sep 9 21:36:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux | |
[testuser@HOSTNAME norikra]$ cat /etc/redhat-release | |
CentOS release 6.5 (Final) | |
[testuser@HOSTNAME norikra]$ rbenv version | |
jruby-1.7.17 (set by RBENV_VERSION environment variable) | |
[testuser@HOSTNAME norikra]$ jruby --version | |
jruby 1.7.17 (1.9.3p392) 2014-12-09 fafd1a7 on OpenJDK 64-Bit Server VM 1.7.0_65-mockbuild_2014_07_16_06_06-b00 +jit [linux-amd64] | |
[testuser@HOSTNAME norikra]$ gem list |
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
[root@HOSTNAME:~]# netstat -natup | |
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name | |
(snip) | |
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 38681/java | |
tcp 0 0 127.0.0.1:48176 127.0.0.1:8080 ESTABLISHED 38681/java | |
tcp 71 0 127.0.0.1:8080 127.0.0.1:48176 ESTABLISHED 38681/java |
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
/* | |
* 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 = '' |
OlderNewer