Skip to content

Instantly share code, notes, and snippets.

View anon5r's full-sized avatar

anon anon5r

View GitHub Profile
@anon5r
anon5r / solr_admin_extend.user.js
Created January 9, 2014 02:40
Solr(<=1.x) admin page Sort field extended
// ==UserScript==
// @name Solr admin page Sort field extended
// @namespace net.anoncom.greasemonkey.
// @include http://*/solr/admin/form.jsp
// ==/UserScript==
// qq
//document.body.innerHTML = document.body.innerHTML.replace(/<td>\n*\s*<strong>Start Row<\/strong>\n\s*<\/td>\n/g, "<td><strong>qq</strong></td>\n<td><input type=\"text\" name=\"qq\" value=\"\" /></td>\n</tr>\n<tr>\n <td>\n\t<strong>Start Row</strong>\n </td>\n");
@anon5r
anon5r / ssl_common.conf
Created January 20, 2016 02:29
SNI対応nginxでのSSL対応サイト共通設定ファイル
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_dhparam dhparam.pem;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header Cache-Control "public, must-revalidate";
## TLS Session Tickets setting
ssl_session_tickets off; # Requires nginx >= 1.5.9
ssl_session_ticket_key ssl_session_ticket.key;
@anon5r
anon5r / nginx__site-availables__example.com.conf
Last active January 20, 2016 02:44
Let's EncryptでSSL対応+HTTP2対応したときの設定
server {
listen 443 ssl http2;
server_name example.com;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log main;
root /var/www/example.com/public;
index index.html;
<?php
/**
* 前方一致
* $haystackが$needleから始まるか判定します。
* @param string $haystack
* @param string $needle
* @return boolean
*/
function startsWith($haystack, $needle)
{
@anon5r
anon5r / gitlab-psql.sh
Created March 25, 2016 01:30
To control PostgreSQL with SQL queries in GitLab omnibus docker image
#!/bin/sh
#sudo docker exec -it gitlab /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -U gitlab -d gitlabhq_production
sudo docker exec -it gitlab sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d gitlabhq_production
psql
@anon5r
anon5r / 山手線駅名名字.txt
Created April 6, 2016 09:53
JR山手線の駅名と同じあるいは類似する日本人の実在する名字
池袋
大塚
巣鴨
駒込
田端
日暮
上野
秋葉
神田
東京
@anon5r
anon5r / string_pad.js
Last active April 11, 2016 05:14
Padding string fixed length
// Pad string to right
String.prototype.pad=function(len,str){
if(typeof str=="undefined") str=" ";
if(this.length>len) return this.toString();
str=str.repeat(len-this.length);
return (this+str).substr(0,len);
}
// Pad string to left
String.prototype.lpad=function(len,str){
if(typeof str=="undefined") str=" ";
@anon5r
anon5r / is_alive_host.php
Last active October 10, 2016 08:35
$hostname の $port が接続先としてコネクション応答出来る状態かを確認します。
<?php
/**
* $hostname が接続先として接続応答出来る状態かを確認します。
*
* @access public
* @static
* @param string $hostname 接続先ホスト名またはIP
* @param int $port 接続先ポート番号
* @param int $timeout タイムアウトを指定する(秒)
* @return boolean
print "今日も一日がんばるびぃ!\n"

Keybase proof

I hereby claim:

  • I am anon5r on github.
  • I am anon5r (https://keybase.io/anon5r) on keybase.
  • I have a public key ASA1ZBc2tRYf-wGjKFM7Gg0zqbH40SMEYhgX-waxoD9FtQo

To claim this, I am signing this object: