Skip to content

Instantly share code, notes, and snippets.

View guruguru.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Image::Magick;
use Data::Dumper;
my ($filename, $outputname, $size, $span, $delay) = @ARGV;
my $gifanime = Image::Magick->new;
@s-wool
s-wool / Rakefile
Created Feb 27, 2018 — forked from kyanny/Rakefile
Qiita::Team お引越しスクリプト
View Rakefile
require 'json'
require 'yaml'
require 'nokogiri'
require 'uri'
require 'faraday'
require 'ostruct'
require 'pry'
def y data
puts YAML.dump data
View project_oxford.py
#!/usr/bin/env python
import requests
import json
headers = {
'Content-Type': 'application/octet-stream',
'Ocp-Apim-Subscription-Key': 'xxx',
}
params = {
View pyenv_install.sh
#!/bin/bash
sudo yum clean all
sudo yum groupinstall -y "Development Tools"
sudo yum install -y bzip2-devel openssl-devel readline-devel sqlite-devel
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
@s-wool
s-wool / restore_rack_topology.pl
Created Dec 12, 2014
Cloudera Managerでrack awarenessを戻すスクリプト
View restore_rack_topology.pl
#!/usr/bin/env perl
use strict;
use warnings;
use File::Basename;
use LWP::UserAgent;
use JSON::XS;
use Data::Dumper;
my $topology_file_path = shift @ARGV;
@s-wool
s-wool / gist:960e565b8e778be82953
Created Sep 16, 2014
第6回elasticsearch勉強会
View gist:960e565b8e778be82953

Aggregationあれこれ

Elasticsearch Inc. Jun Ohtaniさん @johtani この間のefk本の勉強会発表からaggs関連詳しくしたような感じかな

  • Aggregation機能はver 1.0から
@s-wool
s-wool / hue_mysql5.6.diff
Created Dec 14, 2013
MySQL5.6でhueのsyncdbが動かない件のとりあえずの対応
View hue_mysql5.6.diff
diff -r -u hue.orig/apps/jobsub/src/jobsub/migrations/0003_convertCharFieldtoTextField.py hue/apps/jobsub/src/jobsub/migrations/0003_convertCharFieldtoTextField.py
--- hue.orig/apps/jobsub/src/jobsub/migrations/0003_convertCharFieldtoTextField.py 2013-12-09 16:06:58.518311322 +0000
+++ hue/apps/jobsub/src/jobsub/migrations/0003_convertCharFieldtoTextField.py 2013-12-14 13:10:27.126396795 +0000
@@ -9,13 +9,14 @@
def forwards(self, orm):
# Changing field 'OozieStreamingAction.job_properties'
- db.alter_column('jobsub_ooziestreamingaction', 'job_properties', self.gf('django.db.models.fields.TextField')())
+ #db.alter_column('jobsub_ooziestreamingaction', 'job_properties', self.gf('django.db.models.fields.TextField')())
@s-wool
s-wool / hue2.5.diff
Last active Dec 31, 2015
enable other cache backend in hue
View hue2.5.diff
diff -u -r rpmbuild.bak/SOURCES/hue-2.5.0-cdh4.4.0/desktop/conf/hue.ini rpmbuild/SOURCES/hue-2.5.0-cdh4.4.0/desktop/conf/hue.ini
--- rpmbuild.bak/SOURCES/hue-2.5.0-cdh4.4.0/desktop/conf/hue.ini 2013-09-04 12:36:56.000000000 +0900
+++ rpmbuild/SOURCES/hue-2.5.0-cdh4.4.0/desktop/conf/hue.ini 2013-12-14 15:15:16.000000000 +0900
@@ -178,6 +178,10 @@
## password=
## name=desktop/desktop.db
+ [[cache]]
+ # backend=locmem://
+ # key_prefix=
@s-wool
s-wool / convert_skype_emoticons.pl
Created Dec 1, 2013
convert skype emoticons to animated gif file
View convert_skype_emoticons.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Imager;
use File::Basename;
use constant SIZE => 20;
my @emoticons = glob "/Applications/Skype.app/Contents/Resources/*_anim.png";
@s-wool
s-wool / set_id3.py
Created Nov 24, 2013
set id3 tag to mp3 file.
View set_id3.py
# -*- coding:utf-8 -*-
import eyed3
audio_file = eyed3.load("radiko_file.mp3")
audio_file.tag.artist = (u"Artist Name")
audio_file.tag.album = (u"Album Name")
audio_file.tag.title = (u"Title")
audio_file.tag.images.set(eyed3.id3.frames.ImageFrame.FRONT_COVER, "cover.jpg", "image/jpeg")