Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
# set variables
_HASHFILE='/home/pi/script/apache_error_log_check/hash'
_OUTPUTFILE='/home/pi/script/apache_error_log_check/output.txt'
# OLD HASH
if test -f ${_HASHFILE}; then
_OLD_HASH=$(cat ${_HASHFILE})
else
@toripiyo
toripiyo / Vagrantfile
Last active November 17, 2020 22:28
OWASP Mutillidae II vagrant environment
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@toripiyo
toripiyo / country_iptables.sh
Last active May 25, 2021 10:13
block ip address by country unit
#! /bin/bash
# set conf file path
IPTABLES_CONF='/etc/iptables/rules.v4'
# temporary iptables config file
IPTABLES_CONFIG_TMP=`mktemp`
# default rule
echo "*filter" >> $IPTABLES_CONFIG_TMP
@toripiyo
toripiyo / sshrc
Created June 3, 2017 08:40
sshrc file for ssh notification to slack
#!/bin/bash
# [description]
# This script will be executed when someone login with ssh daemon
# [how to use]
# 1. put this file as a /etc/ssh/sshrc
# 2. change file permission with "chmod 755 /etc/ssh/sshrc"
# Send Slack's alerts room
@toripiyo
toripiyo / .tmux.conf
Last active February 10, 2017 13:33
my tmux.conf configuraiton
# decrease key stroke delay
set -sg escape-time 1
# enable mouse operation
set-option -g mouse on
# fix window name
set-option -g allow-rename off
###############
@toripiyo
toripiyo / fabric.md
Last active August 29, 2015 14:15
vagrant and ansible tutorial

fabric tutorial

what is fabric

Fabric = Shell Script + Python + Useful Methods

install fabric

pip install fabric
fabric -V