Saturday, October 23, 2021

reverse proxy setting wordpress, about certbot snap and acme.sh

Note for building 2+ tier web server

Tuesday, October 12, 2021

omit comments on files

 egrep -v '^[[:blank:]]*#|^[[:blank:]]*$' <file_name>


taken from:

https://stackoverflow.com/questions/17392869/how-to-print-a-file-excluding-comments-and-blank-lines-using-grep-sed

Friday, February 14, 2020

ONLY_FULL_GROUP_BY

2020/02/14 16:27:01 [error] 199#199: *1329 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to a member function fetch_row() on bool in /var/www/xxx/admin/modules/reporting/index.php:114

iki dikarenakan
ONLY_FULL_GROUP_BY di mysql

Wednesday, September 12, 2018

Dibiasakan Menulis

Dengan adanya keyboard baru, diharapkan saya bisa menjadi rajin menulis lagi. Ben gak edan

Saturday, July 23, 2016

mancinglog.sh

berguna untuk mencari korelasi antara ip address / file di access.log
------------------------------------------------------------------------------------
start script
------------------------------------------------------------------------------------

#!/bin/bash
logpath=/var/log/nginx/access.log
ARRAY=()
getip=()
getfile=()

function getfiles {
        echo "getfiles param " ${getip[@]}
        pat=$(echo ${getip[@]}|tr " " "|")
        getfile+=($(grep -Ew $pat $logpath| cut -f 7 -d " " | sort | uniq))
        uniqf=($(printf "%s\n" "${getfile[@]}" | sort | uniq -c | sort -rnk1 | awk '{ print $2 }'))
        unset getfile
        getfile=("${uniqf[@]}")
        printf "%s\n" "${getfile[@]}" > files.txt
        echo "getfiles result " ${getfile[@]}
        getips
}



function getips {
        echo "getips param " ${getfile[@]}
        pat=$(echo ${getfile[@]}|tr " " "|")
        getip+=($(grep -Ew $pat $logpath| cut -f 1 -d " " | sort | uniq))
        uniqi=($(printf "%s\n" "${getip[@]}" | sort | uniq -c | sort -rnk1 | awk '{ print $2 }'))
        unset getip
        getip=("${uniqi[@]}")
        printf "%s\n" "${getip[@]}" > ips.txt
        echo "getips result "${getip[@]}
        getfiles
}

getfile=( `cat "files.txt"` )
getip=( `cat "ips.txt"` )
#getips $1
getfile+=($1)
getips

Thursday, July 30, 2015

install solaris openstack on virtualbox

Jadi begini.. ternyata gak support
setelah lihat di web:
http://docs.oracle.com/cd/E36784_01/html/E37629/gnwoi.html#scrolltoc

Oracle Solaris Kernel Zones can run in guests on Oracle VM Server for SPARC. Each Oracle VM Server for SPARC domain has an independent limit for the number of kernel zones that you can run. The limit is 768 for SPARC T4 or SPARC T5 systems, and 512 for SPARC M5 or SPARC M6 systems.
Kernel zones cannot run in Oracle VM Server for x86 guests or on Oracle VM VirtualBox.

Gemblung right?

Tuesday, June 23, 2015

fix locale

fix locale on some python or another script that locale-sensitive
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
 taken from:
http://askubuntu.com/questions/205378/unsupported-locale-setting-fault-by-command-not-found