Skip to content

Instantly share code, notes, and snippets.

View narutaro's full-sized avatar
:octocat:
On vacation

narutaro narutaro

:octocat:
On vacation
View GitHub Profile
@narutaro
narutaro / Oracle JAVA 7 istallation.md
Last active April 13, 2016 23:32
Oracle JAVA 7 istallation

#Install

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

If you see this error,

$ sudo add-apt-repository ppa:webupd8team/java
sudo: add-apt-repository: command not found
@narutaro
narutaro / five_lines_http_server.rb
Created November 5, 2014 03:35
Five line http server
require 'webrick'
server = WEBrick::HTTPServer.new :Port => 1234
server.mount "/", WEBrick::HTTPServlet::FileHandler, './'
trap('INT') { server.stop }
server.start
@narutaro
narutaro / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@narutaro
narutaro / docker_registry_setup.md
Last active October 31, 2023 11:43
Docker registry with basic auth and SSL certificate

Docker registry with basic auth and SSL certificate

Docker registry does not have authentication nor certificate mechanism so in case you have docker registry on the internet, you need something that support those in front of the registry. You can find examples using Nginx for it on the web and this is yet another one.

The architecture

Client talks to Nginx. Nginx proxies the request to the docker registry. The nginx is on the host OS - not as a container.

+-----------+     +--------------------------------------------------------+
|           |     |  Server                              Docker container  |
@narutaro
narutaro / settingup_logrotate.md
Last active September 20, 2015 22:32
How to use logrotate

How to use logrotate

  1. logrotate is triggerd by cron /etc/cron.daily/logrotate
  2. Create a log rotation conf file in /etc/logrotate.d. All the files in this directory is included in /etc/logrotate.conf
  3. Let's add /etc/logrotate.d/collector for example. The contents is as follows:
/var/log/collector/log/*.log {
	daily
	missingok
	rotate 52
@narutaro
narutaro / Matching_space_with_grep.md
Last active September 4, 2015 01:04
Matching space with grep

Matching space with grep

grep "^\s\s\s\s\"url\":\s\"http" */*/*/analysis/json/analysis.json
@narutaro
narutaro / Nerdtree in docker container.md
Last active February 14, 2019 01:17
Nerdtree in docker container

Nerdtree in docker container

Symptom

  • In the tree view of nerdtree, you see ?~V? instead of arrow shape.

Possible reason

  1. vim is not installed but vi
  2. The locale setting is wrong

Solutions

@narutaro
narutaro / git nutshell.md
Last active March 11, 2016 22:10
Git nutshell

Create a new branch

nac:gtip_docs inoue$ git branch
* master
nac:gtip_docs inoue$ git checkout -b goo
Switched to a new branch 'goo'
nac:gtip_docs inoue$ git branch
* goo
 master
@narutaro
narutaro / nfdump usage.md
Last active August 5, 2022 20:21
nfdump usage

#Using nfdump nfdump is a light-weight and simple netflow collector.

#Receive netflow

nfcapd -w -D -l /flows -p 2055

#Show basic stats

@narutaro
narutaro / No password with sudoers.md
Last active October 5, 2015 23:12
No password with /etc/sudoers

#Sample:

superuser ALL=(ALL) NOPASSWD:ALL