Skip to content

Instantly share code, notes, and snippets.

View ytnobody's full-sized avatar
♨️
470

ytnobody / satoshi azuma ytnobody

♨️
470
View GitHub Profile
@nz
nz / Delete all documents in a Solr index using curl.md
Last active February 12, 2024 10:55
Delete all documents in a Solr index using curl
# http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F
# http://wiki.apache.org/solr/UpdateXmlMessages#Updating_a_Data_Record_via_curl

curl "http://index.websolr.com/solr/a0b1c2d3/update?commit=true" -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'

I'm amused at the traction this little gist is getting on Google! I would be remiss not to point out that six+ years later I'm still helping thousands of companies on a daily basis with their search index management, by providing managed Solr as a service over at Websolr, and hosted Elasticsearch at Bonsai. Check us out if you'd like an expert helping hand at Solr and Elasticsearch hosting, ops and support!

@DavidWells
DavidWells / aws-lambda-redirect.js
Created June 28, 2018 20:48
How to do a 301 redirect from an AWS lambda function
exports.handler = (event, context, callback) => {
const response = {
statusCode: 301,
headers: {
Location: 'https://google.com',
}
};
return callback(null, response);
}
@xtetsuji
xtetsuji / maillog-hashnize.pl
Last active October 11, 2022 08:08
enhancement of "pflog" for parsing maillog of postfix 2.3 or higher version.
#!/usr/bin/perl
# "pflog" enhancement for parsing maillog of postfix 2.3 or higher version.
# "pflog" see: http://www.tmtm.org/ruby/pflog/pflog-0.3
use strict;
use warnings;
use Time::Local;
use Getopt::Long;
#use Data::Dumper;
@Shinpeim
Shinpeim / 000.md
Last active January 22, 2022 07:31
プロセスとかスレッドとかプロセス間通信とかについて書く場所

重要

サイズがあまりに大きくなってしまったので、gist ではなくて github 上で管理するようにしました。

https://github.com/Shinpeim/process-book

URL 変わっちゃうの申し訳ないんだけど、一覧性が高くなるのと pull req が受け取れるメリットのほうを取ります。せっかく読みにきてくれたのにひと手間かかっちゃってすみません。

この文書の目的

@hayajo
hayajo / 00.md
Last active March 8, 2020 16:05
NDS#36 Go言語入門
@Shinpeim
Shinpeim / 00.md
Last active January 16, 2020 13:08
Scala 入学式の資料

Better Java としての Scala

Hello World

  • src/main/scala/Main.scala
object Main {
  def main(args: Array[String]): Unit = {
    println("hello scala!")
@walkure
walkure / jma_push_subscriber_sample.pl
Last active December 10, 2015 21:28
気象庁の防災情報PuSH試行試行配信を受信するサブスクライバCGIの例 (cf. http://d.hatena.ne.jp/W53SA/20130109/1357750514 )
#!/usr/bin/env perl
#cf. http://d.hatena.ne.jp/W53SA/20130109/1357750514
use strict;
use LWP::Simple;
use XML::Atom::Feed;
use URI;
use File::Basename;
use Digest::HMAC_SHA1;
@kkotaro0111
kkotaro0111 / analyvote.js
Created December 17, 2012 02:55
読売新聞サイトの選挙速報の比例代表ページから、各政党ごとに獲得票数を合計し、その獲得率を計算するスクリプト http://www.yomiuri.co.jp/election/shugiin/2012/ にアクセスし、コンソールなどに入力して使う。あくまで比例区のみの話なので、小選挙区も含めた最終的な結果とは比較してはいけない。
//12/17 11:30頃に確認した結果
//自由民主党 16,624,457票 27.62% 57議席 31.66%
//日本維新の会 12,262,228票 20.37% 40議席 22.22%
//民主党 9,628,653票 15.99% 30議席 16.66%
//公明党 7,116,474票 11.82% 22議席 12.22%
//みんなの党 5,245,586票 8.71% 14議席 7.77%
//日本共産党 3,689,159票 6.13% 8議席 4.44%
//日本未来の党 3,423,915票 5.68% 7議席 3.88%
//社会民主党 1,420,790票 2.36% 1議席 1.11%
//新党大地 346,848票 0.57% 1議席 1.11%
@moznion
moznion / gist:3599242
Created September 2, 2012 14:04
gitPullSuspender_proto
#!/usr/bin/perl
use strict;
use warnings;
use 5.012;
use WebService::Simple;
my $target_username = "plack"; # <= It's test var! Hehe. FIXME
my $target_reponame = "Plack"; # <= It's test var! Hehe. FIXME
@nekoruri
nekoruri / docker_memo.md
Last active August 29, 2015 14:10
Dockerに関するメモ