High-quality sound earphones are not expensive.

This post is not about computers. Today I write about earphones.

< I stopped to use expensive earphones. >
A wire of earphone is break in the future. We can’t escape from it. But I have bought expensive earphones to listen to music in high-quality sound. It gave me good sound, but when it break I’m so sad….so sad. I really wanted cheap high-quality sound earphones. I checked many web sites and got good solution for it. My solution is using Panasonic earphones with SONY ear-piece.

< SONY ear-piece >
SONY ear-piece EP-EX11 series are able to connect to some of Panasonic earphones. You can buy EP-EX11 on Rakuten Global Market or you can search any shops on the internet. Size variations are SS, S, M, L and LL. Color variations are black and white.

< Panasonic earphones >
Some models of Panasonic earphones are fit with SONY EP-EX11. I tried RP-HJE120, RP-HJE150, RP-HJS150 and RP-TCM19. These are all possible to connect with SONY’s ear-piece.

< RP-HJE120 >
Its wire is 110 cm.
Amazon.com – RP-HJE120

< RP-HJE150 >
Its wire is 120 cm.
Amazon.com – RP-HJE150

< RP-HJS150 >
It’s short wire version. Its wire is 60 cm.
Amazon.com – RP-HJS150

< RP-TCM19 >
This earphone is with remote control and microphone for smartphone. Please be careful not to break, because this model’s wire is thin.
Amazon.com – RP-TCM19

< Put EP-EX11 on Panasonic earphones >
It’s RP-HJE150 without ear-pieces.
step_001

I turned over EP-EX11 to make easier to put them on earphones.
step_002

I insert earphones forcibly to ear-pieces.
step_003

Complete.
step_004

Basic HTML generator for Bootstrap 3

< What’s this? >
It generates basic HTML source for Bootstrap 3. You can choose options when you generate it. I often use this for myself. If you want, please bookmark this page.


< Generator >
Page Title :
Language code :
Bootstrap version :
Compatible with old IE :
Use fixed navbar :
Use sticky footer :
Use jQuery failover :
Use jQuery UI failover :
Use backbone.js :
Use underscore.js :
Use bootbox :

If you choose “Compatible with old IE ” “YES”, you need to put “bootstrap.min.css” and “respond.min.js” on your server. Basically “respond.min.js” doesn’t work correctly on CDN and servers of others.

< Scripts >
You can download scripts that HTML uses. You can put on your server and replace paths of scripts.
Bootstrap
jQuery
jQuery UI
backbone.js
underscore.js
bootbox
html5shiv
Respond.js
( Bootstrap and Respond.js are necessary to download for old IE. Please be careful. )

Make STINGER3 (WordPress theme) compatible with WPML (Multilanguage plugin)

< What’s WPML? >
It is a multilingual plugin for WordPress. I use WPML on this mecrazy blog.
Official website of WPML

< What’s STINGER3? >
This is a theme for WordPress. It has many nice functions without plugin. For example, snippet inserter for ads(like Google Adsense) and cool design social buttons. I have wanted to try to use this theme.
Official website of STINGER3 (Japanese page)

< Hope gentle activity >
The developer of STINGER3 is too busy to answer on Twitter, and I’m not sure he can read languages other than Japanese. If you have any questions about STINGER3, I hope you to find the answer on Google or solve the problems by yourself.

< For the people who can’t read Japanese >
Official website of STINGER3 is in Japanese. I think it’s difficult to find download link of theme zip file. You should find the Japanese word “ダウンロード“. It means “download” in English. Please use CTRL + F to find this word. Please find the current version file name “stinger3ver20140327.zip”.

< Code for compatibility >
The code below give WPML compatibility to STINGER3.

<style type="text/css">

.submenu-languages{
  background-color:#f3f3f3;
  border-style:solid;
  border-color:#dedede;
  border-width:0px 1px 1px 1px;
  position:absolute;
  margin-left:-11px;
  margin-top:21px;
  padding-bottom:5px;
  display:none;
}
.submenu-languages > li{
  white-space:nowrap !important;
  float:none !important;
  display:inline-block !important;
}

.iclflag{ vertical-align:middle;position:relative !important;top:-1px !important; }
#lang_sel{ z-index:1000; }
#lang_sel a{ display:block; }
#lang_sel ul,#lang_sel li,#lang_sel a{
  margin:0px;padding:0px;
  width:300px;
  text-align:left;
  white-space:nowrap;
}
#lang_sel ul,#lang_sel li{ margin:0px !important;padding:0px !important; }
#lang_sel a{ margin:0px !important;padding:0px 7px !important; }
#lang_sel li,#lang_sel a,#lang_sel span{
  height:30px !important;
  line-height:30px !important;
  font-size:14px;
}
#lang_sel > ul > li > ul{ top:31px; }

</style>
<script type="text/javascript">
jQuery(function($){
var langMenuObj = $('.submenu-languages').eq(0);
var wpmlMobile = (typeof(window.orientation) != "undefined");
$('.menu-item-language-current').eq(0).on('mouseenter',function(){
if(!wpmlMobile){langMenuObj.stop(true,true).fadeIn('fast');}
}).on('mouseleave',function(){
if(!wpmlMobile){langMenuObj.stop(true,true).fadeOut('slow');}
}).on('click',function(){
langMenuObj.stop(true,true).toggle();
});
$('.icl_lang_sel_current ').parent().click(function(){ return false; });
});
</script>

< How to insert this code? >
There are 3 example ways to insert the code. Please choose one of them. Or if you know how to customize WordPress, you can insert manually to your PHP scripts.

< Method – 1 >
Go to [ Appearance – Widgets ] of administrator menu. Please add “Text” to one valid area. Please do not enter the title, put the script only in the detail form.

< Method – 2 >
I developed a plugin STINGER3 loves WPML. This plugin do the same thing as “Method – 1”. If you find bugs, please report or tell me on Github, Twitter or Google+.

< Method – 3 >
Using WordPress plugin “Wp Insert“. It can insert HTML code to anywhere on your blog.

< Afterward >
I think each methods are not so difficult. But current version of STINGER3 is not compatible with language mo files. We can only translate with String Translation of WPML. If I have spare time, I want to develop patch for STINGER3 compatible with mo files.

< Updated on June 11, 2014 >
Fixed – It can’t handle first tap event of Android or iOS browsers. Source code on this page and the WordPress plugin on Github are updated.

Running WordPress on Android using KSWEB

< Warning >
You need the skill to set your Android’s IP address public. I don’t write the procedure about network settings, because it depends on your network hardware, software and provider. I’m sorry but please check it on another website.

< Awesome App for Android >
There is an awesome app on Google Play. The app name is KSWEB. Developer page is here. You can download from this page or Google Play.

< Requirements >
The developer of KSWEB says Android device with OS version 2.3.3 or higher and ARM-based processor is required. I will try to run KSWEB on IS05 (Japanese old Android smartphone by SHARP) and the procedure on this post is about this device. But maybe KSWEB can run on so many kinds of Android devices. Please try on any devices you have.

< Installing from Google Play >
( If you want to install from Google Play, please follow this procedure. )
You just need to go KSWEB – Google Play and install it. That’s all of installation.

< Installing from APK file >
( If you want to install from APK file, please follow this procedure. )
Before installing APK file, you need to change your Android’s setting for apps. You need to allow app installs from “unknown sources”. After that, please visit http://kslabs.ru/download/ to download the APK file of KSWEB.
20140531-174245

< Downloading WordPress >
You can choose “downloading on Android directly” or “downloading on PC and upload to Android”. I downloaded on PC from http://wordpress.org/. I installed AirDroid to my Android and visited http://web.airdroid.com/ to upload WordPress ZIP file to my Android. If you want to “download on Android directly”, you just need to visit http://wordpress.org/ by your Android browser.

