Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pexpect
import signal
import fcntl
import termios
import struct
#!/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)
[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
[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
@yunazuno
yunazuno / get_no_artwork_file.py
Created February 9, 2011 09:22
Output filepath if the mp3 has no album artwork
#!/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
/*
* 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[])
{
#!/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
@yunazuno
yunazuno / klink_on_fedora15.sh
Created November 16, 2011 05:43
Install klink on Fedora15
@yunazuno
yunazuno / log_battery_state.sh
Created December 7, 2011 02:28
Log the battery stete to a file
#!/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}'`
@yunazuno
yunazuno / barusu.rb
Created December 9, 2011 09:19
Post barusu automatically.
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
require "julius"
require "twitter"
Twitter.configure do |config|
config.consumer_key = ''
config.consumer_secret = ''
config.oauth_token = ''