< Installing ZIP extractor to your Android >
You need to extract WordPress ZIP file on your Android. I installed AndroZip™ File Manager to my Android. But there are many kinds of ZIP extractor on Google Play, you can choose any app you like.

< Extract ZIP file >
I put the ZIP file “wordpress-3.9.1.zip” on the root of SD card directory. After I extract it “wordpress” directory was automatically made.
20140531-180921

< Adding and enabling optional functions >
Please tap [ TOOLS – WebFace – Start ] to enable KSWEB Web Interface. Please tap [ TOOLS – Main – phpMyAdmin ] to add phpMyAdmin. phpMyAdmin is for making a database on MySQL for WordPress, so it’s not necessary. You can also make a database by PHP script.
20140530-002435

< Making a database by phpMyAdmin >
Please access http://localhost:8000/ by itself(Android) or http://< Android’s local IP address >:8000/ from any computer on the same network.
phpMyAdmin_login
You can login as root with no password. In my sample picture, I made a database “wordpress” for WordPress.
phpMyAdmin_table

< Change WWW root of lighttpd >
Please access http://localhost:8003/ by itself(Android) or http://< Android’s local IP address >:8003/ from any computer on the same network. It’s KSWEB Web Interface. Default user and password are both admin.
KSWEB_Web_Interface
Please click Server settings. You can edit a config file of lighttpd.
Please find a line like below.

server.document-root = “/mnt/sdcard/htdocs”

Change directory path of this line to your WordPress root.
My new setting is below.

#server.document-root = “/mnt/sdcard/htdocs”
server.document-root = “/mnt/sdcard/wordpress”

After changing config file, please reboot lighttpd or KSWEB.

< Ports of lighttpd >
Default ports setting is like below.
lighttpd_ports
If you want to change them, please edit config file.

< Don’t sleep! >
Basically Android smartphone automatically sleeps. If you want it to work 24 hours, you need to keep it away from sleeping. There are many apps to stay it awake on Google Play. Please use StayAwake, KeepScreen or another one you find on Google Play.

< Start WordPress >
Next step is same procedure of general installation of WordPress. Please access your Android with your domain name. WordPress default installation will start. Enjoy your energy‐saving WordPress life.

Reverse proxy on nginx on Raspberry pi

< Ready to install >
You need Debian wheezy to follow my procedure. Not only for Raspberry Pi.

< Why I use Raspberry Pi >
Reverse proxy is simple function. Basically it’s too easy task for general personal computers or any servers. Raspberry Pi is not so powerful, but it’s energy saving computer. It’s not expensive. Anyone can buy it all over the world. It’s enough for reverse proxy on nginx. That’s why I choose Raspberry Pi for reverse proxy server and wrote this post.

< Installing nginx >
Execute command below as root.

apt-get install nginx

That’s all.

< Edit config file >
Edit default config file.

nano /etc/nginx/sites-available/default

My “/etc/nginx/sites-available/default” is like below.

server {
listen 80;
server_name mydomain.net;

location / {
proxy_pass http://127.0.0.1:8080;
}
}

This config transfer accesses “mydomain.net” to 8080 port of local Apache server on Raspberry Pi.

< Add proxy config file >
Add a file for proxy settings.

nano /etc/nginx/conf.d/proxy.conf

My “/etc/nginx/conf.d/proxy.conf” is like blow.

# Header
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# Timeout
proxy_connect_timeout 60;
proxy_read_timeout 90;
proxy_send_timeout 60;

# Buffer
proxy_buffering on;
proxy_buffer_size 8k;
proxy_buffers 100 8k;

# Cache
proxy_cache_path /var/cache/nginx/mydomain.net levels=1:2 keys_zone=cache_$
proxy_temp_path /var/cache/nginx/temp;

proxy_cache_valid 200 2h;
proxy_cache_valid 302 2h;
proxy_cache_valid 301 4h;
proxy_cache_valid any 1m;

Also you need to make cache dir as root.

mkdir /var/cache/nginx

< Start nginx >

service nginx start

How you think about this procedure? So easy?